diplomat.wx_gui.point_edit.ColoredRadioBox

class diplomat.wx_gui.point_edit.ColoredRadioBox(*args: Any, **kwargs: Any)[source]

Bases: Panel

A 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_colormap()

Get the colormap.

get_labels()

Get the radio button labels.

get_selected()

Get the currently selected entry.

get_shape_list()

Get the shape list.

is_multiselect()

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

ColoredRadioEvent

EVT_COLORED_RADIO

PADDING

ids

_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_colormap() → Colormap[source]

Get the colormap.

Returns:

A matplotlib colormap.

get_labels() → List[str][source]

Get the radio button labels.

Returns:

A list of strings.

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.

set_selected(value: ndarray)[source]

Get the currently selected entry.

Parameters:

value – An integer index, the radio button to select, or None to deselect all the radio buttons.

set_shape_list(value: Iterable[str])[source]

Set the shape list.

Parameters:

value – A list of strings, the shapes of each radio button ‘dot’.