Planeshift
|
pawsMenu is standard PAWS menu widget. More...
#include <pawsmenu.h>
Public Member Functions | |
void | AddItem (pawsIMenuItem *item, pawsIMenuItem *nextItem=NULL) |
void | DeleteItem (pawsIMenuItem *item) |
Item is deleted from the menu and destructed. | |
virtual void | DoAction (pawsIMenuItem *item) |
Processes action invoked by user:
| |
virtual void | Draw () |
Draws the widget and all of it's children. | |
bool | HasSubmenus () |
Does menu have any submenus ? | |
virtual bool | OnButtonPressed (int button, int keyModifier, pawsWidget *widget) |
Called whenever a button is pressed. | |
virtual void | OnChildMenuDestroyed (pawsIMenu *child, pawsMenuClose reason) |
Called when child menu was closed. | |
virtual bool | OnMouseDown (int button, int modifiers, int x, int y) |
Manage mouse down event to test for and apply window changes. | |
virtual void | OnParentMenuDestroyed (pawsMenuClose reason) |
Called when parent menu was closed. | |
virtual void | OnSiblingOpened () |
Called when another submenu of parent menu was opened. | |
pawsMenu () | |
pawsMenu (const pawsMenu &origin) | |
virtual bool | PostSetup () |
This is called after the widget and all of it's children have been created. | |
void | SetItemAction (pawsIMenuItem *item, const pawsMenuAction &action) |
Sets action that should be invoked when 'item' is activated by user. | |
virtual void | SetNotify (pawsWidget *notifyTarget) |
Sets widget that should be receiving OnMenuAction events. | |
virtual void | SetParentMenu (pawsIMenu *parentMenu) |
Sets parent menu of submenu. | |
virtual bool | Setup (iDocumentNode *node) |
Setup this widget. | |
~pawsMenu () | |
Protected Member Functions | |
void | Autosize () |
Calculates and sets its size according to size of its content. | |
void | DestroyMenu (pawsMenuClose reason) |
Sends MENU_DESTROY_ACTION_NAME event and notifies its parent and children. | |
csPtr< iDocumentNode > | FindSubmenuNode (iDocumentNode *node, const csString &name) |
Searches for node with attribute "name" equal to parameter in 'node' and its children. | |
int | GetContentHeight () |
int | GetContentWidth () |
Calculates dimensions of menu items. | |
void | SendDestroyAction () |
Sends OnMenuAction event that requests destruction of this menu (MENU_DESTROY_ACTION_NAME) | |
void | SendOnMenuAction (const pawsMenuAction &action) |
Sends OnMenuAction event to notification target. | |
void | SetButtonPositions () |
Sets positions of the Sticky and Close buttons. | |
void | SetPositionsOfItems () |
Calculates and sets position of each menu item. | |
void | SetSubmenuPos (pawsMenu *submenu, int recommY) |
Sets appropriate position of a submenu on screen. | |
Protected Attributes | |
pawsMenuAlign | align |
csRef< iPawsImage > | arrowImage |
bool | autosize |
should Autosize() method be used ? | |
pawsButton * | closeButton |
iGraphics2D * | graphics2d |
csArray< pawsIMenuItem * > | items |
list of menu items | |
pawsTextBox * | label |
pawsWidget * | notifyTarget |
target of OnMenuAction events | |
pawsIMenu * | parentMenu |
bool | sticky |
Is the menu "stickied" on screen ? Stickied menu can only be closed by clicking on the closing button. | |
pawsButton * | stickyButton |
csArray< pawsIMenu * > | submenus |
list of open submenus |
pawsMenu is standard PAWS menu widget.
Definition at line 192 of file pawsmenu.h.
pawsMenu::pawsMenu | ( | ) |
pawsMenu::~pawsMenu | ( | ) |
pawsMenu::pawsMenu | ( | const pawsMenu & | origin | ) |
void pawsMenu::AddItem | ( | pawsIMenuItem * | item, |
pawsIMenuItem * | nextItem = NULL |
||
) |
void pawsMenu::Autosize | ( | ) | [protected] |
Calculates and sets its size according to size of its content.
void pawsMenu::DeleteItem | ( | pawsIMenuItem * | item | ) |
Item is deleted from the menu and destructed.
void pawsMenu::DestroyMenu | ( | pawsMenuClose | reason | ) | [protected] |
Sends MENU_DESTROY_ACTION_NAME event and notifies its parent and children.
Thanks to this all references from parent and children and the widget that is catching menu events are dropped before the destruction.
virtual void pawsMenu::DoAction | ( | pawsIMenuItem * | item | ) | [virtual] |
Processes action invoked by user:
Implements pawsIMenu.
virtual void pawsMenu::Draw | ( | ) | [virtual] |
Draws the widget and all of it's children.
Reimplemented from pawsWidget.
csPtr<iDocumentNode> pawsMenu::FindSubmenuNode | ( | iDocumentNode * | node, |
const csString & | name | ||
) | [protected] |
Searches for node with attribute "name" equal to parameter in 'node' and its children.
If succeeds returns pointer to the node found, or returns NULL.
int pawsMenu::GetContentHeight | ( | ) | [protected] |
int pawsMenu::GetContentWidth | ( | ) | [protected] |
Calculates dimensions of menu items.
bool pawsMenu::HasSubmenus | ( | ) |
Does menu have any submenus ?
virtual bool pawsMenu::OnButtonPressed | ( | int | button, |
int | keyModifier, | ||
pawsWidget * | widget | ||
) | [virtual] |
Called whenever a button is pressed.
button | The button pressed. |
keyModifier | Modifier key in effect. |
widget | The widget the button belongs to. |
Reimplemented from pawsWidget.
virtual void pawsMenu::OnChildMenuDestroyed | ( | pawsIMenu * | child, |
pawsMenuClose | reason | ||
) | [virtual] |
Called when child menu was closed.
Implements pawsIMenu.
Manage mouse down event to test for and apply window changes.
button | Type of button: 1 resizable or movable, 2 context menu or config window. |
modifiers | Used with PAWS_CONSTRUCTION. |
x | Used to test for resize. |
y | Used to test for resize. |
Reimplemented from pawsWidget.
virtual void pawsMenu::OnParentMenuDestroyed | ( | pawsMenuClose | reason | ) | [virtual] |
Called when parent menu was closed.
Implements pawsIMenu.
virtual void pawsMenu::OnSiblingOpened | ( | ) | [virtual] |
Called when another submenu of parent menu was opened.
Implements pawsIMenu.
virtual bool pawsMenu::PostSetup | ( | ) | [virtual] |
This is called after the widget and all of it's children have been created.
Reimplemented from pawsWidget.
void pawsMenu::SendDestroyAction | ( | ) | [protected] |
Sends OnMenuAction event that requests destruction of this menu (MENU_DESTROY_ACTION_NAME)
void pawsMenu::SendOnMenuAction | ( | const pawsMenuAction & | action | ) | [protected] |
Sends OnMenuAction event to notification target.
void pawsMenu::SetButtonPositions | ( | ) | [protected] |
Sets positions of the Sticky and Close buttons.
void pawsMenu::SetItemAction | ( | pawsIMenuItem * | item, |
const pawsMenuAction & | action | ||
) |
Sets action that should be invoked when 'item' is activated by user.
virtual void pawsMenu::SetNotify | ( | pawsWidget * | notifyTarget | ) | [virtual] |
Sets widget that should be receiving OnMenuAction events.
Implements pawsIMenu.
virtual void pawsMenu::SetParentMenu | ( | pawsIMenu * | parentMenu | ) | [virtual] |
Sets parent menu of submenu.
Implements pawsIMenu.
void pawsMenu::SetPositionsOfItems | ( | ) | [protected] |
Calculates and sets position of each menu item.
Sets appropriate position of a submenu on screen.
virtual bool pawsMenu::Setup | ( | iDocumentNode * | ) | [virtual] |
Setup this widget.
Reimplemented from pawsWidget.
pawsMenuAlign pawsMenu::align [protected] |
Definition at line 309 of file pawsmenu.h.
csRef<iPawsImage> pawsMenu::arrowImage [protected] |
Definition at line 307 of file pawsmenu.h.
bool pawsMenu::autosize [protected] |
should Autosize() method be used ?
Definition at line 314 of file pawsmenu.h.
pawsButton * pawsMenu::closeButton [protected] |
Definition at line 304 of file pawsmenu.h.
iGraphics2D* pawsMenu::graphics2d [protected] |
Definition at line 322 of file pawsmenu.h.
csArray<pawsIMenuItem*> pawsMenu::items [protected] |
list of menu items
Definition at line 292 of file pawsmenu.h.
pawsTextBox* pawsMenu::label [protected] |
Definition at line 305 of file pawsmenu.h.
pawsWidget* pawsMenu::notifyTarget [protected] |
target of OnMenuAction events
Definition at line 302 of file pawsmenu.h.
pawsIMenu* pawsMenu::parentMenu [protected] |
Definition at line 287 of file pawsmenu.h.
bool pawsMenu::sticky [protected] |
Is the menu "stickied" on screen ? Stickied menu can only be closed by clicking on the closing button.
Definition at line 320 of file pawsmenu.h.
pawsButton* pawsMenu::stickyButton [protected] |
Definition at line 304 of file pawsmenu.h.
csArray<pawsIMenu*> pawsMenu::submenus [protected] |
list of open submenus
Definition at line 297 of file pawsmenu.h.