Repository: psychopy/psychopy

Issue:
Closing a panel should emit an event and update the state of the menu checkbox.



Discussion:

Resolving patch:
diff --git a/psychopy/app/builder/builder.py b/psychopy/app/builder/builder.py
--- a/psychopy/app/builder/builder.py
+++ b/psychopy/app/builder/builder.py
@@ -2093,6 +2093,10 @@ def addComponentButton(self, name, panel):
         shortName = name
         for redundant in ['component', 'Component', "ButtonBox"]:
             shortName = shortName.replace(redundant, "")
+        # Convert from CamelCase to Title Case for button label
+        label = shortName
+        for c in "".join(c if c.isupper() else "" for c in name[1:]):
+            label = label.replace(c, "\n"+c)
         # set size
         size = 48
         # get tooltip
@@ -2103,7 +2107,7 @@ def addComponentButton(self, name, panel):
         btn = iconCache.getComponentButton(
                 parent=self,
                 name=name,
-                label=shortName,
+                label=label,
                 size=size,
                 tip=thisTip,
         )
@@ -2620,12 +2624,8 @@ def clearMode(self, event=None):
         self.draw()
         self.frame.SetStatusText("")
         self.btnInsertRoutine.SetLabel(_translate('Insert Routine'))
-        self.btnInsertRoutine.SetLabelColor(wx.Colour(cs['text']))
-        self.btnInsertRoutine.SetBackgroundColour(wx.Colour(cs['frame_bg']))
         self.btnInsertRoutine.Update()
         self.btnInsertLoop.SetLabel(_translate('Insert Loop'))
-        self.btnInsertLoop.SetLabelColor(wx.Colour(cs['text']))
-        self.btnInsertLoop.SetBackgroundColour(wx.Colour(cs['frame_bg']))
         self.btnInsertRoutine.Update()
 
     def ConvertEventCoords(self, event):
diff --git a/psychopy/app/coder/codeEditorBase.py b/psychopy/app/coder/codeEditorBase.py
--- a/psychopy/app/coder/codeEditorBase.py
+++ b/psychopy/app/coder/codeEditorBase.py
@@ -79,6 +79,10 @@ def __init__(self, parent, ID, pos, size, style):
         self.MarkerDefine(wx.stc.STC_MARKNUM_FOLDERMIDTAIL,
                           wx.stc.STC_MARK_TCORNER, "white", "#808080")
 
+        # Set what kind of events will trigger a modified event
+        self.SetModEventMask(wx.stc.STC_MOD_DELETETEXT |
+                             wx.stc.STC_MOD_INSERTTEXT)
+
         # Bind context menu
         self.Bind(wx.EVT_CONTEXT_MENU, self.OnContextMenu)
 
diff --git a/psychopy/app/coder/coder.py b/psychopy/app/coder/coder.py
--- a/psychopy/app/coder/coder.py
+++ b/psychopy/app/coder/coder.py
@@ -1127,7 +1127,7 @@ def __init__(self, parent, ID, title, files=(), app=None):
         # Add source assistant panel
         self.paneManager.AddPane(self.sourceAsst,
                                  aui.AuiPaneInfo().
-                                 BestSize((600, 600)).
+                                 BestSize((300, 600)).
                                  Floatable(True).
                                  BottomDockable(True).TopDockable(True).
                                  CloseButton(False).PaneBorder(False).
@@ -1146,7 +1146,6 @@ def __init__(self, parent, ID, title, files=(), app=None):
         self.sourceAsst.SetCloseButton(1, False)
 
         # Create editor notebook
-        #todo: Why is editor default background not same as usual frame backgrounds?
         self.notebook = aui.AuiNotebook(self.pnlMain, -1, size=wx.Size(480, 600))
         #self.notebook.SetArtProvider(PsychopyTabArt())
         # Add editor panel
@@ -2488,6 +2487,7 @@ def setOutputWindow(self, event=None, value=None):
         # show/hide the output window (from the view menu control)
         if value is None:
             value = self.outputChk.IsChecked()
+        self.outputChk.Check(value)
         if value:
             # show the pane
             self.prefs['showOutput'] = True
@@ -2651,6 +2651,7 @@ def _applyAppTheme(self, target=None):
         # updating sourceAsst will incl fileBrowser and sourcetree
         ThemeMixin._applyAppTheme(self.sourceAsst)
         ThemeMixin._applyAppTheme(self.notebook)
+        self.notebook.Refresh()
         if hasattr(self, 'shelf'):
             ThemeMixin._applyAppTheme(self.shelf)
         self.Update()


Test patch: