[GRASS-SVN] r43364 - in grass/trunk/gui/wxpython: gui_modules images

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 31 08:20:58 EDT 2010


Author: mmetz
Date: 2010-08-31 12:20:58 +0000 (Tue, 31 Aug 2010)
New Revision: 43364

Modified:
   grass/trunk/gui/wxpython/gui_modules/gcpmanager.py
   grass/trunk/gui/wxpython/gui_modules/gcpmapdisp.py
   grass/trunk/gui/wxpython/images/small_down_arrow.png
   grass/trunk/gui/wxpython/images/small_up_arrow.png
Log:
GCP Manager update

Modified: grass/trunk/gui/wxpython/gui_modules/gcpmanager.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gcpmanager.py	2010-08-31 12:12:22 UTC (rev 43363)
+++ grass/trunk/gui/wxpython/gui_modules/gcpmanager.py	2010-08-31 12:20:58 UTC (rev 43364)
@@ -19,9 +19,9 @@
 This program is free software under the GNU General Public License
 (>=v2). Read the file COPYING that comes with GRASS for details.
 
- at author Markus Metz
 @author Michael Barton
 @author Updated by Martin Landa <landa.martin gmail.com>
+ at author Markus Metz redesign georectfier -> GCP Manager
 """
 
 import os
@@ -1519,6 +1519,9 @@
             if os.path.exists(self.file['points_bak']):
                 os.unlink(self.file['points_bak'])
 
+            self.SrcMap.Clean()
+            self.TgtMap.Clean()
+
             self.grwiz.Cleanup()
 
             self.Destroy()
@@ -1746,10 +1749,9 @@
 
     def OnHelp(self, event):
         """!Show GCP Manager manual page"""
-        gcmd.RunCommand('g.manual',
-                        quiet = True,
-                        parent = None,
-                        entry = 'wxGUI.GCP_Manager')
+        cmdlist = ['g.manual', 'entry=wxGUI.GCP_Manager']
+        self.parent.goutput.RunCmd(cmdlist, compReg=False,
+                                       switchPage=False)
 
     def OnUpdateActive(self, event):
 

Modified: grass/trunk/gui/wxpython/gui_modules/gcpmapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gcpmapdisp.py	2010-08-31 12:12:22 UTC (rev 43363)
+++ grass/trunk/gui/wxpython/gui_modules/gcpmapdisp.py	2010-08-31 12:20:58 UTC (rev 43364)
@@ -1,27 +1,19 @@
 """!
 @package gcpmapdisp.py
 
- at brief GIS map display canvas, with toolbar for various display
-management functions, and additional toolbars (vector digitizer, 3d
-view).
+ at brief display to manage ground control points with two toolbars, one for
+various display management functions, one for manipulating GCPs.
 
-Can be used either from Layer Manager or as p.mon backend.
-
 Classes:
 - MapFrame
-- MapApp
 
-Usage:
-python mapdisp.py monitor-identifier /path/to/command/file
-
 (C) 2006-2010 by the GRASS Development Team
 This program is free software under the GNU General Public
 License (>=v2). Read the file COPYING that comes with GRASS
 for details.
 
- at author Michael Barton
- at author Jachym Cepicky
- at author Martin Landa <landa.martin gmail.com>
+Derived from mapdisp.py
+
 @author Markus Metz
 """
 
@@ -59,8 +51,6 @@
 import gcmd
 import dbm
 import dbm_dialogs
-import histogram
-import profile
 import globalvar
 import utils
 import gdialogs
@@ -86,8 +76,8 @@
     """!Main frame for map display window. Drawing takes place in
     child double buffered drawing window.
     """
-    def __init__(self, parent=None, id=wx.ID_ANY, title=_("GRASS GIS - Map display"),
-                 style=wx.DEFAULT_FRAME_STYLE, toolbars=["map"],
+    def __init__(self, parent=None, id=wx.ID_ANY, title=_("Manage Ground Control Points"),
+                 style=wx.DEFAULT_FRAME_STYLE, toolbars=["gcpdisp"],
                  tree=None, notebook=None, lmgr=None, page=None,
                  Map=None, auimgr=None, **kwargs):
         """!Main map display window with toolbars, statusbar and
@@ -110,7 +100,7 @@
         self.parent     = parent
         
         if not kwargs.has_key('name'):
-            kwargs['name'] = 'MapWindow'
+            kwargs['name'] = 'GCPMapWindow'
         wx.Frame.__init__(self, parent, id, title, style = style, **kwargs)
         
         # available cursors
@@ -150,12 +140,11 @@
         for toolb in toolbars:
             self.AddToolbar(toolb)
 
-        if self.toolbars['gcpdisp']:
-            self.activemap = self.toolbars['gcpdisp'].togglemap
-            self.activemap.SetSelection(0)
-            self.SrcMap        = self.grwiz.SrcMap       # instance of render.Map
-            self.TgtMap        = self.grwiz.TgtMap       # instance of render.Map
-            self._mgr.SetDockSizeConstraint(0.5, 0.5)
+        self.activemap = self.toolbars['gcpdisp'].togglemap
+        self.activemap.SetSelection(0)
+        self.SrcMap        = self.grwiz.SrcMap       # instance of render.Map
+        self.TgtMap        = self.grwiz.TgtMap       # instance of render.Map
+        self._mgr.SetDockSizeConstraint(0.5, 0.5)
 
         #
         # Add statusbar
@@ -163,25 +152,19 @@
         self.statusbar = self.CreateStatusBar(number=4, style=0)
         self.statusbar.SetStatusWidths([-5, -2, -1, -1])
         self.statusbarWin = dict()
-        if self.toolbars['gcpdisp']:
-            self.statusbarWin['toggle'] = wx.Choice(self.statusbar, wx.ID_ANY,
-                                      choices = [_("Coordinates"),
-                                                 _("Extent"),
-                                                 _("Comp. region"),
-                                                 _("Show comp. extent"),
-                                                 _("Display mode"),
-                                                 _("Display geometry"),
-                                                 _("Map scale"),
-                                                 _("Go to GCP No."),
-                                                 _("RMS error")])
-            # set StatusBar to Go to GCP No.
-            self.statusbarWin['toggle'].SetSelection(7)
-        else:
-            self.statusbarWin['toggle'] = wx.Choice(self.statusbar, wx.ID_ANY,
-                                                choices = globalvar.MAP_DISPLAY_STATUSBAR_MODE)
-            self.statusbarWin['toggle'].SetSelection(UserSettings.Get(group='display',
-                                                                      key='statusbarMode',
-                                                                      subkey='selection'))
+        self.statusbarWin['toggle'] = wx.Choice(self.statusbar, wx.ID_ANY,
+                                  choices = [_("Coordinates"),
+                                             _("Extent"),
+                                             _("Comp. region"),
+                                             _("Show comp. extent"),
+                                             _("Display mode"),
+                                             _("Display geometry"),
+                                             _("Map scale"),
+                                             _("Go to GCP No."),
+                                             _("RMS error")])
+        # set StatusBar to Go to GCP No.
+        self.statusbarWin['toggle'].SetSelection(7)
+
         self.statusbar.Bind(wx.EVT_CHOICE, self.OnToggleStatus, self.statusbarWin['toggle'])
         # auto-rendering checkbox
         self.statusbarWin['render'] = wx.CheckBox(parent=self.statusbar, id=wx.ID_ANY,
@@ -230,29 +213,12 @@
         self.statusbar.Bind(wx.EVT_COMBOBOX, self.OnChangeMapScale, self.statusbarWin['mapscale'])
 
         # go to
-        if self.toolbars['gcpdisp']:
-            self.statusbarWin['goto'] = wx.SpinCtrl(parent=self.statusbar, id=wx.ID_ANY,
-                                 min=0)
-            self.statusbar.Bind(wx.EVT_SPINCTRL, self.OnGoTo, self.statusbarWin['goto'])
-        else:
-            self.statusbarWin['goto'] = wx.TextCtrl(parent=self.statusbar, id=wx.ID_ANY,
-                                                   value="", style=wx.TE_PROCESS_ENTER,
-                                                    size=(100, -1))
+        self.statusbarWin['goto'] = wx.SpinCtrl(parent=self.statusbar, id=wx.ID_ANY,
+                             min=0)
+        self.statusbar.Bind(wx.EVT_SPINCTRL, self.OnGoTo, self.statusbarWin['goto'])
         self.statusbarWin['goto'].Hide()
         self.statusbar.Bind(wx.EVT_TEXT_ENTER, self.OnGoTo, self.statusbarWin['goto'])
 
-        # projection
-        self.statusbarWin['projection'] = wx.CheckBox(parent=self.statusbar, id=wx.ID_ANY,
-                                                      label=_("Use defined projection"))
-        self.statusbarWin['projection'].SetValue(False)
-        size = self.statusbarWin['projection'].GetSize()
-        self.statusbarWin['projection'].SetMinSize((size[0] + 150, size[1]))
-        self.statusbarWin['projection'].SetToolTip(wx.ToolTip (_("Reproject coordinates displayed "
-                                                                 "in the statusbar. Projection can be "
-                                                                 "defined in GUI preferences dialog "
-                                                                 "(tab 'Display')")))
-        self.statusbarWin['projection'].Hide()
-        
         # mask
         self.statusbarWin['mask'] = wx.StaticText(parent = self.statusbar, id = wx.ID_ANY,
                                                   label = '')
@@ -268,24 +234,17 @@
         #
         # Init map display (buffered DC & set default cursor)
         #
-        if self.toolbars['gcpdisp']:
-            self.grwiz.SwitchEnv('source')
-            self.SrcMapWindow = BufferedWindow(self, id=wx.ID_ANY,
-                                              Map=self.SrcMap, tree=self.tree, lmgr=self._layerManager)
+        self.grwiz.SwitchEnv('source')
+        self.SrcMapWindow = BufferedWindow(self, id=wx.ID_ANY,
+                                          Map=self.SrcMap, tree=self.tree, lmgr=self._layerManager)
 
-            self.grwiz.SwitchEnv('target')
-            self.TgtMapWindow = BufferedWindow(self, id=wx.ID_ANY,
-                                              Map=self.TgtMap, tree=self.tree, lmgr=self._layerManager)
-            self.MapWindow = self.SrcMapWindow
-            self.Map = self.SrcMap
-            self.SrcMapWindow.SetCursor(self.cursors["cross"])
-            self.TgtMapWindow.SetCursor(self.cursors["cross"])
-        else:
-            # default is 2D display mode
-            self.MapWindow2D = BufferedWindow(self, id=wx.ID_ANY,
-                                          Map=self.Map, tree=self.tree, lmgr=self._layerManager)
-            self.MapWindow = self.MapWindow2D
-            self.MapWindow.SetCursor(self.cursors["default"])
+        self.grwiz.SwitchEnv('target')
+        self.TgtMapWindow = BufferedWindow(self, id=wx.ID_ANY,
+                                          Map=self.TgtMap, tree=self.tree, lmgr=self._layerManager)
+        self.MapWindow = self.SrcMapWindow
+        self.Map = self.SrcMap
+        self.SrcMapWindow.SetCursor(self.cursors["cross"])
+        self.TgtMapWindow.SetCursor(self.cursors["cross"])
 
         #
         # initialize region values
@@ -296,52 +255,44 @@
         # Bind various events
         #
         self.Bind(wx.EVT_ACTIVATE, self.OnFocus)
-        self.Bind(wx.EVT_CLOSE,    self.OnCloseWindow)
         self.Bind(render.EVT_UPDATE_PRGBAR, self.OnUpdateProgress)
-        if self.toolbars['gcpdisp']:
-            self.Bind(wx.EVT_SIZE,     self.OnDispResize)
-            self.activemap.Bind(wx.EVT_CHOICE, self.OnUpdateActive)
+        self.Bind(wx.EVT_SIZE,     self.OnDispResize)
+        self.activemap.Bind(wx.EVT_CHOICE, self.OnUpdateActive)
         
         #
         # Update fancy gui style
         #
-        if self.toolbars['gcpdisp']:
-            # AuiManager wants a CentrePane , workaround to get two equally sized windows
-            self.list = self.CreateGCPList()
+        # AuiManager wants a CentrePane, workaround to get two equally sized windows
+        self.list = self.CreateGCPList()
 
-            #self.SrcMapWindow.SetSize((300, 300))
-            #self.TgtMapWindow.SetSize((300, 300))
-            self.list.SetSize((100, 150))
-            self._mgr.AddPane(self.list, wx.aui.AuiPaneInfo().
-                      Name("gcplist").Caption(_("GCP List")).LeftDockable(False).
-                      RightDockable(False).PinButton().FloatingSize((600,200)).
-                      CloseButton(False).DestroyOnClose(True).
-                      Top().Layer(1).MinSize((200,100)))
-            self._mgr.AddPane(self.SrcMapWindow, wx.aui.AuiPaneInfo().
-                      Name("source").Caption(_("Source Display")).Dockable(False).
-                      CloseButton(False).DestroyOnClose(True).Floatable(False).
-                      Centre())
-            self._mgr.AddPane(self.TgtMapWindow, wx.aui.AuiPaneInfo().
-                      Name("target").Caption(_("Target Display")).Dockable(False).
-                      CloseButton(False).DestroyOnClose(True).Floatable(False).
-                      Right().Layer(0))
+        #self.SrcMapWindow.SetSize((300, 300))
+        #self.TgtMapWindow.SetSize((300, 300))
+        self.list.SetSize((100, 150))
+        self._mgr.AddPane(self.list, wx.aui.AuiPaneInfo().
+                  Name("gcplist").Caption(_("GCP List")).LeftDockable(False).
+                  RightDockable(False).PinButton().FloatingSize((600,200)).
+                  CloseButton(False).DestroyOnClose(True).
+                  Top().Layer(1).MinSize((200,100)))
+        self._mgr.AddPane(self.SrcMapWindow, wx.aui.AuiPaneInfo().
+                  Name("source").Caption(_("Source Display")).Dockable(False).
+                  CloseButton(False).DestroyOnClose(True).Floatable(False).
+                  Centre())
+        self._mgr.AddPane(self.TgtMapWindow, wx.aui.AuiPaneInfo().
+                  Name("target").Caption(_("Target Display")).Dockable(False).
+                  CloseButton(False).DestroyOnClose(True).Floatable(False).
+                  Right().Layer(0))
 
-            srcwidth, srcheight = self.SrcMapWindow.GetSize()
-            tgtwidth, tgtheight = self.TgtMapWindow.GetSize()
-            tgtwidth = (srcwidth + tgtwidth) / 2
-            self._mgr.GetPane("target").Hide()
-            self._mgr.Update()
-            self._mgr.GetPane("source").BestSize((tgtwidth, tgtheight))
-            self._mgr.GetPane("target").BestSize((tgtwidth, tgtheight))
-            if self.show_target:
-                self._mgr.GetPane("target").Show()
-            else:
-                self.activemap.Enable(False)
+        srcwidth, srcheight = self.SrcMapWindow.GetSize()
+        tgtwidth, tgtheight = self.TgtMapWindow.GetSize()
+        tgtwidth = (srcwidth + tgtwidth) / 2
+        self._mgr.GetPane("target").Hide()
+        self._mgr.Update()
+        self._mgr.GetPane("source").BestSize((tgtwidth, tgtheight))
+        self._mgr.GetPane("target").BestSize((tgtwidth, tgtheight))
+        if self.show_target:
+            self._mgr.GetPane("target").Show()
         else:
-            self._mgr.AddPane(self.MapWindow, wx.aui.AuiPaneInfo().CentrePane().
-                          Dockable(False).BestSize((-1,-1)).
-                          CloseButton(False).DestroyOnClose(True).
-                          Layer(0))
+            self.activemap.Enable(False)
         # called by GCPWizard
         #self._mgr.Update()
 
@@ -355,18 +306,17 @@
         #
         self.digit = None
 
-        if self.toolbars['gcpdisp']:
-            # set active map
-            self.MapWindow = self.SrcMapWindow
-            self.Map = self.SrcMap
-            #
-            # Init zoom history for TgtMapWindow
-            #
-            self.TgtMapWindow.ZoomHistory(self.Map.region['n'],
-                                       self.Map.region['s'],
-                                       self.Map.region['e'],
-                                       self.Map.region['w'])
+        # set active map
+        self.MapWindow = self.SrcMapWindow
+        self.Map = self.SrcMap
         #
+        # Init zoom history for TgtMapWindow
+        #
+        self.TgtMapWindow.ZoomHistory(self.Map.region['n'],
+                                   self.Map.region['s'],
+                                   self.Map.region['e'],
+                                   self.Map.region['w'])
+        #
         # Init zoom history
         #
         self.MapWindow.ZoomHistory(self.Map.region['n'],
@@ -409,44 +359,6 @@
                               CloseButton(False).Layer(2).
                               BestSize((self.toolbars['map'].GetSize())))
 
-        # vector digitizer
-        elif name == "vdigit":
-            from vdigit import haveVDigit
-            if not haveVDigit:
-                from vdigit import errorMsg
-                msg = _("Unable to start vector digitizer.\nThe VDigit python extension "
-                        "was not found or loaded properly.\n"
-                        "Switching back to 2D display mode.\n\nDetails: %s" % errorMsg)
-                
-                self.toolbars['map'].combo.SetValue (_("2D view"))
-                wx.MessageBox(parent=self,
-                              message=msg,
-                              caption=_("Error"),
-                              style=wx.OK | wx.ICON_ERROR | wx.CENTRE)
-                return
-            
-            if self._layerManager:
-                log = self._layerManager.goutput
-            else:
-                log = None
-            self.toolbars['vdigit'] = toolbars.VDigitToolbar(parent=self, mapcontent=self.Map,
-                                                             layerTree=self.tree,
-                                                             log=log)
-            
-            self._mgr.AddPane(self.toolbars['vdigit'],
-                              wx.aui.AuiPaneInfo().
-                              Name("vdigittoolbar").Caption(_("Vector digitizer toolbar")).
-                              ToolbarPane().Top().Row(1).
-                              LeftDockable(False).RightDockable(False).
-                              BottomDockable(False).TopDockable(True).
-                              CloseButton(False).Layer(2).
-                              BestSize((self.toolbars['vdigit'].GetSize())))
-            
-            # change mouse to draw digitized line
-            self.MapWindow.mouse['box'] = "point"
-            self.MapWindow.zoomtype = 0
-            self.MapWindow.pen     = wx.Pen(colour='red',   width=2, style=wx.SOLID)
-            self.MapWindow.polypen = wx.Pen(colour='green', width=2, style=wx.SOLID)
         # GCP display
         elif name == "gcpdisp":
             self.toolbars['gcpdisp'] = toolbars.GCPDisplayToolbar(self)
@@ -471,142 +383,9 @@
                               LeftDockable(False).RightDockable(False).
                               BottomDockable(False).TopDockable(True).
                               CloseButton(False).Layer(2))
-
-        # georectifier
-        elif name == "georect":
-            self.toolbars['georect'] = toolbars.GRToolbar(self, self.Map)
-
-            self._mgr.AddPane(self.toolbars['georect'],
-                              wx.aui.AuiPaneInfo().
-                              Name("georecttoolbar").Caption(_("Georectification toolbar")).
-                              ToolbarPane().Top().
-                              LeftDockable(False).RightDockable(False).
-                              BottomDockable(False).TopDockable(True).
-                              CloseButton(False).Layer(2))
-        # nviz
-        elif name == "nviz":
-            import nviz
             
-            # check for GLCanvas and OpenGL
-            msg = None
-            if not nviz.haveGLCanvas:
-                msg = _("Unable to switch to 3D display mode.\nThe GLCanvas class has not been "
-                        "included with this build "
-                        "of wxPython!\nSwitching back to "
-                        "2D display mode.\n\nDetails: %s" % nviz.errorMsg)
-            if not nviz.haveNviz:
-                msg = _("Unable to switch to 3D display mode.\nThe Nviz python extension "
-                        "was not found or loaded properly.\n"
-                        "Switching back to 2D display mode.\n\nDetails: %s" % nviz.errorMsg)
-            
-            if msg:
-                self.toolbars['map'].combo.SetValue (_("2D view"))
-                wx.MessageBox(parent=self,
-                              message=msg,
-                              caption=_("Error"),
-                              style=wx.OK | wx.ICON_ERROR | wx.CENTRE)
-                return
-            
-            # add Nviz toolbar and disable 2D display mode tools
-            self.toolbars['nviz'] = toolbars.NvizToolbar(self, self.Map)
-            self.toolbars['map'].Enable2D(False)
-            
-            # update layer tree (-> enable 3d-rasters)
-            if self.tree:
-                self.tree.EnableItemType(type='3d-raster', enable=True)
-            
-            # update status bar
-            self.statusbarWin['toggle'].Enable(False)
-
-            # erase map window
-            self.MapWindow.EraseMap()
-
-            self.statusbar.SetStatusText(_("Please wait, loading data..."), 0)
-            
-            # create GL window & NVIZ toolbar
-            if not self.MapWindow3D:
-                self.MapWindow3D = nviz.GLWindow(self, id=wx.ID_ANY,
-                                                 Map=self.Map, tree=self.tree, lmgr=self._layerManager)
-                self.MapWindow = self.MapWindow3D
-                self.MapWindow.SetCursor(self.cursors["default"])
-
-                # add Nviz notebookpage
-                self._layerManager.AddNviz()
-                
-                self.MapWindow3D.OnPaint(None) # -> LoadData
-                self.MapWindow3D.Show()
-                self.MapWindow3D.UpdateView(None)
-            else:
-                self.MapWindow = self.MapWindow3D
-                # add Nviz notebookpage
-                self._layerManager.AddNviz()
-            
-            # switch from MapWindow to MapWindowGL
-            # add nviz toolbar
-            self._mgr.DetachPane(self.MapWindow2D)
-            self.MapWindow2D.Hide()
-            self._mgr.AddPane(self.MapWindow3D, wx.aui.AuiPaneInfo().CentrePane().
-                              Dockable(False).BestSize((-1,-1)).
-                              CloseButton(False).DestroyOnClose(True).
-                              Layer(0))
-            self._mgr.AddPane(self.toolbars['nviz'],
-                              wx.aui.AuiPaneInfo().
-                              Name("nviztoolbar").Caption(_("Nviz toolbar")).
-                              ToolbarPane().Top().Row(1).
-                              LeftDockable(False).RightDockable(False).
-                              BottomDockable(False).TopDockable(True).
-                              CloseButton(False).Layer(2))
-            
-            self.SetStatusText("", 0)
-            
         self._mgr.Update()
 
-    def RemoveToolbar (self, name):
-        """!Removes toolbar from the window
-
-        @todo Only hide, activate by calling AddToolbar()
-        """
-        # cannot hide main toolbar
-        if name == "map":
-            return
-        elif name == "vdigit":
-            # TODO: not destroy only hide
-            self._mgr.DetachPane(self.toolbars['vdigit'])
-            self.toolbars['vdigit'].Destroy()
-        else:
-            self._mgr.DetachPane (self.toolbars[name])
-            self.toolbars[name].Destroy()
-
-        self.toolbars[name] = None
-
-        if name == 'nviz':
-            # unload data
-            #            self.MapWindow3D.Reset()
-            # switch from MapWindowGL to MapWindow
-            self._mgr.DetachPane(self.MapWindow3D)
-            self.MapWindow3D.Hide()
-            self.MapWindow2D.Show()
-            self._mgr.AddPane(self.MapWindow2D, wx.aui.AuiPaneInfo().CentrePane().
-                              Dockable(False).BestSize((-1,-1)).
-                              CloseButton(False).DestroyOnClose(True).
-                              Layer(0))
-            self.MapWindow = self.MapWindow2D
-            # remove nviz notebook page
-            self._layerManager.RemoveNviz()
-            
-            # update layer tree (-> disable 3d-rasters)
-            if self.tree:
-                self.tree.EnableItemType(type='3d-raster', enable=False)
-            
-           
-            self.MapWindow.UpdateMap()
-            
-        self.toolbars['map'].combo.SetValue (_("2D view"))
-        self.toolbars['map'].Enable2D(True)
-        self.statusbarWin['toggle'].Enable(True)
-
-        self._mgr.Update()
-
     def __InitDisplay(self):
         """
         Initialize map display, set dimensions and map region
@@ -614,19 +393,14 @@
         self.width, self.height = self.GetClientSize()
 
         Debug.msg(2, "MapFrame.__InitDisplay():")
-        if self.toolbars['gcpdisp']:
-            self.grwiz.SwitchEnv('source')
-            self.SrcMap.ChangeMapSize(self.GetClientSize())
-            self.SrcMap.region = self.SrcMap.GetRegion() # g.region -upgc
-            self.grwiz.SwitchEnv('target')
-            self.TgtMap.ChangeMapSize(self.GetClientSize())
-            self.TgtMap.region = self.TgtMap.GetRegion() # g.region -upgc
-            # self.SrcMap.SetRegion() # adjust region to match display window
-            # self.TgtMap.SetRegion() # adjust region to match display window
-        else:
-            self.Map.ChangeMapSize(self.GetClientSize())
-            self.Map.region = self.Map.GetRegion() # g.region -upgc
-            # self.Map.SetRegion() # adjust region to match display window
+        self.grwiz.SwitchEnv('source')
+        self.SrcMap.ChangeMapSize(self.GetClientSize())
+        self.SrcMap.region = self.SrcMap.GetRegion() # g.region -upgc
+        self.grwiz.SwitchEnv('target')
+        self.TgtMap.ChangeMapSize(self.GetClientSize())
+        self.TgtMap.region = self.TgtMap.GetRegion() # g.region -upgc
+        # self.SrcMap.SetRegion() # adjust region to match display window
+        # self.TgtMap.SetRegion() # adjust region to match display window
 
     def OnUpdateProgress(self, event):
         """
@@ -642,17 +416,13 @@
         Or set display for georectifying
         """
         if self._layerManager and \
-                self._layerManager.georectifying:
-            # in georectifying session; display used to get geographic
-            # coordinates for GCPs
-            self.OnPointer(event)
-        elif self._layerManager and \
                 self._layerManager.gcpmanagement:
             # in GCP Management, set focus to current MapWindow for mouse actions
             self.OnPointer(event)
             self.MapWindow.SetFocus()
         else:
             # change bookcontrol page to page associated with display
+            # GCP Manager: use bookcontrol?
             if self.page:
                 pgnum = self.layerbook.GetPageIndex(self.page)
                 if pgnum > -1:
@@ -673,69 +443,24 @@
         for layer in qlayer:
             self.Map.DeleteLayer(layer)
 
-        # delete tmp lines
-        if self.MapWindow.mouse["use"] in ("measure",
-                                           "profile"):
-            self.MapWindow.polycoords = []
-            self.MapWindow.ClearLines()
+        self.SrcMapWindow.UpdateMap(render=True)
+        self.TgtMapWindow.UpdateMap(render=True)
+        self._mgr.Update()
         
-        # deselect features in vdigit
-        if self.toolbars['vdigit'] and self.digit:
-            self.digit.driver.SetSelected([])
-            self.MapWindow.UpdateMap(render=True, renderVector=True)
-        elif self.toolbars['gcpdisp']:
-            self.SrcMapWindow.UpdateMap(render=True)
-            self.TgtMapWindow.UpdateMap(render=True)
-            self._mgr.Update()
-        else:
-            self.MapWindow.UpdateMap(render=True)
-        
         # update statusbar
         self.StatusbarUpdate()
 
     def OnPointer(self, event):
         """!Pointer button clicked
         """
-        if self.toolbars['map']:
-            if event:
-                self.toolbars['map'].OnTool(event)
-            self.toolbars['map'].action['desc'] = ''
-        
-        self.MapWindow.mouse['use'] = "pointer"
-        self.MapWindow.mouse['box'] = "point"
-
         # change the cursor
-        if self.toolbars['vdigit']:
-            # digitization tool activated
-            self.MapWindow.SetCursor(self.cursors["cross"])
+        self.SrcMapWindow.SetCursor(self.cursors["cross"])
+        self.SrcMapWindow.mouse['use'] = "pointer"
+        self.SrcMapWindow.mouse['box'] = "point"
+        self.TgtMapWindow.SetCursor(self.cursors["cross"])
+        self.TgtMapWindow.mouse['use'] = "pointer"
+        self.TgtMapWindow.mouse['box'] = "point"
 
-            # reset mouse['box'] if needed
-            if self.toolbars['vdigit'].GetAction() in ['addLine']:
-                if self.toolbars['vdigit'].GetAction('type') in ['point', 'centroid']:
-                    self.MapWindow.mouse['box'] = 'point'
-                else: # line, boundary
-                    self.MapWindow.mouse['box'] = 'line'
-            elif self.toolbars['vdigit'].GetAction() in ['addVertex', 'removeVertex', 'splitLine',
-                                                         'editLine', 'displayCats', 'displayAttrs',
-                                                         'copyCats']:
-                self.MapWindow.mouse['box'] = 'point'
-            else: # moveLine, deleteLine
-                self.MapWindow.mouse['box'] = 'box'
-        
-        elif self._layerManager and self._layerManager.gcpmanagement:
-            self.SrcMapWindow.SetCursor(self.cursors["cross"])
-            self.SrcMapWindow.mouse['use'] = "pointer"
-            self.SrcMapWindow.mouse['box'] = "point"
-            self.TgtMapWindow.SetCursor(self.cursors["cross"])
-            self.TgtMapWindow.mouse['use'] = "pointer"
-            self.TgtMapWindow.mouse['box'] = "point"
-        
-        elif self._layerManager and self._layerManager.georectifying:
-            self.MapWindow.SetCursor(self.cursors["cross"])
-        
-        else:
-            self.MapWindow.SetCursor(self.cursors["default"])
-
     def OnZoomIn(self, event):
         """
         Zoom in the map.
@@ -753,19 +478,18 @@
         # change the cursor
         self.MapWindow.SetCursor(self.cursors["cross"])
 
-        if self._layerManager and self._layerManager.gcpmanagement:
-            if self.MapWindow == self.SrcMapWindow:
-                win = self.TgtMapWindow
-            elif self.MapWindow == self.TgtMapWindow:
-                win = self.SrcMapWindow
+        if self.MapWindow == self.SrcMapWindow:
+            win = self.TgtMapWindow
+        elif self.MapWindow == self.TgtMapWindow:
+            win = self.SrcMapWindow
 
-            win.mouse['use'] = "zoom"
-            win.mouse['box'] = "box"
-            win.zoomtype = 1
-            win.pen = wx.Pen(colour='Red', width=2, style=wx.SHORT_DASH)
-            
-            # change the cursor
-            win.SetCursor(self.cursors["cross"])
+        win.mouse['use'] = "zoom"
+        win.mouse['box'] = "box"
+        win.zoomtype = 1
+        win.pen = wx.Pen(colour='Red', width=2, style=wx.SHORT_DASH)
+        
+        # change the cursor
+        win.SetCursor(self.cursors["cross"])
 
     def OnZoomOut(self, event):
         """
@@ -784,19 +508,18 @@
         # change the cursor
         self.MapWindow.SetCursor(self.cursors["cross"])
 
-        if self._layerManager and self._layerManager.gcpmanagement:
-            if self.MapWindow == self.SrcMapWindow:
-                win = self.TgtMapWindow
-            elif self.MapWindow == self.TgtMapWindow:
-                win = self.SrcMapWindow
+        if self.MapWindow == self.SrcMapWindow:
+            win = self.TgtMapWindow
+        elif self.MapWindow == self.TgtMapWindow:
+            win = self.SrcMapWindow
 
-            win.mouse['use'] = "zoom"
-            win.mouse['box'] = "box"
-            win.zoomtype = -1
-            win.pen = wx.Pen(colour='Red', width=2, style=wx.SHORT_DASH)
-            
-            # change the cursor
-            win.SetCursor(self.cursors["cross"])
+        win.mouse['use'] = "zoom"
+        win.mouse['box'] = "box"
+        win.zoomtype = -1
+        win.pen = wx.Pen(colour='Red', width=2, style=wx.SHORT_DASH)
+        
+        # change the cursor
+        win.SetCursor(self.cursors["cross"])
 
     def OnZoomBack(self, event):
         """
@@ -819,18 +542,17 @@
         # change the cursor
         self.MapWindow.SetCursor(self.cursors["hand"])
 
-        if self._layerManager and self._layerManager.gcpmanagement:
-            if self.MapWindow == self.SrcMapWindow:
-                win = self.TgtMapWindow
-            elif self.MapWindow == self.TgtMapWindow:
-                win = self.SrcMapWindow
+        if self.MapWindow == self.SrcMapWindow:
+            win = self.TgtMapWindow
+        elif self.MapWindow == self.TgtMapWindow:
+            win = self.SrcMapWindow
 
-            win.mouse['use'] = "pan"
-            win.mouse['box'] = "pan"
-            win.zoomtype = 0
-            
-            # change the cursor
-            win.SetCursor(self.cursors["hand"])
+        win.mouse['use'] = "pan"
+        win.mouse['box'] = "pan"
+        win.zoomtype = 0
+        
+        # change the cursor
+        win.SetCursor(self.cursors["hand"])
 
     def OnErase(self, event):
         """
@@ -838,13 +560,12 @@
         """
         self.MapWindow.EraseMap()
 
-        if self._layerManager and self._layerManager.gcpmanagement:
-            if self.MapWindow == self.SrcMapWindow:
-                win = self.TgtMapWindow
-            elif self.MapWindow == self.TgtMapWindow:
-                win = self.SrcMapWindow
+        if self.MapWindow == self.SrcMapWindow:
+            win = self.TgtMapWindow
+        elif self.MapWindow == self.TgtMapWindow:
+            win = self.SrcMapWindow
 
-            win.EraseMap()
+        win.EraseMap()
 
     def OnZoomRegion(self, event):
         """
@@ -934,123 +655,45 @@
         """
         Go to position
         """
-        if self.toolbars['gcpdisp']:
-            #GCPNo = int(event.GetString())
-            GCPNo = self.statusbarWin['goto'].GetValue()
+        #GCPNo = int(event.GetString())
+        GCPNo = self.statusbarWin['goto'].GetValue()
 
-            if GCPNo < 0 or GCPNo > len(self.mapcoordlist):
-                wx.MessageBox(parent=self,
-                      message="%s 1 - %s." % (_("Valid Range:"),
-                                     len(self.mapcoordlist)),
-                      caption=_("Invalid GCP Number"), style=wx.OK | wx.ICON_ERROR | wx.CENTRE)
-                return
+        if GCPNo < 0 or GCPNo > len(self.mapcoordlist):
+            wx.MessageBox(parent=self,
+                  message="%s 1 - %s." % (_("Valid Range:"),
+                                 len(self.mapcoordlist)),
+                  caption=_("Invalid GCP Number"), style=wx.OK | wx.ICON_ERROR | wx.CENTRE)
+            return
 
-            if GCPNo == 0:
-                return
+        if GCPNo == 0:
+            return
 
-            self.list.selectedkey = GCPNo
-            self.list.selected = self.list.FindItemData(-1, GCPNo)
-            self.list.render = False
-            self.list.SetItemState(self.list.selected,
-                              wx.LIST_STATE_SELECTED,
-                              wx.LIST_STATE_SELECTED)
-            self.list.render = True
-            
-            # Source MapWindow:
-            begin = (self.mapcoordlist[GCPNo][1], self.mapcoordlist[GCPNo][2])
-            begin = self.SrcMapWindow.Cell2Pixel(begin)
-            end = begin
-            self.SrcMapWindow.Zoom(begin, end, 0)
+        self.list.selectedkey = GCPNo
+        self.list.selected = self.list.FindItemData(-1, GCPNo)
+        self.list.render = False
+        self.list.SetItemState(self.list.selected,
+                          wx.LIST_STATE_SELECTED,
+                          wx.LIST_STATE_SELECTED)
+        self.list.render = True
+        
+        # Source MapWindow:
+        begin = (self.mapcoordlist[GCPNo][1], self.mapcoordlist[GCPNo][2])
+        begin = self.SrcMapWindow.Cell2Pixel(begin)
+        end = begin
+        self.SrcMapWindow.Zoom(begin, end, 0)
 
-            # redraw map
-            self.SrcMapWindow.UpdateMap()
+        # redraw map
+        self.SrcMapWindow.UpdateMap()
 
-            if self.show_target:
-                # Target MapWindow:
-                begin = (self.mapcoordlist[GCPNo][3], self.mapcoordlist[GCPNo][4])
-                begin = self.TgtMapWindow.Cell2Pixel(begin)
-                end = begin
-                self.TgtMapWindow.Zoom(begin, end, 0)
+        if self.show_target:
+            # Target MapWindow:
+            begin = (self.mapcoordlist[GCPNo][3], self.mapcoordlist[GCPNo][4])
+            begin = self.TgtMapWindow.Cell2Pixel(begin)
+            end = begin
+            self.TgtMapWindow.Zoom(begin, end, 0)
 
-                # redraw map
-                self.TgtMapWindow.UpdateMap()
-
-        else:
-            try:
-                if self.statusbarWin['projection'].IsChecked():
-                    if not UserSettings.Get(group='projection', key='statusbar', subkey='proj4'):
-                        self.statusbar.SetStatusText(_("Projection not defined (check the settings)"), 0)
-                    else:
-                        # reproject values
-                        projIn = UserSettings.Get(group='projection',
-                                                  key='statusbar',
-                                                  subkey='proj4')
-                        projOut = gcmd.RunCommand('g.proj',
-                                                  flags = 'jf',
-                                                  read = True)
-                        proj = projIn.split(' ')[0].split('=')[1]
-                        if proj in ('ll', 'latlong', 'longlat'):
-                            e, n = self.statusbarWin['goto'].GetValue().split(';')
-                            e, n = utils.DMS2Deg(e, n)
-                            proj, coord1 = utils.ReprojectCoordinates(coord = (e, n),
-                                                                      projIn = projIn,
-                                                                      projOut = projOut, flags = 'd')
-                            e, n = coord1
-                        else:
-                            e, n = map(float, self.statusbarWin['goto'].GetValue().split(';'))
-                            proj, coord1 = utils.ReprojectCoordinates(coord = (e, n),
-                                                                      projIn = projIn,
-                                                                      projOut = projOut, flags = 'd')
-                            e, n = coord1
-                else:
-                    if self.Map.projinfo['proj'] == 'll':
-                        e, n = self.statusbarWin['goto'].GetValue().split(';')
-                    else:
-                        e, n = map(float, self.statusbarWin['goto'].GetValue().split(';'))
-                        
-                region = self.Map.GetCurrentRegion()
-                if self.statusbarWin['projection'].IsChecked():
-                    if not UserSettings.Get(group='projection', key='statusbar', subkey='proj4'):
-                        self.statusbar.SetStatusText(_("Projection not defined (check the settings)"), 0)
-                    else:
-                        region['center_easting'], region['center_northing'] = e, n
-                else:
-                    if self.Map.projinfo['proj'] == 'll':
-                        region['center_easting'], region['center_northing'] = utils.DMS2Deg(e, n)
-                    else:
-                        region['center_easting'], region['center_northing'] = e, n
-            except ValueError:
-                region = self.Map.GetCurrentRegion()
-                precision = int(UserSettings.Get(group = 'projection', key = 'format',
-                                                 subkey = 'precision'))
-                format = UserSettings.Get(group = 'projection', key = 'format',
-                                          subkey = 'll')
-                if self.Map.projinfo['proj'] == 'll' and format == 'DMS':
-                        self.statusbarWin['goto'].SetValue("%s" % utils.Deg2DMS(region['center_easting'], 
-                                                                                region['center_northing'],
-                                                                                precision = precision))
-                else:
-                    self.statusbarWin['goto'].SetValue("%.*f; %.*f" % \
-                                                           (precision, region['center_easting'],
-                                                            precision, region['center_northing']))
-                return
-            
-            
-            dn = (region['nsres'] * region['rows']) / 2.
-            region['n'] = region['center_northing'] + dn
-            region['s'] = region['center_northing'] - dn
-            de = (region['ewres'] * region['cols']) / 2.
-            region['e'] = region['center_easting'] + de
-            region['w'] = region['center_easting'] - de
-        
-            self.Map.AdjustRegion()
-
-            # add to zoom history
-            self.MapWindow.ZoomHistory(region['n'], region['s'],
-                                       region['e'], region['w'])
-        
             # redraw map
-            self.MapWindow.UpdateMap()
+            self.TgtMapWindow.UpdateMap()
 
         self.statusbarWin['goto'].SetFocus()
         
@@ -1061,7 +704,6 @@
         self.statusbarWin['resolution'].Hide()
         self.statusbarWin['mapscale'].Hide()
         self.statusbarWin['goto'].Hide()
-        self.statusbarWin['projection'].Hide()
         self.mapScaleValue = self.ppm = None
 
         if self.statusbarWin['toggle'].GetSelection() == 0: # Coordinates
@@ -1081,80 +723,32 @@
             format = UserSettings.Get(group = 'projection', key = 'format',
                                       subkey = 'll')
             
-            if self.statusbarWin['projection'].IsChecked():
-                if not UserSettings.Get(group='projection', key='statusbar', subkey='proj4'):
-                    self.statusbar.SetStatusText(_("Projection not defined (check the settings)"), 0)
+            if self.Map.projinfo['proj'] == 'll' and format == 'DMS':
+                w, s = utils.Deg2DMS(region["w"], region["s"],
+                                     string = False, precision = precision)
+                e, n = utils.Deg2DMS(region["e"], region["n"],
+                                     string = False, precision = precision)
+                if sel == 1:
+                    self.statusbar.SetStatusText("%s - %s, %s - %s" %
+                                                 (w, e, s, n), 0)
                 else:
-                    projOut = UserSettings.Get(group='projection',
-                                               key='statusbar',
-                                               subkey='proj4')
-                    proj, coord1 = utils.ReprojectCoordinates(coord = (region["w"], region["s"]),
-                                                              projOut = projOut, flags = 'd')
-                    proj, coord2 = utils.ReprojectCoordinates(coord = (region["e"], region["n"]),
-                                                          projOut = projOut, flags = 'd')
-                    if sel == 2:
-                        proj, coord3 = utils.ReprojectCoordinates(coord = (0.0, 0.0),
-                                                                  projOut = projOut, flags = 'd')
-                        proj, coord4 = utils.ReprojectCoordinates(coord = (region["ewres"], region["nsres"]),
-                                                                  projOut = projOut, flags = 'd')
-                    if coord1 and coord2:
-                        if proj in ('ll', 'latlong', 'longlat') and format == 'DMS':
-                            w, s = utils.Deg2DMS(coord1[0], coord1[1], string = False,
-                                                 precision = precision)
-                            e, n = utils.Deg2DMS(coord2[0], coord2[1], string = False,
-                                                 precision = precision)
-                            if sel == 1:
-                                self.statusbar.SetStatusText("%s - %s, %s - %s" %
-                                                             (w, e, s, n), 0)
-                            else:
-                                ewres, nsres = utils.Deg2DMS(abs(coord3[0]) - abs(coord4[0]),
-                                                             abs(coord3[1]) - abs(coord4[1]),
-                                                             string = False, hemisphere = False,
-                                                             precision = precision)
-                                self.statusbar.SetStatusText("%s - %s, %s - %s (%s, %s)" %
-                                                             (w, e, s, n, ewres, nsres), 0)
-                        else:
-                            w, s = coord1
-                            e, n = coord2
-                            if sel == 1:
-                                self.statusbar.SetStatusText("%.*f - %.*f, %.*f - %.*f" %
-                                                         (precision, w, precision, e,
-                                                          precision, s, precision, n), 0)
-                            else:
-                                ewres, nsres = coord3
-                                self.statusbar.SetStatusText("%.*f - %.*f, %.*f - %.*f (%.*f, %.*f)" %
-                                                             (precision, w, precision, e,
-                                                              precision, s, precision, n,
-                                                              precision, ewres, precision, nsres), 0)
-                    else:
-                        self.statusbar.SetStatusText(_("Error in projection (check the settings)"), 0)
+                    ewres, nsres = utils.Deg2DMS(region['ewres'], region['nsres'],
+                                                 string = False, precision = precision)
+                    self.statusbar.SetStatusText("%s - %s, %s - %s (%s, %s)" %
+                                                 (w, e, s, n, ewres, nsres), 0)
             else:
-                if self.Map.projinfo['proj'] == 'll' and format == 'DMS':
-                    w, s = utils.Deg2DMS(region["w"], region["s"],
-                                         string = False, precision = precision)
-                    e, n = utils.Deg2DMS(region["e"], region["n"],
-                                         string = False, precision = precision)
-                    if sel == 1:
-                        self.statusbar.SetStatusText("%s - %s, %s - %s" %
-                                                     (w, e, s, n), 0)
-                    else:
-                        ewres, nsres = utils.Deg2DMS(region['ewres'], region['nsres'],
-                                                     string = False, precision = precision)
-                        self.statusbar.SetStatusText("%s - %s, %s - %s (%s, %s)" %
-                                                     (w, e, s, n, ewres, nsres), 0)
+                w, s = region["w"], region["s"]
+                e, n = region["e"], region["n"]
+                if sel == 1:
+                    self.statusbar.SetStatusText("%.*f - %.*f, %.*f - %.*f" %
+                                                 (precision, w, precision, e,
+                                                  precision, s, precision, n), 0)
                 else:
-                    w, s = region["w"], region["s"]
-                    e, n = region["e"], region["n"]
-                    if sel == 1:
-                        self.statusbar.SetStatusText("%.*f - %.*f, %.*f - %.*f" %
-                                                     (precision, w, precision, e,
-                                                      precision, s, precision, n), 0)
-                    else:
-                        ewres, nsres = region['ewres'], region['nsres']
-                        self.statusbar.SetStatusText("%.*f - %.*f, %.*f - %.*f (%.*f, %.*f)" %
-                                                     (precision, w, precision, e,
-                                                      precision, s, precision, n,
-                                                      precision, ewres, precision, nsres), 0)
+                    ewres, nsres = region['ewres'], region['nsres']
+                    self.statusbar.SetStatusText("%.*f - %.*f, %.*f - %.*f (%.*f, %.*f)" %
+                                                 (precision, w, precision, e,
+                                                  precision, s, precision, n,
+                                                  precision, ewres, precision, nsres), 0)
             # enable long help
             self.StatusbarEnableLongHelp()
 
@@ -1229,68 +823,21 @@
         elif self.statusbarWin['toggle'].GetSelection() == 7: # go to
 
             self.statusbar.SetStatusText("")
-            if self.toolbars['gcpdisp']:
-                max = self.list.GetItemCount()
-                if max < 1:
-                    max = 1
-                self.statusbarWin['goto'].SetRange(0, max)
-            else:
-                self.statusbar.SetStatusText("")
-                region = self.Map.GetCurrentRegion()
-                precision = int(UserSettings.Get(group = 'projection', key = 'format',
-                                                 subkey = 'precision'))
-                format = UserSettings.Get(group = 'projection', key = 'format',
-                                          subkey = 'll')
-                
-                if self.statusbarWin['projection'].IsChecked():
-                    if not UserSettings.Get(group='projection', key='statusbar', subkey='proj4'):
-                        self.statusbar.SetStatusText(_("Projection not defined (check the settings)"), 0)
-                    else:
-                        proj, coord  = utils.ReprojectCoordinates(coord = (region['center_easting'],
-                                                                           region['center_northing']),
-                                                                  projOut = UserSettings.Get(group='projection',
-                                                                                             key='statusbar',
-                                                                                             subkey='proj4'),
-                                                                  flags = 'd')
-                        if coord:
-                            if proj in ('ll', 'latlong', 'longlat') and format == 'DMS':
-                                self.statusbarWin['goto'].SetValue("%s" % utils.Deg2DMS(coord[0],
-                                                                                        coord[1],
-                                                                                        precision = precision))
-                            else:
-                                self.statusbarWin['goto'].SetValue("%.*f; %.*f" % (precision, coord[0],
-                                                                                   precision, coord[1]))
-                        else:
-                            self.statusbar.SetStatusText(_("Error in projection (check the settings)"), 0)
-                else:
-                    if self.Map.projinfo['proj'] == 'll' and format == 'DMS':
-                        self.statusbarWin['goto'].SetValue("%s" % utils.Deg2DMS(region['center_easting'], 
-                                                                                region['center_northing'],
-                                                                                precision = precision))
-                    else:
-                        self.statusbarWin['goto'].SetValue("%.*f; %.*f" % (precision, region['center_easting'],
-                                                                           precision, region['center_northing']))
+            max = self.list.GetItemCount()
+            if max < 1:
+                max = 1
+            self.statusbarWin['goto'].SetRange(0, max)
+
             self.statusbarWin['goto'].Show()
 
             # disable long help
             self.StatusbarEnableLongHelp(False)
         
-        elif self.statusbarWin['toggle'].GetSelection() == 8: # projection
-            if self.toolbars['gcpdisp']: # RMS error, not projection
-                self.statusbar.SetStatusText(_("Forward: %s, Backward: %s") %
-                                             (self.fwd_rmserror, self.bkw_rmserror))
-            else:
-                self.statusbar.SetStatusText("")
-                epsg = UserSettings.Get(group='projection', key='statusbar', subkey='epsg')
-                if epsg:
-                    label = '%s (EPSG: %s)' % (_("Use defined projection"), epsg)
-                    self.statusbarWin['projection'].SetLabel(label)
-                else:
-                    self.statusbarWin['projection'].SetLabel(_("Use defined projection"))
-                self.statusbarWin['projection'].Show()
-                
-                # disable long help
-                self.StatusbarEnableLongHelp(False)
+        elif self.statusbarWin['toggle'].GetSelection() == 8: # RMS error
+            self.statusbar.SetStatusText(_("Forward: %s, Backward: %s") %
+                                         (self.fwd_rmserror, self.bkw_rmserror))
+            # disable long help
+            # self.StatusbarEnableLongHelp(False)
             
         else:
             self.statusbar.SetStatusText("", 1)
@@ -1308,7 +855,6 @@
                    (0, self.statusbarWin['resolution']),
                    (0, self.statusbarWin['mapscale']),
                    (0, self.statusbarWin['progress']),
-                   (0, self.statusbarWin['projection']),
                    (0, self.statusbarWin['goto']),
                    (1, self.statusbarWin['toggle']),
                    (2, self.statusbarWin['mask']),
@@ -1344,17 +890,12 @@
     def SaveToFile(self, event):
         """!Save map to image
         """
-        if self.toolbars['nviz']:
-            filetype = "PPM file (*.ppm)|*.ppm|TIF file (*.tif)|*.tif"
-            ltype = [{ 'ext' : 'ppm', 'type' : -1 },
-                     { 'ext' : 'tif', 'type' : wx.BITMAP_TYPE_TIF }]
-        else:
-            img = self.MapWindow.img
-            if not img:
-                gcmd.GMessage(parent = self,
-                              message = _("Nothing to render (empty map). Operation canceled."))
-                return
-            filetype, ltype = gdialogs.GetImageHandlers(img)
+        img = self.MapWindow.img
+        if not img:
+            gcmd.GMessage(parent = self,
+                          message = _("Nothing to render (empty map). Operation canceled."))
+            return
+        filetype, ltype = gdialogs.GetImageHandlers(img)
 
         # get size
         dlg = gdialogs.ImageSizeDialog(self)
@@ -1413,30 +954,6 @@
         self.PopupMenu(printmenu)
         printmenu.Destroy()
 
-    def OnCloseWindow(self, event):
-        """!Window closed.
-        Also close associated layer tree page
-        """
-        pgnum = None
-        self.Map.Clean()
-        
-        # close edited map and 3D tools properly
-        if self.toolbars['vdigit']:
-            maplayer = self.toolbars['vdigit'].GetLayer()
-            if maplayer:
-                self.toolbars['vdigit'].OnExit()
-                self.imgVectorMap = None
-
-        if self.toolbars['nviz']:
-            self.toolbars['nviz'].OnExit()
-        
-        if not self._layerManager:
-            self.Destroy()
-        elif self.page:
-            pgnum = self.layerbook.GetPageIndex(self.page)
-            if pgnum > -1:
-                self.layerbook.DeletePage(pgnum)
-        
     def GetRender(self):
         """!Returns current instance of render.Map()
         """
@@ -1446,449 +963,6 @@
         """!Get map window"""
         return self.MapWindow
     
-    def OnQueryDisplay(self, event):
-        """!Query currrent raster/vector map layers (display mode)
-        """
-        if self.toolbars['map'].GetAction() == 'displayAttrb': # select previous action
-            self.toolbars['map'].SelectDefault(event)
-            return
-
-        self.toolbars['map'].action['desc'] = 'displayAttrb'
-        
-        # switch GIS Manager to output console to show query results
-        self._layerManager.notebook.SetSelection(1)
-
-        self.MapWindow.mouse['use'] = "query"
-        self.MapWindow.mouse['box'] = "point"
-        self.MapWindow.zoomtype = 0
-
-        # change the cursor
-        self.MapWindow.SetCursor(self.cursors["cross"])
-
-    def OnQueryModify(self, event):
-        """
-        Query vector map layer (edit mode)
-        """
-        if self.toolbars['map'].GetAction() == 'modifyAttrb': # select previous action
-            self.toolbars['map'].SelectDefault(event)
-            return
-        
-        self.toolbars['map'].action['desc'] = 'modifyAttrb'
-        
-        self.MapWindow.mouse['use'] = "queryVector"
-        self.MapWindow.mouse['box'] = "point"
-        self.MapWindow.pen = wx.Pen(colour='Red', width=2, style=wx.SHORT_DASH)
-        self.MapWindow.zoomtype = 0
-
-        # change the cursor
-        self.MapWindow.SetCursor(self.cursors["cross"])
-        
-    def QueryMap(self, x, y):
-        """!Query map layer features
-
-        Currently only raster and vector map layers are supported.
-        
-        @param x,y coordinates
-        """
-        #set query snap distance for v.what at mapunit equivalent of 10 pixels
-        qdist = 10.0 * ((self.Map.region['e'] - self.Map.region['w']) / self.Map.width)
-        east, north = self.MapWindow.Pixel2Cell((x, y))
-
-        num = 0
-        for layer in self.tree.GetSelections():
-            type = self.tree.GetPyData(layer)[0]['maplayer'].GetType()
-            if type in ('raster', 'rgb', 'his',
-                        'vector', 'thememap', 'themechart'):
-                num += 1
-        
-        if num < 1:
-            dlg = wx.MessageDialog(parent = self,
-                                   message = _('No raster or vector map layer selected for querying.'),
-                                   caption = _('No map layer selected'),
-                                   style = wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
-            dlg.ShowModal()
-            dlg.Destroy()
-            return
-        
-        mapname = None
-        raststr = ''
-        vectstr = ''
-        rcmd = ['r.what', '--q']
-        vcmd = ['v.what', '--q']
-        for layer in self.tree.GetSelections():
-            type = self.tree.GetPyData(layer)[0]['maplayer'].GetType()
-            dcmd = self.tree.GetPyData(layer)[0]['cmd']
-            name = utils.GetLayerNameFromCmd(dcmd)
-            if name == '':
-                continue
-            if type in ('raster', 'rgb', 'his'):
-                raststr += "%s," % name
-            elif type in ('vector', 'thememap', 'themechart'):
-                vectstr += "%s," % name
-
-        # use display region settings instead of computation region settings
-        self.tmpreg = os.getenv("GRASS_REGION")
-        os.environ["GRASS_REGION"] = self.Map.SetRegion(windres=False)
-        
-        # build query commands for any selected rasters and vectors
-        if raststr != '':
-            rcmd.append('-f')
-            rcmd.append('input=%s' % raststr.rstrip(','))
-            rcmd.append('east_north=%f,%f' % (float(east), float(north)))
-        
-        if vectstr != '':
-            # check for vector maps open to be edited
-            digitToolbar = self.toolbars['vdigit']
-            if digitToolbar:
-                map = digitToolbar.GetLayer().GetName()
-                vect = []
-                for vector in vectstr.split(','):
-                    if map == vector:
-                        self._layerManager.goutput.WriteWarning("Vector map <%s> "
-                                                                "opened for editing - skipped." % map)
-                        continue
-                    vect.append(vector)
-                vectstr = ','.join(vect)
-            
-            if len(vectstr) <= 1:
-                self._layerManager.goutput.WriteCmdLog("Nothing to query.")
-                return
-            
-            vcmd.append('-a')
-            vcmd.append('map=%s' % vectstr.rstrip(','))
-            vcmd.append('east_north=%f,%f' % (float(east), float(north)))
-            vcmd.append('distance=%f' % float(qdist))
-        
-        # parse query command(s)
-        if self._layerManager:
-            if raststr:
-                self._layerManager.goutput.RunCmd(rcmd,
-                                                  compReg=False,
-                                                  onDone = self._QueryMapDone)
-            if vectstr:
-                self._layerManager.goutput.RunCmd(vcmd,
-                                                  onDone = self._QueryMapDone)
-        else:
-            if raststr:
-                gcmd.RunCommand(rcmd)
-            if vectstr:
-                gcmd.RunCommand(vcmd)
-        
-    def _QueryMapDone(self, returncode):
-        """!Restore settings after querying (restore GRASS_REGION)
-
-        @param returncode command return code
-        """
-        if hasattr(self, "tmpreg"):
-            if self.tmpreg:
-                os.environ["GRASS_REGION"] = self.tmpreg
-            elif os.environ.has_key('GRASS_REGION'):
-                del os.environ["GRASS_REGION"]
-        elif os.environ.has_key('GRASS_REGION'):
-            del os.environ["GRASS_REGION"]
-        
-        if hasattr(self, "tmpreg"):
-            del self.tmpreg
-        
-    def QueryVector(self, x, y):
-        """
-        Query vector map layer features
-
-        Attribute data of selected vector object are displayed in GUI dialog.
-        Data can be modified (On Submit)
-        """
-        if not self.tree.layer_selected or \
-                self.tree.GetPyData(self.tree.layer_selected)[0]['type'] != 'vector':
-            wx.MessageBox(parent=self,
-                          message=_("No vector map selected for querying."),
-                          caption=_("Vector querying"),
-                          style=wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
-            return
-        
-        if self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer'].GetMapset() != \
-                grass.gisenv()['MAPSET']:
-            wx.MessageBox(parent=self,
-                          message=_("Only vector map from the current mapset can be modified."),
-                          caption=_("Vector querying"),
-                          style=wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
-            return
-        
-        posWindow = self.ClientToScreen((x + self.MapWindow.dialogOffset,
-                                         y + self.MapWindow.dialogOffset))
-
-        qdist = 10.0 * ((self.Map.region['e'] - self.Map.region['w']) /
-                        self.Map.width)
-        
-        east, north = self.MapWindow.Pixel2Cell((x, y))
-        
-        mapName = self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer'].name
-        
-        if self.dialogs['attributes'] is None:
-            self.dialogs['attributes'] = \
-                dbm_dialogs.DisplayAttributesDialog(parent=self.MapWindow,
-                                                    map=mapName,
-                                                    query=((east, north), qdist),
-                                                    pos=posWindow,
-                                                    action="update")
-        else:
-            # selection changed?
-            if not self.dialogs['attributes'].mapDBInfo or \
-                    self.dialogs['attributes'].mapDBInfo.map != mapName:
-                self.dialogs['attributes'].UpdateDialog(map=mapName, query=((east, north), qdist))
-            else:
-                self.dialogs['attributes'].UpdateDialog(query=((east, north), qdist))
-                
-        cats = self.dialogs['attributes'].GetCats()
-        
-        try:
-            qlayer = self.Map.GetListOfLayers(l_name=globalvar.QUERYLAYER)[0]
-        except IndexError:
-            qlayer = None
-        
-        if self.dialogs['attributes'].mapDBInfo and cats:
-            # highlight feature & re-draw map
-            if qlayer:
-                qlayer.SetCmd(self.AddTmpVectorMapLayer(mapName, cats,
-                                                        useId=False,
-                                                        addLayer=False))
-            else:
-                qlayer = self.AddTmpVectorMapLayer(mapName, cats, useId=False)
-            
-            # set opacity based on queried layer
-            opacity = self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer'].GetOpacity(float=True)
-            qlayer.SetOpacity(opacity)
-            
-            self.MapWindow.UpdateMap(render=False, renderVector=False)
-            if not self.dialogs['attributes'].IsShown():
-                self.dialogs['attributes'].Show()
-        else:
-            if qlayer:
-                self.Map.DeleteLayer(qlayer)
-                self.MapWindow.UpdateMap(render=False, renderVector=False)
-            if self.dialogs['attributes'].IsShown():
-                self.dialogs['attributes'].Hide()
-        
-    def OnQuery(self, event):
-        """!Query tools menu"""
-        if self.toolbars['map']:
-            self.toolbars['map'].OnTool(event)
-            action = self.toolbars['map'].GetAction()
-        
-        point = wx.GetMousePosition()
-        toolsmenu = wx.Menu()
-        # Add items to the menu
-        display = wx.MenuItem(parentMenu=toolsmenu, id=wx.ID_ANY,
-                              text=_("Query raster/vector map(s) (display mode)"),
-                              kind=wx.ITEM_CHECK)
-        toolsmenu.AppendItem(display)
-        self.Bind(wx.EVT_MENU, self.OnQueryDisplay, display)
-        numLayers = 0
-        for layer in self.tree.GetSelections():
-            type = self.tree.GetPyData(layer)[0]['maplayer'].GetType()
-            if type in ('raster', 'rgb', 'his',
-                        'vector', 'thememap', 'themechart'):
-                numLayers += 1
-        if numLayers < 1:
-            display.Enable(False)
-        
-        if action == "displayAttrb":
-            display.Check(True)
-        
-        modify = wx.MenuItem(parentMenu=toolsmenu, id=wx.ID_ANY,
-                             text=_("Query vector map (edit mode)"),
-                             kind=wx.ITEM_CHECK)
-        toolsmenu.AppendItem(modify)
-        self.Bind(wx.EVT_MENU, self.OnQueryModify, modify)
-        digitToolbar = self.toolbars['vdigit']
-        if self.tree.layer_selected:
-            layer_selected = self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer']
-            if layer_selected.GetType() != 'vector' or \
-                    (digitToolbar and \
-                         digitToolbar.GetLayer() == layer_selected):
-                modify.Enable(False)
-            else:
-                if action == "modifyAttrb":
-                    modify.Check(True)
-        
-        self.PopupMenu(toolsmenu)
-        toolsmenu.Destroy()
-
-    def AddTmpVectorMapLayer(self, name, cats, useId=False, addLayer=True):
-        """
-        Add temporal vector map layer to map composition
-
-        @param name name of map layer
-        @param useId use feature id instead of category 
-        """
-        # color settings from ATM
-        color = UserSettings.Get(group='atm', key='highlight', subkey='color')
-        colorStr = str(color[0]) + ":" + \
-            str(color[1]) + ":" + \
-            str(color[2])
-
-        # icon used in vector display and its size
-        icon = ''
-        size = 0
-        vparam = self.tree.GetPyData(self.tree.layer_selected)[0]['cmd']
-        for p in vparam:
-            if '=' in p:
-                parg,pval = p.split('=')
-                if parg == 'icon': icon = pval
-                elif parg == 'size': size = int(pval)
-
-        pattern = ["d.vect",
-                   "map=%s" % name,
-                   "color=%s" % colorStr,
-                   "fcolor=%s" % colorStr,
-                   "width=%d"  % UserSettings.Get(group='atm', key='highlight', subkey='width')]
-        if icon != '':
-            pattern.append('icon=%s' % icon)
-        if size > 0:
-            pattern.append('size=%i' % size)
-        
-        if useId:
-            cmd = pattern
-            cmd.append('-i')
-            cmd.append('cats=%s' % str(cats))
-        else:
-            cmd = []
-            for layer in cats.keys():
-                cmd.append(copy.copy(pattern))
-                lcats = cats[layer]
-                cmd[-1].append("layer=%d" % layer)
-                cmd[-1].append("cats=%s" % utils.ListOfCatsToRange(lcats))
-        
-        #     if self.icon:
-        #         cmd.append("icon=%s" % (self.icon))
-        #     if self.pointsize:
-        #         cmd.append("size=%s" % (self.pointsize))
-
-        if addLayer:
-            if useId:
-                return self.Map.AddLayer(type='vector', name=globalvar.QUERYLAYER, command=cmd,
-                                         l_active=True, l_hidden=True, l_opacity=1.0)
-            else:
-                return self.Map.AddLayer(type='command', name=globalvar.QUERYLAYER, command=cmd,
-                                         l_active=True, l_hidden=True, l_opacity=1.0)
-        else:
-            return cmd
-
-    def OnAnalyze(self, event):
-        """
-        Analysis tools menu
-        """
-        point = wx.GetMousePosition()
-        toolsmenu = wx.Menu()
-        # Add items to the menu
-        measure = wx.MenuItem(toolsmenu, wx.ID_ANY, Icons["measure"].GetLabel())
-        measure.SetBitmap(Icons["measure"].GetBitmap(self.iconsize))
-        toolsmenu.AppendItem(measure)
-        self.Bind(wx.EVT_MENU, self.OnMeasure, measure)
-
-        profile = wx.MenuItem(toolsmenu, wx.ID_ANY, Icons["profile"].GetLabel())
-        profile.SetBitmap(Icons["profile"].GetBitmap(self.iconsize))
-        toolsmenu.AppendItem(profile)
-        self.Bind(wx.EVT_MENU, self.Profile, profile)
-
-        histogram = wx.MenuItem(toolsmenu, wx.ID_ANY, Icons["histogram"].GetLabel())
-        histogram.SetBitmap(Icons["histogram"].GetBitmap(self.iconsize))
-        toolsmenu.AppendItem(histogram)
-        self.Bind(wx.EVT_MENU, self.Histogram, histogram)
-
-        # Popup the menu.  If an item is selected then its handler
-        # will be called before PopupMenu returns.
-        self.PopupMenu(toolsmenu)
-        toolsmenu.Destroy()
-
-    def OnMeasure(self, event):
-        """
-        Init measurement routine that calculates
-        map distance along transect drawn on
-        map display
-        """
-
-        self.totaldist = 0.0 # total measured distance
-
-        # switch GIS Manager to output console to show measure results
-        self._layerManager.notebook.SetSelection(1)
-
-        # change mouse to draw line for measurement
-        self.MapWindow.mouse['use'] = "measure"
-        self.MapWindow.mouse['box'] = "line"
-        self.MapWindow.zoomtype = 0
-        self.MapWindow.pen     = wx.Pen(colour='red', width=2, style=wx.SHORT_DASH)
-        self.MapWindow.polypen = wx.Pen(colour='green', width=2, style=wx.SHORT_DASH)
-
-        # change the cursor
-        self.MapWindow.SetCursor(self.cursors["pencil"])
-
-        # initiating output
-        style = self._layerManager.goutput.cmd_output.StyleWarning
-        self._layerManager.goutput.WriteLog(_('Click and drag with left mouse button '
-                                              'to measure.%s'
-                                              'Double click with left button to clear.') % \
-                                                (os.linesep), style)
-        if self.Map.projinfo['proj'] != 'xy':
-            units = self.Map.projinfo['units']
-            style = self._layerManager.goutput.cmd_output.StyleCommand
-            self._layerManager.goutput.WriteLog(_('Measuring distance') + ' ('
-                                                + units + '):',
-                                                style)
-        else:
-            self._layerManager.goutput.WriteLog(_('Measuring distance:'),
-                                                style)
-
-    def MeasureDist(self, beginpt, endpt):
-        """!Calculate map distance from screen distance
-        and print to output window
-        """
-        if self._layerManager.notebook.GetSelection() != 1:
-            self._layerManager.notebook.SetSelection(1)
-
-        dist, (north, east) = self.MapWindow.Distance(beginpt, endpt)
-
-        dist = round(dist, 3)
-        d, dunits = self.FormatDist(dist)
-
-        self.totaldist += dist
-        td, tdunits = self.FormatDist(self.totaldist)
-
-        strdist = str(d)
-        strtotdist = str(td)
-
-        if self.Map.projinfo['proj'] == 'xy' or 'degree' not in self.Map.projinfo['unit']:
-            angle = int(math.degrees(math.atan2(north,east)) + 0.5)
-            angle = 180 - angle
-            if angle < 0:
-                angle = 360+angle
-
-            mstring = 'segment = %s %s\ttotal distance = %s %s\tbearing = %d deg' \
-                % (strdist,dunits,strtotdist,tdunits,angle)
-        else:
-            mstring = 'segment = %s %s\ttotal distance = %s %s' \
-                % (strdist,dunits,strtotdist,tdunits)
-
-        self._layerManager.goutput.WriteLog(mstring)
-
-        return dist
-
-    def Profile(self, event):
-        """
-        Init profile canvas and tools
-        """
-        raster = []
-        if self.tree.layer_selected and \
-                self.tree.GetPyData(self.tree.layer_selected)[0]['type'] == 'raster':
-            raster.append(self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer'].name)
-
-        self.profile = profile.ProfileFrame(self,
-                                            id=wx.ID_ANY, pos=wx.DefaultPosition, size=(700,300),
-                                            style=wx.DEFAULT_FRAME_STYLE, rasterList=raster)
-        self.profile.Show()
-        # Open raster select dialog to make sure that a raster (and the desired raster)
-        # is selected to be profiled
-        self.profile.OnSelectRaster(None)
-
     def FormatDist(self, dist):
         """!Format length numbers and units in a nice way,
         as a function of length. From code by Hamish Bowman
@@ -1935,178 +1009,12 @@
 
         return (outdist, outunits)
 
-
-    def Histogram(self, event):
-        """
-        Init histogram display canvas and tools
-        """
-        self.histogram = histogram.HistFrame(self,
-                                             id=wx.ID_ANY, size=globalvar.HIST_WINDOW_SIZE,
-                                             style=wx.DEFAULT_FRAME_STYLE)
-
-        #show new display
-        self.histogram.Show()
-        self.histogram.Refresh()
-        self.histogram.Update()
-
-
-    def OnDecoration(self, event):
-        """
-        Decorations overlay menu
-        """
-        point = wx.GetMousePosition()
-        decmenu = wx.Menu()
-        # Add items to the menu
-        AddScale = wx.MenuItem(decmenu, wx.ID_ANY, Icons["addbarscale"].GetLabel())
-        AddScale.SetBitmap(Icons["addbarscale"].GetBitmap(self.iconsize))
-        decmenu.AppendItem(AddScale)
-        self.Bind(wx.EVT_MENU, self.OnAddBarscale, AddScale)
-
-        AddLegend = wx.MenuItem(decmenu, wx.ID_ANY, Icons["addlegend"].GetLabel())
-        AddLegend.SetBitmap(Icons["addlegend"].GetBitmap(self.iconsize))
-        decmenu.AppendItem(AddLegend)
-        self.Bind(wx.EVT_MENU, self.OnAddLegend, AddLegend)
-
-        AddText = wx.MenuItem(decmenu, wx.ID_ANY, Icons["addtext"].GetLabel())
-        AddText.SetBitmap(Icons["addtext"].GetBitmap(self.iconsize))
-        decmenu.AppendItem(AddText)
-        self.Bind(wx.EVT_MENU, self.OnAddText, AddText)
-
-        # Popup the menu.  If an item is selected then its handler
-        # will be called before PopupMenu returns.
-        self.PopupMenu(decmenu)
-        decmenu.Destroy()
-
-    def OnAddBarscale(self, event):
-        """
-        Handler for scale/arrow map decoration menu selection.
-        """
-        if self.dialogs['barscale']:
-            return
-
-        id = 0 # unique index for overlay layer
-
-        # If location is latlon, only display north arrow (scale won't work)
-        #        proj = self.Map.projinfo['proj']
-        #        if proj == 'll':
-        #            barcmd = 'd.barscale -n'
-        #        else:
-        #            barcmd = 'd.barscale'
-
-        # decoration overlay control dialog
-        self.dialogs['barscale'] = \
-            gdialogs.DecorationDialog(parent=self, title=_('Scale and North arrow'),
-                                      size=(350, 200),
-                                      style=wx.DEFAULT_DIALOG_STYLE | wx.CENTRE,
-                                      cmd=['d.barscale', 'at=0,5'],
-                                      ovlId=id,
-                                      name='barscale',
-                                      checktxt = _("Show/hide scale and North arrow"),
-                                      ctrltxt = _("scale object"))
-
-        self.dialogs['barscale'].CentreOnParent()
-        ### dialog cannot be show as modal - in the result d.barscale is not selectable
-        ### self.dialogs['barscale'].ShowModal()
-        self.dialogs['barscale'].Show()
-        self.MapWindow.mouse['use'] = 'pointer'        
-
-    def OnAddLegend(self, event):
-        """
-        Handler for legend map decoration menu selection.
-        """
-        if self.dialogs['legend']:
-            return
-        
-        id = 1 # index for overlay layer in render
-
-        cmd = ['d.legend', 'at=5,50,2,5']
-        if self.tree.layer_selected and \
-                self.tree.GetPyData(self.tree.layer_selected)[0]['type'] == 'raster':
-            cmd.append('map=%s' % self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer'].name)
-
-        # Decoration overlay control dialog
-        self.dialogs['legend'] = \
-            gdialogs.DecorationDialog(parent=self, title=('Legend'),
-                                      size=(350, 200),
-                                      style=wx.DEFAULT_DIALOG_STYLE | wx.CENTRE,
-                                      cmd=cmd,
-                                      ovlId=id,
-                                      name='legend',
-                                      checktxt = _("Show/hide legend"),
-                                      ctrltxt = _("legend object")) 
-
-        self.dialogs['legend'].CentreOnParent() 
-        ### dialog cannot be show as modal - in the result d.legend is not selectable
-        ### self.dialogs['legend'].ShowModal()
-        self.dialogs['legend'].Show()
-        self.MapWindow.mouse['use'] = 'pointer'
-
-    def OnAddText(self, event):
-        """
-        Handler for text decoration menu selection.
-        """
-        if self.MapWindow.dragid > -1:
-            id = self.MapWindow.dragid
-        else:
-            # index for overlay layer in render
-            if len(self.MapWindow.textdict.keys()) > 0:
-                id = self.MapWindow.textdict.keys()[-1] + 1
-            else:
-                id = 101
-
-        self.dialogs['text'] = gdialogs.TextLayerDialog(parent=self, ovlId=id, 
-                                                        title=_('Add text layer'),
-                                                        size=(400, 200))
-        self.dialogs['text'].CenterOnParent()
-
-        # If OK button pressed in decoration control dialog
-        if self.dialogs['text'].ShowModal() == wx.ID_OK:
-            text = self.dialogs['text'].GetValues()['text']
-            active = self.dialogs['text'].GetValues()['active']
-            coords, w, h = self.MapWindow.TextBounds(self.dialogs['text'].GetValues())
-        
-            # delete object if it has no text or is not active
-            if text == '' or active == False:
-                try:
-                    self.MapWindow.pdc.ClearId(id)
-                    self.MapWindow.pdc.RemoveId(id)
-                    del self.MapWindow.textdict[id]
-                except:
-                    pass
-                return
-
-            self.MapWindow.pdc.ClearId(id)
-            self.MapWindow.pdc.SetId(id)
-            self.MapWindow.textdict[id] = self.dialogs['text'].GetValues()
-            
-            self.MapWindow.Draw(self.MapWindow.pdcDec, img=self.MapWindow.textdict[id],
-                                drawid=id, pdctype='text', coords=coords)
-            
-            self.MapWindow.UpdateMap(render=False, renderVector=False)
-            
-        self.MapWindow.mouse['use'] = 'pointer'
-
-    def GetOptData(self, dcmd, type, params, propwin):
-        """
-        Callback method for decoration overlay command generated by
-        dialog created in menuform.py
-        """
-        # Reset comand and rendering options in render.Map. Always render decoration.
-        # Showing/hiding handled by PseudoDC
-        self.Map.ChangeOverlay(ovltype=type, type='overlay', name='', command=dcmd,
-                               l_active=True, l_render=False)
-        self.params[type] = params
-        self.propwin[type] = propwin
-
     def OnZoomToMap(self, event):
         """!
         Set display extents to match selected raster (including NULLs)
         or vector map.
         """
-        if self.toolbars['gcpdisp']:
-            self.MapWindow.ZoomToMap(layers = self.Map.GetListOfLayers())
-        else:
-            self.MapWindow.ZoomToMap()
+        self.MapWindow.ZoomToMap(layers = self.Map.GetListOfLayers())
 
     def OnZoomToRaster(self, event):
         """!
@@ -2182,7 +1090,6 @@
         self.StatusbarUpdate()
         self.statusbarWin['region'].SetValue(showCompExtent)
         self.statusbarWin['resolution'].SetValue(constrainRes)
-        self.statusbarWin['projection'].SetValue(projection)
         if showCompExtent:
             self.MapWindow.regionCoords = []
         
@@ -2202,76 +1109,3 @@
         return self._layerManager
     
 # end of class MapFrame
-
-class MapApp(wx.App):
-    """
-    MapApp class
-    """
-
-    def OnInit(self):
-        wx.InitAllImageHandlers()
-        if __name__ == "__main__":
-            Map = render.Map() # instance of Map class to render GRASS display output to PPM file
-        else:
-            Map = None
-
-        self.mapFrm = MapFrame(parent=None, id=wx.ID_ANY, Map=Map,
-                               size=globalvar.MAP_WINDOW_SIZE)
-        #self.SetTopWindow(Map)
-        self.mapFrm.Show()
-
-        if __name__ == "__main__":
-            # redraw map, if new command appears
-            self.redraw = False
-            status = Command(self, Map, cmdfilename)
-            status.start()
-            self.timer = wx.PyTimer(self.watcher)
-            # check each 0.1s
-            self.timer.Start(100)
-
-        return 1
-
-    def OnExit(self):
-        if __name__ == "__main__":
-            # stop the timer
-            self.timer.Stop()
-            # terminate thread (a bit ugly)
-            os.system("""!echo "quit" >> %s""" % (cmdfilename))
-
-    def watcher(self):
-        """!Redraw, if new layer appears"""
-        if self.redraw:
-            self.mapFrm.OnDraw(None)
-        self.redraw = False
-        return
-# end of class MapApp
-
-if __name__ == "__main__":
-
-    ###### SET command variable
-    if len(sys.argv) != 3:
-        print __doc__
-        sys.exit()
-
-    title = sys.argv[1]
-    cmdfilename = sys.argv[2]
-
-    import gettext
-    gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode=True)
-
-    print >> sys.stderr, "\nStarting monitor <%s>...\n" % (title)
-
-    gm_map = MapApp(0)
-    # set title
-    gm_map.mapFrm.SetTitle(_("GRASS GIS Map Display: " +
-                             title + 
-                             " - Location: " + grass.gisenv()["LOCATION_NAME"]))
-    
-    gm_map.MainLoop()
-    
-    os.remove(cmdfilename)
-    os.system("""!g.gisenv set="GRASS_PYCMDFILE" """)
-
-    print >> sys.stderr, "\nStopping monitor <%s>...\n" % (title)
-
-    sys.exit(0)

Modified: grass/trunk/gui/wxpython/images/small_down_arrow.png
===================================================================
(Binary files differ)

Modified: grass/trunk/gui/wxpython/images/small_up_arrow.png
===================================================================
(Binary files differ)



More information about the grass-commit mailing list