a new oblect utils - enum, enum view, refactoring of mainLayout, debugging, states for sockets
This commit is contained in:
parent
fe1b55bb39
commit
ca67a8e8bc
14 changed files with 260 additions and 57 deletions
|
@ -28,16 +28,20 @@ void M::Button::setImage(const W::String& p_image)
|
|||
if (hasImage) {
|
||||
if (*imageName != p_image) {
|
||||
imageName = static_cast<W::String*>(p_image.copy());
|
||||
W::Vocabulary* vc = new W::Vocabulary();
|
||||
vc->insert(u"image", p_image);
|
||||
broadcast(vc, W::Address{u"changeImage"});
|
||||
if (registered) {
|
||||
W::Vocabulary* vc = new W::Vocabulary();
|
||||
vc->insert(u"image", p_image);
|
||||
broadcast(vc, W::Address{u"changeImage"});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
imageName = static_cast<W::String*>(p_image.copy());
|
||||
hasImage = true;
|
||||
W::Vocabulary* vc = new W::Vocabulary();
|
||||
vc->insert(u"image", p_image);
|
||||
broadcast(vc, W::Address{u"setImage"});
|
||||
if (registered) {
|
||||
W::Vocabulary* vc = new W::Vocabulary();
|
||||
vc->insert(u"image", p_image);
|
||||
broadcast(vc, W::Address{u"setImage"});
|
||||
}
|
||||
}
|
||||
hasImage = true;
|
||||
}
|
||||
|
@ -46,9 +50,11 @@ void M::Button::setEnabled(bool p_enabled)
|
|||
{
|
||||
if (enabled != p_enabled) {
|
||||
enabled = p_enabled;
|
||||
W::Vocabulary* vc = new W::Vocabulary();
|
||||
vc->insert(u"enable", new W::Boolean(enabled));
|
||||
broadcast(vc, W::Address{u"setEnabled"});
|
||||
if (registered) {
|
||||
W::Vocabulary* vc = new W::Vocabulary();
|
||||
vc->insert(u"enable", new W::Boolean(enabled));
|
||||
broadcast(vc, W::Address{u"setEnabled"});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,10 +65,12 @@ void M::Button::setLabel(const W::String& p_label)
|
|||
} else {
|
||||
label = new M::String(p_label, address + W::Address{u"label"});
|
||||
addModel(label);
|
||||
W::Vocabulary* vc = new W::Vocabulary();
|
||||
vc->insert(u"hasLabel", new W::Boolean(true));
|
||||
vc->insert(u"label", label->getAddress());
|
||||
broadcast(vc, W::Address{u"setLabel"});
|
||||
if (registered) {
|
||||
W::Vocabulary* vc = new W::Vocabulary();
|
||||
vc->insert(u"hasLabel", new W::Boolean(true));
|
||||
vc->insert(u"label", label->getAddress());
|
||||
broadcast(vc, W::Address{u"setLabel"});
|
||||
}
|
||||
hasLabel = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue