Planeshift
Public Member Functions | Protected Member Functions | Protected Attributes

pawsMenuItem Class Reference

class pawsMenuItem - standard menu item with label, checkbox (optional) and image (optional). More...

#include <pawsmenu.h>

List of all members.

Public Member Functions

virtual void Draw ()
 Draws the widget and all of it's children.
void EnableCheckbox (bool enable)
 Shows or hides checkbox or image:
void EnableImage (bool enable)
pawsMenuAction GetAction ()
virtual void Invoke ()
 Makes the menu item send its menu event,.
virtual bool Load (iDocumentNode *node)
 Load a widget based on its <widget></widget> tag.
 pawsMenuItem (const pawsMenuItem &origin)
 pawsMenuItem ()
void SetAction (const pawsMenuAction &action)
 Sets/gets content of event that will be sent when the menu item is invoked.
void SetCheckboxImages (const csString &on, const csString &off)
 Sets names of bitmaps:
void SetCheckboxState (bool checked)
 Sets state of checkbox (true/false)
void SetImage (const csString &newImage)
void SetLabel (const csString &newLabel)
void SetSizes (int labelWidth, int spacing, int border)
 Sets layout values: If labelWidth = -1, then sets width of the label so that the text fits right in.
virtual bool Setup (iDocumentNode *node)
 Setup this widget.

Protected Member Functions

virtual void LoadAction (iDocumentNode *node)
 Reads pawsMenuAction data from XML.
void SetLayout ()
 Calculates and sets positions of the checkbox, label and image.

Protected Attributes

pawsMenuAction action
int border
 Space between content of the menu item (image, label, checkbox) and border of the item.
pawsButtoncheckbox
bool checkboxEnabled
iGraphics2D * graphics2d
pawsWidgetimage
bool imageEnabled
 Is image/checkbox visible ?
pawsTextBoxlabel
int spacing
 Horizontal distance between parts of the menu item (image, label, checkbox)

Detailed Description

class pawsMenuItem - standard menu item with label, checkbox (optional) and image (optional).

Definition at line 362 of file pawsmenu.h.


Constructor & Destructor Documentation

pawsMenuItem::pawsMenuItem ( )
pawsMenuItem::pawsMenuItem ( const pawsMenuItem origin)

Member Function Documentation

virtual void pawsMenuItem::Draw ( ) [virtual]

Draws the widget and all of it's children.

Remarks:
Uses clipping rect of it's parent to define drawing area. If the drawing area defined is empty it returns.

Reimplemented from pawsWidget.

void pawsMenuItem::EnableCheckbox ( bool  enable)

Shows or hides checkbox or image:

void pawsMenuItem::EnableImage ( bool  enable)
pawsMenuAction pawsMenuItem::GetAction ( ) [inline, virtual]

Reimplemented from pawsIMenuItem.

Definition at line 375 of file pawsmenu.h.

virtual void pawsMenuItem::Invoke ( ) [virtual]

Makes the menu item send its menu event,.

Reimplemented from pawsIMenuItem.

virtual bool pawsMenuItem::Load ( iDocumentNode *  node) [virtual]

Load a widget based on its <widget></widget> tag.

Parameters:
nodeThe xml data for the widget.
Remarks:
Recursivly loads all child widgets.

Reimplemented from pawsWidget.

virtual void pawsMenuItem::LoadAction ( iDocumentNode *  node) [protected, virtual]

Reads pawsMenuAction data from XML.

void pawsMenuItem::SetAction ( const pawsMenuAction ) [virtual]

Sets/gets content of event that will be sent when the menu item is invoked.

Reimplemented from pawsIMenuItem.

void pawsMenuItem::SetCheckboxImages ( const csString &  on,
const csString &  off 
)

Sets names of bitmaps:

void pawsMenuItem::SetCheckboxState ( bool  checked)

Sets state of checkbox (true/false)

void pawsMenuItem::SetImage ( const csString &  newImage)
void pawsMenuItem::SetLabel ( const csString &  newLabel)
void pawsMenuItem::SetLayout ( ) [protected]

Calculates and sets positions of the checkbox, label and image.

Then sets the width of the whole menu item.

void pawsMenuItem::SetSizes ( int  labelWidth,
int  spacing,
int  border 
)

Sets layout values: If labelWidth = -1, then sets width of the label so that the text fits right in.

virtual bool pawsMenuItem::Setup ( iDocumentNode *  ) [virtual]

Setup this widget.

Reimplemented from pawsWidget.


Member Data Documentation

Definition at line 422 of file pawsmenu.h.

Space between content of the menu item (image, label, checkbox) and border of the item.

Reimplemented from pawsWidget.

Definition at line 437 of file pawsmenu.h.

Definition at line 420 of file pawsmenu.h.

Definition at line 427 of file pawsmenu.h.

iGraphics2D* pawsMenuItem::graphics2d [protected]

Definition at line 439 of file pawsmenu.h.

Definition at line 418 of file pawsmenu.h.

bool pawsMenuItem::imageEnabled [protected]

Is image/checkbox visible ?

Definition at line 427 of file pawsmenu.h.

Definition at line 419 of file pawsmenu.h.

Horizontal distance between parts of the menu item (image, label, checkbox)

Definition at line 432 of file pawsmenu.h.


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