[GRASS-SVN] r48867 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Oct 19 18:05:00 EDT 2011
Author: martinl
Date: 2011-10-19 15:04:59 -0700 (Wed, 19 Oct 2011)
New Revision: 48867
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py
Log:
wxGUI/modeler: update settings dialog
(merge r48865 from trunk)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py 2011-10-19 22:03:49 UTC (rev 48866)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py 2011-10-19 22:04:59 UTC (rev 48867)
@@ -3280,12 +3280,52 @@
settings = settings)
# create notebook pages
+ self._createGeneralPage(self.notebook)
self._createActionPage(self.notebook)
self._createDataPage(self.notebook)
-
+ self._createLoopPage(self.notebook)
+
self.SetMinSize(self.GetBestSize())
self.SetSize(self.size)
+ def _createGeneralPage(self, notebook):
+ """!Create notebook page for action settings"""
+ panel = wx.Panel(parent = notebook, id = wx.ID_ANY)
+ notebook.AddPage(page = panel, text = _("General"))
+
+ # colors
+ border = wx.BoxSizer(wx.VERTICAL)
+ box = wx.StaticBox (parent = panel, id = wx.ID_ANY,
+ label = " %s " % _("Item properties"))
+ 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 = _("Disabled:")),
+ flag = wx.ALIGN_LEFT |
+ wx.ALIGN_CENTER_VERTICAL,
+ pos = (row, 0))
+ rColor = csel.ColourSelect(parent = panel, id = wx.ID_ANY,
+ colour = self.settings.Get(group='modeler', key='disabled', subkey='color'),
+ size = globalvar.DIALOG_COLOR_SIZE)
+ rColor.SetName('GetColour')
+ self.winId['modeler:disabled:color'] = rColor.GetId()
+
+ gridSizer.Add(item = rColor,
+ 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)
+
+ panel.SetSizer(border)
+
+ return panel
+
def _createActionPage(self, notebook):
"""!Create notebook page for action settings"""
panel = wx.Panel(parent = notebook, id = wx.ID_ANY)
@@ -3294,7 +3334,7 @@
# colors
border = wx.BoxSizer(wx.VERTICAL)
box = wx.StaticBox (parent = panel, id = wx.ID_ANY,
- label = " %s " % _("Validity"))
+ label = " %s " % _("Color"))
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer (hgap = 3, vgap = 3)
@@ -3350,24 +3390,7 @@
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 = _("Disabled:")),
- flag = wx.ALIGN_LEFT |
- wx.ALIGN_CENTER_VERTICAL,
- pos = (row, 0))
- rColor = csel.ColourSelect(parent = panel, id = wx.ID_ANY,
- colour = self.settings.Get(group='modeler', key='action', subkey=('color', 'disabled')),
- size = globalvar.DIALOG_COLOR_SIZE)
- rColor.SetName('GetColour')
- self.winId['modeler:action:color:disabled'] = rColor.GetId()
- gridSizer.Add(item = rColor,
- 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)
@@ -3541,6 +3564,91 @@
return panel
+ def _createLoopPage(self, notebook):
+ """!Create notebook page for loop settings"""
+ panel = wx.Panel(parent = notebook, id = wx.ID_ANY)
+ notebook.AddPage(page = panel, text = _("Loop"))
+
+ # colors
+ border = wx.BoxSizer(wx.VERTICAL)
+ box = wx.StaticBox (parent = panel, id = wx.ID_ANY,
+ label = " %s " % _("Color"))
+ 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 = _("Valid:")),
+ flag = wx.ALIGN_LEFT |
+ wx.ALIGN_CENTER_VERTICAL,
+ pos = (row, 0))
+ vColor = csel.ColourSelect(parent = panel, id = wx.ID_ANY,
+ colour = self.settings.Get(group='modeler', key='loop', subkey=('color', 'valid')),
+ size = globalvar.DIALOG_COLOR_SIZE)
+ vColor.SetName('GetColour')
+ self.winId['modeler:loop:color:valid'] = vColor.GetId()
+
+ gridSizer.Add(item = vColor,
+ 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)
+
+ # size
+ box = wx.StaticBox (parent = panel, id = wx.ID_ANY,
+ label = " %s " % _("Shape size"))
+ 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='loop', subkey=('size', 'width')))
+ width.SetName('GetValue')
+ self.winId['modeler:loop: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='loop', subkey=('size', 'height')))
+ height.SetName('GetValue')
+ self.winId['modeler:loop: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)
+
+ panel.SetSizer(border)
+
+ return panel
+
def OnApply(self, event):
"""!Button 'Apply' pressed"""
PreferencesBaseDialog.OnApply(self, event)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py 2011-10-19 22:03:49 UTC (rev 48866)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py 2011-10-19 22:04:59 UTC (rev 48867)
@@ -1086,6 +1086,9 @@
else:
self.settings.Set(group, value, key, subkey)
+ if self.parent.GetName() == 'Modeler':
+ return True
+
#
# update default window dimension
#
More information about the grass-commit
mailing list