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

Posts: 37

Managing input events in menu 5 Years ago  
Hi all,

Based on a previous message in questions section:

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.


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:


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.
Re:Managing input events in menu

Posts: 91

Re:Managing input events in menu 4 Years, 12 Months ago  
Hi Joaquim,

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

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