[GRASS-SVN] r58067 - in grass/branches/develbranch_6/gui/wxpython: . dbmgr gcp gmodeler gui_core location_wizard mapdisp modules nviz psmap vdigit wxplot
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Oct 19 19:10:52 PDT 2013
Author: annakrat
Date: 2013-10-19 19:10:52 -0700 (Sat, 19 Oct 2013)
New Revision: 58067
Modified:
grass/branches/develbranch_6/gui/wxpython/dbmgr/manager.py
grass/branches/develbranch_6/gui/wxpython/gcp/manager.py
grass/branches/develbranch_6/gui/wxpython/gis_set.py
grass/branches/develbranch_6/gui/wxpython/gmodeler/frame.py
grass/branches/develbranch_6/gui/wxpython/gmodeler/model.py
grass/branches/develbranch_6/gui/wxpython/gui_core/dialogs.py
grass/branches/develbranch_6/gui/wxpython/gui_core/ghelp.py
grass/branches/develbranch_6/gui/wxpython/gui_core/gselect.py
grass/branches/develbranch_6/gui/wxpython/gui_core/preferences.py
grass/branches/develbranch_6/gui/wxpython/gui_core/widgets.py
grass/branches/develbranch_6/gui/wxpython/location_wizard/wizard.py
grass/branches/develbranch_6/gui/wxpython/mapdisp/main.py
grass/branches/develbranch_6/gui/wxpython/mapdisp/mapwindow.py
grass/branches/develbranch_6/gui/wxpython/mapdisp/statusbar.py
grass/branches/develbranch_6/gui/wxpython/modules/colorrules.py
grass/branches/develbranch_6/gui/wxpython/modules/histogram.py
grass/branches/develbranch_6/gui/wxpython/nviz/mapwindow.py
grass/branches/develbranch_6/gui/wxpython/nviz/tools.py
grass/branches/develbranch_6/gui/wxpython/psmap/dialogs.py
grass/branches/develbranch_6/gui/wxpython/psmap/frame.py
grass/branches/develbranch_6/gui/wxpython/psmap/utils.py
grass/branches/develbranch_6/gui/wxpython/vdigit/wxdisplay.py
grass/branches/develbranch_6/gui/wxpython/wxgui.py
grass/branches/develbranch_6/gui/wxpython/wxplot/base.py
grass/branches/develbranch_6/gui/wxpython/wxplot/profile.py
Log:
wxGUI: make it compatible with wxpython 2.9 (merge from releasebranch, r58066)
Modified: grass/branches/develbranch_6/gui/wxpython/dbmgr/manager.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/dbmgr/manager.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/dbmgr/manager.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -770,7 +770,6 @@
label = "")
sqlFlexSizer = wx.FlexGridSizer (cols = 3, hgap = 5, vgap = 5)
- sqlFlexSizer.AddGrowableCol(1)
sqlFlexSizer.Add(item = sqlSimple,
flag = wx.ALIGN_CENTER_VERTICAL)
@@ -794,6 +793,7 @@
flag = wx.EXPAND)
sqlFlexSizer.Add(item = btnSqlBuilder,
flag = wx.ALIGN_RIGHT)
+ sqlFlexSizer.AddGrowableCol(1)
sqlSizer.Add(item = sqlFlexSizer,
flag = wx.ALL | wx.EXPAND,
@@ -2517,7 +2517,6 @@
# data area
dataSizer = wx.GridBagSizer(hgap = 5, vgap = 5)
- dataSizer.AddGrowableCol(1)
row = 0
for key in ('layer', 'driver', 'database', 'table', 'key', 'addCat'):
label, value = self.addLayerWidgets[key]
@@ -2542,6 +2541,7 @@
flag = style, pos = (row, 1))
row += 1
+ dataSizer.AddGrowableCol(1)
layerSizer.Add(item = dataSizer,
proportion = 1,
@@ -2571,13 +2571,13 @@
# data area
dataSizer = wx.FlexGridSizer(cols = 2, hgap = 5, vgap = 5)
- dataSizer.AddGrowableCol(1)
for key in ['table', 'key']:
label, value = self.tableWidgets[key]
dataSizer.Add(item = label,
flag = wx.ALIGN_CENTER_VERTICAL)
dataSizer.Add(item = value,
flag = wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)
+ dataSizer.AddGrowableCol(1)
tableSizer.Add(item = dataSizer,
proportion = 1,
@@ -2643,12 +2643,12 @@
dataSizer = wx.BoxSizer(wx.VERTICAL)
flexSizer = wx.FlexGridSizer(cols = 2, hgap = 5, vgap = 5)
- flexSizer.AddGrowableCol(2)
flexSizer.Add(item = label,
flag = wx.ALIGN_CENTER_VERTICAL)
flexSizer.Add(item = self.deleteLayer,
flag = wx.ALIGN_CENTER_VERTICAL)
+ flexSizer.AddGrowableCol(1)
dataSizer.Add(item = flexSizer,
proportion = 0,
@@ -2758,7 +2758,6 @@
# data area
dataSizer = wx.FlexGridSizer(cols = 2, hgap = 5, vgap = 5)
- dataSizer.AddGrowableCol(1)
for key in ('layer', 'driver', 'database', 'table', 'key'):
label, value = self.modifyLayerWidgets[key]
dataSizer.Add(item = label,
@@ -2769,6 +2768,7 @@
else:
dataSizer.Add(item = value,
flag = wx.ALIGN_CENTER_VERTICAL)
+ dataSizer.AddGrowableCol(1)
pageSizer.Add(item = dataSizer,
proportion = 1,
Modified: grass/branches/develbranch_6/gui/wxpython/gcp/manager.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gcp/manager.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/gcp/manager.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -307,7 +307,6 @@
#
# layout
#
- self.sizer.AddGrowableCol(2)
# map type
self.rb_maptype = wx.RadioBox(parent=self, id=wx.ID_ANY,
label=' %s ' % _("Map type to georectify"),
@@ -336,6 +335,7 @@
flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
pos=(3,2))
+ self.sizer.AddGrowableCol(2)
#
# bindings
#
@@ -429,7 +429,6 @@
#
# layout
#
- self.sizer.AddGrowableCol(2)
# group
self.sizer.Add(item=wx.StaticText(parent=self, id=wx.ID_ANY, label=_('Select group:')),
flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
@@ -467,6 +466,7 @@
self.sizer.Add(item=self.ext_txt,
flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
pos=(3, 2))
+ self.sizer.AddGrowableCol(2)
#
# bindings
@@ -514,7 +514,7 @@
self.OnEnterPage()
def OnExtension(self, event):
- self.extension = event.GetString()
+ self.extension = self.ext_txt.GetValue()
def OnPageChanging(self, event=None):
if event.GetDirection() and self.xygroup == '':
@@ -635,7 +635,7 @@
global src_map
global maptype
- src_map = event.GetString()
+ src_map = self.srcselection.GetValue()
if src_map == '':
wx.FindWindowById(wx.ID_FORWARD).Enable(False)
@@ -659,7 +659,7 @@
"""!Source map to display selected"""
global tgt_map
- tgt_map = event.GetString()
+ tgt_map = self.tgtselection.GetValue()
def OnPageChanging(self, event=None):
global src_map
@@ -2397,7 +2397,6 @@
sizer = wx.BoxSizer(wx.VERTICAL)
rmsgridSizer = wx.GridBagSizer(vgap=5, hgap=5)
- rmsgridSizer.AddGrowableCol(1)
# highlight only highest forward RMS error
self.highlighthighest = wx.CheckBox(parent=panel, id=wx.ID_ANY,
@@ -2421,13 +2420,13 @@
self.symbol['sdfactor'] = self.rmsWin.GetId()
rmsgridSizer.Add(item=self.rmsWin, flag=wx.ALIGN_RIGHT, pos=(1, 1))
+ rmsgridSizer.AddGrowableCol(1)
sizer.Add(item=rmsgridSizer, flag=wx.EXPAND | wx.ALL, border=5)
box = wx.StaticBox(parent=panel, id=wx.ID_ANY,
label=" %s " % _("Symbol settings"))
boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer(vgap=5, hgap=5)
- gridSizer.AddGrowableCol(1)
#
# general symbol color
@@ -2534,6 +2533,7 @@
gridSizer.Add(item=widWin,
flag=wx.ALIGN_RIGHT,
pos=(row, 1))
+ gridSizer.AddGrowableCol(1)
boxSizer.Add(item=gridSizer, flag=wx.EXPAND)
sizer.Add(item=boxSizer, flag=wx.EXPAND | wx.ALL, border=5)
@@ -2596,7 +2596,6 @@
# interpolation method
gridSizer = wx.GridBagSizer(vgap=5, hgap=5)
- gridSizer.AddGrowableCol(1)
gridSizer.Add(item=wx.StaticText(parent=panel, id=wx.ID_ANY, label=_('Select interpolation method:')),
pos=(0,0), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5)
self.grmethod = wx.Choice(parent=panel, id=wx.ID_ANY,
@@ -2604,6 +2603,7 @@
gridSizer.Add(item=self.grmethod, pos=(0,1),
flag=wx.ALIGN_RIGHT, border=5)
self.grmethod.SetStringSelection(self.parent.gr_method)
+ gridSizer.AddGrowableCol(1)
sizer.Add(item=gridSizer, flag=wx.EXPAND | wx.ALL, border=5)
# clip to region
@@ -2642,9 +2642,11 @@
def OnSDFactor(self,event):
"""!New factor for RMS threshold = M + SD * factor"""
+ try:
+ self.sdfactor = float(self.rmsWin.GetValue())
+ except ValueError:
+ return
- self.sdfactor = float(event.GetString())
-
if self.sdfactor <= 0:
GError(parent = self,
message=_('RMS threshold factor must be > 0'))
@@ -2657,7 +2659,7 @@
"""!Source map to display selected"""
global src_map
- tmp_map = event.GetString()
+ tmp_map = self.srcselection.GetValue()
if not tmp_map == '' and not tmp_map == src_map:
self.new_src_map = tmp_map
@@ -2666,7 +2668,7 @@
"""!Target map to display selected"""
global tgt_map
- tmp_map = event.GetString()
+ tmp_map = self.tgtselection.GetValue()
if not tmp_map == tgt_map:
self.new_tgt_map = tmp_map
@@ -2678,7 +2680,7 @@
self.parent.clip_to_region = event.IsChecked()
def OnExtension(self, event):
- self.parent.extension = event.GetString()
+ self.parent.extension = self.ext_txt.GetValue()
def UpdateSettings(self):
global src_map
Modified: grass/branches/develbranch_6/gui/wxpython/gis_set.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gis_set.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/gis_set.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -977,7 +977,8 @@
"""!Start-up application"""
def OnInit(self):
- wx.InitAllImageHandlers()
+ if not globalvar.CheckWxVersion([2, 9]):
+ wx.InitAllImageHandlers()
StartUp = GRASSStartup()
StartUp.CenterOnScreen()
self.SetTopWindow(StartUp)
Modified: grass/branches/develbranch_6/gui/wxpython/gmodeler/frame.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gmodeler/frame.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/gmodeler/frame.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -1052,7 +1052,8 @@
shape = self.GetShape()
canvas = shape.GetCanvas()
dc = wx.ClientDC(canvas)
- canvas.PrepareDC(dc)
+ # probably does nothing, removed from wxPython 2.9
+ # canvas.PrepareDC(dc)
if hasattr(self.frame, 'defineRelation'):
drel = self.frame.defineRelation
@@ -1355,7 +1356,6 @@
addSizer = wx.StaticBoxSizer(self.addBox, wx.VERTICAL)
gridSizer = wx.GridBagSizer(hgap = 5, vgap = 5)
- gridSizer.AddGrowableCol(1)
gridSizer.Add(item = wx.StaticText(parent = self, id = wx.ID_ANY,
label = "%s:" % _("Name")),
flag = wx.ALIGN_CENTER_VERTICAL,
@@ -1383,6 +1383,7 @@
gridSizer.Add(item = self.desc,
pos = (2, 1), span = (1, 3),
flag = wx.EXPAND)
+ gridSizer.AddGrowableCol(1)
addSizer.Add(item = gridSizer,
flag = wx.EXPAND)
addSizer.Add(item = self.btnAdd, proportion = 0,
Modified: grass/branches/develbranch_6/gui/wxpython/gmodeler/model.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gmodeler/model.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/gmodeler/model.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -901,7 +901,7 @@
color = UserSettings.Get(group='modeler', key='action',
subkey=('color', 'invalid'))
- wxColor = wx.Color(color[0], color[1], color[2])
+ wxColor = wx.Colour(color[0], color[1], color[2])
self.SetBrush(wx.Brush(wxColor))
def _setPen(self):
@@ -1203,7 +1203,7 @@
else:
color = UserSettings.Get(group = 'modeler', key = 'action',
subkey = ('color', 'invalid'))
- wxColor = wx.Color(color[0], color[1], color[2])
+ wxColor = wx.Colour(color[0], color[1], color[2])
self.SetBrush(wx.Brush(wxColor))
def _setPen(self):
@@ -1395,7 +1395,7 @@
color = UserSettings.Get(group='modeler', key='loop',
subkey=('color', 'valid'))
- wxColor = wx.Color(color[0], color[1], color[2])
+ wxColor = wx.Colour(color[0], color[1], color[2])
self.SetBrush(wx.Brush(wxColor))
def Enable(self, enabled = True):
Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/dialogs.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/dialogs.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -1240,8 +1240,6 @@
def _createDialogBody(self):
bodySizer = wx.GridBagSizer(vgap = 3, hgap = 3)
- bodySizer.AddGrowableCol(1)
- bodySizer.AddGrowableRow(3)
# layer type
bodySizer.Add(item = wx.StaticText(parent = self, label = _("Map type:")),
@@ -1306,6 +1304,8 @@
flag = wx.EXPAND,
pos = (3,1), span = (1, 2))
+ bodySizer.AddGrowableCol(1)
+ bodySizer.AddGrowableRow(3)
# bindings
self.layerType.Bind(wx.EVT_CHOICE, self.OnChangeParams)
self.mapset.Bind(wx.EVT_COMBOBOX, self.OnChangeParams)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/ghelp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/ghelp.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/ghelp.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -86,7 +86,6 @@
"""!Do layout"""
sizer = wx.StaticBoxSizer(self.box, wx.HORIZONTAL)
gridSizer = wx.GridBagSizer(hgap = 3, vgap = 3)
- gridSizer.AddGrowableCol(1)
gridSizer.Add(item = self.searchBy,
flag = wx.ALIGN_CENTER_VERTICAL, pos = (0, 0))
@@ -102,6 +101,7 @@
flag = wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, pos = (row, 0), span = (1, 2))
row += 1
+ gridSizer.AddGrowableCol(1)
sizer.Add(item = gridSizer, proportion = 1)
self.SetSizer(sizer)
@@ -596,7 +596,8 @@
in the Panel.
"""
self.parent = parent
- wx.InitAllImageHandlers()
+ if not globalvar.CheckWxVersion([2, 9]):
+ wx.InitAllImageHandlers()
wx.html.HtmlWindow.__init__(self, parent = parent, **kwargs)
self.loaded = False
Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/gselect.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/gselect.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/gselect.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -1307,8 +1307,6 @@
inputSizer = wx.StaticBoxSizer(self.inputBox, wx.HORIZONTAL)
self.dsnSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
- #self.dsnSizer.AddGrowableRow(0)
- self.dsnSizer.AddGrowableCol(3)
row = 0
self.dsnSizer.Add(item = wx.StaticText(parent = self, id = wx.ID_ANY,
@@ -1341,6 +1339,7 @@
flag = wx.ALIGN_CENTER_VERTICAL | wx.EXPAND,
pos = (row, 1), span = (1, 3))
row += 1
+ self.dsnSizer.AddGrowableCol(3)
inputSizer.Add(item=self.dsnSizer, proportion = 1,
flag=wx.EXPAND | wx.BOTTOM, border = 10)
@@ -1484,14 +1483,17 @@
return data
def OnSetType(self, event, sel = None):
- """!Datasource type changed"""
+ """!Datasource type changed.
+
+ @todo improve showing/hiding widgets
+ """
if event:
sel = event.GetSelection()
else:
self.source.SetSelection(sel)
win = self.input[self.dsnType][1]
if win:
- self.dsnSizer.Remove(win)
+ self.dsnSizer.Detach(win)
win.Hide()
if sel == self.sourceMap['file']: # file
@@ -1675,7 +1677,7 @@
return
win = self.input[self.dsnType][1]
- self.dsnSizer.Remove(win)
+ self.dsnSizer.Detach(win)
if self.dsnType == 'file':
win.Destroy()
Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/preferences.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/preferences.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/preferences.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -277,7 +277,6 @@
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer (hgap = 3, vgap = 3)
- gridSizer.AddGrowableCol(0)
#
# ask when removing map layer from layer tree
@@ -334,6 +333,7 @@
gridSizer.Add(item = copySelectedTextToClipboard,
pos = (row, 0), span = (1, 2))
+ gridSizer.AddGrowableCol(0)
sizer.Add(item = gridSizer, proportion = 1, flag = wx.ALL | wx.EXPAND, border = 5)
border.Add(item = sizer, proportion = 0, flag = wx.ALL | wx.EXPAND, border = 3)
@@ -345,7 +345,6 @@
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer (hgap = 3, vgap = 3)
- gridSizer.AddGrowableCol(0)
row = 0
posDisplay = wx.CheckBox(parent = panel, id = wx.ID_ANY,
@@ -381,6 +380,7 @@
gridSizer.Add(item = defaultPos,
pos = (row, 0), span = (1, 2))
+ gridSizer.AddGrowableCol(0)
sizer.Add(item = gridSizer, proportion = 1, flag = wx.ALL | wx.EXPAND, border = 5)
border.Add(item = sizer, proportion = 0, flag = wx.ALL | wx.EXPAND, border = 3)
@@ -406,7 +406,6 @@
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer (hgap = 3, vgap = 3)
- gridSizer.AddGrowableCol(0)
#
# font settings
@@ -425,6 +424,7 @@
gridSizer.Add(item = outfontButton,
flag = wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL,
pos = (row, 1))
+ gridSizer.AddGrowableCol(0)
#
# languages
@@ -433,7 +433,6 @@
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer (hgap = 3, vgap = 3)
- gridSizer.AddGrowableCol(0)
sizer.Add(item = gridSizer, proportion = 1, flag = wx.ALL | wx.EXPAND, border = 5)
border.Add(item = sizer, proportion = 0, flag = wx.ALL | wx.EXPAND, border = 3)
@@ -456,6 +455,7 @@
flag = wx.ALIGN_RIGHT |
wx.ALIGN_CENTER_VERTICAL,
pos = (row, 1))
+ gridSizer.AddGrowableCol(0)
#
# appearence
#
@@ -463,7 +463,6 @@
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer (hgap = 3, vgap = 3)
- gridSizer.AddGrowableCol(0)
#
# element list
@@ -555,6 +554,7 @@
flag = wx.ALIGN_RIGHT |
wx.ALIGN_CENTER_VERTICAL,
pos = (row, 1))
+ gridSizer.AddGrowableCol(0)
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)
@@ -578,7 +578,6 @@
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer (hgap = 3, vgap = 3)
- gridSizer.AddGrowableCol(0)
#
# font settings
@@ -595,6 +594,7 @@
flag = wx.ALIGN_RIGHT |
wx.ALIGN_CENTER_VERTICAL,
pos = (row, 1))
+ gridSizer.AddGrowableCol(0)
sizer.Add(item = gridSizer, proportion = 1, flag = wx.ALL | wx.EXPAND, border = 5)
border.Add(item = sizer, proportion = 0, flag = wx.ALL | wx.EXPAND, border = 3)
@@ -606,7 +606,6 @@
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer (hgap = 3, vgap = 3)
- gridSizer.AddGrowableCol(0)
#
@@ -762,6 +761,7 @@
gridSizer.Add(item = scrollDir,
flag = wx.ALIGN_RIGHT,
pos = (row, 1))
+ gridSizer.AddGrowableCol(0)
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)
@@ -818,7 +818,6 @@
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer (hgap = 3, vgap = 3)
- gridSizer.AddGrowableCol(0)
#
# command dialog settings
@@ -879,6 +878,7 @@
gridSizer.Add(item = verbosity,
pos = (row, 1), flag = wx.ALIGN_RIGHT)
+ gridSizer.AddGrowableCol(0)
sizer.Add(item = gridSizer, proportion = 1, flag = wx.ALL | wx.EXPAND, border = 5)
border.Add(item = sizer, proportion = 0, flag = wx.ALL | wx.EXPAND, border = 3)
@@ -890,7 +890,6 @@
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer (hgap = 3, vgap = 3)
- gridSizer.AddGrowableCol(0)
#
# raster overlay
@@ -927,6 +926,7 @@
gridSizer.Add(item = rasterCTName,
pos = (row, 1))
+ gridSizer.AddGrowableCol(0)
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)
@@ -975,7 +975,6 @@
highlightSizer = wx.StaticBoxSizer(highlightBox, wx.VERTICAL)
flexSizer = wx.FlexGridSizer (cols = 2, hgap = 5, vgap = 5)
- flexSizer.AddGrowableCol(0)
label = wx.StaticText(parent = panel, id = wx.ID_ANY, label = _("Color:"))
hlColor = csel.ColourSelect(parent = panel, id = wx.ID_ANY,
@@ -995,6 +994,7 @@
flexSizer.Add(label, proportion = 0, flag = wx.ALIGN_CENTER_VERTICAL)
flexSizer.Add(hlWidth, proportion = 0, flag = wx.ALIGN_RIGHT | wx.FIXED_MINSIZE)
+ flexSizer.AddGrowableCol(0)
highlightSizer.Add(item = flexSizer,
proportion = 0,
@@ -1014,7 +1014,6 @@
dataBrowserSizer = wx.StaticBoxSizer(dataBrowserBox, wx.VERTICAL)
flexSizer = wx.FlexGridSizer (cols = 2, hgap = 5, vgap = 5)
- flexSizer.AddGrowableCol(0)
label = wx.StaticText(parent = panel, id = wx.ID_ANY, label = _("Left mouse double click:"))
leftDbClick = wx.Choice(parent = panel, id = wx.ID_ANY,
choices = self.settings.Get(group = 'atm', key = 'leftDbClick', subkey = 'choices', internal = True),
@@ -1044,6 +1043,7 @@
self.winId['atm:askOnDeleteRec:enabled'] = askOnDeleteRec.GetId()
flexSizer.Add(askOnDeleteRec, proportion = 0)
+ flexSizer.AddGrowableCol(0)
dataBrowserSizer.Add(item = flexSizer,
proportion = 0,
@@ -1063,7 +1063,6 @@
createTableSizer = wx.StaticBoxSizer(createTableBox, wx.VERTICAL)
flexSizer = wx.FlexGridSizer (cols = 2, hgap = 5, vgap = 5)
- flexSizer.AddGrowableCol(0)
label = wx.StaticText(parent = panel, id = wx.ID_ANY,
label = _("Key column:"))
@@ -1074,6 +1073,7 @@
flexSizer.Add(label, proportion = 0, flag = wx.ALIGN_CENTER_VERTICAL)
flexSizer.Add(keyColumn, proportion = 0, flag = wx.ALIGN_RIGHT | wx.FIXED_MINSIZE)
+ flexSizer.AddGrowableCol(0)
createTableSizer.Add(item = flexSizer,
proportion = 0,
@@ -1104,7 +1104,6 @@
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer (hgap = 3, vgap = 3)
- gridSizer.AddGrowableCol(1)
# note for users expecting on-the-fly data reprojection
row = 0
@@ -1184,6 +1183,7 @@
gridSizer.Add(item = epsgLoad,
flag = wx.ALIGN_RIGHT,
pos = (row, 1))
+ gridSizer.AddGrowableCol(1)
sizer.Add(item = gridSizer, proportion = 1, flag = wx.ALL | wx.EXPAND, border = 5)
border.Add(item = sizer, proportion = 0, flag = wx.ALL | wx.EXPAND, border = 3)
@@ -1195,7 +1195,6 @@
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer (hgap = 3, vgap = 3)
- gridSizer.AddGrowableCol(2)
row = 0
# ll format
@@ -1226,6 +1225,7 @@
gridSizer.Add(item = precision,
flag = wx.ALIGN_CENTER_VERTICAL,
pos = (row, 2))
+ gridSizer.AddGrowableCol(2)
sizer.Add(item = gridSizer, proportion = 1, flag = wx.ALL | wx.EXPAND, border = 5)
@@ -1413,7 +1413,6 @@
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer (hgap = 5, vgap = 5)
- gridSizer.AddGrowableCol(0)
label = wx.StaticText(parent = panel, id = wx.ID_ANY,
label = _("Select font:"))
@@ -1478,6 +1477,7 @@
if self.font:
self.fontlb.SetStringSelection(self.font, True)
+ gridSizer.AddGrowableCol(0)
sizer.Add(item = gridSizer, proportion = 1,
flag = wx.EXPAND | wx.ALL,
border = 5)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/widgets.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/widgets.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/widgets.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -182,7 +182,7 @@
dc = wx.MemoryDC()
dc.SelectObject(buffer)
- maskColor = wx.Color(255, 255, 255)
+ maskColor = wx.Colour(255, 255, 255)
dc.SetBrush(wx.Brush(maskColor))
dc.Clear()
@@ -202,23 +202,23 @@
def DrawRecord(self, dc, size):
"""!Draw record symbol"""
- dc.SetBrush(wx.Brush(wx.Color(255, 0, 0)))
+ dc.SetBrush(wx.Brush(wx.Colour(255, 0, 0)))
dc.DrawCircle(size[0]/2, size[1] / 2, size[0] / 2)
def DrawStop(self, dc, size):
"""!Draw stop symbol"""
- dc.SetBrush(wx.Brush(wx.Color(50, 50, 50)))
+ dc.SetBrush(wx.Brush(wx.Colour(50, 50, 50)))
dc.DrawRectangle(0, 0, size[0], size[1])
def DrawPlay(self, dc, size):
"""!Draw play symbol"""
- dc.SetBrush(wx.Brush(wx.Color(0, 255, 0)))
+ dc.SetBrush(wx.Brush(wx.Colour(0, 255, 0)))
points = (wx.Point(0, 0), wx.Point(0, size[1]), wx.Point(size[0], size[1] / 2))
dc.DrawPolygon(points)
def DrawPause(self, dc, size):
"""!Draw pause symbol"""
- dc.SetBrush(wx.Brush(wx.Color(50, 50, 50)))
+ dc.SetBrush(wx.Brush(wx.Colour(50, 50, 50)))
dc.DrawRectangle(0, 0, 2 * size[0] / 5, size[1])
dc.DrawRectangle(3 * size[0] / 5, 0, 2 * size[0] / 5, size[1])
Modified: grass/branches/develbranch_6/gui/wxpython/location_wizard/wizard.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/location_wizard/wizard.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/location_wizard/wizard.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -107,7 +107,6 @@
self.tlocTitle = self.MakeTextCtrl(size = (400, -1))
# layout
- self.sizer.AddGrowableCol(3)
self.sizer.Add(item = self.MakeLabel(_("GIS Data Directory:")),
flag = wx.ALIGN_RIGHT |
wx.ALIGN_CENTER_VERTICAL |
@@ -148,6 +147,7 @@
wx.ALIGN_CENTER_VERTICAL |
wx.ALL, border = 5,
pos = (3, 2), span = (1, 2))
+ self.sizer.AddGrowableCol(3)
# bindings
self.Bind(wx.EVT_BUTTON, self.OnBrowse, self.bbrowse)
@@ -233,7 +233,6 @@
label = _("Create a generic Cartesian coordinate system (XY)"))
# layout
- self.sizer.AddGrowableCol(1)
self.sizer.SetVGap(10)
self.sizer.Add(item = self.radio1,
flag = wx.ALIGN_LEFT, pos = (1, 1))
@@ -247,6 +246,7 @@
flag = wx.ALIGN_LEFT, pos = (5, 1))
self.sizer.Add(item = self.radio6,
flag = wx.ALIGN_LEFT, pos = (6, 1))
+ self.sizer.AddGrowableCol(1)
# bindings
self.Bind(wx.EVT_RADIOBUTTON, self.SetVal, id = self.radio1.GetId())
Modified: grass/branches/develbranch_6/gui/wxpython/mapdisp/main.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/mapdisp/main.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/mapdisp/main.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -45,7 +45,8 @@
class MapApp(wx.App):
def OnInit(self):
- wx.InitAllImageHandlers()
+ if not globalvar.CheckWxVersion([2, 9]):
+ wx.InitAllImageHandlers()
if __name__ == "__main__":
self.cmdTimeStamp = os.path.getmtime(monFile['cmd'])
self.Map = Map(cmdfile = monFile['cmd'], mapfile = monFile['map'],
Modified: grass/branches/develbranch_6/gui/wxpython/mapdisp/mapwindow.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/mapdisp/mapwindow.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/mapdisp/mapwindow.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -320,7 +320,8 @@
dc.Clear()
# use PrepareDC to set position correctly
- self.PrepareDC(dc)
+ # probably does nothing, removed from wxPython 2.9
+ # self.PrepareDC(dc)
# create a clipping rect from our position and size
# and update region
@@ -473,7 +474,8 @@
dc = wx.BufferedDC(None, ibuffer)
dc.Clear()
- self.PrepareDC(dc)
+ # probably does nothing, removed from wxPython 2.9
+ # self.PrepareDC(dc)
self.pdc.DrawToDC(dc)
if self.pdcVector:
self.pdcVector.DrawToDC(dc)
Modified: grass/branches/develbranch_6/gui/wxpython/mapdisp/statusbar.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/mapdisp/statusbar.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/mapdisp/statusbar.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -963,6 +963,12 @@
def SetRange(self, range):
"""!Sets progress range."""
self.widget.SetRange(range)
+
+ def SetValue(self, value):
+ if value >= value:
+ self.widget.SetValue(self.GetRange())
+ else:
+ self.widget.SetValue(value)
class SbGoToGCP(SbItem):
Modified: grass/branches/develbranch_6/gui/wxpython/modules/colorrules.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/modules/colorrules.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/modules/colorrules.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -1742,7 +1742,8 @@
dc = wx.BufferedPaintDC(self, self._Buffer)
# use PrepareDC to set position correctly
- self.PrepareDC(dc)
+ # probably does nothing, removed from wxPython 2.9
+ # self.PrepareDC(dc)
# we need to clear the dc BEFORE calling PrepareDC
bg = wx.Brush(self.GetBackgroundColour())
Modified: grass/branches/develbranch_6/gui/wxpython/modules/histogram.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/modules/histogram.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/modules/histogram.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -124,7 +124,8 @@
dc = wx.BufferedPaintDC(self, self._buffer)
# use PrepareDC to set position correctly
- self.PrepareDC(dc)
+ # probably does nothing, removed from wxPython 2.9
+ # self.PrepareDC(dc)
# we need to clear the dc BEFORE calling PrepareDC
bg = wx.Brush(self.GetBackgroundColour())
dc.SetBackground(bg)
@@ -184,7 +185,8 @@
self.Draw(self.pdc, img, drawid = 99)
dc = wx.BufferedPaintDC(self, ibuffer)
dc.Clear()
- self.PrepareDC(dc)
+ # probably does nothing, removed from wxPython 2.9
+ # self.PrepareDC(dc)
self.pdc.DrawToDC(dc)
ibuffer.SaveFile(FileName, FileType)
Modified: grass/branches/develbranch_6/gui/wxpython/nviz/mapwindow.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/nviz/mapwindow.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/nviz/mapwindow.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -93,7 +93,10 @@
self.init = False
self.initView = False
-
+ self.context = None
+ if CheckWxVersion(version=[2, 9]):
+ self.context = glcanvas.GLContext(self)
+
# render mode
self.render = { 'quick' : False,
# do not render vector lines in quick mode
@@ -340,11 +343,18 @@
def OnSize(self, event):
size = self.GetClientSize()
+ if CheckWxVersion(version=[2, 9]):
+ context = self.context
+ else:
+ context = self.GetContext()
if self.size != size \
- and self.GetContext():
+ and context:
Debug.msg(3, "GLCanvas.OnSize(): w = %d, h = %d" % \
(size.width, size.height))
- self.SetCurrent()
+ if CheckWxVersion(version=[2, 9]):
+ self.SetCurrent(self.context)
+ else:
+ self.SetCurrent()
self._display.ResizeWindow(size.width,
size.height)
@@ -367,7 +377,10 @@
def DoPaint(self):
- self.SetCurrent()
+ if CheckWxVersion(version=[2, 9]):
+ self.SetCurrent(self.context)
+ else:
+ self.SetCurrent()
if not self.initView:
self._display.InitView()
Modified: grass/branches/develbranch_6/gui/wxpython/nviz/tools.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/nviz/tools.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/nviz/tools.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -325,7 +325,6 @@
flag = wx.TOP|wx.BOTTOM|wx.RIGHT| wx.ALIGN_RIGHT,
border = 5)
- gridSizer.AddGrowableCol(2)
gridSizer.Add(item = viewSizer, pos = (4, 0), span = (1, 3),
flag = wx.EXPAND)
@@ -340,7 +339,6 @@
label = " %s " % (_("Image Appearance")))
boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
- gridSizer.AddGrowableCol(0)
# background color
self.win['view']['background'] = {}
@@ -355,6 +353,7 @@
self.win['view']['background']['color'] = color.GetId()
color.Bind(csel.EVT_COLOURSELECT, self.OnBgColor)
gridSizer.Add(item = color, pos = (0, 1))
+ gridSizer.AddGrowableCol(0)
boxSizer.Add(item = gridSizer, proportion = 1,
flag = wx.ALL | wx.EXPAND, border = 3)
@@ -671,7 +670,6 @@
label = " %s " % (_("Draw")))
boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
- gridSizer.AddGrowableCol(3)
# mode
gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
@@ -763,6 +761,7 @@
self.win['surface']['draw']['res-fine'] = resF.GetId()
resF.Bind(wx.EVT_SPINCTRL, self.OnSurfaceResolution)
gridSizer.Add(item = resF, pos = (1, 2), flag = wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT)
+ gridSizer.AddGrowableCol(3)
boxSizer.Add(item = gridSizer, proportion = 1,
flag = wx.ALL | wx.EXPAND, border = 3)
@@ -777,7 +776,6 @@
label = " %s " % (_("Surface attributes")))
boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
- gridSizer.AddGrowableCol(2)
# type
self.win['surface']['attr'] = {}
@@ -840,6 +838,7 @@
attrb = code) # -> enable map / disable constant
row += 1
+ gridSizer.AddGrowableCol(2)
boxSizer.Add(item = gridSizer, proportion = 0,
flag = wx.ALL | wx.EXPAND, border = 3)
pageSizer.Add(item = boxSizer, proportion = 0,
@@ -853,7 +852,6 @@
label = " %s " % (_("Position")))
boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
- gridSizer.AddGrowableCol(3)
# position
tooltip = _("Changes the x, y, and z position of the current surface")
@@ -883,6 +881,7 @@
gridSizer.Add(item = pslide, flag = wx.ALIGN_CENTER_VERTICAL, pos = (0, 1))
gridSizer.Add(item = ptext, flag = wx.ALIGN_CENTER_VERTICAL, pos = (0, 2))
gridSizer.Add(item = reset, flag = wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, pos = (0, 3))
+ gridSizer.AddGrowableCol(3)
boxSizer.Add(item = gridSizer, proportion = 1,
flag = wx.ALL | wx.EXPAND, border = 3)
@@ -1207,7 +1206,6 @@
label = " %s " % (_("Vector lines")))
boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer(vgap = 5, hgap = 5)
- gridSizer.AddGrowableCol(5)
# width
gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
@@ -1282,6 +1280,7 @@
gridSizer.Add(item = self.FindWindowById(self.win['vector']['lines']['height']['text']),
pos = (4, 5),
flag = wx.ALIGN_CENTER)
+ gridSizer.AddGrowableCol(5)
boxSizer.Add(item = gridSizer, proportion = 1,
flag = wx.ALL | wx.EXPAND, border = 3)
@@ -1308,10 +1307,6 @@
boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
vertSizer = wx.BoxSizer(wx.VERTICAL)
gridSizer = wx.GridBagSizer(vgap = 5, hgap = 5)
- gridSizer.AddGrowableCol(0)
- gridSizer.AddGrowableCol(2)
- gridSizer.AddGrowableCol(4)
- gridSizer.AddGrowableCol(6)
# icon size
gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
@@ -1379,6 +1374,10 @@
gridSizer.Add(item = isym, flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT,
pos = (0, 6))
+ gridSizer.AddGrowableCol(0)
+ gridSizer.AddGrowableCol(2)
+ gridSizer.AddGrowableCol(4)
+ gridSizer.AddGrowableCol(6)
vertSizer.Add(gridSizer, proportion = 0, flag = wx.EXPAND, border = 0)
# high
gridSizer = wx.GridBagSizer(vgap = 5, hgap = 5)
@@ -1390,6 +1389,7 @@
display.Bind(wx.EVT_CHOICE, self.OnVectorPointsMode)
gridSizer.Add(item=display,
pos=(0, 1), flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)
+
gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
label = _("Height above surface:")),
pos = (1, 2), flag = wx.ALIGN_CENTER_VERTICAL)
@@ -1588,7 +1588,6 @@
label = " %s " % (_("Position")))
boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
gridSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
- gridSizer.AddGrowableCol(3)
# position
self._createControl(panel, data = self.win['volume'], name = 'position',
@@ -1617,6 +1616,7 @@
gridSizer.Add(item = pslide, flag = wx.ALIGN_CENTER_VERTICAL, pos = (0, 1))
gridSizer.Add(item = ptext, flag = wx.ALIGN_CENTER_VERTICAL, pos = (0, 2))
gridSizer.Add(item = reset, flag = wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, pos = (0, 3))
+ gridSizer.AddGrowableCol(3)
boxSizer.Add(item = gridSizer, proportion = 1,
flag = wx.ALL | wx.EXPAND, border = 3)
@@ -2389,9 +2389,6 @@
boxSizer.Add(hSizer, proportion = 0, flag = wx.ALL|wx.EXPAND, border = 3)
gridSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
- gridSizer.AddGrowableCol(0,1)
- gridSizer.AddGrowableCol(1,2)
- gridSizer.AddGrowableCol(2,2)
# text labels
for i in range(2):
@@ -2438,6 +2435,9 @@
gridSizer.Add(item = slider, pos = (4,i+1),
flag = wx.ALIGN_CENTER|wx.EXPAND)
+ gridSizer.AddGrowableCol(0,1)
+ gridSizer.AddGrowableCol(1,2)
+ gridSizer.AddGrowableCol(2,2)
boxSizer.Add(item = gridSizer, proportion = 1,
flag = wx.ALL | wx.EXPAND, border = 3)
@@ -3113,14 +3113,14 @@
return str(color[0]) + ':' + str(color[1]) + ':' + str(color[2])
def _getColorFromString(self, color, delim = ':'):
- """!Convert color string (R:G:B) to wx.Color
+ """!Convert color string (R:G:B) to wx.Colour
@param color string
@param delim delimiter
- @return wx.Color instance
+ @return wx.Colour instance
"""
- return wx.Color(*map(int, color.split(delim)))
+ return wx.Colour(*map(int, color.split(delim)))
def _get3dRange(self, name):
"""!Gelper func for getting range of 3d map"""
@@ -4823,7 +4823,8 @@
dc.SetBackground(wx.Brush("White"))
dc.Clear()
- self.PrepareDC(dc)
+ # probably does nothing, removed from wxPython 2.9
+ # self.PrepareDC(dc)
self.pdc.DrawToDC(dc)
def UpdatePos(self, xcoord, ycoord):
Modified: grass/branches/develbranch_6/gui/wxpython/psmap/dialogs.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/psmap/dialogs.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/psmap/dialogs.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -4346,7 +4346,7 @@
buffer = wx.EmptyBitmap(*self.previewSize)
dc = wx.MemoryDC()
dc.SelectObject(buffer)
- dc.SetBrush(wx.Brush(wx.Color(250, 250, 250)))
+ dc.SetBrush(wx.Brush(wx.Colour(250, 250, 250)))
dc.Clear()
extent = dc.GetTextExtent(warning)
posX = self.previewSize[0] / 2 - extent[0] / 2
Modified: grass/branches/develbranch_6/gui/wxpython/psmap/frame.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/psmap/frame.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/psmap/frame.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -92,15 +92,15 @@
self.pen = {
'paper': wx.Pen(colour = "BLACK", width = 1),
'margins': wx.Pen(colour = "GREY", width = 1),
- 'map': wx.Pen(colour = wx.Color(86, 122, 17), width = 2),
- 'rasterLegend': wx.Pen(colour = wx.Color(219, 216, 4), width = 2),
- 'vectorLegend': wx.Pen(colour = wx.Color(219, 216, 4), width = 2),
- 'mapinfo': wx.Pen(colour = wx.Color(5, 184, 249), width = 2),
- 'scalebar': wx.Pen(colour = wx.Color(150, 150, 150), width = 2),
- 'image': wx.Pen(colour = wx.Color(255, 150, 50), width = 2),
- 'northArrow': wx.Pen(colour = wx.Color(200, 200, 200), width = 2),
- 'point': wx.Pen(colour = wx.Color(100, 100, 100), width = 2),
- 'line': wx.Pen(colour = wx.Color(0, 0, 0), width = 2),
+ 'map': wx.Pen(colour = wx.Colour(86, 122, 17), width = 2),
+ 'rasterLegend': wx.Pen(colour = wx.Colour(219, 216, 4), width = 2),
+ 'vectorLegend': wx.Pen(colour = wx.Colour(219, 216, 4), width = 2),
+ 'mapinfo': wx.Pen(colour = wx.Colour(5, 184, 249), width = 2),
+ 'scalebar': wx.Pen(colour = wx.Colour(150, 150, 150), width = 2),
+ 'image': wx.Pen(colour = wx.Colour(255, 150, 50), width = 2),
+ 'northArrow': wx.Pen(colour = wx.Colour(200, 200, 200), width = 2),
+ 'point': wx.Pen(colour = wx.Colour(100, 100, 100), width = 2),
+ 'line': wx.Pen(colour = wx.Colour(0, 0, 0), width = 2),
'box': wx.Pen(colour = 'RED', width = 2, style = wx.SHORT_DASH),
'select': wx.Pen(colour = 'BLACK', width = 1, style = wx.SHORT_DASH),
'resize': wx.Pen(colour = 'BLACK', width = 1)
@@ -108,14 +108,14 @@
self.brush = {
'paper': wx.WHITE_BRUSH,
'margins': wx.TRANSPARENT_BRUSH,
- 'map': wx.Brush(wx.Color(151, 214, 90)),
- 'rasterLegend': wx.Brush(wx.Color(250, 247, 112)),
- 'vectorLegend': wx.Brush(wx.Color(250, 247, 112)),
- 'mapinfo': wx.Brush(wx.Color(127, 222, 252)),
- 'scalebar': wx.Brush(wx.Color(200, 200, 200)),
- 'image': wx.Brush(wx.Color(255, 200, 50)),
- 'northArrow': wx.Brush(wx.Color(255, 255, 255)),
- 'point': wx.Brush(wx.Color(200, 200, 200)),
+ 'map': wx.Brush(wx.Colour(151, 214, 90)),
+ 'rasterLegend': wx.Brush(wx.Colour(250, 247, 112)),
+ 'vectorLegend': wx.Brush(wx.Colour(250, 247, 112)),
+ 'mapinfo': wx.Brush(wx.Colour(127, 222, 252)),
+ 'scalebar': wx.Brush(wx.Colour(200, 200, 200)),
+ 'image': wx.Brush(wx.Colour(255, 200, 50)),
+ 'northArrow': wx.Brush(wx.Colour(255, 255, 255)),
+ 'point': wx.Brush(wx.Colour(200, 200, 200)),
'line': wx.TRANSPARENT_BRUSH,
'box': wx.TRANSPARENT_BRUSH,
'select':wx.TRANSPARENT_BRUSH,
@@ -1124,8 +1124,6 @@
self.pdcPaper = wx.PseudoDC()
self.pdcTmp = wx.PseudoDC()
self.pdcImage = wx.PseudoDC()
- dc = wx.ClientDC(self)
- self.font = dc.GetFont()
self.SetClientSize((700,510))#?
self._buffer = wx.EmptyBitmap(*self.GetClientSize())
@@ -1275,7 +1273,8 @@
return
dc = wx.BufferedPaintDC(self, self._buffer)
# use PrepareDC to set position correctly
- self.PrepareDC(dc)
+ # probably does nothing, removed from wxPython 2.9
+ # self.PrepareDC(dc)
dc.SetBackground(wx.LIGHT_GREY_BRUSH)
dc.Clear()
@@ -1935,7 +1934,7 @@
if pdctype == 'rectText':
dc = wx.ClientDC(self) # dc created because of method GetTextExtent, which pseudoDC lacks
- font = self.font
+ font = dc.GetFont()
size = 10
font.SetPointSize(size)
font.SetStyle(wx.ITALIC)
@@ -1953,7 +1952,7 @@
pdc.SetFont(font)
textExtent = dc.GetTextExtent(text)
textRect = wx.Rect(0, 0, *textExtent).CenterIn(bb)
- pdc.SetTextForeground(wx.Color(100,100,100,200))
+ pdc.SetTextForeground(wx.Colour(100,100,100,200))
pdc.SetBackgroundMode(wx.TRANSPARENT)
pdc.DrawLabel(text = text, rect = textRect)
Modified: grass/branches/develbranch_6/gui/wxpython/psmap/utils.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/psmap/utils.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/psmap/utils.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -149,7 +149,7 @@
color = (grass.parse_color(rgb)[0]*255,
grass.parse_color(rgb)[1]*255,
grass.parse_color(rgb)[2]*255)
- color = wx.Color(*color)
+ color = wx.Colour(*color)
if color.IsOk():
return color
else:
Modified: grass/branches/develbranch_6/gui/wxpython/vdigit/wxdisplay.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/vdigit/wxdisplay.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/vdigit/wxdisplay.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -909,7 +909,7 @@
subkey = 'value'))
continue
- color = wx.Color(UserSettings.Get(group = 'vdigit', key = 'symbol',
+ color = wx.Colour(UserSettings.Get(group = 'vdigit', key = 'symbol',
subkey = [key, 'color'])[0],
UserSettings.Get(group = 'vdigit', key = 'symbol',
subkey = [key, 'color'])[1],
Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -51,7 +51,8 @@
@return True
"""
- wx.InitAllImageHandlers()
+ if not globalvar.CheckWxVersion([2, 9]):
+ wx.InitAllImageHandlers()
# create splash screen
introImagePath = os.path.join(globalvar.ETCIMGDIR, "silesia_splash.png")
Modified: grass/branches/develbranch_6/gui/wxpython/wxplot/base.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxplot/base.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/wxplot/base.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -110,7 +110,7 @@
def _createColorDict(self):
- """!Create color dictionary to return wx.Color tuples
+ """!Create color dictionary to return wx.Colour tuples
for assigning colors to images in imagery groups"""
self.colorDict = {}
@@ -287,7 +287,7 @@
#
self.client.SetEnableGrid(self.properties['grid']['enabled'])
- self.client.SetGridColour(wx.Color(self.properties['grid']['color'][0],
+ self.client.SetGridColour(wx.Colour(self.properties['grid']['color'][0],
self.properties['grid']['color'][1],
self.properties['grid']['color'][2],
255))
Modified: grass/branches/develbranch_6/gui/wxpython/wxplot/profile.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxplot/profile.py 2013-10-20 01:43:26 UTC (rev 58066)
+++ grass/branches/develbranch_6/gui/wxpython/wxplot/profile.py 2013-10-20 02:10:52 UTC (rev 58067)
@@ -291,7 +291,7 @@
if len(self.seglist) > 0 :
self.ppoints = plot.PolyMarker(self.seglist,
legend = ' ' + self.properties['marker']['legend'],
- colour = wx.Color(self.properties['marker']['color'][0],
+ colour = wx.Colour(self.properties['marker']['color'][0],
self.properties['marker']['color'][1],
self.properties['marker']['color'][2],
255),
@@ -302,7 +302,7 @@
# Add profile distance/elevation pairs to plot data list for each raster profiled
for r in self.rasterList:
- col = wx.Color(self.raster[r]['pcolor'][0],
+ col = wx.Colour(self.raster[r]['pcolor'][0],
self.raster[r]['pcolor'][1],
self.raster[r]['pcolor'][2],
255)
More information about the grass-commit
mailing list