[GRASS-SVN] r45752 - grass-addons/gui/wxpython/psmap/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Mar 25 14:08:12 EDT 2011
Author: martinl
Date: 2011-03-25 11:08:12 -0700 (Fri, 25 Mar 2011)
New Revision: 45752
Modified:
grass-addons/gui/wxpython/psmap/gui_modules/psmap.py
grass-addons/gui/wxpython/psmap/gui_modules/psmap_dialogs.py
Log:
wxGUI/ps.map: floatspin not available in wxPython 2.8.9.1
Modified: grass-addons/gui/wxpython/psmap/gui_modules/psmap.py
===================================================================
--- grass-addons/gui/wxpython/psmap/gui_modules/psmap.py 2011-03-25 14:46:02 UTC (rev 45751)
+++ grass-addons/gui/wxpython/psmap/gui_modules/psmap.py 2011-03-25 18:08:12 UTC (rev 45752)
@@ -47,9 +47,9 @@
import wx
try:
- from agw import flatnotebook as fnb
-except ImportError: # if it's not there locally, try the wxPython lib.
import wx.lib.agw.flatnotebook as fnb
+except ImportError:
+ import wx.lib.flatnotebook as fnb
Icons['psMap'] = {
'script' : MetaIcon(img = iconSet['ps-script'],
Modified: grass-addons/gui/wxpython/psmap/gui_modules/psmap_dialogs.py
===================================================================
--- grass-addons/gui/wxpython/psmap/gui_modules/psmap_dialogs.py 2011-03-25 14:46:02 UTC (rev 45751)
+++ grass-addons/gui/wxpython/psmap/gui_modules/psmap_dialogs.py 2011-03-25 18:08:12 UTC (rev 45752)
@@ -44,15 +44,10 @@
from wx.lib.mixins.listctrl import CheckListCtrlMixin, ListCtrlAutoWidthMixin
from wx.lib.expando import ExpandoTextCtrl, EVT_ETC_LAYOUT_NEEDED
try:
- from agw import floatspin as fs
-except ImportError: # if it's not there locally, try the wxPython lib.
import wx.lib.agw.floatspin as fs
+except ImportError:
+ fs = None
-try:
- from agw import flatnotebook as fnb
-except ImportError: # if it's not there locally, try the wxPython lib.
- import wx.lib.agw.flatnotebook as fnb
-
grass.set_raise_on_error(True)
class UnitConversion:
@@ -2903,11 +2898,15 @@
self.outlineCheck.SetValue(self.vPropertiesDict['color'] != 'none')
widthText = wx.StaticText(panel, id = wx.ID_ANY, label = _("Width (pts):"))
- self.widthSpin = fs.FloatSpin(panel, id = wx.ID_ANY, min_val = 0, max_val = 30,
- increment = 0.5, value = 1, extrastyle = fs.FS_RIGHT)
- self.widthSpin.SetFormat("%f")
- self.widthSpin.SetDigits(2)
-## self.widthSpin = wx.SpinCtrl(panel, id = wx.ID_ANY, min = 1, max = 25, initial = 1, size = self.spinCtrlSize)
+ if fs:
+ self.widthSpin = fs.FloatSpin(panel, id = wx.ID_ANY, min_val = 0, max_val = 30,
+ increment = 0.5, value = 1, extrastyle = fs.FS_RIGHT)
+ self.widthSpin.SetFormat("%f")
+ self.widthSpin.SetDigits(2)
+ else:
+ self.widthSpin = wx.SpinCtrl(panel, id = wx.ID_ANY, min = 1, max = 25, initial = 1,
+ size = self.spinCtrlSize)
+
self.widthSpin.SetValue(self.vPropertiesDict['width'] if self.vPropertiesDict['color'] != 'none' else 1)
colorText = wx.StaticText(panel, id = wx.ID_ANY, label = _("Color:"))
@@ -2992,12 +2991,15 @@
self.outlineCheck.SetToolTipString(_("No effect for fill color from table column"))
widthText = wx.StaticText(panel, id = wx.ID_ANY, label = _("Width (pts):"))
- self.outWidthSpin = fs.FloatSpin(panel, id = wx.ID_ANY, min_val = 0, max_val = 30,
- increment = 0.5, value = 1, extrastyle = fs.FS_RIGHT)
- self.outWidthSpin.SetFormat("%f")
- self.outWidthSpin.SetDigits(1)
-## self.widthSpin = wx.SpinCtrl(panel, id = wx.ID_ANY, min = 1, max = 25, initial = 1, size = self.spinCtrlSize)
-
+ if fs:
+ self.outWidthSpin = fs.FloatSpin(panel, id = wx.ID_ANY, min_val = 0, max_val = 30,
+ increment = 0.5, value = 1, extrastyle = fs.FS_RIGHT)
+ self.outWidthSpin.SetFormat("%f")
+ self.outWidthSpin.SetDigits(1)
+ else:
+ self.widthSpin = wx.SpinCtrl(panel, id = wx.ID_ANY, min = 1, max = 25, initial = 1,
+ size = self.spinCtrlSize)
+
self.outWidthSpin.SetValue(self.vPropertiesDict['hwidth'] if self.vPropertiesDict['hcolor'] != 'none' else 1)
colorText = wx.StaticText(panel, id = wx.ID_ANY, label = _("Color:"))
@@ -5254,4 +5256,4 @@
except grass.ScriptError:
#GError(_("Unable to get type of raster map"))
return None
- return rasterType
\ No newline at end of file
+ return rasterType
More information about the grass-commit
mailing list