menu system extensions
Posted: Sat Oct 30, 2010 22:17
Hello there,
i found, that the menu system (menubar/popup/menuitem) didn't fit 100% to my needs, so i added some features in my local CEGUI source (svn branch 0.7.4). I think this features could be of use to the CEGUI community, so perhaps there is a way to integrate them.
So what i have done?
*(1)Added support for checkable menu items
*(2)Added support for delayed opening / closing of popups, when hovering with the mouse
*(3)Added a property for an offset used for adjusting the position of the popup menus
*(4)Modified the logic, so if the current popup window is switched, all sub popup menus are set to closed state, so they don't appear anymore when the switched popup is reopened.
How i did it?
(1)
*added two new properties to the menu item widget: Checkable, Checked
*added a falagard state imagery "CheckedIcon" to the menu item renderer
(2)
*added a property to the menu item widget: PopupTimerTime, which gives the open/close delay
*added a update routine to CEGUI::MenuItem, which updates the close/open timer if its activated
*triggered the open/close timer depending on the hovering state
(3)
*added a property to the menu item widget: PopupOffset
*the offset is added to the calculated position of the popup window, when it pops up
(4)
*closeAllMenuItemPopups now finds the topmost popup menu and closes its current popup
*added internal onHidden event to PopupMenu where it changes the popups opened state to closed
All changes should be transparent to the current looknfeels and layouts, so no behavior change is made to existing menu systems, except the one in (4), which could be made optional by an additional property if this is not ok.
I have done some more functionality, which i decided to put in my client code. If someone thinks this is useful, i could post some code.
This includes:
*closing all menu popups, when a click is made outside the popup windows or top menu items
*a way to display keyboard shortcuts in the menuitems
Any thoughts, questions or requests on this?
Yours sincerely,
Grimmigbeisser
i found, that the menu system (menubar/popup/menuitem) didn't fit 100% to my needs, so i added some features in my local CEGUI source (svn branch 0.7.4). I think this features could be of use to the CEGUI community, so perhaps there is a way to integrate them.
So what i have done?
*(1)Added support for checkable menu items
*(2)Added support for delayed opening / closing of popups, when hovering with the mouse
*(3)Added a property for an offset used for adjusting the position of the popup menus
*(4)Modified the logic, so if the current popup window is switched, all sub popup menus are set to closed state, so they don't appear anymore when the switched popup is reopened.
How i did it?
(1)
*added two new properties to the menu item widget: Checkable, Checked
*added a falagard state imagery "CheckedIcon" to the menu item renderer
(2)
*added a property to the menu item widget: PopupTimerTime, which gives the open/close delay
*added a update routine to CEGUI::MenuItem, which updates the close/open timer if its activated
*triggered the open/close timer depending on the hovering state
(3)
*added a property to the menu item widget: PopupOffset
*the offset is added to the calculated position of the popup window, when it pops up
(4)
*closeAllMenuItemPopups now finds the topmost popup menu and closes its current popup
*added internal onHidden event to PopupMenu where it changes the popups opened state to closed
All changes should be transparent to the current looknfeels and layouts, so no behavior change is made to existing menu systems, except the one in (4), which could be made optional by an additional property if this is not ok.
I have done some more functionality, which i decided to put in my client code. If someone thinks this is useful, i could post some code.
This includes:
*closing all menu popups, when a click is made outside the popup windows or top menu items
*a way to display keyboard shortcuts in the menuitems
Any thoughts, questions or requests on this?
Yours sincerely,
Grimmigbeisser