Browse Source

wxGUI Histogramming Tool: small (cosmetic changes) in the gui of the plot statistics frame (https://trac.osgeo.org/grass/ticket/2894) - patch by tmsz

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67747 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 9 years ago
parent
commit
fbd7f9ffff
1 changed files with 13 additions and 8 deletions
  1. 13 8
      gui/wxpython/wxplot/dialogs.py

+ 13 - 8
gui/wxpython/wxplot/dialogs.py

@@ -11,7 +11,7 @@ Classes:
  - dialogs::TextDialog
  - dialogs::TextDialog
  - dialogs::OptDialog
  - dialogs::OptDialog
 
 
-(C) 2011-2012 by the GRASS Development Team
+(C) 2011-2016 by the GRASS Development Team
 
 
 This program is free software under the GNU General Public License
 This program is free software under the GNU General Public License
 (>=v2). Read the file COPYING that comes with GRASS for details.
 (>=v2). Read the file COPYING that comes with GRASS for details.
@@ -19,12 +19,15 @@ This program is free software under the GNU General Public License
 @author Michael Barton, Arizona State University
 @author Michael Barton, Arizona State University
 """
 """
 
 
+import os
+
 import wx
 import wx
 import wx.lib.colourselect  as csel
 import wx.lib.colourselect  as csel
 import wx.lib.scrolledpanel as scrolled
 import wx.lib.scrolledpanel as scrolled
 
 
 from core             import globalvar
 from core             import globalvar
 from core.settings    import UserSettings
 from core.settings    import UserSettings
+from core.globalvar   import ICONDIR
 from core.utils import _
 from core.utils import _
 from gui_core.gselect import Select
 from gui_core.gselect import Select
 
 
@@ -239,8 +242,10 @@ class PlotStatsFrame(wx.Frame):
         """
         """
         wx.Frame.__init__(self, parent, id, style = style, **kwargs)
         wx.Frame.__init__(self, parent, id, style = style, **kwargs)
         self.SetLabel(_("Statistics"))
         self.SetLabel(_("Statistics"))
+        self.SetIcon(wx.Icon(os.path.join(ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+        self.panel = wx.Panel(self)
         
         
-        sp = scrolled.ScrolledPanel(self, -1, size=(400, 400),
+        sp = scrolled.ScrolledPanel(self.panel, -1, size=(400, 400),
                                     style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER, name="Statistics" )
                                     style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER, name="Statistics" )
                 
                 
 
 
@@ -258,10 +263,10 @@ class PlotStatsFrame(wx.Frame):
         sizer = wx.BoxSizer(wx.VERTICAL)
         sizer = wx.BoxSizer(wx.VERTICAL)
         txtSizer = wx.BoxSizer(wx.VERTICAL)
         txtSizer = wx.BoxSizer(wx.VERTICAL)
 
 
-        statstitle = wx.StaticText(parent = self, id = wx.ID_ANY, label = self.title)
+        statstitle = wx.StaticText(parent = self.panel, id = wx.ID_ANY, label = self.title)
         sizer.Add(item = statstitle, proportion = 0,
         sizer.Add(item = statstitle, proportion = 0,
                   flag = wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, border = 3)
                   flag = wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, border = 3)
-        line = wx.StaticLine(parent = self, id = wx.ID_ANY, size = (20, -1), style = wx.LI_HORIZONTAL)
+        line = wx.StaticLine(parent = self.panel, id = wx.ID_ANY, size = (20, -1), style = wx.LI_HORIZONTAL)
         sizer.Add(item = line, proportion = 0,
         sizer.Add(item = line, proportion = 0,
                   flag = wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, border = 3)
                   flag = wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, border = 3)
         for stats in self.message:
         for stats in self.message:
@@ -280,7 +285,7 @@ class PlotStatsFrame(wx.Frame):
         sizer.Add(item = sp, proportion = 1, 
         sizer.Add(item = sp, proportion = 1, 
                   flag = wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM, border = 3)
                   flag = wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM, border = 3)
 
 
-        line = wx.StaticLine(parent = self, id = wx.ID_ANY, size = (20, -1), style = wx.LI_HORIZONTAL)
+        line = wx.StaticLine(parent = self.panel, id = wx.ID_ANY, size = (20, -1), style = wx.LI_HORIZONTAL)
         sizer.Add(item = line, proportion = 0,
         sizer.Add(item = line, proportion = 0,
                   flag = wx.GROW |wx.ALIGN_CENTER_VERTICAL|wx.LEFT|wx.RIGHT, border = 3)
                   flag = wx.GROW |wx.ALIGN_CENTER_VERTICAL|wx.LEFT|wx.RIGHT, border = 3)
 
 
@@ -289,11 +294,11 @@ class PlotStatsFrame(wx.Frame):
         #
         #
         btnSizer = wx.BoxSizer(wx.HORIZONTAL)
         btnSizer = wx.BoxSizer(wx.HORIZONTAL)
 
 
-        btn_clipboard = wx.Button(self, id = wx.ID_COPY, label = _('C&opy'))
+        btn_clipboard = wx.Button(self.panel, id = wx.ID_COPY, label = _('C&opy'))
         btn_clipboard.SetToolTipString(_("Copy regression statistics the clipboard (Ctrl+C)"))
         btn_clipboard.SetToolTipString(_("Copy regression statistics the clipboard (Ctrl+C)"))
         btnSizer.Add(item = btn_clipboard, proportion = 0, flag = wx.ALIGN_LEFT | wx.ALL, border = 5)
         btnSizer.Add(item = btn_clipboard, proportion = 0, flag = wx.ALIGN_LEFT | wx.ALL, border = 5)
         
         
-        btnCancel = wx.Button(self, wx.ID_CLOSE)
+        btnCancel = wx.Button(self.panel, wx.ID_CLOSE)
         btnCancel.SetDefault()
         btnCancel.SetDefault()
         btnSizer.Add(item = btnCancel, proportion = 0, flag = wx.ALIGN_RIGHT | wx.ALL, border = 5)        
         btnSizer.Add(item = btnCancel, proportion = 0, flag = wx.ALIGN_RIGHT | wx.ALL, border = 5)        
 
 
@@ -303,7 +308,7 @@ class PlotStatsFrame(wx.Frame):
         btnCancel.Bind(wx.EVT_BUTTON, self.OnClose)
         btnCancel.Bind(wx.EVT_BUTTON, self.OnClose)
         btn_clipboard.Bind(wx.EVT_BUTTON, self.OnCopy)
         btn_clipboard.Bind(wx.EVT_BUTTON, self.OnCopy)
         
         
-        self.SetSizer(sizer)
+        self.panel.SetSizer(sizer)
         sizer.Fit(self)
         sizer.Fit(self)
 
 
     def OnCopy(self, event):
     def OnCopy(self, event):