[GRASS-SVN] r55297 - in grass/branches/releasebranch_6_4/gui/wxpython: . gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Mar 9 23:55:54 PST 2013


Author: annakrat
Date: 2013-03-09 23:55:54 -0800 (Sat, 09 Mar 2013)
New Revision: 55297

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_core/dialogs.py
Log:
wxGUI/locwizard: add help button

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py	2013-03-09 23:27:17 UTC (rev 55296)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py	2013-03-10 07:55:54 UTC (rev 55297)
@@ -428,8 +428,10 @@
                                   message=_("Do you want to create new mapset?"),
                                   caption=_("Create new mapset"),
                                   defaultValue=self._getDefaultMapsetName(),
-                                  validator=GenericValidator(grass.legal_name, self._nameValidationFailed))
-
+                                  validator=GenericValidator(grass.legal_name, self._nameValidationFailed),
+                                  style=wx.OK | wx.CANCEL | wx.HELP)
+            help = dlg.FindWindowById(wx.ID_HELP)
+            help.Bind(wx.EVT_BUTTON, self.OnHelp)
             if dlg.ShowModal() == wx.ID_OK:
                 mapsetName = dlg.GetValue()
                 self.CreateNewMapset(mapsetName)

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_core/dialogs.py	2013-03-09 23:27:17 UTC (rev 55296)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_core/dialogs.py	2013-03-10 07:55:54 UTC (rev 55297)
@@ -2364,7 +2364,8 @@
     It differs from wx.TextEntryDialog because it allows adding validator.
     """
     def __init__(self, parent, message, caption='',
-                 defaultValue='', pos=wx.DefaultPosition, validator=wx.DefaultValidator):
+                 defaultValue='', pos=wx.DefaultPosition, validator=wx.DefaultValidator,
+                 style=wx.OK | wx.CANCEL):
         wx.Dialog.__init__(self, parent=parent, id=wx.ID_ANY, title=caption, pos=pos)
 
         vbox = wx.BoxSizer(wx.VERTICAL)
@@ -2377,7 +2378,7 @@
         vbox.Add(item=self._textCtrl, proportion=0, flag=wx.EXPAND | wx.LEFT | wx.RIGHT, border=10)
         self._textCtrl.SetFocus()
 
-        sizer = self.CreateSeparatedButtonSizer(wx.CANCEL | wx.OK)
+        sizer = self.CreateSeparatedButtonSizer(style)
         vbox.Add(item=sizer, proportion=1, flag=wx.EXPAND | wx.ALL, border=10)
 
         self.SetSizerAndFit(vbox)



More information about the grass-commit mailing list