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

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jun 13 05:14:23 EDT 2010


Author: martinl
Date: 2010-06-13 14:16:53 +0000 (Sun, 13 Jun 2010)
New Revision: 42550

Modified:
   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/wxgui.py
Log:
wxGUI: fixing related to wxPython 2.8.11 (see #1085) 
(merge r42549 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py	2010-06-13 14:13:38 UTC (rev 42549)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py	2010-06-13 14:16:53 UTC (rev 42550)
@@ -25,8 +25,10 @@
 import wx
 try:
     import wx.lib.agw.customtreectrl as CT
+    hasAgw = True
 except ImportError:
     import wx.lib.customtreectrl as CT
+    hasAgw = False
 import wx.combo
 import wx.lib.newevent
 import wx.lib.buttons  as  buttons
@@ -94,7 +96,10 @@
         self.rerender = False                # layer change requires a rerendering if auto render
         self.reorder = False                 # layer change requires a reordering
         
-        super(LayerTree, self).__init__(parent, id, style = ctstyle, **kwargs)
+        if hasAgw:
+            super(LayerTree, self).__init__(parent, id, agwStyle = ctstyle, **kwargs)
+        else:
+            super(LayerTree, self).__init__(parent, id, style = ctstyle, **kwargs)
         self.SetName("LayerTree")
         
         ### SetAutoLayout() causes that no vertical scrollbar is displayed

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-06-13 14:13:38 UTC (rev 42549)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-06-13 14:16:53 UTC (rev 42550)
@@ -71,8 +71,10 @@
 import wx.html
 try:
     import wx.lib.agw.flatnotebook as FN
+    hasAgw = True
 except ImportError:
     import wx.lib.flatnotebook as FN
+    hasAgw = False
 import wx.lib.colourselect as csel
 import wx.lib.filebrowsebutton as filebrowse
 from wx.lib.expando import ExpandoTextCtrl, EVT_ETC_LAYOUT_NEEDED
@@ -993,7 +995,10 @@
 
         # Build notebook
         nbStyle = globalvar.FNPageStyle
-        self.notebook = FN.FlatNotebook( self, id=wx.ID_ANY, style=nbStyle)
+        if hasAgw:
+            self.notebook = FN.FlatNotebook( self, id = wx.ID_ANY, agwStyle = nbStyle)
+        else:
+            self.notebook = FN.FlatNotebook( self, id = wx.ID_ANY, style = nbStyle)
         self.notebook.SetTabAreaColour(globalvar.FNPageColor)
         self.notebook.Bind(FN.EVT_FLATNOTEBOOK_PAGE_CHANGED, self.OnPageChange)
 

Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2010-06-13 14:13:38 UTC (rev 42549)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2010-06-13 14:16:53 UTC (rev 42550)
@@ -52,12 +52,12 @@
 import wx.stc
 try:
     import wx.lib.agw.customtreectrl as CT
+    import wx.lib.agw.flatnotebook   as FN
+    hasAgw = True
 except ImportError:
     import wx.lib.customtreectrl as CT
-try:
-    import wx.lib.agw.flatnotebook as FN
-except ImportError:
-    import wx.lib.flatnotebook as FN
+    import wx.lib.flatnotebook   as FN
+    hasAgw = False
 
 sys.path.append(os.path.join(globalvar.ETCDIR, "python"))
 from grass.script import core as grass
@@ -201,11 +201,17 @@
             FN.FNB_NO_NAV_BUTTONS | \
             FN.FNB_NO_X_BUTTON
         
-        self.notebook = FN.FlatNotebook(parent=self, id=wx.ID_ANY, style=nbStyle)
-        
+        if 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
-        self.gm_cb = FN.FlatNotebook(self, id=wx.ID_ANY, style=cbStyle)
+        if 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)
         self.gm_cb.SetTabAreaColour(globalvar.FNPageColor)
         self.notebook.AddPage(self.gm_cb, text=_("Map layers"))
         



More information about the grass-commit mailing list