MGUI::CTRL_MENUBUTTON Class Reference

#include <mgui/menubtn.h>

Inheritance diagram for MGUI::CTRL_MENUBUTTON:

Inheritance graph
[legend]
List of all members.

Public Types

enum  ITEMSTYLE { ITEMSTYLE_Normal = 0, ITEMSTYLE_Toggle = 0x00000001 }
enum  STYLE { STYLE_Normal = 0, STYLE_NoBorder = 0x00000001, STYLE_HighlightOnEnter = 0x00000002, STYLE_LargeButton = 0x00000004 }

Public Member Functions

ID AddItem (ID id, const UNICODE *label, ITEMSTYLE style=ITEMSTYLE_Normal)
ID AddItem (ID id, const char *label, ITEMSTYLE style=ITEMSTYLE_Normal)
void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, ICONID iconid, const UNICODE *tooltip, STYLE style=STYLE_Normal, int iconsize=0)
void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, ICONID iconid, const char *tooltip, STYLE style=STYLE_Normal, int iconsize=0)
void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, const UNICODE *label, STYLE style=STYLE_Normal, MGUI::LAYOUT_SIZEALIGN sizealign=MGUI::LAYOUT_SIZEALIGN_FixedSize)
void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, const char *label, STYLE style=STYLE_Normal, MGUI::LAYOUT_SIZEALIGN sizealign=MGUI::LAYOUT_SIZEALIGN_FixedSize)
 CTRL_MENUBUTTON ()
CButton & GetCtrl ()
bool GetItemState (ID id) const
CMenu & GetMenu ()
int GetNumItems () const
void RemoveAllItems ()
void RemoveItemByID (ID id)
void RemoveItemByIndex (int indx)
void SetItemEnabled (ID id, bool enabled=true)
void SetItemState (ID id, bool state)
virtual ~CTRL_MENUBUTTON ()

Protected Member Functions

virtual void OnMenuPopup ()
virtual void OnSelection (ID id)=0

Member Enumeration Documentation

enum MGUI::CTRL_MENUBUTTON::ITEMSTYLE
 

Style flags for items.

Currently only one, but may implement radio and submenu styles some day.

Enumeration values:
ITEMSTYLE_Normal 
ITEMSTYLE_Toggle 

Definition at line 67 of file menubtn.h.

enum MGUI::CTRL_MENUBUTTON::STYLE
 

Enumeration values:
STYLE_Normal 
STYLE_NoBorder 
STYLE_HighlightOnEnter 
STYLE_LargeButton 

Definition at line 72 of file menubtn.h.


Constructor & Destructor Documentation

MGUI::CTRL_MENUBUTTON::CTRL_MENUBUTTON  )  [inline]
 

Constructor.

Definition at line 80 of file menubtn.h.

virtual MGUI::CTRL_MENUBUTTON::~CTRL_MENUBUTTON  )  [virtual]
 

Destructor.


Member Function Documentation

ID MGUI::CTRL_MENUBUTTON::AddItem ID  id,
const UNICODE label,
ITEMSTYLE  style = ITEMSTYLE_Normal
 

Add menu item with Unicode label.

The id will be passed to OnSelected() and must be unique within the dialog (for X it only has to be unique within the menu). If you pass -1, an ID will be assigned.

Returns:
ID

ID MGUI::CTRL_MENUBUTTON::AddItem ID  id,
const char *  label,
ITEMSTYLE  style = ITEMSTYLE_Normal
 

Add menu item with label from resource lookup.

The id will be passed to OnSelected() and must be unique within the dialog (for X it only has to be unique within the menu). If you pass -1, an ID will be assigned.

You can create a separator in the menu by creating an item with a label of "-". The ID for a separator is ignored.

Returns:
ID

void MGUI::CTRL_MENUBUTTON::Create MGUI::LAYOUT_PANE_BASE ParentPane,
ICONID  iconid,
const UNICODE tooltip,
STYLE  style = STYLE_Normal,
int  iconsize = 0
 

Create control with icon and ToolTip from resource lookup.

Parameters:
ParentPane  Parent pane
iconid  Icon ID
tooltip  ToolTip string
style  Button style
iconsize  Icon size, 0 for default

void MGUI::CTRL_MENUBUTTON::Create MGUI::LAYOUT_PANE_BASE ParentPane,
ICONID  iconid,
const char *  tooltip,
STYLE  style = STYLE_Normal,
int  iconsize = 0
 

Create control with icon and ToolTip from resource lookup.

Parameters:
ParentPane  Parent pane
iconid  Icon ID
tooltip  ToolTip string for resource lookup
style  Button style
iconsize  Icon size, 0 for default

void MGUI::CTRL_MENUBUTTON::Create MGUI::LAYOUT_PANE_BASE ParentPane,
const UNICODE label,
STYLE  style = STYLE_Normal,
MGUI::LAYOUT_SIZEALIGN  sizealign = MGUI::LAYOUT_SIZEALIGN_FixedSize
 

Create control with Unicode label.

Parameters:
ParentPane  Parent pane
label  Label string
style  Button style

void MGUI::CTRL_MENUBUTTON::Create MGUI::LAYOUT_PANE_BASE ParentPane,
const char *  label,
STYLE  style = STYLE_Normal,
MGUI::LAYOUT_SIZEALIGN  sizealign = MGUI::LAYOUT_SIZEALIGN_FixedSize
 

Create control with label from resource lookup.

Parameters:
ParentPane  Parent pane
label  Label string for resource lookup
style  Button style

CButton& MGUI::CTRL_MENUBUTTON::GetCtrl  )  [inline]
 

Get reference to MFC control (MFC only).

Definition at line 196 of file menubtn.h.

bool MGUI::CTRL_MENUBUTTON::GetItemState ID  id  )  const
 

Get the toggle state of a menu item.

CMenu& MGUI::CTRL_MENUBUTTON::GetMenu  ) 
 

Get reference to CMenu associated with the button (MFC ONLY) This function will be phased out.

int MGUI::CTRL_MENUBUTTON::GetNumItems  )  const
 

Get the number of items on the menu.

virtual void MGUI::CTRL_MENUBUTTON::OnMenuPopup  )  [inline, protected, virtual]
 

Called just before the menu is popped up.

Definition at line 203 of file menubtn.h.

virtual void MGUI::CTRL_MENUBUTTON::OnSelection ID  id  )  [protected, pure virtual]
 

For X, you must override it.

Parameters:
id  The ID of the item selected

void MGUI::CTRL_MENUBUTTON::RemoveAllItems  ) 
 

void MGUI::CTRL_MENUBUTTON::RemoveItemByID ID  id  ) 
 

void MGUI::CTRL_MENUBUTTON::RemoveItemByIndex int  indx  ) 
 

void MGUI::CTRL_MENUBUTTON::SetItemEnabled ID  id,
bool  enabled = true
 

Enable or disable an item.

void MGUI::CTRL_MENUBUTTON::SetItemState ID  id,
bool  state
 

Set the toggle state of a menu item.


The documentation for this class was generated from the following file:
Generated on Tue Dec 14 13:20:46 2004 for TNTsdk by  doxygen 1.3.8-20040913