[GRASS-SVN] r52628 - grass/trunk/gui/wxpython/swipe
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Aug 11 13:45:59 PDT 2012
Author: wenzeslaus
Date: 2012-08-11 13:45:59 -0700 (Sat, 11 Aug 2012)
New Revision: 52628
Modified:
grass/trunk/gui/wxpython/swipe/dialogs.py
grass/trunk/gui/wxpython/swipe/frame.py
grass/trunk/gui/wxpython/swipe/mapwindow.py
grass/trunk/gui/wxpython/swipe/toolbars.py
Log:
wxGUI: swipe: small clean up
Modified: grass/trunk/gui/wxpython/swipe/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/swipe/dialogs.py 2012-08-11 19:10:44 UTC (rev 52627)
+++ grass/trunk/gui/wxpython/swipe/dialogs.py 2012-08-11 20:45:59 UTC (rev 52628)
@@ -23,7 +23,7 @@
class SwipeMapDialog(ElementDialog):
"""!Dialog used to select raster maps"""
def __init__(self, parent, title = _("Select raster maps"), id = wx.ID_ANY, first = None, second = None):
- ElementDialog.__init__(self, parent, title, label = _("Name of top/left raster map:"))
+ ElementDialog.__init__(self, parent, title, id = id, label = _("Name of top/left raster map:"))
self.element = gselect.Select(parent = self.panel, type = 'raster',
size = globalvar.DIALOG_GSELECT_SIZE)
Modified: grass/trunk/gui/wxpython/swipe/frame.py
===================================================================
--- grass/trunk/gui/wxpython/swipe/frame.py 2012-08-11 19:10:44 UTC (rev 52627)
+++ grass/trunk/gui/wxpython/swipe/frame.py 2012-08-11 20:45:59 UTC (rev 52628)
@@ -1,20 +1,18 @@
-import os
+
import sys
import wx
import time
-if __name__ == "__main__":
- sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
import grass.script as grass
from gui_core.mapdisp import DoubleMapFrame
-from core.render import Map, MapLayer
+from core.render import Map
from mapdisp import statusbar as sb
from core.debug import Debug
from mapdisp.statusbar import EVT_AUTO_RENDER
from swipe.toolbars import SwipeMapToolbar, SwipeMainToolbar, SwipeMiscToolbar
-from swipe.mapwindow import SwipeBufferedWindow, EVT_MOTION
+from swipe.mapwindow import SwipeBufferedWindow
from swipe.dialogs import SwipeMapDialog
@@ -279,8 +277,6 @@
dlg = SwipeMapDialog(self, first = self.rasters['first'], second = self.rasters['second'])
if dlg.ShowModal() == wx.ID_OK:
maps = dlg.GetValues()
- raster1 = grass.find_file(name = maps[0], element = 'cell')
- raster2 = grass.find_file(name = maps[1], element = 'cell')
self.SetFirstRaster(name = maps[0])
self.SetSecondRaster(name = maps[1])
@@ -354,7 +350,7 @@
return self.toolbars['swipeMap']
def IsStandalone(self):
- if parent:
+ if self.parent:
return False
return True
@@ -455,20 +451,3 @@
self.GetWindow1().movingSash = True
self.GetWindow2().movingSash = True
-
-
-def main():
- import gettext
-
- gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode = True)
-
- app = wx.PySimpleApp()
- wx.InitAllImageHandlers()
-
- frame = SwipeMapFrame()
- frame.Show()
- app.MainLoop()
-
-
-if __name__ == '__main__':
- main()
Modified: grass/trunk/gui/wxpython/swipe/mapwindow.py
===================================================================
--- grass/trunk/gui/wxpython/swipe/mapwindow.py 2012-08-11 19:10:44 UTC (rev 52627)
+++ grass/trunk/gui/wxpython/swipe/mapwindow.py 2012-08-11 20:45:59 UTC (rev 52628)
@@ -17,7 +17,7 @@
Class _MouseEvent taken from wxPython FloatCanvas source code (Christopher Barker).
"""
-import time
+
import wx
from core.debug import Debug
Modified: grass/trunk/gui/wxpython/swipe/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/swipe/toolbars.py 2012-08-11 19:10:44 UTC (rev 52627)
+++ grass/trunk/gui/wxpython/swipe/toolbars.py 2012-08-11 20:45:59 UTC (rev 52628)
@@ -95,7 +95,6 @@
def _toolbarData(self):
"""!Toolbar data"""
- icons = swipeIcons
return self._getToolbarData((("addRaster", swipeIcons['addRast'],
self.parent.OnSelectRasters),
(None, ),
@@ -105,7 +104,6 @@
def OnToolMenu(self, event):
"""!Menu for additional tools"""
- point = wx.GetMousePosition()
toolMenu = wx.Menu()
for label, itype, handler, desc in (
@@ -140,7 +138,6 @@
def _toolbarData(self):
"""!Toolbar data"""
- icons = BaseIcons
return self._getToolbarData((("quit", swipeIcons['quit'],
self.parent.OnCloseWindow),
))
More information about the grass-commit
mailing list