[GRASS-SVN] r47168 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jul 18 13:55:03 EDT 2011


Author: annakrat
Date: 2011-07-18 10:55:03 -0700 (Mon, 18 Jul 2011)
New Revision: 47168

Modified:
   grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
   grass/trunk/gui/wxpython/gui_modules/nviz_tools.py
Log:
wxNviz: north arrow size -- textCtrl instead of spinCtrl (need floats)

Modified: grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py	2011-07-18 17:41:06 UTC (rev 47167)
+++ grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py	2011-07-18 17:55:03 UTC (rev 47168)
@@ -141,7 +141,11 @@
         self.nvizDefault = NvizDefault()
         self.light = copy.deepcopy(UserSettings.Get(group = 'nviz', key = 'light')) # copy
         self.decoration = self.nvizDefault.SetDecorDefaultProp()
-        self.decoration['arrow']['size'] = round(self._display.GetLongDim() / 8., -2)
+        arwSize = self._display.GetLongDim()/8.
+        coef = 0.01
+        if arwSize < 1:
+            coef = 100.
+        self.decoration['arrow']['size'] = int(arwSize * coef)/coef
         
         self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
         self.Bind(wx.EVT_SIZE,             self.OnSize)

Modified: grass/trunk/gui/wxpython/gui_modules/nviz_tools.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz_tools.py	2011-07-18 17:41:06 UTC (rev 47167)
+++ grass/trunk/gui/wxpython/gui_modules/nviz_tools.py	2011-07-18 17:55:03 UTC (rev 47168)
@@ -1724,11 +1724,11 @@
         gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
                                            label = _("Arrow size (in map units):")),
                       pos = (0,0), span = (1, 2), flag = wx.ALIGN_CENTER_VERTICAL)
-        sizeSpin = wx.SpinCtrl(parent = panel, id = wx.ID_ANY, size = (65, -1),
-                               min = 0, max = 1e6, initial = 1000)
-        gridSizer.Add(sizeSpin, pos = (0, 2))
-        self.win['decoration']['arrow']['size'] = sizeSpin.GetId()
-        sizeSpin.Bind(wx.EVT_SPINCTRL, self.OnArrowProp)
+        sizeCtrl = NumTextCtrl(parent = panel, id = wx.ID_ANY, size = (65, -1), style = wx.TE_PROCESS_ENTER)
+        gridSizer.Add(sizeCtrl, pos = (0, 2))
+        self.win['decoration']['arrow']['size'] = sizeCtrl.GetId()
+        sizeCtrl.Bind(wx.EVT_TEXT_ENTER, self.OnArrowProp)
+        sizeCtrl.Bind(wx.EVT_KILL_FOCUS, self.OnArrowProp)
         
         # color
         gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,



More information about the grass-commit mailing list