MGUI::CTRL_PUSHBUTTON Class Reference

PushButton control supporting both text and icon buttons. More...

#include <mgui/ctrl.h>

Inheritance diagram for MGUI::CTRL_PUSHBUTTON:
Inheritance graph
[legend]

List of all members.

Public Types

enum  STYLE {
  STYLE_Default = 0, STYLE_NoFrame = 0x01, STYLE_NoMargin = 0x02, STYLE_SetCursor = 0x04,
  STYLE_WideMargins = 0x08, STYLE_HighlightOnMouseOver = 0x10, STYLE_ShadowOnMouseOver = 0x20, STYLE_TextAtLeft = 0x40
}

Public Member Functions

 CTRL_PUSHBUTTON ()
virtual ~CTRL_PUSHBUTTON ()
void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, ICONID iconid, const MISTRING &tooltip, UINT16 iconsize=0, STYLE style=STYLE_Default, MGUI::LAYOUT_SIZEALIGN sizealign=MGUI::LAYOUT_SIZEALIGN_FixedSize)
void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, const MGUI::ICON &iconNormal, const MGUI::ICON &iconMouseOver, const MISTRING &tooltip, STYLE style=STYLE_Default, MGUI::LAYOUT_SIZEALIGN sizealign=MGUI::LAYOUT_SIZEALIGN_FixedSize)
void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, const MGUI::ICON &icon, const MISTRING &tooltip, STYLE style=STYLE_Default, MGUI::LAYOUT_SIZEALIGN sizealign=MGUI::LAYOUT_SIZEALIGN_FixedSize)
void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, const MISTRING &label, STYLE style=STYLE_Default, MGUI::LAYOUT_SIZEALIGN sizealign=MGUI::LAYOUT_SIZEALIGN_FixedSize)
void SetDelegateOnPressed (DELEGATE_VOID_NOPARMS delegate)
void UpdateIcon (const MGUI::ICON &icon)

Private Member Functions

virtual void OnPressed ()

Detailed Description

PushButton control supporting both text and icon buttons.


Member Enumeration Documentation

Button styles.

Enumerator:
STYLE_Default 
STYLE_NoFrame 

Don't include frame around button, cannot combine with STYLE_Shadow/HighlightOnMouseOver.

STYLE_NoMargin 

Don't include margin, typically only used for icon button.

STYLE_SetCursor 

Set standard cursor, for use when button in sash.

STYLE_WideMargins 

Use wider margins for text buttons, typically used for buttons at bottom of window.

STYLE_HighlightOnMouseOver 

Only show highlight frame on mouseover, cannot combine with STYLE_NoFrame or STYLE_ShadowOnMouseOver.

STYLE_ShadowOnMouseOver 

Only show shadow frame on mouseover, cannot combine with STYLE_NoFrame or STYLE_HighlightOnMouseOver.

STYLE_TextAtLeft 

Place text at left of button, for use when button expanded to fill width of pane.


Constructor & Destructor Documentation

MGUI::CTRL_PUSHBUTTON::CTRL_PUSHBUTTON (  ) 

Constructor.

virtual MGUI::CTRL_PUSHBUTTON::~CTRL_PUSHBUTTON (  )  [virtual]

Destructor.


Member Function Documentation

void MGUI::CTRL_PUSHBUTTON::Create ( MGUI::LAYOUT_PANE_BASE ParentPane,
ICONID  iconid,
const MISTRING tooltip,
UINT16  iconsize = 0,
STYLE  style = STYLE_Default,
MGUI::LAYOUT_SIZEALIGN  sizealign = MGUI::LAYOUT_SIZEALIGN_FixedSize 
)

Create control with ICONID.

Parameters:
ParentPane Parent pane
iconid Icon ID
tooltip ToolTip string
iconsize Icon size, 0 for default
style Button style
void MGUI::CTRL_PUSHBUTTON::Create ( MGUI::LAYOUT_PANE_BASE ParentPane,
const MGUI::ICON iconNormal,
const MGUI::ICON iconMouseOver,
const MISTRING tooltip,
STYLE  style = STYLE_Default,
MGUI::LAYOUT_SIZEALIGN  sizealign = MGUI::LAYOUT_SIZEALIGN_FixedSize 
)

Create control with different icons for "normal" and "mouse-over" states.

Parameters:
ParentPane Parent pane
iconNormal Icon
iconMouseOver Icon when mouse is over and not pressed
tooltip ToolTip string
style Button style
void MGUI::CTRL_PUSHBUTTON::Create ( MGUI::LAYOUT_PANE_BASE ParentPane,
const MGUI::ICON icon,
const MISTRING tooltip,
STYLE  style = STYLE_Default,
MGUI::LAYOUT_SIZEALIGN  sizealign = MGUI::LAYOUT_SIZEALIGN_FixedSize 
)

Create control with icon.

Parameters:
ParentPane Parent pane
icon Icon
tooltip ToolTip string
style Button style
void MGUI::CTRL_PUSHBUTTON::Create ( MGUI::LAYOUT_PANE_BASE ParentPane,
const MISTRING label,
STYLE  style = STYLE_Default,
MGUI::LAYOUT_SIZEALIGN  sizealign = MGUI::LAYOUT_SIZEALIGN_FixedSize 
)

Create control with text label.

Parameters:
ParentPane Parent pane
label Label string
style Button style
virtual void MGUI::CTRL_PUSHBUTTON::OnPressed (  )  [private, virtual]

Called when button is pushed.

Default implementation calls delegate if has been set.

void MGUI::CTRL_PUSHBUTTON::SetDelegateOnPressed ( DELEGATE_VOID_NOPARMS  delegate  )  [inline]

Set delegate to call when button pressed.

void MGUI::CTRL_PUSHBUTTON::UpdateIcon ( const MGUI::ICON icon  ) 

Update icon for button.

Button must have been created with icon and new icon must match size of original.

Parameters:
icon Icon

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

Generated on Sun Oct 7 21:35:36 2012 for TNTsdk 2012 by  doxygen 1.6.1