fsleyes_widgets.togglepanel¶
This module provides the TogglePanel class, which is a panel that
contains a button and some content. Pushing the button toggles the visibility
of the content.
-
class
fsleyes_widgets.togglepanel.TogglePanel(parent, toggleSide=64, initialState=True, label=None)¶ Bases:
wx._core.PanelA
TogglePanelis awx.Panelthat contains a button and some content.Pushing the button toggles the visibility of the content.
All of the content should be added to the panel which is returned by the
GetPane()method.The
TogglePanelmay be used in place of thewx.CollapsiblePane, which is buggy under Linux/GTK.Create a
TogglePanel.Parameters: - parent – The
wxparent object. - toggleSide – Which side to place the toggle button. Must be one
of
wx.TOP,wx.BOTTOM,wx.LEFT, orwx.RIGHT. - initialState – Initial state for the panel content - visible
(
True) or hidden (False). - label – A label to be displayed on the toggle button.
-
__init__(parent, toggleSide=64, initialState=True, label=None)¶ Create a
TogglePanel.Parameters: - parent – The
wxparent object. - toggleSide – Which side to place the toggle button. Must be one
of
wx.TOP,wx.BOTTOM,wx.LEFT, orwx.RIGHT. - initialState – Initial state for the panel content - visible
(
True) or hidden (False). - label – A label to be displayed on the toggle button.
- parent – The
Returns the toggle button (actually a
wx.StaticText). This is for testing purposes.
-
SetLabel(label)¶ Sets the label to show on the toggle button. Pass in
Nonefor no label.
-
GetLabel()¶ Returns the current toggle button label
-
GetToggleButton()¶ Returns the toggle button (actually a
wx.StaticText). This is for testing purposes.
-
Expand(expand=True)¶ Expand the content pane.
Parameters: expand – Trueto expand,Falseto collapse.
-
Collapse()¶ Collapse the content pane.
-
IsExpanded()¶ Return
Trueif the content pane is currently expanded,Falseotherwise.
-
Toggle(ev=None)¶ Toggles visibility of the panel content.
This method is called when the button is pushed. If
evis notNone, anEVT_TOGGLEPANEL_EVENTis generated.
-
GetPane()¶ Returns the
wx.Panelto which all content should be added.
-
_TogglePanel__expand(expand=True, force=False)¶ Expands or collapses the content panel.
Parameters: - expand –
Trueto expand,Falseto collapse. - force – If
True, the panel is re-configured, regardless of whether it is already in the requested expanded/collapsed state.
- expand –
-
_TogglePanel__refresh()¶ Refreshes the layout.
-
__module__= 'fsleyes_widgets.togglepanel'¶
- parent – The
-
fsleyes_widgets.togglepanel.EVT_TOGGLEPANEL_EVENT= <wx.core.PyEventBinder object>¶ Identifier for the
TogglePanelEventevent.
-
fsleyes_widgets.togglepanel.TogglePanelEvent¶ alias of
wx.lib.newevent.NewEvent.<locals>._Event