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

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

Protected Member Functions

virtual void OnSelection ()

Detailed Description

Form containing label and Combobox control.

Definition at line 334 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

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.
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 369 of file combobox.h.

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

Add single item with UNICODE* string.

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 359 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 349 of file combobox.h.

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 376 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 383 of file combobox.h.

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

Parameters:
ParentPane  Parent pane
label  Label string
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 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.

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::DeleteAllItems  )  [inline]
 

Delete all items from control.

Definition at line 413 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 417 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 422 of file combobox.h.

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

Get reference to CTRL_COMBOBOX in form.

Definition at line 431 of file combobox.h.

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

Get reference to CTRL_COMBOBOX in form.

Definition at line 427 of file combobox.h.

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

Retrieve number of items in the list.

Definition at line 435 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 440 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 446 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 452 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 458 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 463 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 468 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 474 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 481 of file combobox.h.

virtual void MGUI::FORM_COMBOBOX::OnSelection  )  [protected, virtual]
 

Called when user makes selection.

Derived class must call corresponding base class method BEFORE performing its own processing.

virtual void MGUI::FORM_COMBOBOX::SetEnabled bool  enabled = true  )  [virtual]
 

Set whether control is enabled.

Reimplemented from MGUI::FORM_COMPOSITE.

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 494 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 501 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 506 of file combobox.h.


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