Form to show list of items with checkbox in front of each. More...
#include <mgui/formchecklist.h>

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 BITSET & | GetSelectedSet () 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 () |
Form to show list of items with checkbox in front of each.
| MGUI::FORM_CHECKLIST::FORM_CHECKLIST | ( | ) |
Constructor.
| virtual MGUI::FORM_CHECKLIST::~FORM_CHECKLIST | ( | ) | [virtual] |
Destructor.
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.
| 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.
| 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.
| 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.
| index | Zero-based index of item to delete |
| void MGUI::FORM_CHECKLIST::DeleteItemID | ( | ID | id | ) |
Delete item from list given ID.
| id | ID of item to delete |
| UINT16 MGUI::FORM_CHECKLIST::GetCount | ( | ) | const |
Retrieve number of items in the list.
Get index to item from ID.
| id | ID of item to retrieve index of |
Get ID associated with list item.
| index | Zero-based index of item |
Get text string associated with list item.
| index | Zero-based index of item |
| UINT16 MGUI::FORM_CHECKLIST::GetSelectedCount | ( | ) | const |
Get number of selected items.
| 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.
| 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.
| index | Zero-based index of item |
| bool MGUI::FORM_CHECKLIST::IsItemSelectedID | ( | ID | id | ) | const |
Determine if specified item is selected.
| 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.
| 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.
| 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.
1.6.1