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)

Bases: wx._core.Panel

A radio control which displays a collection of wx.ToggleButton controls, 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 BitmapRadioBox which allows the user to switch between view mode and edit mode:

_images/bitmapradiobox.png

When the user pushes a button, a EVT_BITMAP_RADIO_EVENT is generated.

Create a BitmapRadioBox.

Parameters:
  • parent – A parent window.
  • style – Either wx.HORIZONTAL (the default) or wx.VERTICAL, to control the button layout direction.
__init__(parent, style=None)

Create a BitmapRadioBox.

Parameters:
  • parent – A parent window.
  • style – Either wx.HORIZONTAL (the default) or wx.VERTICAL, to control the button layout direction.
AddChoice(selectedBmp, unselectedBmp=None, clientData=None)

Add a button to this BitmapRadioBox.

Parameters:
  • selectedBmp – A wx.Bitmap to display on the button when it is selected.
  • unselectedBmp – Optional. A wx.Bitmap to display on the button when it is not selected.
  • clientData – Arbitrary data which is associated with the choice.
Clear()

Remove all buttons from this BitmapRadioBox.

EnableChoice(index, enable=True)

Enable or disable the button at the specified index.

DisableChoice(index=None)

Disable the button at the specified index.

Set(bitmaps, clientData=None)

Set all buttons at once.

Parameters:
  • bitmaps – A list of wx.Bitmap objects.
  • clientData – A list of arbitrary data to associate with each choice.
GetSelection()

Returns the index of the curently selected choice.

SetSelection(index)

Sets the current selection.

_BitmapRadioBox__onButton(ev)

Called when a button is pushed. Updates the selection, and emits a BitmapRadioEvent.

__module__ = 'fsleyes_widgets.bitmapradio'
fsleyes_widgets.bitmapradio.EVT_BITMAP_RADIO_EVENT = <wx.core.PyEventBinder object>

Identifier for the BitmapRadioEvent.

fsleyes_widgets.bitmapradio.BitmapRadioEvent

alias of wx.lib.newevent.NewEvent.<locals>._Event