[GRASS-SVN] r60738 - in grass/branches/releasebranch_7_0: gui/wxpython/gui_core lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jun 8 01:37:53 PDT 2014


Author: martinl
Date: 2014-06-08 01:37:52 -0700 (Sun, 08 Jun 2014)
New Revision: 60738

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/gui_core/forms.py
   grass/branches/releasebranch_7_0/gui/wxpython/gui_core/gselect.py
   grass/branches/releasebranch_7_0/lib/gis/parser_standard_options.c
Log:
 wxGUI: add SeperatorSelect? widget
 libgis: define gisprompt for G_OPT_F_SEP
         (merge r60640-1 from trunk)


Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/forms.py	2014-06-08 08:28:23 UTC (rev 60737)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/forms.py	2014-06-08 08:37:52 UTC (rev 60738)
@@ -1135,6 +1135,7 @@
                 if p.get('prompt','') not in ('color',
                                               'subgroup',
                                               'sigfile',
+                                              'separator',
                                               'dbdriver',
                                               'dbname',
                                               'dbtable',
@@ -1300,6 +1301,17 @@
                     which_sizer.Add(item = selection, proportion = 0,
                                     flag = wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.TOP | wx.ALIGN_CENTER_VERTICAL,
                                     border = 5)
+
+                # separator
+                elif prompt == 'separator':
+                    win = gselect.SeparatorSelect(parent = which_panel)
+                    value = self._getValue(p)
+                    win.SetValue(value)
+                    p['wxId'] = [ win.GetId() ]
+                    win.Bind(wx.EVT_TEXT, self.OnSetValue)
+                    which_sizer.Add(item = win, proportion = 0,
+                                    flag = wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.TOP | wx.ALIGN_CENTER_VERTICAL,
+                                    border = 5)
                 
                 # layer, dbdriver, dbname, dbcolumn, dbtable entry
                 elif prompt in ('dbdriver',
@@ -1595,7 +1607,7 @@
                     cb.GetTextCtrl().Bind(wx.EVT_TEXT, self.OnSetValue)
                     if p.get('guidependency', ''):
                         cb.Bind(wx.EVT_COMBOBOX, self.OnUpdateSelection)
-                
+
             if self.parent.GetName() == 'MainFrame' and (self._giface and hasattr(self._giface, "_model")):
                 parChk = wx.CheckBox(parent = which_panel, id = wx.ID_ANY,
                                      label = _("Parameterized in model"))

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/gselect.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/gselect.py	2014-06-08 08:28:23 UTC (rev 60737)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/gselect.py	2014-06-08 08:37:52 UTC (rev 60738)
@@ -25,6 +25,7 @@
  - gselect::OgrTypeSelect
  - gselect::CoordinatesSelect
  - gselect::SignatureSelect
+ - gselect::SeparatorSelect
 
 (C) 2007-2014 by the GRASS Development Team 
 
@@ -2301,3 +2302,12 @@
         except OSError:
             self.SetItems([])
         self.SetValue('')
+
+class SeparatorSelect(wx.ComboBox):
+    """!Widget for selecting seperator"""
+    def __init__(self, parent, id = wx.ID_ANY, size = globalvar.DIALOG_GSELECT_SIZE, 
+                 **kwargs):
+        super(SeparatorSelect, self).__init__(parent, id, size = size, 
+                                              **kwargs)
+        self.SetName("SeparatorSelect")
+        self.SetItems(['pipe', 'comma', 'space', 'tab', 'newline'])

Modified: grass/branches/releasebranch_7_0/lib/gis/parser_standard_options.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/gis/parser_standard_options.c	2014-06-08 08:28:23 UTC (rev 60737)
+++ grass/branches/releasebranch_7_0/lib/gis/parser_standard_options.c	2014-06-08 08:37:52 UTC (rev 60738)
@@ -544,6 +544,7 @@
 	Opt->type = TYPE_STRING;
 	Opt->key_desc = "character";
 	Opt->required = NO;
+        Opt->gisprompt = "old,separator,separator";
 	Opt->answer = "pipe";
 	Opt->label = _("Field separator");
 	Opt->description = _("Special characters: pipe, comma, space, tab, newline");



More information about the grass-commit mailing list