From 52d826ba83665e8afedfd8450a3ebb9f669df09f Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 8 Mar 2012 10:40:54 -0500 Subject: [PATCH] Use Python AUI implementation (instead of C++) in hooke.ui.gui. --- hooke/ui/gui/interface.py | 6 +++--- hooke/ui/gui/navbar.py | 31 +++++++++++++++++++++---------- hooke/ui/gui/panel/notebook.py | 3 ++- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/hooke/ui/gui/interface.py b/hooke/ui/gui/interface.py index 3d106e0..2c58923 100644 --- a/hooke/ui/gui/interface.py +++ b/hooke/ui/gui/interface.py @@ -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 diff --git a/hooke/ui/gui/navbar.py b/hooke/ui/gui/navbar.py index 94a7d06..3d18e64 100644 --- a/hooke/ui/gui/navbar.py +++ b/hooke/ui/gui/navbar.py @@ -19,27 +19,38 @@ """ 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 diff --git a/hooke/ui/gui/panel/notebook.py b/hooke/ui/gui/panel/notebook.py index c521783..b507e71 100644 --- a/hooke/ui/gui/panel/notebook.py +++ b/hooke/ui/gui/panel/notebook.py @@ -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 -- 2.26.2