class menu_item : public window
A menu_item may relate to an other menu_container in the form of a popup_menu. The popup_menu is not a child window of the menu_item but is an independent window; an unmanaged direct child of the root window. The popup menu pops up, i.e. becomes visible when the pointer enters the menu item. Once a popup menu is visible, it stays visible until the pointer enters another menu item in the same menu container or when a mouse button is clicked. So when a menu item is highlighted, it tells its sibling menu items to remove their popup menus. Removing a submenu means the menu items in the submenu must also remove their submenus recursively.
The third action of a menu_item when the pointer enters its window, is grabbing the pointer. This prevents windows which are not part of the menu system from reacting to the mouse buttons. The menu system remains active until the button is clicked. After the mouse button is released, all popup menus are removed and the pointer grab is cancelled.
The pointer grab may be released inside a menu item or outside a menu item. Only when the button click happens inside a menu item that does not have a popup menu will the menu item send a comamnd back to the application.
Member functions | |
---|---|
menu_item | menu_item contructors and destructors |
HideSubmenu | Hide the submenus related to this item |
ShowSubmenu | Show the submenu related to this item |
Popup | Relate the item to a submenu |
Enable | Enable or disable a menu item |