wCheckComboBox

A checkcombobox is like a read-only combobox but in which the items in the dropdown are preceded by a checkbox.

Appearance:
Superclass:wControl
Styles:
StylesDescription
wCcSortSorts the entries in the list alphabetically.
wCcNeededScrollOnly create a vertical scrollbar if needed.
wCcAlwaysScrollAlways show a vertical scrollbar.
wCcEndEllipsisIf the text value is too long, it is truncated and ellipses are added.
wCcNormalColorUse normal color to draw the control instead of read-only color.
Events:wCommandEvent
wCommandEventDescription
wEvent_CheckComboBoxWhen the value of the checkcombobox changed by user.
wEvent_CheckComboBoxCloseUpWhen the listbox of the checkcombobox disappears.
wEvent_CheckComboBoxDropDownWhen the listbox part of the checkcombobox is shown.
wEvent_CommandSetFocusWhen the control receives the keyboard focus.
wEvent_CommandKillFocusWhen the control loses the keyboard focus.

Consts

wCcSort = 0x00000100
wCcNeededScroll = 0x00200000
wCcAlwaysScroll = 2099200
wCcEndEllipsis = 1
wCcNormalColor = 2

Procs

proc getCount(self: wCheckComboBox): int {...}{.inline, raises: [], tags: [].}
Returns the number of items in the control.
proc len(self: wCheckComboBox): int {...}{.inline, raises: [], tags: [].}
Returns the number of items in the control.
proc getText(self: wCheckComboBox; index: int): string {...}{.inline, raises: [], tags: [].}
Returns the text of the item with the given index.
proc `[]`(self: wCheckComboBox; index: int): string {...}{.inline, raises: [IndexDefect],
    tags: [].}
Returns the text of the item with the given index. Raise error if index out of bounds.
proc insert(self: wCheckComboBox; pos: int; text: string) {...}{.inline, raises: [], tags: [].}
Inserts the given string before the specified position. Notice that the inserted item won't be sorted even the listbox has wCbSort style. If pos is -1, the string is added to the end of the list.
proc insert(self: wCheckComboBox; pos: int; list: openArray[string]) {...}{.inline,
    raises: [], tags: [].}
Inserts multiple strings in the same time.
proc append(self: wCheckComboBox; text: string) {...}{.inline, raises: [], tags: [].}
Appends the given string to the end. If the checkcombobox has the wCbSort style, the string is inserted into the list and the list is sorted.
proc append(self: wCheckComboBox; list: openArray[string]) {...}{.inline, raises: [],
    tags: [].}
Appends multiple strings in the same time.
proc delete(self: wCheckComboBox; index: int) {...}{.inline, raises: [], tags: [].}
Delete a string in the checkcombobox.
proc delete(self: wCheckComboBox; text: string) {...}{.inline, raises: [], tags: [].}
Search and delete the specified string in the checkcombobox.
proc findText(self: wCheckComboBox; text: string): int {...}{.inline, raises: [], tags: [].}
Finds an item whose label matches the given text.
proc isSelected(self: wCheckComboBox; index: int): bool {...}{.inline, raises: [], tags: [].}
Determines whether an item is selected.
proc isDisabled(self: wCheckComboBox; index: int): bool {...}{.inline, raises: [], tags: [].}
Determines whether an item is disabled.
proc select(self: wCheckComboBox; index: int = -1) {...}{.raises: [], tags: [].}
Selects an item, -1 means all items.
proc select(self: wCheckComboBox; text: string) {...}{.raises: [], tags: [].}
Selects an item by given text.
proc selectAll(self: wCheckComboBox) {...}{.inline, raises: [], tags: [].}
Selects all items.
proc deselect(self: wCheckComboBox; index: int = -1) {...}{.raises: [], tags: [].}
Deselects an item, -1 means all items.
proc deselect(self: wCheckComboBox; text: string) {...}{.raises: [], tags: [].}
Deselects an item by given text.
proc deselectAll(self: wCheckComboBox) {...}{.inline, raises: [], tags: [].}
Deselects all items.
proc toggle(self: wCheckComboBox; index: int) {...}{.raises: [], tags: [].}
Toggle an item.
proc toggle(self: wCheckComboBox; text: string) {...}{.raises: [], tags: [].}
Toggle an item by given text.
proc disable(self: wCheckComboBox; index: int) {...}{.raises: [], tags: [].}
Disables an item, -1 means all items.
proc disable(self: wCheckComboBox; text: string) {...}{.raises: [], tags: [].}
Disables an item by given text.
proc disableAll(self: wCheckComboBox) {...}{.inline, raises: [], tags: [].}
Disables all items.
proc enable(self: wCheckComboBox; index: int) {...}{.raises: [], tags: [].}
Enables an item, -1 means all items.
proc enable(self: wCheckComboBox; text: string) {...}{.raises: [], tags: [].}
Enables an item by given text.
proc enableAll(self: wCheckComboBox) {...}{.inline, raises: [], tags: [].}
Enables all items.
proc setText(self: wCheckComboBox; index: int; text: string) {...}{.raises: [], tags: [].}
Changes the text of the specified item.
proc setSeparator(self: wCheckComboBox; sep: string) {...}{.inline, raises: [], tags: [].}
Sets the separator between itmes, default value is ", ".
proc getSeparator(self: wCheckComboBox): string {...}{.inline, raises: [], tags: [].}
Gets the separator between itmes, default value is ", ".
proc setValue(self: wCheckComboBox; text: string) {...}{.raises: [], tags: [].}
Sets the text for the checkcombobox text field. This function will split the input text and then try to select the subitmes, leading or trailing spaces are ignored.
proc getValue(self: wCheckComboBox): string {...}{.inline, raises: [], tags: [].}
Gets the text for the checkcombobox text field.
proc clear(self: wCheckComboBox) {...}{.inline, raises: [], tags: [].}
Remove all items from a checkcombobox.
proc isPopup(self: wCheckComboBox): bool {...}{.inline, raises: [], tags: [].}
Returns whether or not the listbox is popup.
proc popup(self: wCheckComboBox) {...}{.inline, raises: [wNilAccess, wCursorError],
                                tags: [RootEffect].}
Shows the listbox portion of the checkcombobox.
proc dismiss(self: wCheckComboBox) {...}{.inline, raises: [], tags: [].}
Hides the listbox portion of the checkcombobox.
proc getEmpty(self: wCheckComboBox): string {...}{.inline, raises: [], tags: [].}
Gets the displayed text if the value is empty .
proc setEmpty(self: wCheckComboBox; text: string) {...}{.inline, raises: [], tags: [].}
Sets the displayed text if the value is empty.
proc changeStyle(self: wCheckComboBox; style: wStyle) {...}{.inline, raises: [], tags: [].}
Change the style of the contorl. Only wCcEndEllipsis or wCcNormalColor can be changed.
proc getListControl(self: wCheckComboBox): wListBox {...}{.inline, raises: [], tags: [].}
Returns the list control part of this checkcombobox.
proc selections(self: wCheckComboBox): wCheckComboBoxSelection {...}{.inline, raises: [],
    tags: [].}
Returns a help object to iterate over, so that both items and pairs work. For example:
for i in checkCombobox.selections: echo i
for i, text in checkCombobox.selections: echo i, ": ", text
proc init(self: wCheckComboBox; parent: wWindow; id = wDefaultID; pos = wDefaultPoint;
         size = wDefaultSize; choices: openArray[string] = []; style: wStyle = 0) {...}{.raises: [
    wNilAccess, wWindowError, wCursorError, wBrushError, Exception, IndexDefect,
    wFontError, wError, wPenError], tags: [RootEffect].}
Initializes a checkcombobox.
proc CheckComboBox(parent: wWindow; id = wDefaultID; pos = wDefaultPoint;
                  size = wDefaultSize; choices: openArray[string] = [];
                  style: wStyle = 0): wCheckComboBox {...}{.inline, discardable, raises: [
    wNilAccess, wWindowError, wCursorError, wBrushError, Exception, IndexDefect,
    wFontError, wError, wPenError], tags: [RootEffect].}
Constructor.

Methods

method getDefaultSize(self: wCheckComboBox): wSize {...}{.raises: [Exception],
    tags: [RootEffect].}
Returns the default size for the control.
method getBestSize(self: wCheckComboBox): wSize {...}{.inline, raises: [Exception],
    tags: [RootEffect].}
Returns the best acceptable minimal size for the control.
method setFont(self: wCheckComboBox; font: wFont) {...}{.raises: [wNilAccess, Exception,
    IndexDefect, wFontError, wPenError, wBrushError], tags: [RootEffect].}
Sets the font for this text control.
method release(self: wCheckComboBox) {...}{.raises: [], tags: [RootEffect].}
Release all the resources during destroying. Used internally.

Iterators

iterator items(self: wCheckComboBox): string {...}{.inline, raises: [], tags: [].}
Iterate each item in this control.
iterator pairs(self: wCheckComboBox): (int, string) {...}{.inline, raises: [], tags: [].}
Iterates over each item in this control. Yields (index, [index]) pairs.
iterator items(self: wCheckComboBoxSelection): int {...}{.raises: [], tags: [].}
Iterates over each index of the selected items.
iterator pairs(self: wCheckComboBoxSelection): (int, string) {...}{.raises: [IndexDefect],
    tags: [].}
Iterates over each item of the selected items. Yields (index, [index]) pairs.