[GRASS-SVN] r42559 - in grass/branches/develbranch_6/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jun 14 06:09:38 EDT 2010


Author: martinl
Date: 2010-06-14 10:09:38 +0000 (Mon, 14 Jun 2010)
New Revision: 42559

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/ghelp.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_tools.py
   grass/branches/develbranch_6/gui/wxpython/wxgui.py
Log:
wxGUI: more fixes for wxPython 2.8.11
(merge r42558 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py	2010-06-14 10:07:02 UTC (rev 42558)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py	2010-06-14 10:09:38 UTC (rev 42559)
@@ -612,29 +612,38 @@
         # really needed (ML)
         # self.notebook.SetFont(wx.Font(10, wx.FONTFAMILY_MODERN, wx.NORMAL, wx.NORMAL, 0, ''))
 
-        self.notebook = FN.FlatNotebook(parent=self.panel, id=wx.ID_ANY,
-                                        style=FN.FNB_BOTTOM |
-                                        FN.FNB_NO_NAV_BUTTONS |
-                                        FN.FNB_FANCY_TABS | FN.FNB_NO_X_BUTTON)
-
-        dbmStyle = globalvar.FNPageStyle
-
-        self.browsePage = FN.FlatNotebook(self.panel, id=wx.ID_ANY,
-                                          style=dbmStyle)
+        if globalvar.hasAgw:
+            self.notebook = FN.FlatNotebook(parent = self.panel, id = wx.ID_ANY,
+                                            agwStyle = FN.FNB_BOTTOM |
+                                            FN.FNB_NO_NAV_BUTTONS |
+                                            FN.FNB_FANCY_TABS | FN.FNB_NO_X_BUTTON)
+        else:
+            self.notebook = FN.FlatNotebook(parent = self.panel, id = wx.ID_ANY,
+                                            style = FN.FNB_BOTTOM |
+                                            FN.FNB_NO_NAV_BUTTONS |
+                                            FN.FNB_FANCY_TABS | FN.FNB_NO_X_BUTTON)
+        
+        if globalvar.hasAgw:
+            dbmStyle = { 'agwStyle' : globalvar.FNPageStyle }
+        else:
+            dbmStyle = { 'style' : globalvar.FNPageStyle }
+        
+        self.browsePage = FN.FlatNotebook(self.panel, id = wx.ID_ANY,
+                                          **dbmStyle)
         # self.notebook.AddPage(self.browsePage, caption=_("Browse data"))
         self.notebook.AddPage(self.browsePage, text=_("Browse data")) # FN
         self.browsePage.SetTabAreaColour(globalvar.FNPageColor)
 
-        self.manageTablePage = FN.FlatNotebook(self.panel, id=wx.ID_ANY,
-                                               style=dbmStyle)
+        self.manageTablePage = FN.FlatNotebook(self.panel, id = wx.ID_ANY,
+                                               **dbmStyle)
         #self.notebook.AddPage(self.manageTablePage, caption=_("Manage tables"))
         self.notebook.AddPage(self.manageTablePage, text=_("Manage tables")) # FN
         if not self.editable:
             self.notebook.GetPage(self.notebook.GetPageCount()-1).Enable(False)
         self.manageTablePage.SetTabAreaColour(globalvar.FNPageColor)
 
-        self.manageLayerPage = FN.FlatNotebook(self.panel, id=wx.ID_ANY,
-                                               style=dbmStyle)
+        self.manageLayerPage = FN.FlatNotebook(self.panel, id = wx.ID_ANY,
+                                               **dbmStyle)
         #self.notebook.AddPage(self.manageLayerPage, caption=_("Manage layers"))
         self.notebook.AddPage(self.manageLayerPage, text=_("Manage layers")) # FN
         self.manageLayerPage.SetTabAreaColour(globalvar.FNPageColor)

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/ghelp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/ghelp.py	2010-06-14 10:07:02 UTC (rev 42558)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/ghelp.py	2010-06-14 10:09:38 UTC (rev 42559)
@@ -551,7 +551,10 @@
                 FN.FNB_TABS_BORDER_SIMPLE | \
                 FN.FNB_NO_X_BUTTON
         
-        aboutNotebook = FN.FlatNotebook(panel, id=wx.ID_ANY, style=nbstyle)
+        if globalvar.hasAgw:
+            aboutNotebook = FN.FlatNotebook(panel, id = wx.ID_ANY, agwStyle = nbstyle)
+        else:
+            aboutNotebook = FN.FlatNotebook(panel, id = wx.ID_ANY, style = nbstyle)
         aboutNotebook.SetTabAreaColour(globalvar.FNPageColor)
         
         # make pages for About GRASS notebook

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py	2010-06-14 10:07:02 UTC (rev 42558)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py	2010-06-14 10:09:38 UTC (rev 42559)
@@ -168,3 +168,6 @@
     have_mlist = True
 else:
     have_mlist = False
+
+"""@Check version of wxPython, use agwStyle for 2.8.11+"""
+hasAgw = CheckWxVersion()

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2010-06-14 10:07:02 UTC (rev 42558)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2010-06-14 10:09:38 UTC (rev 42559)
@@ -411,9 +411,14 @@
         
         self.statusbar = self.CreateStatusBar(number = 1)
         
-        self.notebook = FN.FlatNotebook(parent = self, id = wx.ID_ANY,
-                                        style = FN.FNB_FANCY_TABS | FN.FNB_BOTTOM |
-                                        FN.FNB_NO_NAV_BUTTONS | FN.FNB_NO_X_BUTTON)
+        if globalvar.hasAgw:
+            self.notebook = FN.FlatNotebook(parent = self, id = wx.ID_ANY,
+                                            agwStyle = FN.FNB_FANCY_TABS | FN.FNB_BOTTOM |
+                                            FN.FNB_NO_NAV_BUTTONS | FN.FNB_NO_X_BUTTON)
+        else:
+            self.notebook = FN.FlatNotebook(parent = self, id = wx.ID_ANY,
+                                            style = FN.FNB_FANCY_TABS | FN.FNB_BOTTOM |
+                                            FN.FNB_NO_NAV_BUTTONS | FN.FNB_NO_X_BUTTON)
         
         self.canvas = ModelCanvas(self)
         self.canvas.SetBackgroundColour(wx.WHITE)
@@ -2911,11 +2916,19 @@
         
         wx.Dialog.__init__(self, parent = parent, id = id, title = title, style = style, **kwargs)
         
-        self.notebook = FN.FlatNotebook(self, id = wx.ID_ANY,
-                                        style = FN.FNB_FANCY_TABS |
-                                        FN.FNB_BOTTOM |
-                                        FN.FNB_NO_NAV_BUTTONS |
-                                        FN.FNB_NO_X_BUTTON)
+        if globalvar.hasAgw:
+            self.notebook = FN.FlatNotebook(self, id = wx.ID_ANY,
+                                            agwStyle = FN.FNB_FANCY_TABS |
+                                            FN.FNB_BOTTOM |
+                                            FN.FNB_NO_NAV_BUTTONS |
+                                            FN.FNB_NO_X_BUTTON)
+        else:
+            self.notebook = FN.FlatNotebook(self, id = wx.ID_ANY,
+                                            agwStyle = FN.FNB_FANCY_TABS |
+                                            FN.FNB_BOTTOM |
+                                            FN.FNB_NO_NAV_BUTTONS |
+                                            FN.FNB_NO_X_BUTTON)
+        
         panel = self._createPages()
         wx.CallAfter(self.notebook.SetSelection, 0)
         

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py	2010-06-14 10:07:02 UTC (rev 42558)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py	2010-06-14 10:09:38 UTC (rev 42559)
@@ -32,7 +32,6 @@
 import wx.lib.buttons  as  buttons
 
 import globalvar
-hasAgw = globalvar.CheckWxVersion()
 
 from grass.script import core as grass
 
@@ -96,7 +95,7 @@
         self.rerender = False                # layer change requires a rerendering if auto render
         self.reorder = False                 # layer change requires a reordering
         
-        if hasAgw:
+        if globalvar.hasAgw:
             super(LayerTree, self).__init__(parent, id, agwStyle = ctstyle, **kwargs)
         else:
             super(LayerTree, self).__init__(parent, id, style = ctstyle, **kwargs)

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-06-14 10:07:02 UTC (rev 42558)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-06-14 10:09:38 UTC (rev 42559)
@@ -73,7 +73,6 @@
     import wx.lib.agw.flatnotebook as FN
 except ImportError:
     import wx.lib.flatnotebook as FN
-hasAgw = globalvar.CheckWxVersion()
 import wx.lib.colourselect as csel
 import wx.lib.filebrowsebutton as filebrowse
 from wx.lib.expando import ExpandoTextCtrl, EVT_ETC_LAYOUT_NEEDED
@@ -994,7 +993,7 @@
 
         # Build notebook
         nbStyle = globalvar.FNPageStyle
-        if hasAgw:
+        if globalvar.hasAgw:
             self.notebook = FN.FlatNotebook( self, id = wx.ID_ANY, agwStyle = nbStyle)
         else:
             self.notebook = FN.FlatNotebook( self, id = wx.ID_ANY, style = nbStyle)

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_tools.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_tools.py	2010-06-14 10:07:02 UTC (rev 42558)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_tools.py	2010-06-14 10:09:38 UTC (rev 42559)
@@ -55,7 +55,11 @@
         self.mapWindow  = display.GetWindow()
         self._display   = self.mapWindow.GetDisplay()
         
-        FN.FlatNotebook.__init__(self, parent, id, style = style, **kwargs)
+        if globalvar.hasAgw:
+            kwargs['agwStyle'] = style
+        else:
+            kwargs['style'] = style
+        FN.FlatNotebook.__init__(self, parent, id, **kwargs)
         self.SetTabAreaColour(globalvar.FNPageColor)
         
         self.win  = {} # window ids

Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2010-06-14 10:07:02 UTC (rev 42558)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2010-06-14 10:09:38 UTC (rev 42559)
@@ -56,7 +56,6 @@
 except ImportError:
     import wx.lib.customtreectrl as CT
     import wx.lib.flatnotebook   as FN
-hasAgw = globalvar.CheckWxVersion()
 
 sys.path.append(os.path.join(globalvar.ETCDIR, "python"))
 from grass.script import core as grass
@@ -200,14 +199,14 @@
             FN.FNB_NO_NAV_BUTTONS | \
             FN.FNB_NO_X_BUTTON
         
-        if hasAgw:
+        if globalvar.hasAgw:
             self.notebook = FN.FlatNotebook(parent=self, id=wx.ID_ANY, agwStyle = nbStyle)
         else:
             self.notebook = FN.FlatNotebook(parent=self, id=wx.ID_ANY, style = nbStyle)
 
         # create displays notebook widget and add it to main notebook page
         cbStyle = globalvar.FNPageStyle
-        if hasAgw:
+        if globalvar.hasAgw:
             self.gm_cb = FN.FlatNotebook(self, id=wx.ID_ANY, agwStyle = cbStyle)
         else:
             self.gm_cb = FN.FlatNotebook(self, id=wx.ID_ANY, style = cbStyle)



More information about the grass-commit mailing list