Hi all,
Based on a previous message in questions section:
<QUOTE>
I'm not very confortable to do two dynamic_cast operations and a search with strings to determine the action to do.
[....]
The difference between vbox and menu in handling input is that vboxes don't
handle it. That's why the input is passed to the child widgets. It's no problem to use them, if you prefer it this way. But menus do have a lot of advantages over vboxes.
</QUOTE>
I think that the buttons contained in the menu could receive their inputs events if they notify their own status to their container (the menu).
This could be a code example:
Code: |
class widget: to set that it is selected:
void setSelected(bool newSelected)
{
if (this->selected != newSelected)
{
this->selected = newSelected;
//Draw the widget in selected mode
if (this->parent)
{
this->parent->selectedChild(this, newSelected);
}
}
}
protected:
virtual void selectedChild(MMSWidget *widget, bool selected);
|
selectedChild should be a virtual method defined in the container, by default it should do nothing, but in hte menu it should be overloaded.
Thanks and Best Regards,
Joaquim Duran