diplomat.wx_gui.point_edit.ColoredRadioBox¶
- class diplomat.wx_gui.point_edit.ColoredRadioBox(*args: Any, **kwargs: Any)[source]¶
Bases:
PanelA colored radio box. Contains a list of ColoredRadioButtons, and implements selection such that only one radio button can be selected at a time.
- __init__(parent, colormap: str | list | Colormap, shape_list: Iterable[str], labels: List[str], group_ids: List[int] | None, group_prefix: str = 'Individual ', w_id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, name='ColoredRadioBox')[source]¶
Create a ColoredRadioBox.
- Parameters:
parent – The parent wx.Window.
colormap – A matplotlib colormap or string referencing a matplotlib colormap, used to assign each radio a color.
shape_list – A iterable or generator of strings, being the shapes to use to draw each point.
labels – A list of strings, being the labels for all the radio buttons.
group_ids – A optional list of integers, the group or individual each part belongs to.
group_prefix – A string, prefix used when listing groups.
w_id – The wx ID.
pos – The position of the widget.
size – The size of the widget.
style – The style of the widget.
name – The name of the widget.
Methods
__init__(parent, colormap, shape_list, ...)Create a ColoredRadioBox.
Get the colormap.
Get the radio button labels.
Get the currently selected entry.
Get the shape list.
Get if this selection box currently support selecting multiple elements at once.
set_colormap(value)Set the colormap.
set_labels(value)Set the radio button labels.
set_multiselect(value)Enable/Disable multi-selection mode.
set_selected(value)Get the currently selected entry.
set_shape_list(value)Set the shape list.
Attributes
ColoredRadioEventEVT_COLORED_RADIOPADDINGids- _correct_sidebar_size(forward_now=True)[source]¶
PRIVATE: Fixes the size of the radio box to account for the scrollbar…
- _enforce_single_select(event: None, post: bool = True)[source]¶
PRIVATE: Enforces single select, only allowing for one radio button to be selected at a time.
- get_selected() ndarray[source]¶
Get the currently selected entry.
- Returns:
An integer index, the index of the selected radio button, or None if no radio button is selected.
- get_shape_list() Iterable[str][source]¶
Get the shape list.
- Returns:
A list of strings, the shapes of each radio button ‘dot’.
- is_multiselect() bool[source]¶
Get if this selection box currently support selecting multiple elements at once.
- Returns:
A boolean, True if multi-selection is enabled.
- set_colormap(value: str | list | Colormap)[source]¶
Set the colormap.
- Parameters:
value – A matplotlib colormap, or string which refers to a valid matplotlib colormap.
- set_labels(value: List[str])[source]¶
Set the radio button labels.
- Parameters:
value – A list of strings.
- set_multiselect(value: bool)[source]¶
Enable/Disable multi-selection mode.
- Parameters:
value – True to enable multiple selections at once, otherwise set to False.