fsleyes_widgets.bitmapradio
This module provides the BitmapRadioBox class, a radio control
which uses bitmap toggle buttons.
- class fsleyes_widgets.bitmapradio.BitmapRadioBox(parent, style=None)[source]
Bases:
PanelA radio control which displays a collection of
wx.ToggleButtoncontrols, each of which displays an image.Each of these buttons corresponds to a mutually exclusive option - when the user clicks on a button, it is toggled on, and all of the others are toggled off.
For example, here is a
BitmapRadioBoxwhich allows the user to switch between view mode and edit mode:When the user pushes a button, a
EVT_BITMAP_RADIO_EVENTis generated.Create a
BitmapRadioBox.- Parameters:
parent – A parent window.
style – A combination of
BMPRADIO_ALLOW_DESELECTED, and one ofwx.HORIZONTAL(the default) orwx.VERTICAL, to control the button layout direction
- property buttons
Returns a list containing the
BitmapToggleButtoninstances. Used for testing.
- AddChoice(selectedBmp, unselectedBmp=None, clientData=None)[source]
Add a button to this
BitmapRadioBox.- Parameters:
selectedBmp – A
wx.Bitmapto display on the button when it is selected.unselectedBmp – Optional. A
wx.Bitmapto display on the button when it is not selected.clientData – Arbitrary data which is associated with the choice.
- fsleyes_widgets.bitmapradio.BMPRADIO_ALLOW_DESELECTED = 1
Style flag which allows all buttons to be de-selected. If not specified (the default), one button must always be selected.
- fsleyes_widgets.bitmapradio.EVT_BITMAP_RADIO_EVENT = <wx.core.PyEventBinder object>
Identifier for the
BitmapRadioEvent.
- fsleyes_widgets.bitmapradio.BitmapRadioEvent
Event emitted when the user changes the radio selection. Contains the following attributes:
index: The index of the new selection.clientData: Client data associated with the new selection.value:FalseifBMPRADIO_ALLOW_DESELECTEDis active,and the selected button was clicked on (thus deselecting it),
Trueotherwise.