CrystalSpace

Public API Reference

Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

csMenu Class Reference
[Menu]

The Menu class represents two types of menu: vertical (popup) menus and bar menus. More...

#include <csws/csmenu.h>

Inheritance diagram for csMenu:

csComponent List of all members.

Public Member Functions

 csMenu (csComponent *iParent, csMenuFrameStyle iFrameStyle=csmfs3D, int iMenuStyle=CSMS_DEFAULTVALUE)
 Create menu object.
virtual void Draw ()
 Draw the menu.
virtual bool HandleEvent (iEvent &Event)
 Handle input events.
virtual bool PreHandleEvent (iEvent &Event)
 Pre-handle keyboard events to catch hotkeys.
bool CurrentHandleEvent (iEvent &Event)
 Pass a event to current item.
virtual void PlaceItems ()
 Recalculate menu size (called after each menu item insertion).
bool IsMenuBar ()
 Return true if menu is a menu bar.
virtual void SetState (int mask, bool enable)
 Set/clear given component state flags.
bool SetCurrent (csComponent *newCurrent, bool DropSubmenu=false)
 Set a child as current menu item.
virtual bool SetRect (int xmin, int ymin, int xmax, int ymax)
 Re-position childs when rescaled.
void Deactivate (int DismissCode)
 Deactivate menu.
csComponentGetItem (int iCommandCode)
 Find the item with given command code (even in submenus).
void SetCheck (int iCommandCode, bool iState)
 Set/remove a checkmark left of the menu item.
bool GetCheck (int iCommandCode)
 Get the checked state of the specified menu item.
virtual void Insert (csComponent *comp)
 Set fPlaceItems since a item has been inserted.
virtual void Delete (csComponent *comp)
 Set fPlaceItems since a item has been removed.
virtual void SuggestSize (int &w, int &h)
 Suggest the size of the menu.

Public Attributes

csComponentcurrent
 Current menu item.

Friends

class csMenuItem

Detailed Description

The Menu class represents two types of menu: vertical (popup) menus and bar menus.

In fact, menu class is a bit messy just now, and as soon as I will have time it should be cleaned up. However, it works reasonably well, so it is just a matter of taste.

Definition at line 225 of file csmenu.h.


Constructor & Destructor Documentation

csMenu::csMenu csComponent iParent,
csMenuFrameStyle  iFrameStyle = csmfs3D,
int  iMenuStyle = CSMS_DEFAULTVALUE
 

Create menu object.


Member Function Documentation

bool csMenu::CurrentHandleEvent iEvent Event  ) 
 

Pass a event to current item.

void csMenu::Deactivate int  DismissCode  ) 
 

Deactivate menu.

virtual void csMenu::Delete csComponent comp  )  [virtual]
 

Set fPlaceItems since a item has been removed.

Reimplemented from csComponent.

virtual void csMenu::Draw  )  [virtual]
 

Draw the menu.

Reimplemented from csComponent.

bool csMenu::GetCheck int  iCommandCode  ) 
 

Get the checked state of the specified menu item.

csComponent* csMenu::GetItem int  iCommandCode  ) 
 

Find the item with given command code (even in submenus).

virtual bool csMenu::HandleEvent iEvent Event  )  [virtual]
 

Handle input events.

Reimplemented from csComponent.

virtual void csMenu::Insert csComponent comp  )  [virtual]
 

Set fPlaceItems since a item has been inserted.

Reimplemented from csComponent.

bool csMenu::IsMenuBar  )  [inline]
 

Return true if menu is a menu bar.

Definition at line 270 of file csmenu.h.

virtual void csMenu::PlaceItems  )  [virtual]
 

Recalculate menu size (called after each menu item insertion).

virtual bool csMenu::PreHandleEvent iEvent Event  )  [virtual]
 

Pre-handle keyboard events to catch hotkeys.

Reimplemented from csComponent.

void csMenu::SetCheck int  iCommandCode,
bool  iState
 

Set/remove a checkmark left of the menu item.

bool csMenu::SetCurrent csComponent newCurrent,
bool  DropSubmenu = false
 

Set a child as current menu item.

virtual bool csMenu::SetRect int  xmin,
int  ymin,
int  xmax,
int  ymax
[virtual]
 

Re-position childs when rescaled.

Reimplemented from csComponent.

virtual void csMenu::SetState int  mask,
bool  enable
[virtual]
 

Set/clear given component state flags.

Reimplemented from csComponent.

virtual void csMenu::SuggestSize int &  w,
int &  h
[virtual]
 

Suggest the size of the menu.

Reimplemented from csComponent.


Member Data Documentation

csComponent* csMenu::current
 

Current menu item.

Definition at line 248 of file csmenu.h.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.3.9.1