[GRASS-SVN] r44662 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 22 08:21:54 EST 2010


Author: martinl
Date: 2010-12-22 05:21:54 -0800 (Wed, 22 Dec 2010)
New Revision: 44662

Modified:
   grass/trunk/gui/wxpython/gui_modules/gdialogs.py
   grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: fix wrapping module description


Modified: grass/trunk/gui/wxpython/gui_modules/gdialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gdialogs.py	2010-12-22 11:32:54 UTC (rev 44661)
+++ grass/trunk/gui/wxpython/gui_modules/gdialogs.py	2010-12-22 13:21:54 UTC (rev 44662)
@@ -1503,7 +1503,7 @@
     return filetype, ltype
 
 class StaticWrapText(wx.StaticText):
-    """! A Static Text field that wraps its text to fit its width,
+    """!A Static Text field that wraps its text to fit its width,
     enlarging its height if necessary.
     """
     def __init__(self, parent, id = wx.ID_ANY, label = '', *args, **kwds):
@@ -1523,7 +1523,7 @@
     def OnResize(self, event):
         if not getattr(self, "resizing", False):
             self.resizing = True
-            newSize = wx.Size(self.parent.GetSize().width,
+            newSize = wx.Size(self.parent.GetSize().width - 50,
                               self.GetSize().height)
             if self.wrappedSize != newSize:
                 wx.StaticText.SetLabel(self, self.originalLabel)

Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2010-12-22 11:32:54 UTC (rev 44661)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2010-12-22 13:21:54 UTC (rev 44662)
@@ -33,8 +33,8 @@
 @todo
  - verify option value types
 
-Copyright (C) 2000-2010 by the GRASS Development Team
-This program is free software under the GPL (>=v2) Read the file
+Copyright(C) 2000-2010 by the GRASS Development Team
+This program is free software under the GPL(>=v2) Read the file
 COPYING coming with GRASS for details.
 
 @author Jan-Oliver Wagner <jan at intevation.de>
@@ -741,21 +741,21 @@
                                     bitmap = wx.Bitmap(name = os.path.join(imagepath,
                                                                        'grass_form.png'),
                                                      type = wx.BITMAP_TYPE_PNG))
-        topsizer.Add (item = self.logo, proportion = 0, border = 3,
-                      flag = wx.ALL | wx.ALIGN_CENTER_VERTICAL)
+        topsizer.Add(item = self.logo, proportion = 0, border = 3,
+                     flag = wx.ALL | wx.ALIGN_CENTER_VERTICAL)
         
         # add module description
-        if self.task.label !=  '':
+        if self.task.label:
             module_desc = self.task.label + ' ' + self.task.description
         else:
             module_desc = self.task.description
         self.description = gdialogs.StaticWrapText(parent = self.panel,
                                                    label = module_desc)
-        topsizer.Add (item = self.description, proportion = 1, border = 5,
-                      flag = wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)
-                      
-        guisizer.Add (item = topsizer, proportion = 0, flag = wx.EXPAND)
+        topsizer.Add(item = self.description, proportion = 1, border = 5,
+                     flag = wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)
         
+        guisizer.Add(item = topsizer, proportion = 0, flag = wx.EXPAND)
+        
         self.panel.SetSizerAndFit(guisizer)
         self.Layout()
         
@@ -764,7 +764,7 @@
                                       mainFrame = self)
         self.goutput = self.notebookpanel.goutput
         self.notebookpanel.OnUpdateValues = self.updateValuesHook
-        guisizer.Add (item = self.notebookpanel, proportion = 1, flag = wx.EXPAND)
+        guisizer.Add(item = self.notebookpanel, proportion = 1, flag = wx.EXPAND)
         
         # status bar
         status_text = _("Enter parameters for '") + self.task.name + "'"
@@ -803,7 +803,7 @@
             self.btn_run.SetToolTipString(_("Run the command (Ctrl+R)"))
             self.btn_run.SetDefault()
             # copy
-            self.btn_clipboard = wx.Button(parent = self.panel, id = wx.ID_COPY)
+            self.btn_clipboard = wx.Button(parent = self.panel, id = wx.ID_COPY, label = _("C&opy"))
             self.btn_clipboard.SetToolTipString(_("Copy the current command string to the clipboard (Ctrl+C)"))
             
             btnsizer.Add(item = self.btn_run, proportion = 0,
@@ -855,11 +855,6 @@
         self.Bind(wx.EVT_CLOSE,  self.OnCancel)
         self.Bind(wx.EVT_KEY_UP, self.OnKeyUp)
         
-        # constrained_size = self.notebookpanel.GetSize()
-        # 80 takes the tabbar into account
-        ### self.notebookpanel.SetSize((constrained_size[0] + 25, constrained_size[1])) 
-        ### self.notebookpanel.Layout()
-        
         # do layout
         # called automatically by SetSizer()
         self.panel.SetAutoLayout(True) 
@@ -1154,7 +1149,7 @@
             # if label is given: description -> tooltip
             if f.get('label','') !=  '':
                 title = text_beautify(f['label'])
-                tooltip = text_beautify (f['description'], width = -1)
+                tooltip = text_beautify(f['description'], width = -1)
             else:
                 title = text_beautify(f['description'])
                 tooltip = None
@@ -1215,7 +1210,7 @@
             # otherwise description -> lavel
             if p.get('label','') !=  '':
                 title = text_beautify(p['label'])
-                tooltip = text_beautify (p['description'], width = -1)
+                tooltip = text_beautify(p['description'], width = -1)
             else:
                 title = text_beautify(p['description'])
                 tooltip = None
@@ -1232,7 +1227,7 @@
                     p.get('multiple', False) and \
                     p.get('gisprompt',False) ==  False and \
                     p.get('type', '') ==  'string':
-                title_txt = wx.StaticBox (parent = which_panel, id = wx.ID_ANY)
+                title_txt = wx.StaticBox(parent = which_panel, id = wx.ID_ANY)
             else:
                 title_sizer = wx.BoxSizer(wx.HORIZONTAL)
                 title_txt = wx.StaticText(parent = which_panel)



More information about the grass-commit mailing list