MGUI::FORM_COMBOBOX Class Reference

Form containing label and Combobox control. More...

#include <mgui/combobox.h>

Inheritance diagram for MGUI::FORM_COMBOBOX:

Inheritance graph
MGUI::FORM_COMBOBOX_T\< _CT \>MGUI::FORM_COMPOSITEMGUI::FORM
[legend]
List of all members.

Public Member Functions

DEPRECATED int AddItem (ID id, const char *string, bool resize=true)
int AddItem (ID id, const MISTRING &string, bool resize=true)
DEPRECATED void AddItems (const MGUI::LISTITEMDEF *items, bool resize=true)
void AddUnitItems (int UnitType, int DftUnitID=0)
DEPRECATED void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, const MISTRING &label, const MGUI::LISTITEMDEF *items, int listheight=7, 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)
DEPRECATED void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, const char *label, const MGUI::LISTITEMDEF *items=0, int listheight=7, 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 Create (MGUI::LAYOUT_PANE_BASE &ParentPane, const MISTRING &label, int listheight=7, 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)
 FORM_COMBOBOX ()
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)
void SetSelectedItemID (ID id)
void SetSorted (bool sorted=true)
virtual ~FORM_COMBOBOX ()

Detailed Description

Form containing label and Combobox control.

Definition at line 366 of file combobox.h.


Constructor & Destructor Documentation

MGUI::FORM_COMBOBOX::FORM_COMBOBOX (  ) 

Default constructor.

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

Destructor.


Member Function Documentation

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

Add single item with string from resource lookup.

If control was created with STYLE_Sorted then the list 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.
Deprecated:
Use TEXTID with MISTRING version instead.
Parameters:
id  ID to attach to item
string  String for resource lookup
resize  Attempt to resize if needed to fit new item string

Definition at line 393 of file combobox.h.

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

Definition at line 381 of file combobox.h.

DEPRECATED void MGUI::FORM_COMBOBOX::AddItems ( const MGUI::LISTITEMDEF items,
bool  resize = true 
) [inline]

Add multiple items.

Parameters:
items  Items to add, terminated by item with NULL string
resize  Attempt to resize if needed to fit largest item string

Definition at line 405 of file combobox.h.

void MGUI::FORM_COMBOBOX::AddUnitItems ( int  UnitType,
int  DftUnitID = 0 
) [inline]

Add items to combobox for unit selection.

Item IDs will be equal to UnitIDs.

Parameters:
UnitType  Unit type
DftUnitID  Default unit ID

Definition at line 414 of file combobox.h.

DEPRECATED void MGUI::FORM_COMBOBOX::Create ( MGUI::LAYOUT_PANE_BASE ParentPane,
const MISTRING label,
const MGUI::LISTITEMDEF items,
int  listheight = 7,
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 Unicode label.

Parameters:
ParentPane  Parent pane
label  Label string
items  Initial item set
listheight  Maximum list height when dropped down in characters
width  Width in 'typical' characters, 0 for default

DEPRECATED void MGUI::FORM_COMBOBOX::Create ( MGUI::LAYOUT_PANE_BASE ParentPane,
const char *  label,
const MGUI::LISTITEMDEF items = 0,
int  listheight = 7,
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 label from resource lookup.

Deprecated:
Use TEXTID with MISTRING version instead.
Parameters:
ParentPane  Parent pane
label  Label string for resource lookup
items  Initial item set, 0 for none
listheight  Maximum list height when dropped down in characters
width  Width in 'typical' characters, 0 for default

void MGUI::FORM_COMBOBOX::Create ( MGUI::LAYOUT_PANE_BASE ParentPane,
const MISTRING label,
int  listheight = 7,
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.

Definition at line 460 of file combobox.h.

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

Delete item from list given index.

Parameters:
index  Zero-based index of item to delete

Definition at line 464 of file combobox.h.

void MGUI::FORM_COMBOBOX::DeleteItemID ( ID  id  )  [inline]

Delete item from list given ID.

Parameters:
id  ID of item to delete

Definition at line 469 of file combobox.h.

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

Get reference to CTRL_COMBOBOX in form.

Definition at line 478 of file combobox.h.

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

Get reference to CTRL_COMBOBOX in form.

Definition at line 474 of file combobox.h.

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

Retrieve number of items in the list.

Definition at line 482 of file combobox.h.

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

Definition at line 487 of file combobox.h.

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

Definition at line 493 of file combobox.h.

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

Definition at line 499 of file combobox.h.

MGUI::CTRL_LABEL& MGUI::FORM_COMBOBOX::GetLabel (  )  [inline]

Get label control if any.

Usually the label control is only retrieved for alignment purposes.

Definition at line 505 of file combobox.h.

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

Get currently selected item.

Returns:
Zero-based index of selected item or -1 if none selected.

Definition at line 510 of file combobox.h.

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.

Definition at line 515 of file combobox.h.

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

Definition at line 521 of file combobox.h.

bool MGUI::FORM_COMBOBOX::IsItemSelected ( int  index  )  const [inline]

Determine if specified item is selected.

Parameters:
index  Zero-based index of item

Definition at line 528 of file combobox.h.

void MGUI::FORM_COMBOBOX::SetDelegateOnSelection ( DELEGATE_VOID_NOPARMS  delegate  )  [inline]

Set delegate to call when user makes a selection.

Definition at line 533 of file combobox.h.

void MGUI::FORM_COMBOBOX::SetSelectedItem ( int  index  )  [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

Definition at line 539 of file combobox.h.

void MGUI::FORM_COMBOBOX::SetSelectedItemID ( ID  id  )  [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

Definition at line 546 of file combobox.h.

void MGUI::FORM_COMBOBOX::SetSorted ( bool  sorted = true  )  [inline]

Set whether items are to be sorted or not.

Definition at line 551 of file combobox.h.


The documentation for this class was generated from the following file:
Generated on Thu Apr 26 04:48:32 2007 for TNTsdk by  doxygen 1.5.2