Author: btami Date: 2008-03-03 07:29:50 -0600 (Mon, 03 Mar 2008) New Revision: 9854
Modified: trunk/gnue-designer/src/app/designer.py trunk/gnue-designer/src/base/tools/PropertyEditor.py trunk/gnue-designer/src/base/tools/TreeView.py trunk/gnue-designer/src/forms/Debugger.py trunk/gnue-designer/src/forms/LayoutEditor/LayoutEditor.py trunk/gnue-designer/src/forms/LayoutEditor/Workspace.py trunk/gnue-designer/src/forms/document.py trunk/gnue-designer/src/reports/Char/LayoutEditor.py trunk/gnue-designer/src/reports/Standard/LayoutEditor.py trunk/gnue-designer/src/ui/wx/Base.py trunk/gnue-designer/src/ui/wx/Instance.py Log: fixes to let designer start with current forms Modified: trunk/gnue-designer/src/app/designer.py =================================================================== --- trunk/gnue-designer/src/app/designer.py 2008-02-21 14:08:20 UTC (rev 9853) +++ trunk/gnue-designer/src/app/designer.py 2008-03-03 13:29:50 UTC (rev 9854) @@ -31,6 +31,9 @@ import time from StringIO import StringIO +# Force the forms uidriver to call wxversion.ensureMinimal() +from gnue.forms.uidrivers.wx26 import UIdriver as UIwxpython + from gnue.common.apps import RuntimeSettings from gnue.common.apps.GClientApp import GClientApp from gnue.common.utils.FileUtils import dyn_import @@ -96,9 +99,8 @@ print "Running" # TODO: make a startup/GConfig parameter, and/or do auto-detection - from gnue.designer.ui.wx.Base import UIBase - self.ui = UIBase(self) + self.ui = Base.UIBase(self) # Setup the Most Recently Used URL manager Modified: trunk/gnue-designer/src/base/tools/PropertyEditor.py =================================================================== --- trunk/gnue-designer/src/base/tools/PropertyEditor.py 2008-02-21 14:08:20 UTC (rev 9853) +++ trunk/gnue-designer/src/base/tools/PropertyEditor.py 2008-03-03 13:29:50 UTC (rev 9854) @@ -28,6 +28,7 @@ __all__ = ['PropertyEditor'] import sys +from types import UnicodeType, StringType import wx import wx.lib.mixins.listctrl as mixins @@ -36,7 +37,6 @@ from gnue.common.apps import GDebug from gnue.common.formatting import GTypecast from gnue.designer.base.ToolBase import ToolBase -from gnue.forms.uidrivers.wx.common import wxEncode class PropertyEditor(ToolBase): @@ -196,7 +196,10 @@ if common_value is MixedValues: common_value = u_('(Multiple)') - self.listctrl.SetStringItem(index, 1, str(common_value)) + if type(common_value) in (UnicodeType, StringType): + self.listctrl.SetStringItem(index, 1, common_value) + else: + self.listctrl.SetStringItem(index, 1, str(common_value)) Modified: trunk/gnue-designer/src/base/tools/TreeView.py =================================================================== --- trunk/gnue-designer/src/base/tools/TreeView.py 2008-02-21 14:08:20 UTC (rev 9853) +++ trunk/gnue-designer/src/base/tools/TreeView.py 2008-03-03 13:29:50 UTC (rev 9854) @@ -37,7 +37,6 @@ from gnue.common.apps import GDebug from gnue.common.logic import GTrigger from gnue.forms import GFForm, GFObjects, GFLibrary -from gnue.forms.uidrivers.wx.common import wxEncode from gnue.designer.base.PopupMenu import ObjectMenu from gnue.designer.base.Icons import treeIconMap, treeIconList from gnue.designer.base.ToolBase import * @@ -95,7 +94,7 @@ def AppendItem(self, parent, description): - rv = self.tree.AppendItem(parent, wxEncode(description)) + rv = self.tree.AppendItem(parent, description) return rv def object_selected_event (self, event): Modified: trunk/gnue-designer/src/forms/Debugger.py =================================================================== --- trunk/gnue-designer/src/forms/Debugger.py 2008-02-21 14:08:20 UTC (rev 9853) +++ trunk/gnue-designer/src/forms/Debugger.py 2008-03-03 13:29:50 UTC (rev 9854) @@ -26,12 +26,11 @@ """ import sys, os -import wx from gnue.common.apps import GDebug from gnue.common.apps.GClientApp import GClientApp from gnue.forms import GFForm, GFInstance, GFParser from StringIO import StringIO -from gnue.forms.uidrivers.wx import UIdriver as UIwxpython +from gnue.forms.uidrivers.wx26 import UIdriver as UIwxpython ##################################################### ## TODO Modified: trunk/gnue-designer/src/forms/LayoutEditor/LayoutEditor.py =================================================================== --- trunk/gnue-designer/src/forms/LayoutEditor/LayoutEditor.py 2008-02-21 14:08:20 UTC (rev 9853) +++ trunk/gnue-designer/src/forms/LayoutEditor/LayoutEditor.py 2008-03-03 13:29:50 UTC (rev 9854) @@ -33,8 +33,7 @@ from gnue.common.apps import GDebug from gnue.common.events import Event from gnue.forms import GFObjects -from gnue.forms.uidrivers.wx import UIdriver as UIwxpython -from gnue.forms.uidrivers.wx.common import wxEncode +from gnue.forms.uidrivers.wx26 import UIdriver as UIwxpython from gnue.designer.base.PopupMenu import PageMenu from gnue.designer.base.TemplateParser import TemplateParser from gnue.designer.base.EditorBase import EditorBase Modified: trunk/gnue-designer/src/forms/LayoutEditor/Workspace.py =================================================================== --- trunk/gnue-designer/src/forms/LayoutEditor/Workspace.py 2008-02-21 14:08:20 UTC (rev 9853) +++ trunk/gnue-designer/src/forms/LayoutEditor/Workspace.py 2008-03-03 13:29:50 UTC (rev 9854) @@ -29,7 +29,7 @@ import wx from gnue.common.apps import GDebug from gnue.forms import GFObjects -from gnue.forms.uidrivers.wx import UIdriver as UIwxpython +from gnue.forms.uidrivers.wx26 import UIdriver as UIwxpython from gnue.designer.base.PopupMenu import PageMenu from gnue.designer.base.TemplateParser import TemplateParser from gnue.designer.base.ToolBase import * Modified: trunk/gnue-designer/src/forms/document.py =================================================================== --- trunk/gnue-designer/src/forms/document.py 2008-02-21 14:08:20 UTC (rev 9853) +++ trunk/gnue-designer/src/forms/document.py 2008-03-03 13:29:50 UTC (rev 9854) @@ -30,11 +30,6 @@ # --------------------------------------------------------------------------- # --------------------------------------------------------------------------- -# External imports -# --------------------------------------------------------------------------- -import wx - -# --------------------------------------------------------------------------- # GNUe Imports # --------------------------------------------------------------------------- from gnue.designer.base.document import BaseDocument Modified: trunk/gnue-designer/src/reports/Char/LayoutEditor.py =================================================================== --- trunk/gnue-designer/src/reports/Char/LayoutEditor.py 2008-02-21 14:08:20 UTC (rev 9853) +++ trunk/gnue-designer/src/reports/Char/LayoutEditor.py 2008-03-03 13:29:50 UTC (rev 9854) @@ -26,7 +26,6 @@ import wx from gnue.designer.base.ToolBase import ToolBase -from gnue.forms.uidrivers.wx import UIdriver as UIwxpython class LayoutEditor (ToolBase): Modified: trunk/gnue-designer/src/reports/Standard/LayoutEditor.py =================================================================== --- trunk/gnue-designer/src/reports/Standard/LayoutEditor.py 2008-02-21 14:08:20 UTC (rev 9853) +++ trunk/gnue-designer/src/reports/Standard/LayoutEditor.py 2008-03-03 13:29:50 UTC (rev 9854) @@ -26,7 +26,6 @@ import wx from gnue.designer.base.ToolBase import ToolBase -from gnue.forms.uidrivers.wx import UIdriver as UIwxpython class LayoutEditor (ToolBase): Modified: trunk/gnue-designer/src/ui/wx/Base.py =================================================================== --- trunk/gnue-designer/src/ui/wx/Base.py 2008-02-21 14:08:20 UTC (rev 9853) +++ trunk/gnue-designer/src/ui/wx/Base.py 2008-03-03 13:29:50 UTC (rev 9854) @@ -21,7 +21,7 @@ # # $Id$ """ -UI Driver for wxWidgets 2.6 +UI Driver for wxWidgets 2.8 """ # --------------------------------------------------------------------------- @@ -31,41 +31,12 @@ import os import string -# --------------------------------------------------------------------------- -# wx Imports -# --------------------------------------------------------------------------- -try: - if not hasattr(sys, 'frozen'): - import wxversion - # For development use: - if os.environ.has_key('GNUE_WX_VERSION'): - wxversion.select(os.environ['GNUE_WX_VERSION']) - else: - wxversion.select ('2.6') +import wx -except ImportError: - pass # wxselect not installed - -try: # Make sure 2.6 did in fact load - import wx - if wx.__version__ < '2.6.1': - raise ImportError -except ImportError: - raise "GNUe Designer requires wxPython 2.6.1 or greater." - -# Issue stability warning for old wx versions -if wx.__version__ < '2.6.3': - print - print "*" * 70 - print "WARNING: GNUe Designer is unstable on wxPython %s." % wx.__version__ - print " For a stable experience, please install 2.6.2.1 or better" - print "*" * 70 - print - # --------------------------------------------------------------------------- # GNUe Imports # --------------------------------------------------------------------------- -from gnue.forms.uidrivers.wx.GFwxApp import setWxApp +###from gnue.forms.uidrivers.wx.GFwxApp import setWxApp from gnue.common.apps import GConfig @@ -91,20 +62,16 @@ def run(self): # Set form's wx app to be us - setWxApp(self) +### setWxApp(self) # Reuse the login handler from Form's wx driver # This has to happen after setWxApp, otherwise bad things happen - from gnue.forms.uidrivers.wx import UILoginHandler + from gnue.forms.uidrivers.wx26 import UILoginHandler self.app.getConnectionManager().setLoginHandler(UILoginHandler()) # Call wx's MainLoop self.app.init() - # TODO: Temp - if wx.__version__ < '2.6.2.1': - wx.MessageDialog(None, 'Designer may be unstable when used\nwith wxWidgets %s. \nVersion 2.6.2.1 or better is recommended.' % wx.__version__) - self.MainLoop() def createInstance(self, instance): Modified: trunk/gnue-designer/src/ui/wx/Instance.py =================================================================== --- trunk/gnue-designer/src/ui/wx/Instance.py 2008-02-21 14:08:20 UTC (rev 9853) +++ trunk/gnue-designer/src/ui/wx/Instance.py 2008-03-03 13:29:50 UTC (rev 9854) @@ -34,9 +34,10 @@ #---------------------------------------------------------------------------- import wx try: - import wx.aui as PyAUI # For wx 2.7+, use the builtin library + import wx.aui # For wx 2.7+, use the builtin library except ImportError: - from uihelpers import PyAUI # Use the less-stable python version + print "Gnue-designer needs wxpython 2.8.x" +# from uihelpers import PyAUI # Use the less-stable python version #---------------------------------------------------------------------------- # GNUe Imports @@ -123,7 +124,7 @@ # RuntimeSettings.getint(self.document.runtime_section, 'y', -1))) # Add the toolbar to the PyAUI manager - self._auiMgr.AddPane(self.toolbar, PyAUI.PaneInfo(). + self._auiMgr.AddPane(self.toolbar, wx.aui.AuiPaneInfo(). Name("PrimaryToolBar"). Caption(u_("GNUe Designer")). ToolbarPane().Top()) @@ -202,7 +203,7 @@ self.editNotebook = notebook = wx.Notebook( self,-1) - self._auiMgr.AddPane(notebook, PyAUI.PaneInfo().Name('Editor').\ + self._auiMgr.AddPane(notebook, wx.aui.AuiPaneInfo().Name('Editor').\ Caption('Editor').CenterPane()) ##TODO: Experimenting with tabs at the top... @@ -269,7 +270,7 @@ appd = (id, title, baseclass, hotkey, pos) - toolinfo = PyAUI.PaneInfo().Name(title).Caption(title) + toolinfo = wx.aui.AuiPaneInfo().Name(title).Caption(title) if tool._docked: # Docked type @@ -337,7 +338,7 @@ # Setup PyAUI (the docking framework) - self._auiMgr = PyAUI.FrameManager() + self._auiMgr = wx.aui.AuiManager() # In wx 2.7+, we can call PyAUI.FrameManager(self) # and eliminate the next line. @@ -382,7 +383,7 @@ #============================================================================ # Our own PyAUI dock decorator #============================================================================ -class MyDockArt(PyAUI.DefaultDockArt): +class MyDockArt(wx.aui.AuiDefaultDockArt): def __init__(self, *arg, **parm): - PyAUI.DefaultDockArt.__init__(self, *arg, **parm) - self.SetFont(PyAUI.AUI_ART_CAPTION_FONT, wx.SMALL_FONT) + wx.aui.AuiDefaultDockArt.__init__(self, *arg, **parm) + self.SetFont(wx.aui.AUI_DOCKART_CAPTION_FONT, wx.SMALL_FONT) _______________________________________________ commit-gnue mailing list commit-gnue@gnu.org http://lists.gnu.org/mailman/listinfo/commit-gnue