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

Default ortho/lightbox panel properties are accessible again (via

show/hide canvas properties button)
parent 9b1335f0
No related branches found
No related tags found
No related merge requests found
...@@ -102,16 +102,12 @@ class ConfigPanel(wx.Panel): ...@@ -102,16 +102,12 @@ class ConfigPanel(wx.Panel):
def __init__(self, parent, target, layout=None): def __init__(self, parent, target, layout=None):
import fsl.fslview.layouts as layouts
wx.Panel.__init__(self, parent) wx.Panel.__init__(self, parent)
self._name = '{}_{}'.format(self.__class__.__name__, id(self)) self._name = '{}_{}'.format(self.__class__.__name__, id(self))
self._target = target self._target = target
self._sizer = wx.BoxSizer(wx.HORIZONTAL) self._sizer = wx.BoxSizer(wx.HORIZONTAL)
if layout is None:
layout = layouts.layouts[target]
self._propPanel = props.buildGUI(self, target, view=layout) self._propPanel = props.buildGUI(self, target, view=layout)
self._sizer.Add(self._propPanel, flag=wx.EXPAND, proportion=1) self._sizer.Add(self._propPanel, flag=wx.EXPAND, proportion=1)
......
#!/usr/bin/env python
#
# profilepanel.py -
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
import logging
log = logging.getLogger(__name__)
import wx
import props
import fsl.fslview.layouts as layouts
import fsl.fslview.strings as strings
class ProfilePanel(wx.Panel):
def __init__(self, parent, profile):
wx.Panel.__init__(self, parent)
self._name = '{}_{}'.format(self.__class__.__name__, id(self))
self._profile = profile
self._actionPanel = wx.Panel(self)
self._actionSizer = wx.BoxSizer(wx.HORIZONTAL)
self._sizer = wx.BoxSizer(wx.VERTICAL)
self._propPanel = props.buildGUI(
self,
profile,
view=layouts.layouts[profile])
actions = profile.getActions()
for (name, func) in actions.items():
btn = wx.Button(self._actionPanel,
label=strings.labels[profile, name])
self._actionSizer.Add(btn, flag=wx.EXPAND)
btn.Bind(wx.EVT_BUTTON, lambda ev, f=func: f.doAction())
btn.Enable(profile.isEnabled(name))
def toggle(val, valid, ctx, n=name, b=btn):
b.Enable(profile.isEnabled(n))
profile.addActionToggleListener(name, self._name, toggle)
self._sizer.Add(self._propPanel, flag=wx.EXPAND)
self._sizer.Add(self._actionPanel, flag=wx.EXPAND)
self._actionPanel.SetSizer(self._actionSizer)
self .SetSizer(self._sizer)
self._actionPanel.Layout()
self .Layout()
...@@ -201,16 +201,23 @@ class CanvasPanel(fslpanel.FSLViewPanel): ...@@ -201,16 +201,23 @@ class CanvasPanel(fslpanel.FSLViewPanel):
displayCtx, displayCtx,
displayCtx.getSyncPropertyName('volume')) displayCtx.getSyncPropertyName('volume'))
import fsl.fslview.layouts as layouts
self.__actionPanel = fslpanel.ConfigPanel(
self, self, layout=layouts.layouts[CanvasPanel, 'actions'])
self.__profilePanel = wx.Panel(self) self.__profilePanel = wx.Panel(self)
self.__canvasContainer = wx.Panel(self) self.__canvasContainer = wx.Panel(self)
self.__listLocContainer = wx.Panel(self) self.__listLocContainer = wx.Panel(self)
self.__dispSetContainer = wx.Panel(self) self.__dispSetContainer = wx.Panel(self)
import fsl.fslview.layouts as layouts
self.__actionPanel = fslpanel.ConfigPanel(
self,
self,
layout=layouts.layouts.get((type(self), 'actions'), None))
self.__canvasPropsPanel = fslpanel.ConfigPanel(
self.__dispSetContainer,
self,
layout=layouts.layouts.get((type(self), 'props'), None))
self.__canvasPanel = wx.Panel(self.__canvasContainer) self.__canvasPanel = wx.Panel(self.__canvasContainer)
self.__imageListPanel = imagelistpanel.ImageListPanel( self.__imageListPanel = imagelistpanel.ImageListPanel(
...@@ -221,8 +228,6 @@ class CanvasPanel(fslpanel.FSLViewPanel): ...@@ -221,8 +228,6 @@ class CanvasPanel(fslpanel.FSLViewPanel):
self.__displayPropsPanel = imagedisplaypanel.ImageDisplayPanel( self.__displayPropsPanel = imagedisplaypanel.ImageDisplayPanel(
self.__dispSetContainer, imageList, displayCtx) self.__dispSetContainer, imageList, displayCtx)
self.__canvasPropsPanel = wx.Panel(self.__dispSetContainer)
self.__listLocSizer = wx.BoxSizer(wx.HORIZONTAL) self.__listLocSizer = wx.BoxSizer(wx.HORIZONTAL)
self.__listLocContainer.SetSizer(self.__listLocSizer) self.__listLocContainer.SetSizer(self.__listLocSizer)
......
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