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 3d106e04dd42918969070ddf3648a2634aaa7530..2c58923c8698455ce69346bb24859d651dd3f296 100644 (file)
@@ -31,8 +31,10 @@ import platform
 import shutil
 import time
 
+import wx
 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
@@ -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)
-        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
index 94a7d062f533915b1fc9b7631e1119127e15704a..3d18e644bd3012d975b6e682cae66a1d10f3f1f7 100644 (file)
 """
 
 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
 
 
-class NavBar (wx.ToolBar):
+class NavBar (aui.AuiToolBar):
     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 = {
-            'previous': self.AddLabelTool(
-                id=wx.ID_PREVIEW_PREVIOUS,
+            'previous': self.AddTool(
+                tool_id=wx.ID_PREVIEW_PREVIOUS,
                 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(
-                    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
index c5217835a9aed09e05801217aca37595bfa16732..b507e7108165abf55f4694a8c665dd1711045a10 100644 (file)
@@ -18,7 +18,8 @@
 """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