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

Python shell panel. Added for debugging, but super cool!

parent 1c636225
No related branches found
No related tags found
No related merge requests found
......@@ -146,6 +146,7 @@ titles = TypeDict({
'HistogramControlPanel' : 'Histogram control',
'ClusterPanel' : 'Cluster browser',
'OverlayInfoPanel' : 'Overlay information',
'ShellPanel' : 'Python shell',
'LookupTablePanel.loadLut' : 'Select a lookup table file',
'LookupTablePanel.labelExists' : 'Label already exists',
......@@ -172,6 +173,7 @@ actions = TypeDict({
'CanvasPanel.toggleLookupTablePanel' : 'Lookup tables',
'CanvasPanel.toggleClusterPanel' : 'Cluster browser',
'CanvasPanel.toggleOverlayInfo' : 'Overlay information',
'CanvasPanel.toggleShell' : 'Python shell',
'OrthoPanel.toggleOrthoToolBar' : 'View properties',
'OrthoPanel.toggleProfileToolBar' : 'Edit toolbar',
......
......@@ -17,6 +17,7 @@ from histogramcontrolpanel import HistogramControlPanel
from clusterpanel import ClusterPanel
from canvassettingspanel import CanvasSettingsPanel
from overlayinfopanel import OverlayInfoPanel
from shellpanel import ShellPanel
from orthotoolbar import OrthoToolBar
from orthoprofiletoolbar import OrthoProfileToolBar
......
#!/usr/bin/env python
#
# shellpanel.py -
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
import wx
import wx.py.shell as wxshell
import fsl.fslview.panel as fslpanel
class ShellPanel(fslpanel.FSLViewPanel):
def __init__(self, parent, overlayList, displayCtx, sceneOpts):
fslpanel.FSLViewPanel.__init__(self, parent, overlayList, displayCtx)
lcls = {
'displayCtx' : displayCtx,
'overlayList' : overlayList,
'sceneOpts' : sceneOpts,
}
shell = wxshell.Shell(
self,
introText='\nFSLEyes python shell\n'
'Available variables are:\n'
' - overlayList\n'
' - displayCtx\n'
' - sceneOpts\n\n',
locals=lcls)
font = shell.GetFont()
shell.SetFont(font.Larger())
sizer = wx.BoxSizer(wx.HORIZONTAL)
self.SetSizer(sizer)
sizer.Add(shell, flag=wx.EXPAND, proportion=1)
def destroy(self):
fslpanel.FSLViewPanel.destroy(self)
......@@ -85,7 +85,11 @@ class CanvasPanel(viewpanel.ViewPanel):
location=wx.TOP)),
('toggleLookupTablePanel', lambda *a: self.togglePanel(
fslcontrols.LookupTablePanel,
location=wx.TOP))]
location=wx.TOP)),
('toggleShell', lambda *a: self.togglePanel(
fslcontrols.ShellPanel,
self.getSceneOptions(),
location=wx.BOTTOM))]
actionz = collections.OrderedDict(actionz + extraActions.items())
viewpanel.ViewPanel.__init__(
......
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