[GRASS-SVN] r67679 - grass/trunk/gui/wxpython/lmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 26 19:05:12 PST 2016


Author: annakrat
Date: 2016-01-26 19:05:12 -0800 (Tue, 26 Jan 2016)
New Revision: 67679

Modified:
   grass/trunk/gui/wxpython/lmgr/frame.py
Log:
wxGUI: use native notebook for Layer manager tabs on linux and mac to avoid glitches, keep the FlatNotebook for Windows because native looks ugly

Modified: grass/trunk/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/frame.py	2016-01-27 01:53:23 UTC (rev 67678)
+++ grass/trunk/gui/wxpython/lmgr/frame.py	2016-01-27 03:05:12 UTC (rev 67679)
@@ -49,7 +49,7 @@
 from gui_core.preferences  import MapsetAccess, PreferencesDialog
 from lmgr.layertree        import LayerTree, LMIcons
 from lmgr.menudata         import LayerManagerMenuData, LayerManagerModuleTree
-from gui_core.widgets      import GNotebook
+from gui_core.widgets      import GNotebook, FormNotebook
 from modules.mcalc_builder import MapCalcFrame
 from dbmgr.manager         import AttributeManager
 from core.workspace        import ProcessWorkspaceFile, ProcessGrcFile, WriteWorkspaceFile
@@ -278,7 +278,10 @@
     
     def _createNoteBook(self):
         """Creates notebook widgets"""
-        self.notebook = GNotebook(parent = self, style = globalvar.FNPageDStyle)
+        if sys.platform == 'win32':
+            self.notebook = GNotebook(parent=self, style=globalvar.FNPageDStyle)
+        else:
+            self.notebook = FormNotebook(parent=self, style=wx.NB_BOTTOM)
         # create displays notebook widget and add it to main notebook page
         cbStyle = globalvar.FNPageStyle
         if globalvar.hasAgw:
@@ -334,8 +337,11 @@
             self.pyshell = None
         
         # bindings
+        if sys.platform == 'win32':
+            self.notebook.Bind(FN.EVT_FLATNOTEBOOK_PAGE_CHANGED, self.OnPageChanged)
+        else:
+            self.notebook.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.OnPageChanged)
         self.notebookLayers.Bind(FN.EVT_FLATNOTEBOOK_PAGE_CHANGED,    self.OnCBPageChanged)
-        self.notebook.Bind(FN.EVT_FLATNOTEBOOK_PAGE_CHANGED, self.OnPageChanged)
         self.notebookLayers.Bind(FN.EVT_FLATNOTEBOOK_PAGE_CLOSING,    self.OnCBPageClosed)
         
         return self.notebook



More information about the grass-commit mailing list