#include <pgpopupmenu.h>
Inheritance diagram for PG_PopupMenu:

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 | item_with_id |
| class | MenuItem |
| A menu item data structure. More... | |
| class | SignalSelectMenuItem |
| Signal type declaration. More... | |
keyboard handling (accelerators, ESC/ENTER & arrows)
Definition at line 68 of file pgpopupmenu.h.
|
|
Definition at line 270 of file pgpopupmenu.h. |
|
||||||||||||||||||||||||
|
Definition at line 227 of file pgpopupmenu.cpp. References getCaptionHeight(), items, LoadThemeStyle(), PG_Widget::MoveWidget(), PG_Rect::my_height, PG_Rect::my_width, PG_Rect::my_xpos, myCaption, PG_Rect::PG_Rect(), xPadding, and yPadding. |
|
|
Definition at line 262 of file pgpopupmenu.cpp. References PG_FileArchive::UnloadSurface(). |
|
||||||||||||||||
|
Definition at line 318 of file pgpopupmenu.cpp. |
|
||||||||||||||||
|
Definition at line 308 of file pgpopupmenu.cpp. |
|
||||||||||||||||||||||||
|
Adds a menu item whose handler (if any) is set to be a stand-alone function.
Definition at line 295 of file pgpopupmenu.cpp. References PG_Signal1< P1, datatype >::connect(), and PG_PopupMenu::MenuItem::sigSelectMenuItem. Referenced by addSeparator(), InfoPopUp::InfoPopUp(), and XMLStartDoc(). |
|
|
Definition at line 347 of file pgpopupmenu.cpp. References addMenuItem(), PG_PopupMenu::MenuItem::MIF_SEPARATOR, and PG_NULLSTR. Referenced by Menu::setup(). |
|
|
Definition at line 352 of file pgpopupmenu.cpp. |
|
|
Definition at line 360 of file pgpopupmenu.cpp. |
|
|
Definition at line 488 of file pgpopupmenu.cpp. |
|
||||||||||||||||
|
overridable eventhandler to blit the widget contents to the screen
Reimplemented from PG_ThemeWidget. Definition at line 510 of file pgpopupmenu.cpp. References captionActiveColor, PG_Widget::DrawText(), PG_Draw::DrawThemedSurface(), PG_ThemeWidget::eventBlit(), PG_Application::GetScreen(), PG_PopupMenu::MenuItem::isDisabled(), PG_PopupMenu::MenuItem::isSelected(), PG_PopupMenu::MenuItem::isSeparator(), items, PG_PopupMenu::MenuItem::measureItem(), miDisabledColor, miNormalColor, miSelectedColor, PG_Rect::my_xpos, PG_Rect::my_ypos, myCaption, PG_PopupMenu::MenuItem::paintDisabled(), PG_PopupMenu::MenuItem::paintNormal(), PG_PopupMenu::MenuItem::paintSelected(), sepNormalColor, sepShadowColor, and PG_Widget::SetFontColor(). |
|
|
overridable eventhandler called whenever the widget gets hidden.
Reimplemented from PG_Widget. Definition at line 838 of file pgpopupmenu.cpp. References PG_Widget::eventHide(), and PG_MessageObject::ReleaseCapture(). |
|
|
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. Definition at line 734 of file pgpopupmenu.cpp. References PG_Widget::extractHotkey(), PG_Widget::Hide(), PG_PopupMenu::MenuItem::isDisabled(), items, PG_Widget::Redraw(), PG_PopupMenu::MenuItem::sigSelectMenuItem, sigSelectMenuItem, PG_Application::TranslateNumpadKeys(), and PG_PopupMenu::MenuItem::unselect(). |
|
|
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. Definition at line 699 of file pgpopupmenu.cpp. References PG_MessageObject::eventMouseButtonDown(). |
|
|
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. Definition at line 710 of file pgpopupmenu.cpp. References PG_MessageObject::eventMouseButtonUp(), handleClick(), PG_Widget::Hide(), and PG_PopupMenu::MenuItem::isSeparator(). |
|
|
eventhandler for mouse movements. This overrideable handler is called everytime the mouse cursor is entering the widget area. Reimplemented from PG_Widget. Definition at line 889 of file pgpopupmenu.cpp. References PG_Widget::eventMouseEnter(). |
|
|
eventhandler for mouse movements. This overrideable handler is called everytime the mouse cursor is leaving the widget area. Reimplemented from PG_Widget. Definition at line 893 of file pgpopupmenu.cpp. References PG_Widget::eventMouseLeave(). |
|
|
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. Definition at line 646 of file pgpopupmenu.cpp. References PG_Rect::IsInside(), items, PG_Rect::my_xpos, PG_Rect::my_ypos, PG_Widget::ProcessEvent(), PG_Widget::Redraw(), PG_MessageObject::ReleaseCapture(), PG_Point::x, and PG_Point::y. |
|
||||||||||||
|
Callback for the MoveWidget event.
Reimplemented from PG_Widget. Definition at line 821 of file pgpopupmenu.cpp. References PG_Widget::eventMoveWidget(), PG_Rect::my_height, PG_Rect::my_xpos, PG_Rect::my_ypos, xPadding, and yPadding. |
|
|
overridable eventhandler called whenever the widget gets shown.
Reimplemented from PG_Widget. Definition at line 828 of file pgpopupmenu.cpp. References PG_Widget::eventShow(), and PG_MessageObject::SetCapture(). |
|
||||||||||||
|
Definition at line 397 of file pgpopupmenu.cpp. References PG_Widget::GetTextSize(), PG_Rect::my_height, PG_Rect::my_width, PG_Rect::my_xpos, PG_Rect::my_ypos, and myCaption. Referenced by PG_PopupMenu(), and recalcRect(). |
|
||||||||||||
|
Definition at line 462 of file pgpopupmenu.cpp. References PG_Rect::IsInside(), PG_PopupMenu::MenuItem::isMute(), PG_PopupMenu::MenuItem::isSubMenu(), liberate(), sigSelectMenuItem, PG_PopupMenu::MenuItem::sigSelectMenuItem, PG_PopupMenu::MenuItem::unselect(), PG_Point::x, and PG_Point::y. Referenced by eventMouseButtonUp(). |
|
|
Definition at line 492 of file pgpopupmenu.cpp. References PG_Widget::Hide(), and liberate(). Referenced by handleClick(), and liberate(). |
|
||||||||||||
|
Load a style from the theme definition.
Reimplemented from PG_ThemeWidget. Definition at line 885 of file pgpopupmenu.cpp. References PG_ThemeWidget::LoadThemeStyle(). |
|
|
Load a specific themestyle.
Reimplemented from PG_ThemeWidget. Definition at line 847 of file pgpopupmenu.cpp. References captionActiveColor, captionInactiveColor, PG_Theme::FindGradient(), PG_Theme::FindSurface(), PG_Theme::GetColor(), PG_Theme::GetProperty(), PG_Application::GetTheme(), PG_ThemeWidget::LoadThemeStyle(), miDisabledColor, miNormalColor, minTabWidth, miSelectedColor, separatorLineWidth, sepNormalColor, sepShadowColor, xPadding, and yPadding. Referenced by PG_PopupMenu(). |
|
|
Definition at line 352 of file pgpopupmenu.h. References xPadding. Referenced by PG_PopupMenu::MenuItem::measureItem(). |
|
||||||||||||
|
Definition at line 374 of file pgpopupmenu.cpp. References PG_Application::GetScreenHeight(), PG_Application::GetScreenWidth(), PG_Widget::MoveWidget(), PG_Rect::my_height, PG_Rect::my_width, PG_Rect::my_xpos, PG_Rect::my_ypos, and PG_Widget::Show(). Referenced by trackMenu(). |
|
|
Definition at line 420 of file pgpopupmenu.cpp. References getCaptionHeight(), PG_Application::GetScreenHeight(), PG_Application::GetScreenWidth(), items, PG_PopupMenu::MenuItem::measureItem(), PG_Rect::my_height, PG_Rect::my_width, PG_Rect::my_xpos, PG_Rect::my_ypos, PG_Widget::SizeWidget(), xPadding, and yPadding. |
|
||||||||||||||||
|
Definition at line 897 of file pgpopupmenu.cpp. References PG_Signal1< P1, datatype >::connect(), items, and PG_PopupMenu::MenuItem::sigSelectMenuItem. |
|
||||||||||||
|
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
Definition at line 368 of file pgpopupmenu.cpp. References PG_Application::GetEventSupplier(), and openMenu(). Referenced by PG_MenuBar::leaveButton(). |
|
|
menu caption
Definition at line 308 of file pgpopupmenu.h. Referenced by eventBlit(), and LoadThemeStyle(). |
|
|
Definition at line 309 of file pgpopupmenu.h. Referenced by LoadThemeStyle(). |
|
|
Definition at line 305 of file pgpopupmenu.h. Referenced by eventBlit(), eventKeyDown(), eventMouseMotion(), PG_PopupMenu(), recalcRect(), and SetMenuItemSlot(). |
|
|
Definition at line 313 of file pgpopupmenu.h. Referenced by eventBlit(), and LoadThemeStyle(). |
|
|
Definition at line 311 of file pgpopupmenu.h. Referenced by eventBlit(), and LoadThemeStyle(). |
|
|
if a menu entry has a right justified component ( e.g. "save\tctrl-s" ), this is the minimum space for the tab Definition at line 323 of file pgpopupmenu.h. Referenced by LoadThemeStyle(), and PG_PopupMenu::MenuItem::measureItem(). |
|
|
Definition at line 312 of file pgpopupmenu.h. Referenced by eventBlit(), and LoadThemeStyle(). |
|
|
the menu items collection
Definition at line 306 of file pgpopupmenu.h. Referenced by eventBlit(), getCaptionHeight(), and PG_PopupMenu(). |
|
|
Definition at line 325 of file pgpopupmenu.h. Referenced by LoadThemeStyle(). |
|
|
Definition at line 315 of file pgpopupmenu.h. Referenced by eventBlit(), and LoadThemeStyle(). |
|
|
Definition at line 316 of file pgpopupmenu.h. Referenced by eventBlit(), and LoadThemeStyle(). |
|
|
Definition at line 266 of file pgpopupmenu.h. Referenced by PG_MenuBar::Add(), eventKeyDown(), and handleClick(). |
|
|
Definition at line 318 of file pgpopupmenu.h. Referenced by eventMoveWidget(), LoadThemeStyle(), maxItemWidth(), PG_PopupMenu(), and recalcRect(). |
|
|
Definition at line 319 of file pgpopupmenu.h. Referenced by eventMoveWidget(), LoadThemeStyle(), PG_PopupMenu(), and recalcRect(). |
1.4.2