Skip to content
Snippets Groups Projects
Commit fcfdf36f authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Documentation/comments/refactoring for LocationPanel, OrthoToolBar and

LightBoxToolBar.
parent 9e069993
No related branches found
No related tags found
No related merge requests found
doc/images/lightboxtoolbar.png

30.5 KiB

doc/images/locationpanel.png

49.4 KiB

doc/images/orthotoolbar.png

29.1 KiB

#!/usr/bin/env python
#
# lightboxtoolbar.py -
# lightboxtoolbar.py - The LightBoxToolBar class.
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""This module provides the :class:`LightBoxToolBar` class, which is a
:class:`.FSLEyesToolBar` for use with the :class:`.LightBoxPanel`.
"""
import wx
......@@ -18,8 +21,30 @@ import fsl.data.strings as strings
class LightBoxToolBar(fsltoolbar.FSLEyesToolBar):
"""The ``LightBoxToolBar`` is a :class:`.FSLEyesToolBar` for use with the
:class:`.LightBoxPanel`. A ``LightBoxToolBar`` looks something like this:
.. image:: images/lightboxtoolbar.png
:scale: 50%
:align: center
The ``LightBoxToolBar`` allows the user to control important parts of the
:class:`.LightBoxPanel` display, and also to display a
:class:`.CanvasSettingsPanel`, which allows control over all aspects of a
``LightBoxPanel``.
"""
def __init__(self, parent, overlayList, displayCtx, lb):
"""Create a ``LightBoxToolBar``.
:arg parent: The :mod:`wx` parent object.
:arg overlayList: The :class:`.OverlayList` instance.
:arg displayCtx: The :class:`.DisplayContext` instance.
:arg lb: The :class:`.LightBoxPanel` instance.
"""
actionz = {'more' : self.showMoreSettings}
......@@ -123,6 +148,12 @@ class LightBoxToolBar(fsltoolbar.FSLEyesToolBar):
def showMoreSettings(self, *a):
"""Opens a :class:`.CanvasSettingsPanel` for the
:class:`.LightBoxPanel` that owns this ``LightBoxToolBar``.
The ``CanvasSettingsPanel`` is opened as a floating pane - see the
:meth:`.ViewPanel.togglePanel` method.
"""
import canvassettingspanel
self.lightBoxPanel.togglePanel(
canvassettingspanel.CanvasSettingsPanel,
......
This diff is collapsed.
#!/usr/bin/env python
#
# orthotoolbar.py -
# orthotoolbar.py - The OrthoToolBar class.
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""This module provides the :class:`OrthoToolBar` class, which is a
:class:`.FSLEyesToolBar` for use with the :class:`.OrthoPanel`.
"""
import props
......@@ -16,9 +19,40 @@ import fsl.data.strings as strings
class OrthoToolBar(fsltoolbar.FSLEyesToolBar):
"""The ``OrthoToolBar`` is a :class:`.FSLEyesToolBar` for use with the
:class:`.OrthoPanel`. An ``OrthoToolBar`` looks something like this:
.. image:: images/orthotoolbar.png
:scale: 50%
:align: center
The ``OrthoToolBar`` allows the user to control important parts of the
:class:`.OrthoPanel` display, and also to display a
:class:`.CanvasSettingsPanel`, which allows control over all aspects of
an ``OrthoPanel``.
The ``OrthoToolBar`` contains controls which modify properties, or run
actions, defined on the following classes:
.. autosummary::
:nosignatures:
~fsl.fsleyes.views.orthopanel.OrthoPanel
~fsl.fsleyes.displaycontext.orthoopts.OrthoOpts
~fsl.fsleyes.profiles.orthoviewprofile.OrthoViewProfile
"""
def __init__(self, parent, overlayList, displayCtx, ortho):
"""Create an ``OrthoToolBar``.
:arg parent: The :mod:`wx` parent object.
:arg overlayList: The :class:`.OverlayList` instance.
:arg displayCtx: The :class:`.DisplayContext` instance.
:arg ortho: The :class:`.OrthoPanel` instance.
"""
actionz = {'more' : self.showMoreSettings}
......@@ -39,6 +73,11 @@ class OrthoToolBar(fsltoolbar.FSLEyesToolBar):
def __makeTools(self, *a):
"""Called by :meth:`__init__`, and whenever the
:attr:`.ViewPanel.profile` property changes.
Re-creates all tools shown on this ``OrthoToolBar``.
"""
ortho = self.orthoPanel
orthoOpts = ortho.getSceneOptions()
......@@ -139,6 +178,13 @@ class OrthoToolBar(fsltoolbar.FSLEyesToolBar):
def showMoreSettings(self, *a):
"""Opens a :class:`.CanvasSettingsPanel` for the
:class:`.OrthoPanel` that owns this ``OrthoToolBar``.
The ``CanvasSettingsPanel`` is opened as a floating pane - see the
:meth:`.ViewPanel.togglePanel` method.
"""
import canvassettingspanel
self.orthoPanel.togglePanel(canvassettingspanel.CanvasSettingsPanel,
self.orthoPanel,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment