[GRASS-SVN] r50015 - grass/branches/develbranch_6/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Dec 31 12:27:27 EST 2011


Author: martinl
Date: 2011-12-31 09:27:27 -0800 (Sat, 31 Dec 2011)
New Revision: 50015

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_core/ghelp.py
   grass/branches/develbranch_6/gui/wxpython/gui_core/widgets.py
Log:
wxGUI/about: fix scrolledpanel initial focus


Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/ghelp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/ghelp.py	2011-12-31 17:25:12 UTC (rev 50014)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/ghelp.py	2011-12-31 17:27:27 UTC (rev 50015)
@@ -32,7 +32,6 @@
     import wx.lib.customtreectrl as CT
     from wx.lib.hyperlink import HyperLinkCtrl
 import wx.lib.flatnotebook as FN
-import wx.lib.scrolledpanel as scrolled
 
 import grass.script as grass
 
@@ -40,7 +39,7 @@
 from core             import utils
 from lmgr.menudata    import ManagerData
 from core.gcmd        import GError, DecodeString
-from gui_core.widgets import GNotebook, StaticWrapText, ItemTree
+from gui_core.widgets import GNotebook, StaticWrapText, ItemTree, ScrolledPanel
 
 class SearchModuleWindow(wx.Panel):
     """!Search module window (used in MenuTreeWindow)"""
@@ -495,9 +494,8 @@
             copytext = _('%s file missing') % 'COPYING'
         
         # put text into a scrolling panel
-        copyrightwin = scrolled.ScrolledPanel(self, id = wx.ID_ANY, 
-                                              size = wx.DefaultSize,
-                                              style = wx.TAB_TRAVERSAL | wx.SUNKEN_BORDER)
+        copyrightwin = ScrolledPanel(self)
+                                     
         copyrighttxt = wx.StaticText(copyrightwin, id = wx.ID_ANY, label = copytext)
         copyrightwin.SetAutoLayout(True)
         copyrightwin.sizer = wx.BoxSizer(wx.VERTICAL)
@@ -519,8 +517,7 @@
         else:
             license = _('%s file missing') % 'GPL.TXT'
         # put text into a scrolling panel
-        licensewin = scrolled.ScrolledPanel(self, id = wx.ID_ANY, 
-                                            style = wx.TAB_TRAVERSAL | wx.SUNKEN_BORDER)
+        licensewin = ScrolledPanel(self)
         licensetxt = wx.StaticText(licensewin, id = wx.ID_ANY, label = license)
         licensewin.SetAutoLayout(True)
         licensewin.sizer = wx.BoxSizer(wx.VERTICAL)
@@ -542,10 +539,9 @@
             authorsFile.close()
         else:
             authors = _('%s file missing') % 'AUTHORS'
-        authorwin = scrolled.ScrolledPanel(self, id = wx.ID_ANY, 
-                                           style  =  wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER)
+        authorwin = ScrolledPanel(self)
         authortxt = wx.StaticText(authorwin, id = wx.ID_ANY, label = authors)
-        authorwin.SetAutoLayout(1)
+        authorwin.SetAutoLayout(True)
         authorwin.SetupScrolling()
         authorwin.sizer = wx.BoxSizer(wx.VERTICAL)
         authorwin.sizer.Add(item = authortxt, proportion = 1,
@@ -590,8 +586,7 @@
         else:
             contribs = None
         
-        contribwin = scrolled.ScrolledPanel(self, id = wx.ID_ANY, 
-                                           style = wx.TAB_TRAVERSAL | wx.SUNKEN_BORDER)
+        contribwin = ScrolledPanel(self)
         contribwin.SetAutoLayout(True)
         contribwin.SetupScrolling()
         contribwin.sizer = wx.BoxSizer(wx.VERTICAL)
@@ -650,9 +645,8 @@
         else:
             translators = None
         
-        translatorswin = scrolled.ScrolledPanel(self, id = wx.ID_ANY, 
-                                           style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER)
-        translatorswin.SetAutoLayout(1)
+        translatorswin = ScrolledPanel(self)
+        translatorswin.SetAutoLayout(True)
         translatorswin.SetupScrolling()
         translatorswin.sizer = wx.BoxSizer(wx.VERTICAL)
         

Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/widgets.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/widgets.py	2011-12-31 17:25:12 UTC (rev 50014)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/widgets.py	2011-12-31 17:27:27 UTC (rev 50015)
@@ -93,8 +93,9 @@
 
 class ScrolledPanel(SP.ScrolledPanel):
     """!Custom ScrolledPanel to avoid strange behaviour concerning focus"""
-    def __init__(self, parent):
-        SP.ScrolledPanel.__init__(self, parent = parent, id = wx.ID_ANY)
+    def __init__(self, parent, style = wx.TAB_TRAVERSAL | wx.SUNKEN_BORDER):
+        SP.ScrolledPanel.__init__(self, parent = parent, id = wx.ID_ANY, style = style)
+
     def OnChildFocus(self, event):
         pass
 



More information about the grass-commit mailing list