Use Python AUI implementation (instead of C++) in hooke.ui.gui.
authorW. Trevor King <wking@drexel.edu>
Thu, 8 Mar 2012 15:40:54 +0000 (10:40 -0500)
committerW. Trevor King <wking@drexel.edu>
Thu, 8 Mar 2012 15:52:18 +0000 (10:52 -0500)
hooke/ui/gui/interface.py
hooke/ui/gui/navbar.py
hooke/ui/gui/panel/notebook.py

index 3d106e0..2c58923 100644 (file)
@@ -31,8 +31,10 @@ import platform
 import shutil
 import time
 
 import shutil
 import time
 
+import wx
 import wx.html
 import wx.html
-import wx.aui as aui
+#import wx.aui as aui         # C++ implementation
+import wx.lib.agw.aui as aui  # Python implementation
 import wx.lib.evtmgr as evtmgr
 # wxPropertyGrid is included in wxPython >= 2.9.1, see
 #   http://wxpropgrid.sourceforge.net/cgi-bin/index?page=download
 import wx.lib.evtmgr as evtmgr
 # wxPropertyGrid is included in wxPython >= 2.9.1, see
 #   http://wxpropgrid.sourceforge.net/cgi-bin/index?page=download
@@ -75,8 +77,6 @@ class HookeFrame (wx.Frame):
         # set the gradient and drag styles
         self._c['manager'].GetArtProvider().SetMetric(
             aui.AUI_DOCKART_GRADIENT_TYPE, aui.AUI_GRADIENT_NONE)
         # set the gradient and drag styles
         self._c['manager'].GetArtProvider().SetMetric(
             aui.AUI_DOCKART_GRADIENT_TYPE, aui.AUI_GRADIENT_NONE)
-        self._c['manager'].SetFlags(
-            self._c['manager'].GetFlags() ^ aui.AUI_MGR_TRANSPARENT_DRAG)
 
         # Min size for the frame itself isn't completely done.  See
         # the end of FrameManager::Update() for the test code. For
 
         # Min size for the frame itself isn't completely done.  See
         # the end of FrameManager::Update() for the test code. For
index 94a7d06..3d18e64 100644 (file)
 """
 
 import wx
 """
 
 import wx
+#import wx.aui as aui         # C++ implementation
+import wx.lib.agw.aui as aui  # Python implementation
 
 from ...util.callback import callback, in_callback
 
 
 
 from ...util.callback import callback, in_callback
 
 
-class NavBar (wx.ToolBar):
+class NavBar (aui.AuiToolBar):
     def __init__(self, callbacks, *args, **kwargs):
         super(NavBar, self).__init__(*args, **kwargs)
     def __init__(self, callbacks, *args, **kwargs):
         super(NavBar, self).__init__(*args, **kwargs)
-        self.SetToolBitmapSize(wx.Size(16,16))
+        bitmap_size = wx.Size(16,16)
+        self.SetToolBitmapSize(bitmap_size)
         self._c = {
         self._c = {
-            'previous': self.AddLabelTool(
-                id=wx.ID_PREVIEW_PREVIOUS,
+            'previous': self.AddTool(
+                tool_id=wx.ID_PREVIEW_PREVIOUS,
                 label='Previous',
                 bitmap=wx.ArtProvider_GetBitmap(
                 label='Previous',
                 bitmap=wx.ArtProvider_GetBitmap(
-                    wx.ART_GO_BACK, wx.ART_OTHER, wx.Size(16, 16)),
-                shortHelp='Previous curve'),
-            'next': self.AddLabelTool(
-                id=wx.ID_PREVIEW_NEXT,
+                    wx.ART_GO_BACK, wx.ART_OTHER, bitmap_size),
+                disabled_bitmap=wx.NullBitmap,
+                kind=wx.ITEM_NORMAL,
+                short_help_string='Previous curve',
+                long_help_string='',
+                client_data=None),
+            'next': self.AddTool(
+                tool_id=wx.ID_PREVIEW_NEXT,
                 label='Next',
                 bitmap=wx.ArtProvider_GetBitmap(
                 label='Next',
                 bitmap=wx.ArtProvider_GetBitmap(
-                    wx.ART_GO_FORWARD, wx.ART_OTHER, wx.Size(16, 16)),
-                shortHelp='Next curve'),
+                    wx.ART_GO_FORWARD, wx.ART_OTHER, bitmap_size),
+                disabled_bitmap=wx.NullBitmap,
+                kind=wx.ITEM_NORMAL,
+                short_help_string='Next curve',
+                long_help_string='',
+                client_data=None),
             }
         self.Realize()
         self._callbacks = callbacks
             }
         self.Realize()
         self._callbacks = callbacks
index c521783..b507e71 100644 (file)
@@ -18,7 +18,8 @@
 """Notebook panel for Hooke.
 """
 
 """Notebook panel for Hooke.
 """
 
-import wx.aui as aui
+#import wx.aui as aui         # C++ implementation
+import wx.lib.agw.aui as aui  # Python implementation
 
 from . import Panel
 from .welcome import WelcomeWindow
 
 from . import Panel
 from .welcome import WelcomeWindow