Planeshift
pawsMenuAction Class Reference

When pawsMenu is created, target of notification messages (OnMenuAction) must be set by SetNotify() method. More...

#include <pawsmenu.h>

Public Attributes

csString name
 
csArray< csString > params
 

Detailed Description

When pawsMenu is created, target of notification messages (OnMenuAction) must be set by SetNotify() method.

When pawsMenu creates a submenu, it sets the target of notification messages automatically.

Events with action name="submenu" are handled by the menu and are not delivered to subscriber.

When menu wants to destruct itself, it must not do this directly but it must call DestroyMenu() method. This notifies parent and children of menu about the destruction and then sends MENU_DESTROY_ACTION_NAME event via OnMenuAction(). The receiving widget is responsible for destruction of the menu. This way the widget which uses the menu knows about its destruction and all references to the menu are dropped.

All pawsMenu instances should be added to children of mainWidget.

pawsMenuItem XML definition

attributes: image - name of image (if missing, image is disabled) label - text of label colour - colour of label checked - state of checkbox [yes|no] (if missing, checkbox is disabled) CheckboxOn - images of checkbox states (if missing, default is used) CheckboxOff LabelWidth - width of label (if missing, it is set to the width of the letters inside) spacing - horizontal spacing between image, label and checkbox (if missing, default is used) border - space between border and inner components (if missing, default is used)

action - name of event that is sent when user activates the item param1 - arbitrary number of additional variables that are included in the event param2 paramN

pawsMenu XML definition

attributes: align - "left" or "center" autosize - if "true", then widget size is calculated and set so its content just fits in colour - colour of menu label

All widgets inside are added as menu items. pawsMenuAction - when OnMenuAction event is invoked, this structure is sent to event handler and tells it what action the handler should take.

Content of pawsMenuAction is defined in each regular menu item.

Definition at line 96 of file pawsmenu.h.

Member Data Documentation

csString pawsMenuAction::name

Definition at line 99 of file pawsmenu.h.

csArray<csString> pawsMenuAction::params

Definition at line 100 of file pawsmenu.h.


The documentation for this class was generated from the following file: