nux-1.14.0
|
Public Member Functions | |
MenuPage (const TCHAR *title=TEXT(""), NUX_FILE_LINE_PROTO) | |
const TCHAR * | GetName () const |
ActionItem * | AddAction (const TCHAR *label=0, int UserValue=0) |
void | AddSeparator () |
MenuPage * | AddMenu (const TCHAR *label) |
ActionItem * | AddSubMenu (const TCHAR *label, MenuPage *menu) |
void | RemoveItem (ActionItem *item) |
void | RemoveAllItem () |
bool | CanClose () const |
void | EmitMouseMove (int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags) |
void | EmitMouseUp (int x, int y, unsigned long button_flags, unsigned long key_flags) |
void | EmitMouseDown (int x, int y, unsigned long button_flags, unsigned long key_flags) |
void | EmitMouseDrag (int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags) |
void | RecvMouseLeave (int x, int y, unsigned long button_flags, unsigned long key_flags) |
void | StartMenu (int MenuXPosition, int MenuYPosition, int x=0, int y=0, bool OverrideCurrentMenuChain=true) |
Start the MenuPage iteration and show it. | |
void | StopMenu (int x=0, int y=0) |
Stop the MenuPage iteration and hide it. | |
void | SetFontName (char *font_name) |
void | SetOnClosureContinueEventCycle (bool on_closure_continue_with_event) |
Let regular widgets process a mouse down event that closes the menu chain without a menu item selection. | |
bool | OnClosureContinueEventCycle () const |
Returns True if a mouse down that closes the menu chain can be processed by regular widgets. | |
void | StopActionSubMenu () |
void | ExecuteActionItem (MenuItem *menuItem) |
void | NotifyActionTriggeredToParent (MenuPage *, MenuItem *menuItem) |
void | NotifyTerminateMenuCascade () |
void | NotifyMouseDownOutsideMenuCascade (int x, int y) |
void | SetParentMenu (MenuPage *) |
MenuPage * | GetParentMenu () |
void | setShowItemIcon (bool b) |
bool | ShowItemIcon () |
bool | TestMouseDown () |
bool | TestMouseUp (int x, int y, unsigned long button_flags, unsigned long key_flags, bool &hit_inside_a_menu) |
void | Terminate (int x, int y, unsigned long button_flags, unsigned long key_flags) |
void | SetActive (bool b) |
bool | IsActive () const |
int | GetNumItem () const |
ActionItem * | GetActionItem (int i) const |
int | GetActionItemIndex (ActionItem *action) const |
virtual Geometry | GetAbsoluteGeometry () const |
Return the position of this object with regard to its top left corner of the physical window. | |
virtual Geometry | GetRootGeometry () const |
Return the position of this object with regard to its top level parent (the main layout or a BaseWindow). | |
virtual long | ComputeChildLayout () |
virtual void | SetGeometry (const Geometry &geo) |
Set Geometry. | |
Public Attributes | |
sigc::signal< void, int > | sigItemSelected |
sigc::signal< void, MenuPage *, ActionItem * > | sigActionTriggered |
Send an action Signal. | |
sigc::signal< void > | sigTerminateMenuCascade |
Terminate the menu and its sub menu cascade. | |
sigc::signal< void, MenuPage *, int, int > | sigMouseDownOutsideMenuCascade |
Notify that a mouse down event happened outside the menu cascade. | |
sigc::signal< void, MenuPage * > | sigOpeningMenu |
sigc::signal< void, MenuPage * > | sigClosingMenu |
Protected Member Functions | |
virtual Area * | FindAreaUnderMouse (const Point &mouse_position, NuxEventType event_type) |
virtual long | ProcessEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo) |
virtual void | Draw (GraphicsEngine &GfxContext, bool force_draw) |
virtual void | DrawContent (GraphicsEngine &GfxContext, bool force_draw) |
virtual void | PostDraw (GraphicsEngine &GfxContext, bool force_draw) |
Friends | |
class | MenuBar |
class | WindowCompositor |
Definition at line 89 of file MenuPage.h.
Area * nux::MenuPage::FindAreaUnderMouse | ( | const Point & | mouse_position, |
NuxEventType | event_type | ||
) | [protected, virtual] |
Return the area under the mouse pointer.
Reimplemented from nux::View.
Definition at line 364 of file MenuPage.cpp.
References nux::Area::AcceptMouseWheelEvent(), and nux::Area::TestMousePointerInclusionFilterMouseWheel().
{ bool mouse_inside = TestMousePointerInclusionFilterMouseWheel(mouse_position, event_type); if(mouse_inside == false) return NULL; if((event_type == NUX_MOUSE_WHEEL) && (!AcceptMouseWheelEvent())) return NULL; return this; }
Geometry nux::MenuPage::GetAbsoluteGeometry | ( | ) | const [virtual] |
Return the position of this object with regard to its top left corner of the physical window.
Return the position of the Area inside the physical window. For the main layout set in WindowThread, The following functions are equivalent:
Reimplemented from nux::Area.
Definition at line 1218 of file MenuPage.cpp.
References nux::Area::GetGeometry().
{ return GetGeometry(); }
int nux::MenuPage::GetActionItemIndex | ( | ActionItem * | action | ) | const |
Get the index of and item in the menu.
Definition at line 1202 of file MenuPage.cpp.
{ if (action == 0) return -1; for (int i = 0; i < (int) m_MenuItemVector.size(); i++) { if (action == m_MenuItemVector[i]->GetActionItem() ) { return i; } } return -1; }
int nux::MenuPage::GetNumItem | ( | ) | const [inline] |
Return the number of items in the menu.
Definition at line 236 of file MenuPage.h.
{
return m_numItem;
}
Geometry nux::MenuPage::GetRootGeometry | ( | ) | const [virtual] |
Return the position of this object with regard to its top level parent (the main layout or a BaseWindow).
Return the position of the Area inside the physical window. For the main layout set in WindowThread or for a BaseWindow, GetRootGeometry () is equivalent to GetGeometry ().
Reimplemented from nux::Area.
Definition at line 1223 of file MenuPage.cpp.
References nux::Area::GetGeometry().
{ return GetGeometry(); }
bool nux::MenuPage::OnClosureContinueEventCycle | ( | ) | const |
Returns True if a mouse down that closes the menu chain can be processed by regular widgets.
When a menu chain closes as a result of a mouse down event outside of the menu chain, there is still the possibility to let regular widgets process the event. The flag is tested on the top level MenuPage of the menu chain.
Definition at line 1233 of file MenuPage.cpp.
{
return on_closure_continue_with_event_;
}
void nux::MenuPage::SetOnClosureContinueEventCycle | ( | bool | on_closure_continue_with_event | ) |
Let regular widgets process a mouse down event that closes the menu chain without a menu item selection.
When a menu chain closes as a result of a mouse down event outside of the menu chain, there is still the possibility to let regular widgets process the event. The flag is tested on the top level MenuPage of the menu chain.
propagate_when_closing_without_action | Set to True to propagate the event to regular widgets if the menu chain closes as a result of a mouse down event outside the menu chain. |
Definition at line 1228 of file MenuPage.cpp.
{ on_closure_continue_with_event_ = on_closure_continue_with_event; }