[GRASS-SVN] r60640 - grass/trunk/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Sat May 31 08:16:38 PDT 2014


Author: martinl
Date: 2014-05-31 08:16:38 -0700 (Sat, 31 May 2014)
New Revision: 60640

Modified:
   grass/trunk/gui/wxpython/gui_core/forms.py
   grass/trunk/gui/wxpython/gui_core/gselect.py
Log:
wxGUI: add SeperatorSelect widget


Modified: grass/trunk/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/forms.py	2014-05-31 15:13:53 UTC (rev 60639)
+++ grass/trunk/gui/wxpython/gui_core/forms.py	2014-05-31 15:16:38 UTC (rev 60640)
@@ -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/trunk/gui/wxpython/gui_core/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/gselect.py	2014-05-31 15:13:53 UTC (rev 60639)
+++ grass/trunk/gui/wxpython/gui_core/gselect.py	2014-05-31 15:16:38 UTC (rev 60640)
@@ -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'])



More information about the grass-commit mailing list