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.Panel
A
TogglePanel
is awx.Panel
that 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
TogglePanel
may be used in place of thewx.CollapsiblePane
, which is buggy under Linux/GTK.Create a
TogglePanel
.Parameters: - parent – The
wx
parent 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
wx
parent 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
None
for no label.
-
GetLabel
()¶ Returns the current toggle button label
-
GetToggleButton
()¶ - Returns the toggle button (actually a
wx.StaticText
). This - is for testing purposes.
Deprecated in 0.1.1, to be removed in 1.0.0. Use button instead
- Returns the toggle button (actually a
-
Expand
(expand=True)¶ Expand the content pane.
Parameters: expand – True
to expand,False
to collapse.
-
Collapse
()¶ Collapse the content pane.
-
IsExpanded
()¶ Return
True
if the content pane is currently expanded,False
otherwise.
-
Toggle
(ev=None)¶ Toggles visibility of the panel content.
This method is called when the button is pushed. If
ev
is notNone
, anEVT_TOGGLEPANEL_EVENT
is generated.
-
GetPane
()¶ Returns the
wx.Panel
to which all content should be added.
-
_TogglePanel__expand
(expand=True, force=False)¶ Expands or collapses the content panel.
Parameters: - expand –
True
to expand,False
to 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
TogglePanelEvent
event.
-
fsleyes_widgets.togglepanel.
TogglePanelEvent
¶ alias of
wx.lib.newevent.NewEvent.<locals>._Event