Disko Forum logo Login  |  Register  |  Lost Password
Managing input events in menu

Duran
Posts: 37
graphgraph

Managing input events in menu 5 Years, 11 Months ago  
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
 
  The administrator has disabled public write access.
Managing input events in menu

Stefan
Posts: 91
graph

Re:Managing input events in menu 5 Years, 11 Months ago  
Hi Joaquim,

interesting thought, we will discuss this internally, this might be a good feature for 1.7.

kind regards
Stefan
 
  The administrator has disabled public write access.
Powered by FireBoard
get the latest posts directly to your desktop