[GRASS-SVN] r54916 - in grass/trunk/gui/wxpython: . animation gmodeler gui_core iclass mapdisp mapswipe modules nviz psmap rlisetup vdigit
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Feb 5 00:42:01 PST 2013
Author: annakrat
Date: 2013-02-05 00:42:01 -0800 (Tue, 05 Feb 2013)
New Revision: 54916
Modified:
grass/trunk/gui/wxpython/animation/g.gui.animation.py
grass/trunk/gui/wxpython/gis_set.py
grass/trunk/gui/wxpython/gmodeler/frame.py
grass/trunk/gui/wxpython/gmodeler/g.gui.gmodeler.py
grass/trunk/gui/wxpython/gui_core/ghelp.py
grass/trunk/gui/wxpython/iclass/g.gui.iclass.py
grass/trunk/gui/wxpython/mapdisp/main.py
grass/trunk/gui/wxpython/mapdisp/mapwindow.py
grass/trunk/gui/wxpython/mapswipe/g.gui.mapswipe.py
grass/trunk/gui/wxpython/modules/colorrules.py
grass/trunk/gui/wxpython/modules/histogram.py
grass/trunk/gui/wxpython/nviz/tools.py
grass/trunk/gui/wxpython/psmap/frame.py
grass/trunk/gui/wxpython/psmap/g.gui.psmap.py
grass/trunk/gui/wxpython/rlisetup/g.gui.rlisetup.py
grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.py
grass/trunk/gui/wxpython/wxgui.py
Log:
wxGUI: ensure compatibility with wxPython 2.9
Modified: grass/trunk/gui/wxpython/animation/g.gui.animation.py
===================================================================
--- grass/trunk/gui/wxpython/animation/g.gui.animation.py 2013-02-05 08:19:54 UTC (rev 54915)
+++ grass/trunk/gui/wxpython/animation/g.gui.animation.py 2013-02-05 08:42:01 UTC (rev 54916)
@@ -51,6 +51,7 @@
sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
from core.settings import UserSettings
+from core.globalvar import CheckWxVersion
from core.giface import StandaloneGrassInterface
from animation.frame import AnimationFrame, MAX_COUNT
@@ -76,7 +77,8 @@
strds = None
app = wx.PySimpleApp()
- wx.InitAllImageHandlers()
+ if not CheckWxVersion([2, 9]):
+ wx.InitAllImageHandlers()
frame = AnimationFrame(parent = None)
frame.CentreOnScreen()
Modified: grass/trunk/gui/wxpython/gis_set.py
===================================================================
--- grass/trunk/gui/wxpython/gis_set.py 2013-02-05 08:19:54 UTC (rev 54915)
+++ grass/trunk/gui/wxpython/gis_set.py 2013-02-05 08:42:01 UTC (rev 54916)
@@ -956,7 +956,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/trunk/gui/wxpython/gmodeler/frame.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/frame.py 2013-02-05 08:19:54 UTC (rev 54915)
+++ grass/trunk/gui/wxpython/gmodeler/frame.py 2013-02-05 08:42:01 UTC (rev 54916)
@@ -1062,7 +1062,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
Modified: grass/trunk/gui/wxpython/gmodeler/g.gui.gmodeler.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/g.gui.gmodeler.py 2013-02-05 08:19:54 UTC (rev 54915)
+++ grass/trunk/gui/wxpython/gmodeler/g.gui.gmodeler.py 2013-02-05 08:42:01 UTC (rev 54916)
@@ -45,6 +45,7 @@
sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
from core.giface import StandaloneGrassInterface
+from core.globalvar import CheckWxVersion
from gmodeler.frame import ModelFrame
def main():
@@ -52,7 +53,8 @@
gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode = True)
app = wx.PySimpleApp()
- wx.InitAllImageHandlers()
+ if not CheckWxVersion([2, 9]):
+ wx.InitAllImageHandlers()
frame = ModelFrame(parent = None, giface = StandaloneGrassInterface())
if options['file']:
frame.LoadModelFile(options['file'])
Modified: grass/trunk/gui/wxpython/gui_core/ghelp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/ghelp.py 2013-02-05 08:19:54 UTC (rev 54915)
+++ grass/trunk/gui/wxpython/gui_core/ghelp.py 2013-02-05 08:42:01 UTC (rev 54916)
@@ -605,7 +605,8 @@
in the Panel.
"""
self.parent = parent
- wx.InitAllImageHandlers()
+ if not globalvar.CheckWxVersion([2, 9]):
+ wx.InitAllImageHandlers()
HtmlWindow.__init__(self, parent = parent, **kwargs)
self.loaded = False
Modified: grass/trunk/gui/wxpython/iclass/g.gui.iclass.py
===================================================================
--- grass/trunk/gui/wxpython/iclass/g.gui.iclass.py 2013-02-05 08:19:54 UTC (rev 54915)
+++ grass/trunk/gui/wxpython/iclass/g.gui.iclass.py 2013-02-05 08:42:01 UTC (rev 54916)
@@ -58,6 +58,7 @@
sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
from core.settings import UserSettings
+from core.globalvar import CheckWxVersion
from core.giface import StandaloneGrassInterface
from iclass.frame import IClassMapFrame
@@ -85,7 +86,8 @@
# launch application
app = wx.PySimpleApp()
- wx.InitAllImageHandlers()
+ if not CheckWxVersion([2, 9]):
+ wx.InitAllImageHandlers()
# show main frame
giface = StandaloneGrassInterface()
Modified: grass/trunk/gui/wxpython/mapdisp/main.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/main.py 2013-02-05 08:19:54 UTC (rev 54915)
+++ grass/trunk/gui/wxpython/mapdisp/main.py 2013-02-05 08:42:01 UTC (rev 54916)
@@ -298,7 +298,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 = DMonMap(cmdfile = monFile['cmd'], mapfile = monFile['map'],
Modified: grass/trunk/gui/wxpython/mapdisp/mapwindow.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/mapwindow.py 2013-02-05 08:19:54 UTC (rev 54915)
+++ grass/trunk/gui/wxpython/mapdisp/mapwindow.py 2013-02-05 08:42:01 UTC (rev 54916)
@@ -363,7 +363,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
@@ -523,7 +524,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/trunk/gui/wxpython/mapswipe/g.gui.mapswipe.py
===================================================================
--- grass/trunk/gui/wxpython/mapswipe/g.gui.mapswipe.py 2013-02-05 08:19:54 UTC (rev 54915)
+++ grass/trunk/gui/wxpython/mapswipe/g.gui.mapswipe.py 2013-02-05 08:42:01 UTC (rev 54916)
@@ -57,6 +57,7 @@
sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
from core.settings import UserSettings
+from core.globalvar import CheckWxVersion
from core.giface import StandaloneGrassInterface
from mapswipe.frame import SwipeMapFrame
@@ -83,7 +84,8 @@
grass.fatal(_("Raster map <%s> not found") % mapName)
app = wx.PySimpleApp()
- wx.InitAllImageHandlers()
+ if not CheckWxVersion([2, 9]):
+ wx.InitAllImageHandlers()
frame = SwipeMapFrame(parent = None, giface = StandaloneGrassInterface())
Modified: grass/trunk/gui/wxpython/modules/colorrules.py
===================================================================
--- grass/trunk/gui/wxpython/modules/colorrules.py 2013-02-05 08:19:54 UTC (rev 54915)
+++ grass/trunk/gui/wxpython/modules/colorrules.py 2013-02-05 08:42:01 UTC (rev 54916)
@@ -1810,7 +1810,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/trunk/gui/wxpython/modules/histogram.py
===================================================================
--- grass/trunk/gui/wxpython/modules/histogram.py 2013-02-05 08:19:54 UTC (rev 54915)
+++ grass/trunk/gui/wxpython/modules/histogram.py 2013-02-05 08:42:01 UTC (rev 54916)
@@ -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/trunk/gui/wxpython/nviz/tools.py
===================================================================
--- grass/trunk/gui/wxpython/nviz/tools.py 2013-02-05 08:19:54 UTC (rev 54915)
+++ grass/trunk/gui/wxpython/nviz/tools.py 2013-02-05 08:42:01 UTC (rev 54916)
@@ -5056,7 +5056,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/trunk/gui/wxpython/psmap/frame.py
===================================================================
--- grass/trunk/gui/wxpython/psmap/frame.py 2013-02-05 08:19:54 UTC (rev 54915)
+++ grass/trunk/gui/wxpython/psmap/frame.py 2013-02-05 08:42:01 UTC (rev 54916)
@@ -1241,7 +1241,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()
Modified: grass/trunk/gui/wxpython/psmap/g.gui.psmap.py
===================================================================
--- grass/trunk/gui/wxpython/psmap/g.gui.psmap.py 2013-02-05 08:19:54 UTC (rev 54915)
+++ grass/trunk/gui/wxpython/psmap/g.gui.psmap.py 2013-02-05 08:42:01 UTC (rev 54916)
@@ -49,7 +49,8 @@
gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode = True)
app = wx.PySimpleApp()
- wx.InitAllImageHandlers()
+ if not CheckWxVersion([2, 9]):
+ wx.InitAllImageHandlers()
frame = PsMapFrame(parent = None)
frame.Show()
Modified: grass/trunk/gui/wxpython/rlisetup/g.gui.rlisetup.py
===================================================================
--- grass/trunk/gui/wxpython/rlisetup/g.gui.rlisetup.py 2013-02-05 08:19:54 UTC (rev 54915)
+++ grass/trunk/gui/wxpython/rlisetup/g.gui.rlisetup.py 2013-02-05 08:42:01 UTC (rev 54916)
@@ -36,6 +36,7 @@
sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
from core.giface import StandaloneGrassInterface
+from core.globalvar import CheckWxVersion
from rlisetup.frame import RLiSetupFrame
@@ -43,7 +44,8 @@
gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'),
unicode = True)
app = wx.PySimpleApp()
- wx.InitAllImageHandlers()
+ if not CheckWxVersion([2, 9]):
+ wx.InitAllImageHandlers()
frame = RLiSetupFrame(parent = None, giface = StandaloneGrassInterface())
frame.Show()
Modified: grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.py 2013-02-05 08:19:54 UTC (rev 54915)
+++ grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.py 2013-02-05 08:42:01 UTC (rev 54916)
@@ -41,6 +41,7 @@
if __name__ == '__main__':
sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+from core.globalvar import CheckWxVersion
from mapdisp.frame import MapFrame
from core.giface import StandaloneGrassInterface
from core.settings import UserSettings
@@ -79,7 +80,8 @@
os.environ['GRASS_RENDER_IMMEDIATE'] = 'cairo'
app = wx.PySimpleApp()
- wx.InitAllImageHandlers()
+ if not CheckWxVersion([2, 9]):
+ wx.InitAllImageHandlers()
frame = VDigitMapFrame(options['map'])
frame.Show()
Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py 2013-02-05 08:19:54 UTC (rev 54915)
+++ grass/trunk/gui/wxpython/wxgui.py 2013-02-05 08:42:01 UTC (rev 54916)
@@ -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")
More information about the grass-commit
mailing list