fsleyes.controls.controlpanel¶
This module provides the ControlPanel, ControlToolBar,
and SettingsPanel classes, base-classes for all FSLeyes controls.
See the fsleyes package documentation for an overview of FSLeyes views
and controls.
The SettingsPanel is a convenience
class for certain FSLeyes control panels (see the :fsleyes
documentation).
-
class
fsleyes.controls.controlpanel.ControlMixin[source]¶ Bases:
objectMixin class for the
ControlPanelandControlToolBar.-
static
title()[source]¶ May be overridden by sub-classes. Returns a title to be used in menus and window title bars.
-
static
ignoreControl()[source]¶ Tell FSLeyes that this control should not be considered a FSLeyes plugin.
The default implementation returns
False, but may be overridden by sub-classes to control whether a menu item should be added for the control in the settings menu for the relevant FSLeyes view(s).Note that this method must be implemented on the class that is to be ignored - inherited implementations from base classes are not considered.
-
static
supportedViews()[source]¶ Return the views that this control supports.
This method may be overridden by sub-classes to return a list of the view types that are supported by this control. For example, the
OrthoToolBarcontrol is intended to be used solely with theOrthoPanelview.The default implementation returns
None, which is interpreted as being compatible with all views.
-
static
supportSubClasses()[source]¶ May be overridden by sub-classes. If this control panel is intended for use with specific views, via the
supportedViews()method, this method specifies whether sub-classes of thesupportedViews()are supported (the default), or whether only the specific classes insupportedViews()are supported.Note that this method must be implemented on the specific control class that wishes to use it - it is not considered if implemented in a base classe.
-
static
defaultLayout()[source]¶ Return default options for
ViewPanel.togglePanel().This method may be overridden by sub-classes to return a
dictcontaining keyword arguments to be used by theViewPanel.togglePanel()method when a control panel of this type is added. WhentogglePanelis called, if any arguments are provided, the arguments returned by this method are not used.
-
static
profileCls()[source]¶ Return the custom interaction profile associated with this control. Must be a sub-class of
Profile.When a control panel is opened, if it requires a different profile to the one that is active, that profile is created and activated. If any other controls required the previous profile, they are closed.
Control panels which are associated with an interaction profile can assume that the profile has already been created by the time the control is created. The
Profileinstance can be retrieved viaViewPanel.currentProfile().
-
__dict__= mappingproxy({'__module__': 'fsleyes.controls.controlpanel', '__doc__': 'Mixin class for the :class:`ControlPanel` and :class:`ControlToolBar`.\n ', 'title': <staticmethod object>, 'ignoreControl': <staticmethod object>, 'supportedViews': <staticmethod object>, 'supportSubClasses': <staticmethod object>, 'defaultLayout': <staticmethod object>, 'profileCls': <staticmethod object>, '__dict__': <attribute '__dict__' of 'ControlMixin' objects>, '__weakref__': <attribute '__weakref__' of 'ControlMixin' objects>, '__annotations__': {}})¶
-
__module__= 'fsleyes.controls.controlpanel'¶
-
__weakref__¶ list of weak references to the object (if defined)
-
static
-
class
fsleyes.controls.controlpanel.ControlPanel(parent, overlayList, displayCtx, viewPanel, *args, **kwargs)[source]¶ Bases:
fsleyes.panel.FSLeyesPanel,fsleyes.controls.controlpanel.ControlMixinThe
ControlPanelis the base class for all FSLeyes controls. All sub-classes must call__init__.-
__init__(parent, overlayList, displayCtx, viewPanel, *args, **kwargs)[source]¶ Create a
ControlPanel.- Parameters
parent – Parent
wxobjectoverlayList – The
OverlayListdisplayCtx – The
DisplayContextassociated withviewPanel.viewPanel – The FSLeyes
ViewPanelthat owns thisControlPanel
All other arguments are passed through to the
FSLeyesPanel.
-
destroy()[source]¶ Must be called when this
ControlPanelis no longer needed. Clears references and calls the base classdestroymethod.
-
property
viewPanel¶ Returns a reference to the
ViewPanelthat owns thisControlPanel.
-
__module__= 'fsleyes.controls.controlpanel'¶
-
-
class
fsleyes.controls.controlpanel.ControlToolBar(parent, overlayList, displayCtx, viewPanel, height=32, orient=<MagicMock name='mock.HORIZONTAL' id='4119918696'>, *args, **kwargs)[source]¶ Bases:
fsleyes.toolbar.FSLeyesToolBar,fsleyes.controls.controlpanel.ControlMixinThe
ControlToolBaris the base class for all FSLeyes toolbars.-
__module__= 'fsleyes.controls.controlpanel'¶
-
-
class
fsleyes.controls.controlpanel.SettingsPanel(*args, **kwargs)[source]¶ Bases:
fsleyes.controls.controlpanel.ControlPanelThe
SettingsPanelis a convenience class for FSLeyes control panels which use afsleyes_widgets.WidgetListto display a collection of controls for the user. When displayed as a dialog/ floating frame, theSettingsPanelwill automatically resize itself to fit its contents. See theCanvasSettingsPanelfor an example.-
__init__(*args, **kwargs)[source]¶ Create a
SettingsPanel. All arguments are passed to theFSLeyesPanel.__init__()method.
-
getWidgetList()[source]¶ Returns the
fsleyes_widgets.WidgetListwhich should be used by sub-classes to display content to the user.
-
__widgetListChange(ev)¶ Called whenever the widget list contents change. If this panel is floating, its parent is autmatically resized.
-
__module__= 'fsleyes.controls.controlpanel'¶
-