MGUI::FORM_COMBOBOX Class Reference

Form containing label and Combobox control. More...

#include <mgui/combobox.h>

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

List of all members.

Public Member Functions

 FORM_COMBOBOX ()
virtual ~FORM_COMBOBOX ()
int AddItem (ID id, const MISTRING &string, bool resize=true)
void AddUnitItem (int MeasureType, int UnitID)
void AddUnitItems (int MeasureType, int DftUnitID=0)
void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, const MISTRING &label, int listheight=12, int width=0, MGUI::LAYOUT_SIZEALIGN sizealign=MGUI::LAYOUT_SIZEALIGN_FixedSize, MGUI::CTRL_COMBOBOX::STYLE style=MGUI::CTRL_COMBOBOX::STYLE_Default, MGUI::CTRL_LABEL::STYLE labelstyle=MGUI::CTRL_LABEL::STYLE_LeftNoWrap)
void DeleteAllItems ()
void DeleteItem (int index)
void DeleteItemID (ID id)
const CTRL_COMBOBOXGetComboBox () const
CTRL_COMBOBOXGetComboBox ()
int GetCount () const
int GetIndexFromID (ID id) const
ID GetItemID (int index) const
MISTRING GetItemString (int index) const
MGUI::CTRL_LABELGetLabel ()
int GetSelectedItem () const
ID GetSelectedItemID () const
int InsertItem (int index, ID id, const MISTRING &string)
bool IsItemSelected (int index) const
void SetDelegateOnSelection (DELEGATE_VOID_NOPARMS delegate)
void SetSelectedItem (int index, bool notify=false)
void SetSelectedItemID (ID id, bool notify=false)
void SetSelectedPrevious (bool notify=false)
void SetSorted (bool sorted=true)

Private Member Functions

virtual void v_CreateEnd ()

Detailed Description

Form containing label and Combobox control.


Constructor & Destructor Documentation

MGUI::FORM_COMBOBOX::FORM_COMBOBOX (  ) 

Default constructor.

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

Destructor.


Member Function Documentation

int MGUI::FORM_COMBOBOX::AddItem ( ID  id,
const MISTRING string,
bool  resize = true 
) [inline]

Add single item with MISTRING or TEXTID.

If control was created with STYLE_Sorted then the combo will be resorted after the item is added, otherwise the item will be added to the end of the list.

Returns:
Zero-based index of item added or error < 0.
Parameters:
id ID to attach to item
string String to show in list
resize Attempt to resize if needed to fit new item string
void MGUI::FORM_COMBOBOX::AddUnitItem ( int  MeasureType,
int  UnitID 
) [inline]

Add item to combobox for unit selection.

Item ID will be equal to UnitID.

Parameters:
MeasureType Measurement type
UnitID Unit ID
void MGUI::FORM_COMBOBOX::AddUnitItems ( int  MeasureType,
int  DftUnitID = 0 
) [inline]

Add items to combobox for unit selection.

Item IDs will be equal to UnitIDs.

Parameters:
MeasureType Measurement type
DftUnitID Default unit ID
void MGUI::FORM_COMBOBOX::Create ( MGUI::LAYOUT_PANE_BASE ParentPane,
const MISTRING label,
int  listheight = 12,
int  width = 0,
MGUI::LAYOUT_SIZEALIGN  sizealign = MGUI::LAYOUT_SIZEALIGN_FixedSize,
MGUI::CTRL_COMBOBOX::STYLE  style = MGUI::CTRL_COMBOBOX::STYLE_Default,
MGUI::CTRL_LABEL::STYLE  labelstyle = MGUI::CTRL_LABEL::STYLE_LeftNoWrap 
)

Create form with MISTRING label.

Parameters:
ParentPane Parent pane
label Label string
listheight Maximum list height when dropped down in characters
width Width in 'typical' characters, 0 for default
void MGUI::FORM_COMBOBOX::DeleteAllItems (  )  [inline]

Delete all items from control.

void MGUI::FORM_COMBOBOX::DeleteItem ( int  index  )  [inline]

Delete item from list given index.

Parameters:
index Zero-based index of item to delete
void MGUI::FORM_COMBOBOX::DeleteItemID ( ID  id  )  [inline]

Delete item from list given ID.

Parameters:
id ID of item to delete
const CTRL_COMBOBOX& MGUI::FORM_COMBOBOX::GetComboBox (  )  const [inline]

Get reference to CTRL_COMBOBOX in form.

CTRL_COMBOBOX& MGUI::FORM_COMBOBOX::GetComboBox (  )  [inline]

Get reference to CTRL_COMBOBOX in form.

int MGUI::FORM_COMBOBOX::GetCount (  )  const [inline]

Retrieve number of items in the list.

int MGUI::FORM_COMBOBOX::GetIndexFromID ( ID  id  )  const [inline]

Get index to item from ID.

Returns:
Zero-based index or -1 if no matching item found.
Parameters:
id ID of item to retrieve index of
ID MGUI::FORM_COMBOBOX::GetItemID ( int  index  )  const [inline]

Get ID associated with list item.

Returns:
ID specified when item was added.
Parameters:
index Zero-based index of item
MISTRING MGUI::FORM_COMBOBOX::GetItemString ( int  index  )  const [inline]

Get text string associated with list item.

Returns:
String containing text, will be empty if invalid item.
Parameters:
index Zero-based index of item
MGUI::CTRL_LABEL& MGUI::FORM_COMBOBOX::GetLabel (  )  [inline]

Get label control if any.

Usually the label control is only retrieved for alignment purposes.

int MGUI::FORM_COMBOBOX::GetSelectedItem (  )  const [inline]

Get currently selected item.

Returns:
Zero-based index of selected item or -1 if none selected.
ID MGUI::FORM_COMBOBOX::GetSelectedItemID (  )  const [inline]

Get ID of currently selected item.

Returns:
ID or -1 if item was not found or none selected.
int MGUI::FORM_COMBOBOX::InsertItem ( int  index,
ID  id,
const MISTRING string 
) [inline]

Insert item at specified position.

Unlike the AddItem method this does not cause the list to be resorted.

Returns:
Zero-based index of item added or error < 0.
Parameters:
index Zero-based index of position at which item should be inserted
id ID to attach to item
string String to show in combo
bool MGUI::FORM_COMBOBOX::IsItemSelected ( int  index  )  const [inline]

Determine if specified item is selected.

Parameters:
index Zero-based index of item
void MGUI::FORM_COMBOBOX::SetDelegateOnSelection ( DELEGATE_VOID_NOPARMS  delegate  )  [inline]

Set delegate to call when user makes a selection.

void MGUI::FORM_COMBOBOX::SetSelectedItem ( int  index,
bool  notify = false 
) [inline]

Select item using zero-based index.

If item is not visible the list will be scrolled to make it visible.

Parameters:
index Zero-based index of item, -1 to have no item selected
notify Notify delegate if selection changed
void MGUI::FORM_COMBOBOX::SetSelectedItemID ( ID  id,
bool  notify = false 
) [inline]

Select item using item ID.

If item does not exist then no item will be selected. If item is not visible the list will be scrolled to make it visible.

Parameters:
id ID of item to select
notify Notify delegate if selection changed
void MGUI::FORM_COMBOBOX::SetSelectedPrevious ( bool  notify = false  )  [inline]

Set selected item to item prior to current selection.

Intended to be used in delegate to revert selection on failure.

Parameters:
notify Notify delegate if selection changed
void MGUI::FORM_COMBOBOX::SetSorted ( bool  sorted = true  )  [inline]

Set whether items are to be sorted or not.

virtual void MGUI::FORM_COMBOBOX::v_CreateEnd (  )  [private, virtual]

Used to fill in the items of the combobox for a derived class.


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

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