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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Apr 17 05:06:31 EDT 2010


Author: martinl
Date: 2010-04-17 05:06:31 -0400 (Sat, 17 Apr 2010)
New Revision: 41904

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py
Log:
wxGUI/modeler: data size configurable
(merge r41903 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2010-04-17 09:01:40 UTC (rev 41903)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2010-04-17 09:06:31 UTC (rev 41904)
@@ -1128,13 +1128,17 @@
         
 class ModelData(ogl.EllipseShape):
     """!Data item class"""
-    def __init__(self, parent, x, y, name = '', value = '', prompt = '', width = 175, height = 50):
+    def __init__(self, parent, x, y, name = '', value = '', prompt = '', width = None, height = None):
         self.parent  = parent
         self.name    = name
         self.value   = value
         self.prompt  = prompt
         self.intermediate = False
         self.propWin = None
+        if not width:
+            width = UserSettings.Get(group='modeler', key='data', subkey=('size', 'width'))
+        if not height:
+            height = UserSettings.Get(group='modeler', key='data', subkey=('size', 'height'))
         
         self.actions = { 'from' : list(), 'to' : list() }
 
@@ -1928,14 +1932,51 @@
         panel = wx.Panel(parent = notebook, id = wx.ID_ANY)
         notebook.AddPage(page = panel, text = _("Data"))
         
+        # size
         border = wx.BoxSizer(wx.VERTICAL)
         box   = wx.StaticBox (parent = panel, id = wx.ID_ANY,
-                              label = " %s " % _("Data settings"))
+                              label = " %s " % _("Size settings"))
         sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
         
         gridSizer = wx.GridBagSizer (hgap=3, vgap=3)
         gridSizer.AddGrowableCol(0)
         
+        row = 0
+        gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
+                                         label = _("Width:")),
+                      flag = wx.ALIGN_LEFT |
+                      wx.ALIGN_CENTER_VERTICAL,
+                      pos = (row, 0))
+        
+        width = wx.SpinCtrl(parent = panel, id = wx.ID_ANY,
+                            min = 0, max = 500,
+                            initial = self.settings.Get(group='modeler', key='data', subkey=('size', 'width')))
+        width.SetName('GetValue')
+        self.winId['modeler:data:size:width'] = width.GetId()
+        
+        gridSizer.Add(item = width,
+                      flag = wx.ALIGN_RIGHT |
+                      wx.ALIGN_CENTER_VERTICAL,
+                      pos = (row, 1))
+
+        row += 1
+        gridSizer.Add(item = wx.StaticText(parent=panel, id=wx.ID_ANY,
+                                         label=_("Height:")),
+                      flag = wx.ALIGN_LEFT |
+                      wx.ALIGN_CENTER_VERTICAL,
+                      pos=(row, 0))
+        
+        height = wx.SpinCtrl(parent = panel, id = wx.ID_ANY,
+                             min = 0, max = 500,
+                             initial = self.settings.Get(group='modeler', key='data', subkey=('size', 'height')))
+        height.SetName('GetValue')
+        self.winId['modeler:data:size:height'] = height.GetId()
+        
+        gridSizer.Add(item = height,
+                      flag = wx.ALIGN_RIGHT |
+                      wx.ALIGN_CENTER_VERTICAL,
+                      pos = (row, 1))
+        
         sizer.Add(item=gridSizer, proportion=1, flag=wx.ALL | wx.EXPAND, border=5)
         border.Add(item=sizer, proportion=0, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=3)
         

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py	2010-04-17 09:01:40 UTC (rev 41903)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py	2010-04-17 09:06:31 UTC (rev 41904)
@@ -531,6 +531,12 @@
                         'height' : 50,
                         },
                     },
+                'data' : { 
+                    'size' : {
+                        'width' : 175,
+                        'height' : 50,
+                        },
+                    },
                 },
             }
         



More information about the grass-commit mailing list