Selaa lähdekoodia

wxGUI: HelpWindow moved to help.py

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38833 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 vuotta sitten
vanhempi
commit
10ddcbaac4
2 muutettua tiedostoa jossa 51 lisäystä ja 30 poistoa
  1. 6 30
      gui/wxpython/gis_set.py
  2. 45 0
      gui/wxpython/gui_modules/help.py

+ 6 - 30
gui/wxpython/gis_set.py

@@ -8,7 +8,6 @@ Location/mapset management (selection, creation, etc.).
 
 Classes:
  - GRASSStartup
- - HelpWindow
  - StartUp
 
 (C) 2006-2009 by the GRASS Development Team
@@ -34,6 +33,8 @@ from gui_modules import globalvar
 if not os.getenv("GRASS_WXBUNDLED"):
     globalvar.CheckForWx()
 
+from gui_modules import help
+
 import wx
 import wx.html
 import wx.lib.rcsizer as rcs
@@ -720,10 +721,10 @@ class GRASSStartup(wx.Frame):
         # help text in lib/init/helptext.html
         file=os.path.join(self.gisbase, "docs", "html", "helptext.html")
 
-        helpFrame = HelpWindow(parent=self, id=wx.ID_ANY,
-                               title=_("GRASS Quickstart"),
-                               size=(640, 480),
-                               file=file)
+        helpFrame = help.HelpWindow(parent=self, id=wx.ID_ANY,
+                                    title=_("GRASS Quickstart"),
+                                    size=(640, 480),
+                                    file=file)
         helpFrame.Show(True)
 
         event.Skip()
@@ -733,31 +734,6 @@ class GRASSStartup(wx.Frame):
         event.Skip()
         sys.exit(2)
 
-class HelpWindow(wx.Frame):
-    """!GRASS Quickstart help window"""
-    def __init__(self, parent, id, title, size, file):
-
-        wx.Frame.__init__(self, parent=parent, id=id, title=title, size=size)
-
-        sizer = wx.BoxSizer(wx.VERTICAL)
-
-        # text
-        helpFrame = wx.html.HtmlWindow(parent=self, id=wx.ID_ANY)
-        helpFrame.SetStandardFonts (size = 10)
-        helpFrame.SetBorders(10)
-        wx.InitAllImageHandlers()
-
-        helpFrame.LoadFile(file)
-        self.Ok = True
-
-        sizer.Add(item=helpFrame, proportion=1, flag=wx.EXPAND)
-
-        self.SetAutoLayout(True)
-        self.SetSizer(sizer)
-        #        sizer.Fit(self)
-        #        sizer.SetSizeHints(self)
-        self.Layout()
-
 class GListBox(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin):
     """!Use wx.ListCtrl instead of wx.ListBox, different style for
     non-selectable items (e.g. mapsets with denied permission)"""

+ 45 - 0
gui/wxpython/gui_modules/help.py

@@ -0,0 +1,45 @@
+"""!
+@package help.py
+
+@brief Help window
+
+@todo Needs improvements...
+
+Classes:
+ - HelpWindow
+
+(C) 2008-2009 by the GRASS Development Team
+
+This program is free software under the GNU General Public
+License (>=v2). Read the file COPYING that comes with GRASS
+for details.
+
+@author Martin Landa <landa.martin gmail.com>
+"""
+
+import wx
+
+class HelpWindow(wx.Frame):
+    """!GRASS Quickstart help window"""
+    def __init__(self, parent, id, title, size, file):
+
+        wx.Frame.__init__(self, parent=parent, id=id, title=title, size=size)
+
+        sizer = wx.BoxSizer(wx.VERTICAL)
+
+        # text
+        helpFrame = wx.html.HtmlWindow(parent=self, id=wx.ID_ANY)
+        helpFrame.SetStandardFonts (size = 10)
+        helpFrame.SetBorders(10)
+        wx.InitAllImageHandlers()
+
+        helpFrame.LoadFile(file)
+        self.Ok = True
+
+        sizer.Add(item=helpFrame, proportion=1, flag=wx.EXPAND)
+
+        self.SetAutoLayout(True)
+        self.SetSizer(sizer)
+        #        sizer.Fit(self)
+        #        sizer.SetSizeHints(self)
+        self.Layout()