MGUI::FORM_CHECKLIST Class Reference

Form to show list of items with checkbox in front of each. More...

#include <mgui/formchecklist.h>

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

List of all members.

Public Types

enum  STYLES {
  STYLE_Default = 0x00, STYLE_FirstIsExclusive = 0x01, STYLE_AtLeastOne = 0x02, STYLE_OnlyOne = 0x04,
  STYLE_ShowScrollbar = 0x08, STYLE_ShowFrame = 0x10
}

Public Member Functions

 FORM_CHECKLIST ()
virtual ~FORM_CHECKLIST ()
UINT16 AddItem (ID id, const MISTRING &label, bool selected=false)
void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, const MISTRING &ColumnLabel, int rows, int columns=1, STYLES Style=STYLE_Default, MGUI::LAYOUT_SIZEALIGN SizeAlign=MGUI::LAYOUT_SIZEALIGN_Expand)
void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, int rows, int columns=1, STYLES Style=STYLE_Default, MGUI::LAYOUT_SIZEALIGN SizeAlign=MGUI::LAYOUT_SIZEALIGN_Expand)
void DeleteAllItems ()
void DeleteItem (UINT16 index)
void DeleteItemID (ID id)
UINT16 GetCount () const
UINT16 GetIndexFromID (ID id) const
ID GetItemID (UINT16 index) const
MISTRING GetItemString (UINT16 index) const
UINT16 GetSelectedCount () const
const BITSETGetSelectedSet () const
UINT16 InsertItem (UINT16 index, ID id, const MISTRING &string, bool selected=false)
bool IsItemSelected (UINT16 index) const
bool IsItemSelectedID (ID id) const
void SetAllSelected (bool selected, bool notify=true)
void SetDelegateOnChangeSelection (DELEGATE_VOID_NOPARMS delegate)
virtual void SetEnabled (bool enabled)
bool SetItemSelected (UINT16 index, bool selected, bool notify=true)
bool SetItemSelectedID (ID id, bool selected, bool notify=true)
virtual void SetVisible (bool visible)
void SizeToContentWidth ()

Detailed Description

Form to show list of items with checkbox in front of each.


Member Enumeration Documentation

Enumerator:
STYLE_Default 

Default style, no selection rules.

STYLE_FirstIsExclusive 

First item is exclusive of others, toggling it on will toggle others off automatically.

STYLE_AtLeastOne 

Must have at least one item selected.

STYLE_OnlyOne 

There can be only one selected.

STYLE_ShowScrollbar 

Show vertical scrollbar.

STYLE_ShowFrame 

Show frame around list.


Constructor & Destructor Documentation

MGUI::FORM_CHECKLIST::FORM_CHECKLIST (  ) 

Constructor.

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

Destructor.


Member Function Documentation

UINT16 MGUI::FORM_CHECKLIST::AddItem ( ID  id,
const MISTRING label,
bool  selected = false 
)

Add single item to end of list.

For best results, add items before calling Create() to allow automatic sizing. No selection validation is done for items added after Create(), programmer is responsible for setting to conform to control STYLE.

Returns:
Zero-based index of item added.
Parameters:
id ID to attach to item
label String to show in list
selected Set item as 'selected'
void MGUI::FORM_CHECKLIST::Create ( MGUI::LAYOUT_PANE_BASE ParentPane,
const MISTRING ColumnLabel,
int  rows,
int  columns = 1,
STYLES  Style = STYLE_Default,
MGUI::LAYOUT_SIZEALIGN  SizeAlign = MGUI::LAYOUT_SIZEALIGN_Expand 
)

Create with column heading.

Parameters:
ParentPane Parent pane
ColumnLabel Label for the string column
rows Height in rows
columns Number of list columns
void MGUI::FORM_CHECKLIST::Create ( MGUI::LAYOUT_PANE_BASE ParentPane,
int  rows,
int  columns = 1,
STYLES  Style = STYLE_Default,
MGUI::LAYOUT_SIZEALIGN  SizeAlign = MGUI::LAYOUT_SIZEALIGN_Expand 
)

Create form.

Parameters:
ParentPane Parent pane
rows Height in rows
columns Number of list columns
void MGUI::FORM_CHECKLIST::DeleteAllItems (  ) 

Delete all items from control.

void MGUI::FORM_CHECKLIST::DeleteItem ( UINT16  index  ) 

Delete item from list given index.

Parameters:
index Zero-based index of item to delete
void MGUI::FORM_CHECKLIST::DeleteItemID ( ID  id  ) 

Delete item from list given ID.

Parameters:
id ID of item to delete
UINT16 MGUI::FORM_CHECKLIST::GetCount (  )  const

Retrieve number of items in the list.

UINT16 MGUI::FORM_CHECKLIST::GetIndexFromID ( ID  id  )  const

Get index to item from ID.

Returns:
Zero-based index or UINT16_MAX if no matching item found.
Parameters:
id ID of item to retrieve index of
ID MGUI::FORM_CHECKLIST::GetItemID ( UINT16  index  )  const

Get ID associated with list item.

Returns:
ID specified when item was added.
Parameters:
index Zero-based index of item
MISTRING MGUI::FORM_CHECKLIST::GetItemString ( UINT16  index  )  const

Get text string associated with list item.

Returns:
String containing text, will be empty if invalid item.
Parameters:
index Zero-based index of item
UINT16 MGUI::FORM_CHECKLIST::GetSelectedCount (  )  const

Get number of selected items.

Returns:
Number of selected items or 0 if none selected.
const BITSET& MGUI::FORM_CHECKLIST::GetSelectedSet (  )  const

Retrieve set of selected items.

UINT16 MGUI::FORM_CHECKLIST::InsertItem ( UINT16  index,
ID  id,
const MISTRING string,
bool  selected = false 
)

Insert item at specified position.

For best results, add items before calling Create() to allow automatic sizing. No selection validation is done for items added after Create(), programmer is responsible for setting to conform to control STYLE.

Returns:
Zero-based index of item added
Parameters:
index Zero-based index of position at which item should be inserted
id ID to attach to item
string String to show in list
selected Set item as 'selected'
bool MGUI::FORM_CHECKLIST::IsItemSelected ( UINT16  index  )  const

Determine if specified item is selected.

Parameters:
index Zero-based index of item
bool MGUI::FORM_CHECKLIST::IsItemSelectedID ( ID  id  )  const

Determine if specified item is selected.

Parameters:
id ID of item to retrieve index of
void MGUI::FORM_CHECKLIST::SetAllSelected ( bool  selected,
bool  notify = true 
)

Set all items as selected or not.

void MGUI::FORM_CHECKLIST::SetDelegateOnChangeSelection ( DELEGATE_VOID_NOPARMS  delegate  ) 

Set delegate to call when user makes a selection.

virtual void MGUI::FORM_CHECKLIST::SetEnabled ( bool  enabled  )  [virtual]

Set whether form is enabled.

Reimplemented from MGUI::FORM_COMPOSITE.

bool MGUI::FORM_CHECKLIST::SetItemSelected ( UINT16  index,
bool  selected,
bool  notify = true 
)

Select whether item is selected using index.

Returns:
'True' if state was changed, 'false' if not.
Parameters:
index Zero-based index of item
bool MGUI::FORM_CHECKLIST::SetItemSelectedID ( ID  id,
bool  selected,
bool  notify = true 
)

Select whether item is selected using ID.

Returns:
'True' if state was changed, 'false' if not.
Parameters:
id ID of item to select
virtual void MGUI::FORM_CHECKLIST::SetVisible ( bool  visible  )  [virtual]

Set whether form is visible.

Reimplemented from MGUI::FORM_COMPOSITE.

void MGUI::FORM_CHECKLIST::SizeToContentWidth (  ) 

Resize control to be able to show widest item.


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

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