In file include/csws/csmenu.h:

class csMenu : public csComponent

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

Inheritance:


Public Fields

csComponent* current
Current menu item

Public Methods

csMenu(csComponent *iParent, csMenuFrameStyle iFrameStyle = csmfs3D, int iMenuStyle = CSMS_DEFAULTVALUE)
Create menu object
bool CurrentHandleEvent(csEvent &Event)
Pass a event to current item
void Deactivate(int DismissCode)
Deactivate menu
virtual void Draw()
Draw the menu
csComponent* GetItem(int iCommandCode)
Find the item with given command code (even in submenus)
virtual bool HandleEvent(csEvent &Event)
Handle input events
bool IsMenuBar()
Return true if menu is a menu bar
virtual void PlaceItems()
Recalculate menu size (called after each menu item insertion)
virtual bool PreHandleEvent(csEvent &Event)
Pre-handle keyboard events to catch hotkeys
void SetCheck(int iCommandCode, bool iState)
Set/remove a checkmark left to menu item
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
virtual void SetState(int mask, bool enable)
Set/clear given component state flags

Private Fields

int BorderWidth
Menu border width and height
csComponent* first
Remember the first menu item
int FrameStyle
Menu frame style
csComponent* last
Remember the last selected menu item
int MenuStyle
Menu style flags
csComponent* oldparentfocus
Old parent's focused component
bool SubMenuOpened
Are submenus opened?

Private Methods

virtual bool ExecuteKey(int key)
Move from current item to next selectable item in one of four directions
void SetItemWidth(csComponent *start, int count, int width)
Set 'width' for 'count' items from 'start'

Inherited from csComponent:

Public Fields

csApp* app
csRect bound
csVector clipchildren
csComponent* focused
unsigned int id
csComponent* next
csComponent* parent
csComponent* top

Public Methods

void Box(int xmin, int ymin, int xmax, int ymax, int colindx)
void Center(bool iHoriz = true, bool iVert = true)
virtual void Close()
virtual void Delete(csComponent *comp)
void DeleteAll()
void DeleteClipChild(csComponent *clipchild)
void Drag(int x, int y, int DragMode)
void FindMaxFreeRect(csRect &area)
virtual void FixPosition(int &newX, int &newY)
virtual void FixSize(int &newW, int &newH)
csComponent* ForEach(bool (*func) (csComponent *child, void *param), void *param = NULL, bool Zorder = false)
csComponent* GetChild(int find_id)
csComponent* GetClipParent()
int GetColor(int Index)
csComponent* GetDefault()
int GetDragStyle()
csComponent* GetFocused()
int GetFont()
int GetState(int mask)
virtual char* GetText()
virtual void GetText(char *oText, int iTextSize)
csComponent* GetTop()
void GlobalToLocal(int &x, int &y)
bool HandleDragEvent(csEvent &Event, int BorderW, int BorderH)
virtual void Hide()
virtual void Insert(csComponent *comp)
void InsertClipChild(csComponent *clipchild)
void Invalidate(bool IncludeChildren = false)
void Invalidate(int xmin, int ymin, int xmax, int ymax, bool IncludeChildren = false)
void Invalidate(csRect &area, bool IncludeChildren = false)
void Line(float x1, float y1, float x2, float y2, int colindx)
void LocalToGlobal(int &x, int &y)
virtual bool Maximize()
virtual csComponent* NextChild(csComponent *start = NULL, bool disabled = false)
virtual csComponent* NextControl(csComponent *start = NULL)
virtual csComponent* NextGroup(csComponent *start = NULL)
void ObliqueRect3D(int xmin, int ymin, int xmax, int ymax, int cornersize, int darkindx, int lightindx)
void Pixel(int x, int y, int colindx)
virtual bool PostHandleEvent(csEvent &Event)
virtual csComponent* PrevChild(csComponent *start = NULL, bool disabled = false)
virtual csComponent* PrevControl(csComponent *start = NULL)
virtual csComponent* PrevGroup(csComponent *start = NULL)
void Rect3D(int xmin, int ymin, int xmax, int ymax, int darkindx, int lightindx)
void Redraw()
virtual bool Restore()
bool Select()
void* SendCommand(int CommandCode, void *Info = NULL)
void SetApp(csApp *newapp)
void SetClipRect()
void SetClipRect(int xmin, int ymin, int xmax, int ymax)
void SetColor(int Index, int Color)
bool SetDragRect(int xmin, int ymin, int xmax, int ymax)
void SetDragStyle(int iDragStyle)
bool SetFocused(csComponent *comp)
void SetFont(int iFont, bool IncludeChildren = false)
void SetMouse(csMouseCursorID Cursor)
void SetPalette(int iPaletteID)
void SetPalette(int *iPalette, int iPaletteSize)
void SetPos(int x, int y)
void SetSize(int w, int h)
void SetSizingCursor(int dragtype)
virtual void SetSuggestedSize(int dw, int dh)
virtual void SetText(char *iText)
bool SetZorder(csComponent *comp, csComponent *below)
virtual void Show(bool focused = false)
void Sprite2D(csSprite2D *s2d, int x, int y)
void Sprite2D(csSprite2D *s2d, int x, int y, int w, int h)
virtual void SuggestSize(int &w, int &h)
void Text(int x, int y, int fgindx, int bgindx, char *s)
int TextHeight()
int TextWidth(char *text)

Public

Protected Fields

csRect clip
csComponent* clipparent
csRect dirty
static csRect dragBound
int DragStyle
static int dragX
int Font
bool Maximized
csRect OrgBound
bool originalpalette
int* palette
int state
char* text

Protected Methods

void Clip(csObjVector &rect, csComponent *last)
void ClipAlienChildren(csObjVector &rect, csComponent *child)
void DrawUnderline(int iX, int iY, char *iText, int iUnderlinePos, int iColor)
static void PrepareLabel(char *iLabel, char * &oLabel, int &oUnderlinePos)
static int WordLeft(char *iText, int StartPos)
static int WordRight(char *iText, int StartPos)

Inherited from csBase:


Documentation

The Menu class represents two types of menu: vertical (popup) menus and bar menus
int BorderWidth
Menu border width and height

int FrameStyle
Menu frame style

int MenuStyle
Menu style flags

csComponent* first
Remember the first menu item

csComponent* last
Remember the last selected menu item

csComponent* oldparentfocus
Old parent's focused component

bool SubMenuOpened
Are submenus opened?

csComponent* current
Current menu item

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

virtual void Draw()
Draw the menu

virtual bool HandleEvent(csEvent &Event)
Handle input events

virtual bool PreHandleEvent(csEvent &Event)
Pre-handle keyboard events to catch hotkeys

bool CurrentHandleEvent(csEvent &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

csComponent* GetItem(int iCommandCode)
Find the item with given command code (even in submenus)

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

void SetItemWidth(csComponent *start, int count, int width)
Set 'width' for 'count' items from 'start'

virtual bool ExecuteKey(int key)
Move from current item to next selectable item in one of four directions


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de