Ver código fonte

wxGUI: use TextCtrl in About, so that the text can be copied

It also gives white bg and breaks long lines.
Not applicable for Info, Contrib, C Extra
and Tr which are a table from widgets
(need more work to replace by HTML).

Applied to Copy, License, Cite, Authors.


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@68660 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 9 anos atrás
pai
commit
3e32ee0f26
1 arquivos alterados com 12 adições e 11 exclusões
  1. 12 11
      gui/wxpython/gui_core/ghelp.py

+ 12 - 11
gui/wxpython/gui_core/ghelp.py

@@ -249,9 +249,9 @@ class AboutWindow(wx.Frame):
 
         # put text into a scrolling panel
         copyrightwin = ScrolledPanel(self.aboutNotebook)
-        copyrightwin.SetBackgroundColour('WHITE')
-        copyrighttxt = wx.StaticText(
-            copyrightwin, id=wx.ID_ANY, label=copytext)
+        copyrighttxt = wx.TextCtrl(
+            copyrightwin, id=wx.ID_ANY, value=copytext,
+        style=wx.TE_MULTILINE | wx.TE_READONLY)
         copyrightwin.SetAutoLayout(True)
         copyrightwin.sizer = wx.BoxSizer(wx.VERTICAL)
         copyrightwin.sizer.Add(item=copyrighttxt, proportion=1,
@@ -273,8 +273,9 @@ class AboutWindow(wx.Frame):
             license = _('%s file missing') % 'GPL.TXT'
         # put text into a scrolling panel
         licensewin = ScrolledPanel(self.aboutNotebook)
-        licensewin.SetBackgroundColour('WHITE')
-        licensetxt = wx.StaticText(licensewin, id=wx.ID_ANY, label=license)
+        licensetxt = wx.TextCtrl(
+            licensewin, id=wx.ID_ANY, value=license,
+        style=wx.TE_MULTILINE | wx.TE_READONLY)
         licensewin.SetAutoLayout(True)
         licensewin.sizer = wx.BoxSizer(wx.VERTICAL)
         licensewin.sizer.Add(item=licensetxt, proportion=1,
@@ -298,9 +299,9 @@ class AboutWindow(wx.Frame):
 
         # put text into a scrolling panel
         window = ScrolledPanel(self.aboutNotebook)
-        window.SetBackgroundColour('WHITE')
-        stat_text = wx.StaticText(
-            window, id=wx.ID_ANY, label=text)
+        stat_text = wx.TextCtrl(
+            window, id=wx.ID_ANY, value=text,
+        style=wx.TE_MULTILINE | wx.TE_READONLY)
         window.SetAutoLayout(True)
         window.sizer = wx.BoxSizer(wx.VERTICAL)
         window.sizer.Add(item=stat_text, proportion=1,
@@ -322,8 +323,9 @@ class AboutWindow(wx.Frame):
         else:
             authors = _('%s file missing') % 'AUTHORS'
         authorwin = ScrolledPanel(self.aboutNotebook)
-        authorwin.SetBackgroundColour('WHITE')
-        authortxt = wx.StaticText(authorwin, id=wx.ID_ANY, label=authors)
+        authortxt = wx.TextCtrl(
+            authorwin, id=wx.ID_ANY, value=authors,
+        style=wx.TE_MULTILINE | wx.TE_READONLY)
         authorwin.SetAutoLayout(True)
         authorwin.SetupScrolling()
         authorwin.sizer = wx.BoxSizer(wx.VERTICAL)
@@ -374,7 +376,6 @@ class AboutWindow(wx.Frame):
             contribs = None
 
         contribwin = ScrolledPanel(self.aboutNotebook)
-        contribwin.SetBackgroundColour('WHITE')
         contribwin.SetAutoLayout(True)
         contribwin.SetupScrolling()
         contribwin.sizer = wx.BoxSizer(wx.VERTICAL)