A radio box item is used to select one of number of mutually exclusive choices.
It is displayed as a vertical column or horizontal row of labelled buttons.
This class supports the following styles:
Handlers bound for the following event types will receive a CommandEvent parameter.
See also
__init__ | Default constructor. |
Create | Creates the radiobox for two-step construction. |
EnableItem | Enables or disables an individual button in the radiobox. |
FindString | Finds a button matching the given string, returning the position if found, or NOT_FOUND if not found. |
GetColumnCount | Returns the number of columns in the radiobox. |
GetCount | Returns the number of items in the control. |
GetItemFromPoint | Returns a radio box item under the point, a zero-based item index, or NOT_FOUND if no item is under the point. |
GetItemHelpText | Returns the helptext associated with the specified item if any or '' . |
GetItemLabel | GetItemLabel(self, n) -> string |
GetItemToolTip | Returns the tooltip associated with the specified item if any or None. |
GetRowCount | Returns the number of rows in the radiobox. |
GetSelection | Returns the index of the selected item or NOT_FOUND if no item is selected. |
GetString | Returns the label of the item with the given index. |
IsItemEnabled | Returns True if the item is enabled or False if it was disabled using Enable . |
IsItemShown | Returns True if the item is currently shown or False if it was hidden using Show . |
SetItemHelpText | Sets the helptext for an item. |
SetItemLabel | SetItemLabel(self, n, text) |
SetItemToolTip | Sets the tooltip text for the specified item in the radio group. |
SetSelection | Sets the selection to the given item n or removes the selection entirely if n == NOT_FOUND . |
SetString | Sets the label for the given item. |
ShowItem | Shows or hides individual buttons. |
ColumnCount | See GetColumnCount |
Count | See GetCount |
RowCount | See GetRowCount |
Selection | See GetSelection and SetSelection |
A radio box item is used to select one of number of mutually exclusive choices.
Possible constructors:
RadioBox()
RadioBox(parent, id=ID_ANY, label='', pos=DefaultPosition,
size=DefaultSize, choices=[], majorDimension=0,
style=RA_SPECIFY_COLS, validator=DefaultValidator, name=RadioBoxNameStr)
Overloaded Implementations:
__init__ (self)
Default constructor.
__init__ (self, parent, id=ID_ANY, label=’‘, pos=DefaultPosition, size=DefaultSize, choices=[], majorDimension=0, style=RA_SPECIFY_COLS, validator=DefaultValidator, name=RadioBoxNameStr)
Constructor, creating and showing a radiobox.
Parameters: |
|
---|
Creates the radiobox for two-step construction.
See RadioBox for further details.
Enables or disables an individual button in the radiobox.
Parameters: |
|
---|---|
Return type: | bool |
See also
Finds a button matching the given string, returning the position if found, or NOT_FOUND if not found.
Parameters: |
|
---|---|
Return type: | int |
Returns the number of columns in the radiobox.
Return type: | int |
---|
Returns the number of items in the control.
Return type: | int |
---|
See also
IsEmpty
Returns a radio box item under the point, a zero-based item index, or NOT_FOUND if no item is under the point.
Parameters: | pt (Point) – Point in client coordinates. |
---|---|
Return type: | int |
Returns the helptext associated with the specified item if any or '' .
Parameters: | item (int) – The zero-based item index. |
---|---|
Return type: | string |
See also
GetItemLabel(self, n) -> string
Return the text of the n’th item in the radio box.
Returns the tooltip associated with the specified item if any or None.
Parameters: | item (int) – |
---|---|
Return type: | ToolTip |
See also
Returns the number of rows in the radiobox.
Return type: | int |
---|
Returns the index of the selected item or NOT_FOUND if no item is selected.
Return type: | int |
---|---|
Returns: | The position of the current selection. |
Note
This method can be used with single selection list boxes only, you should use ListBox.GetSelections for the list boxes with LB_MULTIPLE style.
See also
SetSelection , GetStringSelection
Returns the label of the item with the given index.
Parameters: | n (int) – The zero-based index. |
---|---|
Return type: | string |
Returns: | The label of the item or an empty string if the position was invalid. |
Returns True if the item is enabled or False if it was disabled using Enable .
This function is currently only implemented in wxMSW, wxGTK and wxUniversal and always returns True in the other ports.
Parameters: | n (int) – The zero-based button position. |
---|---|
Return type: | bool |
Returns True if the item is currently shown or False if it was hidden using Show .
Note that this function returns True for an item which hadn’t been hidden even if the entire radiobox is not currently shown.
This function is currently only implemented in wxMSW, wxGTK and wxUniversal and always returns True in the other ports.
Parameters: | n (int) – The zero-based button position. |
---|---|
Return type: | bool |
Sets the helptext for an item.
Empty string erases any existing helptext.
Parameters: |
|
---|
See also
SetItemLabel(self, n, text)
Set the text of the n’th item in the radio box.
Sets the tooltip text for the specified item in the radio group.
This function is currently only implemented in wxMSW and wxGTK2 and does nothing in the other ports.
Parameters: |
|
---|
See also
Sets the selection to the given item n or removes the selection entirely if n == NOT_FOUND .
Note that this does not cause any command events to be emitted nor does it deselect any other items in the controls which support multiple selections.
Parameters: | n (int) – The string position to select, starting from zero. |
---|
See also
SetString , SetStringSelection
Sets the label for the given item.
Parameters: |
|
---|
Shows or hides individual buttons.
Parameters: |
|
---|---|
Return type: | bool |
Returns: | True if the item has been shown or hidden or False if nothing was done because it already was in the requested state. |
See also
See GetColumnCount
See GetRowCount
See GetSelection and SetSelection