#include <mgui/combobox.h>
Inheritance diagram for MGUI::CTRL_COMBOBOX:

Public Types | |
| enum | STYLE { STYLE_Default = 0x00, STYLE_Sorted = 0x01 } |
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 MGUI::LISTITEMDEF *items, int listheight=7, int width=0, MGUI::LAYOUT_SIZEALIGN sizealign=MGUI::LAYOUT_SIZEALIGN_FixedSize, STYLE style=STYLE_Default) |
| void | Create (MGUI::LAYOUT_PANE_BASE &ParentPane, int listheight=7, int width=0, MGUI::LAYOUT_SIZEALIGN sizealign=MGUI::LAYOUT_SIZEALIGN_FixedSize, STYLE style=STYLE_Default) |
| CTRL_COMBOBOX () | |
| void | DeleteAllItems () |
| void | DeleteItem (int index) |
| void | DeleteItemID (ID id) |
| int | GetCount () const |
| CComboBox & | GetCtrl () |
| int | GetIndexFromID (ID id) const |
| ID | GetItemID (int index) const |
| MISTRING | GetItemString (int index) const |
| int | GetSelectedItem () const |
| ID | GetSelectedItemID () const |
| void | IniRead (INIHANDLE IniHandle, const char *IniGroup, const char *IniField, bool notify=true) |
| void | IniWrite (INIHANDLE IniHandle, const char *IniGroup, const char *IniField) const |
| int | InsertItem (int index, ID id, const MISTRING &string) |
| bool | IsItemSelected (int index) const |
| void | SetDelegateOnSelection (DELEGATE_VOID_NOPARMS delegate) |
| virtual void | SetEnabled (bool enabled=true) |
| void | SetSelectedItem (int index) |
| void | SetSelectedItemID (ID id) |
| void | SetSorted (bool sorted=true) |
| void | SizeToContentWidth () |
| virtual | ~CTRL_COMBOBOX () |
At present this is implemented as an OptionMenu for X.
Definition at line 94 of file combobox.h.
| MGUI::CTRL_COMBOBOX::CTRL_COMBOBOX | ( | ) |
Constructor.
| virtual MGUI::CTRL_COMBOBOX::~CTRL_COMBOBOX | ( | ) | [virtual] |
Destructor.
| DEPRECATED int MGUI::CTRL_COMBOBOX::AddItem | ( | ID | id, | |
| const char * | string, | |||
| bool | resize = true | |||
| ) |
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.
| id | ID to attach to item |
| string | String for resource lookup |
| resize | Attempt to resize if needed to fit new item string |
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.
| id | ID to attach to item |
| string | String to show in list |
| resize | Attempt to resize if needed to fit new item string |
| DEPRECATED void MGUI::CTRL_COMBOBOX::AddItems | ( | const MGUI::LISTITEMDEF * | items, | |
| bool | resize = true | |||
| ) |
Add multiple items.
| items | Items to add, terminated by item with NULL string |
| resize | Attempt to resize if needed to fit largest item string |
| void MGUI::CTRL_COMBOBOX::AddUnitItems | ( | int | UnitType, | |
| int | DftUnitID = 0 | |||
| ) |
Add items to combobox for unit selection.
Item IDs will be equal to UnitIDs.
| UnitType | Unit type |
| DftUnitID | Default unit ID |
| DEPRECATED void MGUI::CTRL_COMBOBOX::Create | ( | MGUI::LAYOUT_PANE_BASE & | ParentPane, | |
| const MGUI::LISTITEMDEF * | items, | |||
| int | listheight = 7, |
|||
| int | width = 0, |
|||
| MGUI::LAYOUT_SIZEALIGN | sizealign = MGUI::LAYOUT_SIZEALIGN_FixedSize, |
|||
| STYLE | style = STYLE_Default | |||
| ) |
Create control.
| ParentPane | Parent pane |
| items | Initial item set |
| listheight | Maximum list height when dropped down in characters |
| width | Width in 'typical' characters, 0 for default |
| void MGUI::CTRL_COMBOBOX::Create | ( | MGUI::LAYOUT_PANE_BASE & | ParentPane, | |
| int | listheight = 7, |
|||
| int | width = 0, |
|||
| MGUI::LAYOUT_SIZEALIGN | sizealign = MGUI::LAYOUT_SIZEALIGN_FixedSize, |
|||
| STYLE | style = STYLE_Default | |||
| ) |
Create control.
| ParentPane | Parent pane |
| listheight | Maximum list height when dropped down in characters |
| width | Width in 'typical' characters, 0 for default |
| void MGUI::CTRL_COMBOBOX::DeleteAllItems | ( | ) |
Delete all items from control.
| void MGUI::CTRL_COMBOBOX::DeleteItem | ( | int | index | ) |
Delete item from list given index.
| index | Zero-based index of item to delete |
| void MGUI::CTRL_COMBOBOX::DeleteItemID | ( | ID | id | ) |
Delete item from list given ID.
| id | ID of item to delete |
| int MGUI::CTRL_COMBOBOX::GetCount | ( | ) | const |
Retrieve number of items in the list.
| CComboBox& MGUI::CTRL_COMBOBOX::GetCtrl | ( | ) | [inline] |
| int MGUI::CTRL_COMBOBOX::GetIndexFromID | ( | ID | id | ) | const |
Get index to item from ID.
| id | ID of item to retrieve index of |
| ID MGUI::CTRL_COMBOBOX::GetItemID | ( | int | index | ) | const |
Get ID associated with list item.
| index | Zero-based index of item |
| MISTRING MGUI::CTRL_COMBOBOX::GetItemString | ( | int | index | ) | const |
Get text string associated with list item.
| index | Zero-based index of item |
| int MGUI::CTRL_COMBOBOX::GetSelectedItem | ( | ) | const |
Get currently selected item.
| ID MGUI::CTRL_COMBOBOX::GetSelectedItemID | ( | ) | const |
Get ID of currently selected item.
| void MGUI::CTRL_COMBOBOX::IniRead | ( | INIHANDLE | IniHandle, | |
| const char * | IniGroup, | |||
| const char * | IniField, | |||
| bool | notify = true | |||
| ) |
Read setting from INI file.
If Create() has already been performed the control's state will be updated.
| IniHandle | Handle to INI file to read from, 0 for default |
| IniGroup | INI group to read from |
| IniField | INI field to read from |
| notify | Call OnSelection() if control has already been created |
| void MGUI::CTRL_COMBOBOX::IniWrite | ( | INIHANDLE | IniHandle, | |
| const char * | IniGroup, | |||
| const char * | IniField | |||
| ) | const [inline] |
Write currently selected item ID to INI file.
| IniHandle | Handle to INI file to read from, 0 for default |
| IniGroup | INI group to read from |
| IniField | INI field to read from |
Definition at line 237 of file combobox.h.
Insert item at specified position.
Unlike the AddItem method this does not cause the list to be resorted.
| 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::CTRL_COMBOBOX::IsItemSelected | ( | int | index | ) | const |
Determine if specified item is selected.
| index | Zero-based index of item |
| void MGUI::CTRL_COMBOBOX::SetDelegateOnSelection | ( | DELEGATE_VOID_NOPARMS | delegate | ) | [inline] |
| virtual void MGUI::CTRL_COMBOBOX::SetEnabled | ( | bool | enabled = true |
) | [virtual] |
| void MGUI::CTRL_COMBOBOX::SetSelectedItem | ( | int | index | ) |
Select item using zero-based index.
If item is not visible the list will be scrolled to make it visible.
| index | Zero-based index of item, -1 to have no item selected |
| void MGUI::CTRL_COMBOBOX::SetSelectedItemID | ( | ID | id | ) |
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.
| id | ID of item to select |
| void MGUI::CTRL_COMBOBOX::SetSorted | ( | bool | sorted = true |
) |
Set whether items are to be sorted or not.
| void MGUI::CTRL_COMBOBOX::SizeToContentWidth | ( | ) |
Resize control to be able to show widest item.
1.5.2