CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

csMenu Class Reference
[Menu]

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

#include <csmenu.h>

Inheritance diagram for csMenu:

csComponent List of all members.

Public Methods

 csMenu (csComponent *iParent, csMenuFrameStyle iFrameStyle=csmfs3D, int iMenuStyle=CSMS_DEFAULTVALUE)
 Create menu object. More...

virtual void Draw ()
 Draw the menu. More...

virtual bool HandleEvent (iEvent &Event)
 Handle input events. More...

virtual bool PreHandleEvent (iEvent &Event)
 Pre-handle keyboard events to catch hotkeys. More...

bool CurrentHandleEvent (iEvent &Event)
 Pass a event to current item. More...

virtual void PlaceItems ()
 Recalculate menu size (called after each menu item insertion). More...

bool IsMenuBar ()
 Return true if menu is a menu bar. More...

virtual void SetState (int mask, bool enable)
 Set/clear given component state flags. More...

bool SetCurrent (csComponent *newCurrent, bool DropSubmenu=false)
 Set a child as current menu item. More...

virtual bool SetRect (int xmin, int ymin, int xmax, int ymax)
 Re-position childs when rescaled. More...

void Deactivate (int DismissCode)
 Deactivate menu. More...

csComponentGetItem (int iCommandCode)
 Find the item with given command code (even in submenus). More...

void SetCheck (int iCommandCode, bool iState)
 Set/remove a checkmark left to menu item. More...

virtual void Insert (csComponent *comp)
 Set fPlaceItems since a item has been inserted. More...

virtual void Delete (csComponent *comp)
 Set fPlaceItems since a item has been removed. More...

virtual void SuggestSize (int &w, int &h)
 Suggest the size of the menu. More...


Public Attributes

csComponentcurrent
 Current menu item. More...


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 220 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.

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 265 of file csmenu.h.

References csmfsBar.

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 to 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 243 of file csmenu.h.


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