[GRASS-SVN] r35440 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jan 16 15:02:35 EST 2009


Author: martinl
Date: 2009-01-16 15:02:35 -0500 (Fri, 16 Jan 2009)
New Revision: 35440

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/workspace.py
Log:
wxGUI: grc2gwx: gridline support added
      (merge from relbr64, r35438)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py	2009-01-16 19:57:52 UTC (rev 35439)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py	2009-01-16 20:02:35 UTC (rev 35440)
@@ -10,7 +10,7 @@
  - TextLayerDialog 
  - LoadMapLayersDialog
  - MultiImportDialog
- - LayerList (used by MultiImport) 
+ - LayersList (used by MultiImport) 
  - SetOpacityDialog
 
 (C) 2008 by the GRASS Development Team

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2009-01-16 19:57:52 UTC (rev 35439)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2009-01-16 20:02:35 UTC (rev 35440)
@@ -1072,13 +1072,20 @@
                                 maxValue = 1e6
                             txt2 = wx.SpinCtrl(parent=which_panel, id=wx.ID_ANY, size=globalvar.DIALOG_SPIN_SIZE,
                                                min=minValue, max=maxValue)
+                            txt2.SetName("SpinCtrl")
                             style = wx.BOTTOM | wx.LEFT
                         else:
                             txt2 = wx.TextCtrl(parent=which_panel, value = p.get('default',''))
+                            txt.SetName("TextCtrl")
                             style = wx.EXPAND | wx.BOTTOM | wx.LEFT
                         
-                        if p.get('value','') != '':
-                            txt2.SetValue(p['value']) # parameter previously set
+                        if p.get('value', '') != '':
+                            # parameter previously set
+                            if txt2.GetName() == "SpinCtrl":
+                                txt2.SetValue(int(p['value']))
+                            else:
+                                txt2.SetValue(p['value'])
+                        
                         which_sizer.Add(item=txt2, proportion=0,
                                         flag=style, border=5)
 

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/workspace.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/workspace.py	2009-01-16 19:57:52 UTC (rev 35439)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/workspace.py	2009-01-16 20:02:35 UTC (rev 35440)
@@ -664,7 +664,9 @@
                 self.inVector = False
             elif self.inGroup:
                 self.inGroup = False
-
+            elif self.inGridline:
+                self.inGridline = False
+        
         elif element == 'opacity':
             self.layers[-1]['opacity'] = float(self._get_value(line))
 
@@ -783,6 +785,64 @@
             if value != '':
                 self.layers[-1]['cmd'].append('cats=%s' % value)
 
+        # gridline
+        elif element == 'gridline':
+            self.inGridline = True
+            self.layers.append({
+                    "type"    : 'grid',
+                    "name"    : self._get_value(line),
+                    "checked" : None,
+                    "opacity" : None,
+                    "cmd"     : ['d.grid'],
+                    "group"   : self.inGroup,
+                    "display" : 0})
+
+        elif element == 'gridcolor':
+            value = self._get_value(line)
+            if value != '':
+                self.layers[-1]['cmd'].append('color=%s' % self._color_name_to_rgb(value))
+
+        elif element == 'gridborder':
+            value = self._get_value(line)
+            if value != '':
+                self.layers[-1]['cmd'].append('bordercolor=%s' % self._color_name_to_rgb(value))
+
+        elif element == 'textcolor':
+            value = self._get_value(line)
+            if value != '':
+                self.layers[-1]['cmd'].append('textcolor=%s' % self._color_name_to_rgb(value))
+
+        elif element in ('gridsize',
+                         'gridorigin'):
+            value = self._get_value(line)
+            if value != '':
+                self.layers[-1]['cmd'].append('%s=%s' % (element[4:], value))
+
+        elif element in 'fontsize':
+            value = self._get_value(line)
+            if value != '':
+                self.layers[-1]['cmd'].append('%s=%s' % (element, value))
+        
+        elif element == 'griddraw':
+            value = self._get_value(line)
+            if value == '0':
+                self.layers[-1]['cmd'].append('-n')
+                
+        elif element == 'gridgeo':
+            value = self._get_value(line)
+            if value == '1':
+                self.layers[-1]['cmd'].append('-g')
+        
+        elif element == 'borderdraw':
+            value = self._get_value(line)
+            if value == '0':
+                self.layers[-1]['cmd'].append('-b')
+
+        elif element == 'textdraw':
+            value = self._get_value(line)
+            if value == '0':
+                self.layers[-1]['cmd'].append('-t')
+        
         else:
             self.error += _(' row %d:') % line_id + line + os.linesep
             self.num_error += 1



More information about the grass-commit mailing list