controls/DebugVariablePanel/DebugVariableViewer.py
changeset 1807 5562f34f2fc2
parent 1782 5b6ad7a7fd9d
child 1823 1e9a67d68612
--- a/controls/DebugVariablePanel/DebugVariableViewer.py	Fri Sep 15 18:57:20 2017 +0300
+++ b/controls/DebugVariablePanel/DebugVariableViewer.py	Fri Sep 15 19:01:31 2017 +0300
@@ -41,10 +41,10 @@
  HIGHLIGHT_RESIZE] = range(6)
 
 # Viewer highlight styles
-HIGHLIGHT_DROP_PEN = wx.Pen(wx.Colour(0, 128, 255))
-HIGHLIGHT_DROP_BRUSH = wx.Brush(wx.Colour(0, 128, 255, 128))
-HIGHLIGHT_RESIZE_PEN = wx.Pen(wx.Colour(200, 200, 200))
-HIGHLIGHT_RESIZE_BRUSH = wx.Brush(wx.Colour(200, 200, 200))
+HIGHLIGHT_DROP_PEN = None
+HIGHLIGHT_DROP_BRUSH = None
+HIGHLIGHT_RESIZE_PEN = None
+HIGHLIGHT_RESIZE_BRUSH = None
 
 # -------------------------------------------------------------------------------
 #                        Base Debug Variable Viewer Class
@@ -72,6 +72,7 @@
         self.Highlight = HIGHLIGHT_NONE
         # List of buttons
         self.Buttons = []
+        self.InitHighlightPensBrushes()
 
     def __del__(self):
         """
@@ -80,6 +81,16 @@
         # Remove reference to Debug Variable Panel
         self.ParentWindow = None
 
+    def InitHighlightPensBrushes(self):
+        """
+        Init global pens and brushes
+        """
+        if HIGHLIGHT_DROP_PEN is None:
+            HIGHLIGHT_DROP_PEN = wx.Pen(wx.Colour(0, 128, 255))
+            HIGHLIGHT_DROP_BRUSH = wx.Brush(wx.Colour(0, 128, 255, 128))
+            HIGHLIGHT_RESIZE_PEN = wx.Pen(wx.Colour(200, 200, 200))
+            HIGHLIGHT_RESIZE_BRUSH = wx.Brush(wx.Colour(200, 200, 200))
+
     def GetIndex(self):
         """
         Return position of Viewer in Debug Variable Panel