[GRASS-SVN] r42551 - in grass/branches/releasebranch_6_4/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:25:04 +0000 (Sun, 13 Jun 2010)
New Revision: 42551

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/wxgui_utils.py
   grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py
Log:
wxGUI: fixing related to wxPython 2.8.11 (see #1085)


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2010-06-13 14:16:53 UTC (rev 42550)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2010-06-13 14:25:04 UTC (rev 42551)
@@ -67,7 +67,12 @@
 
 import wx
 import wx.html
-import wx.lib.flatnotebook as FN
+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
@@ -1079,7 +1084,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/releasebranch_6_4/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/wxgui_utils.py	2010-06-13 14:16:53 UTC (rev 42550)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/wxgui_utils.py	2010-06-13 14:25:04 UTC (rev 42551)
@@ -25,7 +25,12 @@
 import string
 
 import wx
-import wx.lib.customtreectrl as CT
+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
@@ -73,7 +78,10 @@
         if 'style' in kargs:
             ctstyle |= kargs['style']
             del kargs['style']
-        super(LayerTree, self).__init__(parent, id, pos, size, style = ctstyle)
+        if hasAgw:
+            super(LayerTree, self).__init__(parent, id, pos, size, agwStyle = ctstyle)
+        else:
+            super(LayerTree, self).__init__(parent, id, pos, size, style = ctstyle)
         self.SetName("LayerTree")
 
         ### SetAutoLayout() causes that no vertical scrollbar is displayed

Modified: grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py	2010-06-13 14:16:53 UTC (rev 42550)
+++ grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py	2010-06-13 14:25:04 UTC (rev 42551)
@@ -66,6 +66,15 @@
 import  wx.lib.scrolledpanel as scrolled
 from wx.lib.wordwrap import wordwrap
 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
+    import wx.lib.flatnotebook   as FN
+    hasAgw = False
+
+try:
     import subprocess
 except:
     import compat.subprocess as subprocess
@@ -305,14 +314,17 @@
             FN.FNB_NO_NAV_BUTTONS | \
             FN.FNB_NO_X_BUTTON
         
-        self.notebook = FN.FlatNotebook(parent=self, id=wx.ID_ANY, style=nbStyle)
-
-        #self.notebook = wx.aui.AuiNotebook(parent=self, id=wx.ID_ANY, style=wx.aui.AUI_NB_BOTTOM)
-        #self.notebook.SetFont(wx.Font(pointSize=11, family=wx.FONTFAMILY_DEFAULT, style=wx.NORMAL, weight=0))
-
+        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 for each display"))
 



More information about the grass-commit mailing list