


keyboard handling (accelerators, ESC/ENTER & arrows)
Public Member Functions | |
| PG_PopupMenu (PG_Widget *parent, int x, int y, const std::string &caption=PG_NULLSTR, const std::string &style="PopupMenu") | |
| ~PG_PopupMenu () | |
| PG_PopupMenu & | addSeparator () |
| bool | SetMenuItemSlot (int id, MenuItem::MenuItemSlot slot, PG_Pointer clientdata=NULL) |
| int | maxItemWidth () const |
| void | disableItem (int dd) |
| void | enableItem (int id) |
| void | trackMenu (int x=-1, int y=-1) |
| Modal popup menu will be shown - i.e. | |
| void | openMenu (int x=-1, int y=-1) |
Add a new menu item to this menu | |
Constructs a new menu item using the provided parameters and then adds the item to this menu. | |
| PG_PopupMenu & | addMenuItem (const std::string &caption, int ID, MenuItem::MenuItemSlot, PG_Pointer data=NULL, MenuItem::MI_FLAGS flags=MenuItem::MIF_NONE) |
| Adds a menu item whose handler (if any) is set to be a stand-alone function. | |
| PG_PopupMenu & | addMenuItem (const std::string &caption, int ID, MenuItem::MI_FLAGS flags=MenuItem::MIF_NONE) |
| PG_PopupMenu & | addMenuItem (const std::string &caption, PG_PopupMenu *sub, MenuItem::MI_FLAGS flags=MenuItem::MIF_SUBMENU) |
Public Attributes | |
| SignalSelectMenuItem | sigSelectMenuItem |
Protected Types | |
| typedef std::list< MenuItem * >::iterator | MII |
Protected Member Functions | |
| void | eventBlit (SDL_Surface *surface, const PG_Rect &src, const PG_Rect &dst) |
| overridable eventhandler to blit the widget contents to the screen | |
| void | eventMouseEnter () |
| eventhandler for mouse movements. | |
| void | eventMouseLeave () |
| eventhandler for mouse movements. | |
| bool | eventMouseMotion (const SDL_MouseMotionEvent *motion) |
| Overridable Eventhandler for a SDL_MouseMotionEvent message. | |
| bool | eventMouseButtonDown (const SDL_MouseButtonEvent *button) |
| Overridable Eventhandler for a SDL_MouseButtonEvent message. | |
| bool | eventMouseButtonUp (const SDL_MouseButtonEvent *button) |
| Overridable Eventhandler for a SDL_MouseButtonEvent message. | |
| bool | eventKeyDown (const SDL_KeyboardEvent *key) |
| Overridable Eventhandler for a SDL_KeyboardEvent message. | |
| void | eventMoveWidget (int x, int y) |
| Callback for the MoveWidget event. | |
| void | eventShow () |
| overridable eventhandler called whenever the widget gets shown. | |
| void | eventHide () |
| overridable eventhandler called whenever the widget gets hidden. | |
| void | LoadThemeStyle (const std::string &widgettype) |
| Load a specific themestyle. | |
| void | LoadThemeStyle (const std::string &widgettype, const std::string &objectname) |
| Load a style from the theme definition. | |
| virtual bool | getCaptionHeight (PG_Rect &rect, bool constructing=false) |
| virtual void | recalcRect () |
| virtual void | handleClick (int x, int y) |
| virtual void | enslave (PG_PopupMenu *master) |
| virtual void | liberate () |
Protected Attributes | |
| std::list< MenuItem * > | items |
| std::string | myCaption |
| the menu items collection | |
| PG_Color | captionActiveColor |
| menu caption | |
| PG_Color | captionInactiveColor |
| PG_Color | miNormalColor |
| PG_Color | miSelectedColor |
| PG_Color | miDisabledColor |
| PG_Color | sepNormalColor |
| PG_Color | sepShadowColor |
| int | xPadding |
| int | yPadding |
| int | minTabWidth |
| if a menu entry has a right justified component ( e.g. | |
| int | separatorLineWidth |
Classes | |
| class | MenuItem |
| A menu item data structure. More... | |
| class | SignalSelectMenuItem |
| Signal type declaration. More... | |
|
|
|
|
||||||||||||||||||||||||
|
|
|
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||||||||||
|
Adds a menu item whose handler (if any) is set to be a stand-alone function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||
|
overridable eventhandler to blit the widget contents to the screen
Reimplemented from PG_ThemeWidget. |
|
|
overridable eventhandler called whenever the widget gets hidden.
Reimplemented from PG_Widget. |
|
|
Overridable Eventhandler for a SDL_KeyboardEvent message. This handler is called when a key changed it's state from unpressed to pressed. The default implementation returns 'false' which indicates that this message is not processed by this object.
Reimplemented from PG_MessageObject. |
|
|
Overridable Eventhandler for a SDL_MouseButtonEvent message. This handler is called when a mouse button is pressed. The default implementation returns 'false' which indicates that this message is not processed by this object.
Reimplemented from PG_MessageObject. |
|
|
Overridable Eventhandler for a SDL_MouseButtonEvent message. This handler is called when a mouse button is released. The default implementation returns 'false' which indicates that this message is not processed by this object.
Reimplemented from PG_MessageObject. |
|
|
eventhandler for mouse movements. This overrideable handler is called everytime the mouse cursor is entering the widget area. Reimplemented from PG_Widget. |
|
|
eventhandler for mouse movements. This overrideable handler is called everytime the mouse cursor is leaving the widget area. Reimplemented from PG_Widget. |
|
|
Overridable Eventhandler for a SDL_MouseMotionEvent message. This handler is called when mouse movement is detected. The default implementation returns 'false' which indicates that this message is not processed by this object.
Reimplemented from PG_MessageObject. |
|
||||||||||||
|
Callback for the MoveWidget event.
Reimplemented from PG_Widget. |
|
|
overridable eventhandler called whenever the widget gets shown.
Reimplemented from PG_Widget. |
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
|
|
||||||||||||
|
Load a style from the theme definition.
Reimplemented from PG_ThemeWidget. |
|
|
Load a specific themestyle.
Reimplemented from PG_ThemeWidget. |
|
|
|
|
||||||||||||
|
|
|
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
Modal popup menu will be shown - i.e. all mouse/keyboard events will be captured by the menu and until the user selects any menu item (or cancels the menu by pressing ESC) no other widget will be accessible. If x @endcoce and @code y
|
|
|
menu caption
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if a menu entry has a right justified component ( e.g. "save\tctrl-s" ), this is the minimum space for the tab |
|
|
|
|
|
the menu items collection
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|