Parcourir la source

wxGUI sync'ed with develbr6 (profile and georect related fixes)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@31215 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa il y a 17 ans
Parent
commit
6f27e18611

Fichier diff supprimé car celui-ci est trop grand
+ 987 - 577
gui/wxpython/gui_modules/georect.py


+ 2 - 0
gui/wxpython/gui_modules/globalvar.py

@@ -80,6 +80,8 @@ DIALOG_COMBOBOX_SIZE = (300, -1)
 DIALOG_GSELECT_SIZE = (400, -1)
 DIALOG_TEXTCTRL_SIZE = (400, -1)
 
+MAP_WINDOW_SIZE = (680, 520)
+
 """File name extension binaries/scripts"""
 if subprocess.mswindows:
     EXT_BIN = '.exe'

+ 72 - 59
gui/wxpython/gui_modules/mapdisp.py

@@ -231,7 +231,7 @@ class BufferedWindow(wx.Window):
         self.dragid   = -1
         self.lastpos  = (0, 0)
 
-    def Draw(self, pdc, img=None, drawid=None, pdctype='image', coords=[0,0,0,0]):
+    def Draw(self, pdc, img=None, drawid=None, pdctype='image', coords=[0, 0, 0, 0]):
         """
         Draws map and overlay decorations
         """
@@ -632,10 +632,19 @@ class BufferedWindow(wx.Window):
 
         self.DrawCompRegionExtent()
 
+        #
         # redraw pdcTmp if needed
+        #
         if len(self.polycoords) > 0:
             self.DrawLines(self.pdcTmp)
-
+        if self.parent.gismanager.georectifying:
+            # -> georectifier (redraw GCPs)
+            if self.parent.grtoolbar:
+                coordtype = 'gcpcoord'
+            else:
+                coordtype = 'mapcoord'
+            self.parent.gismanager.georectifying.DrawGCP(coordtype)
+            
         stop = time.clock()
 
         #
@@ -831,10 +840,18 @@ class BufferedWindow(wx.Window):
 
         return -1
 
-    def DrawCross(self, pdc, coords, size, rotation=0):
+    def DrawCross(self, pdc, coords, size, rotation=0,
+                  text=None, textAlign='lr', textOffset=(5, 5)):
         """Draw cross in PseudoDC
 
-           TODO: implement rotation
+        @todo implement rotation
+
+        @param pdc PseudoDC
+        @param coord center coordinates
+        @param rotation rotate symbol
+        @param text draw also text (text, font, color, rotation)
+        @param textAlign alignment (default 'lower-right')
+        @textOffset offset for text (from center point)
         """
         Debug.msg(4, "BufferedWindow.DrawCross(): pdc=%s, coords=%s, size=%d" % \
                   (pdc, coords, size))
@@ -845,6 +862,21 @@ class BufferedWindow(wx.Window):
         for lineCoords in coordsCross:
             self.Draw(pdc, drawid=self.lineid, pdctype='line', coords=lineCoords)
 
+        if not text:
+            return self.lineid
+
+        if textAlign == 'ul':
+            coord = [coords[0] - textOffset[0], coords[1] - textOffset[1], 0, 0]
+        elif textAlign == 'ur':
+            coord = [coords[0] + textOffset[0], coords[1] - textOffset[1], 0, 0]
+        elif textAlign == 'lr':
+            coord = [coords[0] + textOffset[0], coords[1] + textOffset[1], 0, 0]
+        else:
+            coord = [coords[0] - textOffset[0], coords[1] + textOffset[1], 0, 0]
+        
+        self.Draw(pdc, img=text,
+                  pdctype='text', coords=coord)
+
         return self.lineid
 
     def MouseActions(self, event):
@@ -1229,16 +1261,17 @@ class BufferedWindow(wx.Window):
                 self.DrawLines(pdc=self.pdcTmp)
             except:
                 pass
+
         elif self.mouse["use"] == "pointer" and self.parent.gismanager.georectifying:
-            self.SetCursor(self.parent.cursors["cross"])
+            # -> georectifying
             coord = self.Pixel2Cell(self.mouse['end'])
-            if self.parent.georect:
+            if self.parent.grtoolbar:
                 coordtype = 'gcpcoord'
             else:
                 coordtype = 'mapcoord'
-            self.gismanager.gr.gcpmgr.SetGCPData(coordtype, coord, self)
-            self.DrawCross(pdc=self.pdcTmp, coords=self.mouse['end'],
-                                       size=5)
+
+            self.parent.gismanager.georectifying.SetGCPData(coordtype, coord, self)
+            self.UpdateMap(render=False, renderVector=False)
 
         elif self.mouse["use"] == "pointer" and self.parent.digittoolbar:
             # digitization tool active
@@ -1985,7 +2018,7 @@ class BufferedWindow(wx.Window):
         zoomreg = {}
 
         # find selected map
-        if not self.tree.GetSelection():
+        if not self.tree or not self.tree.GetSelection():
             return
 
         item  = self.tree.GetSelection()
@@ -2187,26 +2220,17 @@ class MapFrame(wx.Frame):
                  pos=wx.DefaultPosition, size=wx.DefaultSize,
                  style=wx.DEFAULT_FRAME_STYLE, toolbars=["map"],
                  tree=None, notebook=None, gismgr=None, page=None,
-                 Map=None, auimgr=None, georect=False):
-        """
-            Main map display window with toolbars, statusbar and
-            DrawWindow
-
-            Parameters:
-                parent  -- parent window, None, wx.Window()
-                id      -- window ID, int, wx.ID_ANY
-                title   -- window title, string
-                pos     -- where to place it, tupple, wx.Position
-                size    -- window size, tupple, wx.Size
-                style   -- window style
-                toolbars-- array of default toolbars, which should appear,
-                           currently: ['map', 'digit']
-                notebook-- control book ID in GIS Manager
-                tree    -- associated layer tree
-                gismgr  -- GIS Manager panel
-                page    -- notebook page with layer tree
-                Map     -- instance of render.Map
-                georect -- is window used by georectifier
+                 Map=None, auimgr=None):
+        """
+        Main map display window with toolbars, statusbar and
+        DrawWindow
+
+        @param toolbars array of activated toolbars, e.g. ['map', 'digit']
+        @param tree reference to layer tree
+        @param notebook control book ID in Layer Manager
+        @param gismgr Layer Manager panel
+        @param page notebook page with layer tree
+        @param Map instance of render.Map
         """
 
         wx.Frame.__init__(self, parent, id, title, pos, size, style)
@@ -2216,7 +2240,6 @@ class MapFrame(wx.Frame):
         self.tree       = tree      # GIS Manager layer tree object
         self.page       = page      # Notebook page holding the layer tree
         self.layerbook  = notebook  # GIS Manager layer tree notebook
-        self.georect    = georect   # Map display used for setting GCPs for georectifier
         self.parent     = parent
 
         #
@@ -2380,28 +2403,28 @@ class MapFrame(wx.Frame):
         Add defined toolbar to the window
 
         Currently known toolbars are:
-            * map
-            * digit
-            * georect
-        """
+         - map basic map toolbar
+         - digit vector digitizer
+         - georect georectifier
+         """
         if name == "map":
             self.maptoolbar = toolbars.MapToolbar(self, self.Map)
 
             self._mgr.AddPane(self.maptoolbar.toolbar,
                               wx.aui.AuiPaneInfo().
-                              Name("maptoolbar").Caption("Map Toolbar").
+                              Name("maptoolbar").Caption(_("Map Toolbar")).
                               ToolbarPane().Top().
                               LeftDockable(False).RightDockable(False).
                               BottomDockable(False).TopDockable(True).
                               CloseButton(False).Layer(2))
 
-        elif name == "digit":
+        if name == "digit":
             self.digittoolbar = toolbars.VDigitToolbar(self, self.Map, self.tree)
 
             for toolRow in range(0, self.digittoolbar.numOfRows):
                 self._mgr.AddPane(self.digittoolbar.toolbar[toolRow],
                                   wx.aui.AuiPaneInfo().
-                                  Name("digittoolbar" + str(toolRow)).Caption("Digit Toolbar").
+                                  Name("digittoolbar" + str(toolRow)).Caption(_("Digit Toolbar")).
                                   ToolbarPane().Top().Row(toolRow + 1).
                                   LeftDockable(False).RightDockable(False).
                                   BottomDockable(False).TopDockable(True).
@@ -2413,12 +2436,12 @@ class MapFrame(wx.Frame):
             self.MapWindow.pen     = wx.Pen(colour='red',   width=2, style=wx.SOLID)
             self.MapWindow.polypen = wx.Pen(colour='green', width=2, style=wx.SOLID)
 
-        elif name == "georect":
+        if name == "georect":
             self.grtoolbar = toolbars.GRToolbar(self, self.Map)
 
             self._mgr.AddPane(self.grtoolbar.toolbar,
                               wx.aui.AuiPaneInfo().
-                              Name("grtoolbar").Caption("Georectification Toolbar").
+                              Name("grtoolbar").Caption(_("Georectification Toolbar")).
                               ToolbarPane().Top().
                               LeftDockable(False).RightDockable(False).
                               BottomDockable(False).TopDockable(True).
@@ -2462,27 +2485,17 @@ class MapFrame(wx.Frame):
         Change choicebook page to match display.
         Or set display for georectifying
         """
-        if self.georect:
-            # display used to set GCPs in map to georectify
-            try:
-                if event.GetActive():
-                    self.gismanager.gr.SwitchEnv('new')
-                else:
-                    self.gismanager.gr.SwitchEnv('original')
-            except:
-                pass
-            
-        elif self.gismanager.georectifying:
+        if self.gismanager.georectifying:
             # in georectifying session; display used to get get geographic
             # coordinates for GCPs
-            self.MapWindow.pen = wx.Pen(colour='black', width=2, style=wx.SOLID)
-            self.MapWindow.SetCursor(self.cursors["cross"])
+            self.OnPointer(event)
         else:
             # change bookcontrol page to page associated with display
-            if self.page :
+            if self.page:
                 pgnum = self.layerbook.GetPageIndex(self.page)
                 if pgnum > -1:
                     self.layerbook.SetSelection(pgnum)
+        
         event.Skip()
 
     def OnMotion(self, event):
@@ -2687,17 +2700,17 @@ class MapFrame(wx.Frame):
                                          (self.Map.region["w"], self.Map.region["e"],
                                           self.Map.region["s"], self.Map.region["n"]), 0)
 
-        elif self.toggleStatus.GetSelection() == 2: # Show comp. extent
-            self.statusbar.SetStatusText("", 0)
-            self.showRegion.Show()
-
-        elif self.toggleStatus.GetSelection() == 3: # Comp. region
+        elif self.toggleStatus.GetSelection() == 2: # Comp. region
             compregion = self.Map.GetRegion()
             self.statusbar.SetStatusText("%.2f - %.2f, %.2f - %.2f (%.2f, %.2f)" %
                                          (compregion["w"], compregion["e"],
                                           compregion["s"], compregion["n"],
                                           compregion["ewres"], compregion["nsres"]), 0)
 
+        elif self.toggleStatus.GetSelection() == 3: # Show comp. extent
+            self.statusbar.SetStatusText("", 0)
+            self.showRegion.Show()
+
         elif self.toggleStatus.GetSelection() == 4: # Display mode
             self.statusbar.SetStatusText("", 0)
             self.compResolution.Show()

+ 43 - 38
gui/wxpython/gui_modules/preferences.py

@@ -149,44 +149,49 @@ class Settings:
                 'saveOnExit'            : { 'enabled' : False },
                 },
             'profile': {
-            'raster0' : { 'pcolor' : (0, 0, 255, 255), # profile line color
-                          'pwidth' : 1, # profile line width
-                          'pstyle' : 'solid', # profile line pen style
-                          },
-            'raster1' : { 'pcolor' : (255, 0, 0, 255), 
-                          'pwidth' : 1, 
-                          'pstyle' : 'solid', 
-                          },
-            'raster2' : { 'pcolor' : (0, 255, 0, 255), 
-                          'pwidth' : 1, 
-                          'pstyle' : 'solid', 
-                          },
-            'font' : { 'titleSize' : 12,
-                       'axisSize' : 11,
-                       'legendSize' : 10,
-                       },
-            'marker' : { 'color' : wx.Colour(0, 0, 0),
-                         'fill' : 'transparent',
-                         'size' : 2,
-                         'type' : 'triangle',
-                         'legend' : _('Segment break'),
-                         },
-            'grid' : { 'color' : wx.Colour(200,200,200) ,
-                       'enabled' : True,
-                       },
-            'x-axis' : { 'type' : 'auto', # axis format
-                         'min' : 0, # axis min for custom axis range
-                         'max': 0, # axis max for custom axis range
-                         'log' : False,
-                         },
-            'y-axis' : { 'type' : 'auto', # axis format
-                         'min' : 0, # axis min for custom axis range
-                         'max': 0, # axis max for custom axis range
-                         'log' : False,
-                         },
-            'legend' : { 'enabled' : True
-                         },
-            },
+                'raster0' : { 'pcolor' : (0, 0, 255, 255), # profile line color
+                              'pwidth' : 1, # profile line width
+                              'pstyle' : 'solid', # profile line pen style
+                              },
+                'raster1' : { 'pcolor' : (255, 0, 0, 255), 
+                              'pwidth' : 1, 
+                              'pstyle' : 'solid', 
+                              },
+                'raster2' : { 'pcolor' : (0, 255, 0, 255), 
+                              'pwidth' : 1, 
+                              'pstyle' : 'solid', 
+                              },
+                'font' : { 'titleSize' : 12,
+                           'axisSize' : 11,
+                           'legendSize' : 10,
+                           },
+                'marker' : { 'color' : wx.Colour(0, 0, 0),
+                             'fill' : 'transparent',
+                             'size' : 2,
+                             'type' : 'triangle',
+                             'legend' : _('Segment break'),
+                             },
+                'grid' : { 'color' : wx.Colour(200,200,200) ,
+                           'enabled' : True,
+                           },
+                'x-axis' : { 'type' : 'auto', # axis format
+                             'min' : 0, # axis min for custom axis range
+                             'max': 0, # axis max for custom axis range
+                             'log' : False,
+                             },
+                'y-axis' : { 'type' : 'auto', # axis format
+                             'min' : 0, # axis min for custom axis range
+                             'max': 0, # axis max for custom axis range
+                             'log' : False,
+                             },
+                'legend' : { 'enabled' : True
+                             },
+                },
+            'georect' : {
+                'symbol' : { 'color' : (0, 0, 255, 255),
+                             'width' : 2,
+                             },
+                },
             }
 
         #

+ 0 - 2
gui/wxpython/gui_modules/profile.py

@@ -38,8 +38,6 @@ except:
     downloading source or binaries."""
     print >> sys.stderr, "profile.py: " + msg
 
-from threading import Thread
-
 import globalvar
 try:
     import subprocess

+ 33 - 8
gui/wxpython/gui_modules/render.py

@@ -24,7 +24,6 @@ import os
 import sys
 import glob
 import math
-# import time
 try:
     import subprocess
 except:
@@ -262,7 +261,7 @@ class Map(object):
     """
     Map composition (stack of map layers and overlays)
     """
-    def __init__(self):
+    def __init__(self, gisrc=None):
         # 
         # region/extent settigns
         #
@@ -282,8 +281,11 @@ class Map(object):
         #
         # environment settings
         #
-        self.env       = {}  # enviroment variables, like MAPSET, LOCATION_NAME, etc.
-
+        # enviroment variables, like MAPSET, LOCATION_NAME, etc.
+        self.env         = {}
+        # path to external gisrc
+        self.gisrc = gisrc
+        
         # 
         # generated file for rendering the map
         #
@@ -334,6 +336,11 @@ class Map(object):
         if not os.getenv("GISBASE"):
             print >> sys.stderr, _("GISBASE not set. You must be in GRASS GIS to run this program.")
             sys.exit(1)
+            
+        # use external gisrc if defined
+        gisrc_orig = os.getenv("GISRC")
+        if self.gisrc:
+            os.environ["GISRC"] = self.gisrc
 
         gisenvCmd = gcmd.Command(["g.gisenv"])
 
@@ -344,6 +351,10 @@ class Map(object):
             val = val.replace("'","")
             self.env[key] = val
 
+        # back to original gisrc
+        if self.gisrc:
+            os.environ["GISRC"] = gisrc_orig
+
     def GetWindow(self):
         """Read WIND file and set up self.wind dictionary"""
         # FIXME: duplicated region WIND == g.region (at least some values)
@@ -484,6 +495,11 @@ class Map(object):
         tmpreg = os.getenv("GRASS_REGION")
         os.unsetenv("GRASS_REGION")
 
+        # use external gisrc if defined
+        gisrc_orig = os.getenv("GISRC")
+        if self.gisrc:
+            os.environ["GISRC"] = self.gisrc
+
         # do not update & shell style output
         cmdList = ["g.region", "-u", "-g", "-p", "-c"]
 
@@ -524,6 +540,10 @@ class Map(object):
             except ValueError:
                 region[key] = val
 
+        # back to original gisrc
+        if self.gisrc:
+            os.environ["GISRC"] = gisrc_orig
+
         # restore region
         if tmpreg:
             os.environ["GRASS_REGION"] = tmpreg
@@ -701,12 +721,15 @@ class Map(object):
         @return name of file with rendered image or None
         """
 
-        # startTime = time.time()
-
         maps = []
         masks =[]
         opacities = []
 
+        # use external gisrc if defined
+        gisrc_orig = os.getenv("GISRC")
+        if self.gisrc:
+            os.environ["GISRC"] = self.gisrc
+
         tmp_region = os.getenv("GRASS_REGION")
         os.environ["GRASS_REGION"] = self.SetRegion(windres)
         os.environ["GRASS_WIDTH"]  = str(self.width)
@@ -789,9 +812,11 @@ class Map(object):
             print >> sys.stderr, e
             return None
 
-        Debug.msg (2, "Map.Render() force=%s file=%s" % (force, self.mapfile))
+        # back to original gisrc
+        if self.gisrc:
+            os.environ["GISRC"] = gisrc_orig
 
-        # print time.time() - startTime
+        Debug.msg (2, "Map.Render() force=%s file=%s" % (force, self.mapfile))
 
         return self.mapfile
 

+ 67 - 12
gui/wxpython/gui_modules/toolbars.py

@@ -5,6 +5,7 @@ CLASSES:
     * AbstractToolbar
     * MapToolbar
     * GRToolbar
+    * GCPToolbar
     * VDigitToolbar
     * ProfileToolbar
     
@@ -67,8 +68,8 @@ class AbstractToolbar(object):
 
         if label:
             toolWin = toolbar.AddLabelTool(tool, label, bitmap,
-                                        bmpDisabled, kind,
-                                        shortHelp, longHelp)
+                                           bmpDisabled, kind,
+                                           shortHelp, longHelp)
             parent.Bind(wx.EVT_TOOL, handler, toolWin)
         else: # add separator
             toolbar.AddSeparator()
@@ -225,8 +226,8 @@ class GRToolbar(AbstractToolbar):
              wx.ITEM_NORMAL, Icons["erase"].GetLabel(), Icons["erase"].GetDesc(),
              self.mapdisplay.OnErase),
             ("", "", "", "", "", "", ""),
-            (self.gcpset, "gcpset", Icons["gcpset"].GetBitmap(),
-             wx.ITEM_RADIO, Icons["gcpset"].GetLabel(), Icons["gcpset"].GetDesc(),
+            (self.gcpset, "grGcpSet", Icons["grGcpSet"].GetBitmap(),
+             wx.ITEM_RADIO, Icons["grGcpSet"].GetLabel(), Icons["grGcpSet"].GetDesc(),
              self.mapdisplay.OnPointer),
             (self.pan, "pan", Icons["pan"].GetBitmap(),
              wx.ITEM_RADIO, Icons["pan"].GetLabel(), Icons["pan"].GetDesc(),
@@ -243,18 +244,72 @@ class GRToolbar(AbstractToolbar):
             (self.zoommenu, "zoommenu", Icons["zoommenu"].GetBitmap(),
              wx.ITEM_NORMAL, Icons["zoommenu"].GetLabel(), Icons["zoommenu"].GetDesc(),
              self.mapdisplay.OnZoomMenu),
-            ("", "", "", "", "", "", "")
             )
 
-    def OnSelect(self, event):
-        """
-        Select / enable tool available in tools list
-        """
-        tool =  event.GetString()
+class GCPToolbar(AbstractToolbar):
+    """
+    Toolbar for digitization
+    """
+    def __init__(self, parent, mapdisplay, map):
+        self.parent     = parent # GCP
+        self.mapcontent = map
+        self.mapdisplay = mapdisplay
 
-        if tool == "Digitize" and not self.mapdisplay.digittoolbar:
-            self.mapdisplay.AddToolbar("digit")
+        self.toolbar = wx.ToolBar(parent=self.mapdisplay, id=wx.ID_ANY)
 
+        # self.SetToolBar(self.toolbar)
+        self.toolbar.SetToolBitmapSize(globalvar.toolbarSize)
+
+        self.InitToolbar(self.mapdisplay, self.toolbar, self.ToolbarData())
+
+        # realize the toolbar
+        self.toolbar.Realize()
+
+    def ToolbarData(self):
+        
+        self.gcpSave = wx.NewId()
+        self.gcpAdd = wx.NewId()
+        self.gcpDelete = wx.NewId()
+        self.gcpClear = wx.NewId()
+        self.gcpReload = wx.NewId()
+        self.rms = wx.NewId()
+        self.georect = wx.NewId()
+        self.settings = wx.NewId()
+        self.quit = wx.NewId()
+
+        return (
+            (self.gcpSave, 'grGcpSave', Icons["grGcpSave"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["grGcpSave"].GetLabel(), Icons["grGcpSave"].GetDesc(),
+             self.parent.SaveGCPs),
+            (self.gcpAdd, 'grGrGcpAdd', Icons["grGcpAdd"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["grGcpAdd"].GetLabel(), Icons["grGcpAdd"].GetDesc(),
+             self.parent.AddGCP),
+            (self.gcpDelete, 'grGrGcpDelete', Icons["grGcpDelete"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["grGcpDelete"].GetLabel(), Icons["grGcpDelete"].GetDesc(), 
+             self.parent.DeleteGCP),
+            (self.gcpClear, 'grGcpClear', Icons["grGcpClear"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["grGcpClear"].GetLabel(), Icons["grGcpClear"].GetDesc(), 
+             self.parent.ClearGCP),
+            (self.gcpReload, 'grGcpReload', Icons["grGcpReload"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["grGcpReload"].GetLabel(), Icons["grGcpReload"].GetDesc(), 
+             self.parent.ReloadGCPs),
+
+            ("", "", "", "", "", "", ""),
+            (self.rms, 'grGcpRms', Icons["grGcpRms"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["grGcpRms"].GetLabel(), Icons["grGcpRms"].GetDesc(),
+             self.parent.OnRMS),
+            (self.georect, 'grGeorect', Icons["grGeorect"].GetBitmap(), 
+             wx.ITEM_NORMAL, Icons["grGeorect"].GetLabel(), Icons["grGeorect"].GetDesc(),
+             self.parent.OnGeorect),
+            ("", "", "", "", "", "", ""),
+            (self.settings, 'grSettings', Icons["grSettings"].GetBitmap(), 
+             wx.ITEM_NORMAL, Icons["grSettings"].GetLabel(), Icons["grSettings"].GetDesc(),
+             self.parent.OnSettings),
+            (self.quit, 'grGcpQuit', Icons["grGcpQuit"].GetBitmap(), 
+             wx.ITEM_NORMAL, Icons["grGcpQuit"].GetLabel(), Icons["grGcpQuit"].GetDesc(),
+             self.parent.OnQuit)
+            )
+    
 class VDigitToolbar(AbstractToolbar):
     """
     Toolbar for digitization

+ 209 - 112
gui/wxpython/icons/icon.py

@@ -77,9 +77,9 @@ icons_default = {
     ## attributes
     "digDispAttr" : 'display.attributes.gif',
     ## general
-    "digUndo" : wx.ART_ERROR,
+    "digUndo" : wx.ART_ERROR, # FIXME
     "digSettings" : 'settings.gif',
-    "digAdditionalTools" : wx.ART_ERROR,
+    "digAdditionalTools" : wx.ART_ERROR, # FIXME
     # gis manager
     "newdisplay" : 'gui-startmon.gif',
     "workspaceNew" : 'file-new.gif',
@@ -115,18 +115,24 @@ icons_default = {
     "font"       : 'gui-font.gif',
     "histogram"  : 'module-d.histogram.gif',
     "color"      : 'edit-color.gif',
-    "options"    : wx.ART_ERROR,
+    "options"    :  wx.ART_ERROR, # FIXME
+    # profile 
     "profile"    : 'gui-profile.gif',
     "transect"   : 'gui-profiledefine.gif',
-#    "profiledraw": 'gui-profiledraw.gif',
-    "profiledraw"  : 'gui-redraw.gif',
+    # "profiledraw": 'gui-profiledraw.gif',
+    "profiledraw" : 'gui-redraw.gif',
     "profileopt" : 'gui-profileopt.gif',
     # georectify
-    'cleargcp'   : 'gui-gcperase.gif',
-    'gcpset'     : 'gui-gcpset.gif',
-    'georect'    : 'gui-georect.gif',
-    'rms'        : 'gui-rms.gif',
-    'refreshgcp' : 'gui-display.gif'
+    'grGcpClear'   : 'gui-gcperase.gif',
+    'grGcpSet'     : 'gui-gcpset.gif',
+    'grGeorect'    : 'gui-georect.gif',
+    'grGcpRms'     : 'gui-rms.gif',
+    'grGcpRefresh' : 'gui-display.gif',
+    "grGcpSave"    : 'file-save.gif', 
+    "grGcpAdd"     : wx.ART_ERROR, # FIXME
+    "grGcpDelete"  : wx.ART_ERROR, # FIXME
+    "grGcpReload"  : 'gui-redraw.gif',
+    "grSettings"   : 'edit-color.gif', 
     }
 
 # merge icons dictionaries, join paths
@@ -215,113 +221,204 @@ class MetaIcon:
 #
 Icons = {
     # map display
-    "displaymap" : MetaIcon (img=icons_img["displaymap"], label="Display map"),
-    "rendermap"  : MetaIcon (img=icons_img["rendermap"], label="Re-render map",
-                             desc="Force re-rendering of all layers"),
-    "erase"      : MetaIcon (img=icons_img["erase"], label="Erase display"),
-    "pointer"    : MetaIcon (img=icons_img["pointer"], label="Pointer"),
-    "zoom_in"    : MetaIcon (img=icons_img["zoom_in"], label="Zoom in",
-                             desc="Drag or click mouse to zoom"),
-    "zoom_out"   : MetaIcon (img=icons_img["zoom_out"], label="Zoom out",
-                             desc="Drag or click mouse to unzoom"),
-    "pan"        : MetaIcon (img=icons_img["pan"], label="Pan",
-                             desc="Drag with mouse to pan"),
-    "queryDisplay" : MetaIcon (img=icons_img["query"], label="Query raster/vector map(s) (display mode)",
-                             desc="Query selected raster/vector map(s)"),
-    "queryModify" : MetaIcon (img=icons_img["query"], label="Query vector map (editable mode)",
-                             desc="Query selected vector map in editable mode"),
-    "zoom_back"  : MetaIcon (img=icons_img["zoom_back"], label="Return to previous zoom"),
-    "zoommenu"   : MetaIcon (img=icons_img["zoommenu"], label="Zoom options",
-                             desc="Display zoom management"),
-    "overlay"    : MetaIcon (img=icons_img["overlay"], label="Add overlay",
-                             desc="Add graphic overlays to map"),
-    "addbarscale": MetaIcon (img=icons_img["addbarscale"], label="Add scalebar and north arrow"),
-    "addlegend"  : MetaIcon (img=icons_img["addlegend"], label="Add legend"),
-    "savefile"   : MetaIcon (img=icons_img["savefile"], label="Save display to PNG file"),
-    "printmap"   : MetaIcon (img=icons_img["printmap"], label="Print display"),
+    "displaymap" : MetaIcon (img=icons_img["displaymap"],
+                             label=_("Display map")),
+    "rendermap"  : MetaIcon (img=icons_img["rendermap"],
+                             label=_("Re-render map"),
+                             desc=_("Force re-rendering of all layers")),
+    "erase"      : MetaIcon (img=icons_img["erase"],
+                             label=_("Erase display")),
+    "pointer"    : MetaIcon (img=icons_img["pointer"],
+                             label=_("Pointer")),
+    "zoom_in"    : MetaIcon (img=icons_img["zoom_in"],
+                             label=_("Zoom in"),
+                             desc=_("Drag or click mouse to zoom")),
+    "zoom_out"   : MetaIcon (img=icons_img["zoom_out"],
+                             label=_("Zoom out"),
+                             desc=_("Drag or click mouse to unzoom")),
+    "pan"        : MetaIcon (img=icons_img["pan"],
+                             label=_("Pan"),
+                             desc=_("Drag with mouse to pan")),
+    "queryDisplay" : MetaIcon (img=icons_img["query"],
+                               label=_("Query raster/vector map(s) (display mode)"),
+                               desc=_("Query selected raster/vector map(s)")),
+    "queryModify" : MetaIcon (img=icons_img["query"],
+                              label=_("Query vector map (editable mode)"),
+                             desc=_("Query selected vector map in editable mode")),
+    "zoom_back"  : MetaIcon (img=icons_img["zoom_back"],
+                             label=_("Return to previous zoom")),
+    "zoommenu"   : MetaIcon (img=icons_img["zoommenu"],
+                             label=_("Zoom options"),
+                             desc=_("Display zoom management")),
+    "overlay"    : MetaIcon (img=icons_img["overlay"],
+                             label=_("Add overlay"),
+                             desc=_("Add graphic overlays to map")),
+    "addbarscale": MetaIcon (img=icons_img["addbarscale"],
+                             label=_("Add scalebar and north arrow")),
+    "addlegend"  : MetaIcon (img=icons_img["addlegend"],
+                             label=_("Add legend")),
+    "savefile"   : MetaIcon (img=icons_img["savefile"],
+                             label=_("Save display to PNG file")),
+    "printmap"   : MetaIcon (img=icons_img["printmap"],
+                             label=_("Print display")),
     # gis manager
-    "newdisplay" : MetaIcon (img=icons_img["newdisplay"], label="Start new display"),
-    "workspaceNew" : MetaIcon (img=icons_img["workspaceNew"], label="Create new workspace file"),
-    "workspaceLoad" : MetaIcon (img=icons_img["workspaceLoad"], label="Load map layers into workspace"),
-    "workspaceOpen" : MetaIcon (img=icons_img["workspaceOpen"], label="Open existing workspace file"),
-    "workspaceSave" : MetaIcon (img=icons_img["workspaceSave"], label="Save current workspace to file"),
+    "newdisplay" : MetaIcon (img=icons_img["newdisplay"],
+                             label=_("Start new display")),
+    "workspaceNew" : MetaIcon (img=icons_img["workspaceNew"],
+                               label=_("Create new workspace file")),
+    "workspaceLoad" : MetaIcon (img=icons_img["workspaceLoad"],
+                                label=_("Load map layers into workspace")),
+    "workspaceOpen" : MetaIcon (img=icons_img["workspaceOpen"],
+                                label=_("Open existing workspace file")),
+    "workspaceSave" : MetaIcon (img=icons_img["workspaceSave"],
+                                label=_("Save current workspace to file")),
     # TODO: "layer" is not conformant with GRASS vocabulary (vector layer: 1..x) ! 
-    "addrast"    : MetaIcon (img=icons_img["addrast"], label="Add raster map layer"),
-    "addvect"    : MetaIcon (img=icons_img["addvect"], label="Add vector map layer"),
-    "addcmd"     : MetaIcon (img=icons_img["addcmd"], label="Add command layer"),
-    "addgrp"     : MetaIcon (img=icons_img["addgrp"], label="Add layer group"),
-    "addovl"     : MetaIcon (img=icons_img["addovl"], label="Add grid or vector labels overlay"),
-    "delcmd"     : MetaIcon (img=icons_img["delcmd"], label="Delete selected layer"),
-    "quit"       : MetaIcon (img=icons_img["quit"], label="Quit"),
-    "attrtable"  : MetaIcon (img=icons_img["attrtable"], label="Show attribute table"),
-    "addrgb"     : MetaIcon (img=icons_img["addrgb"], label="Add RGB layer"),
-    "addhis"     : MetaIcon (img=icons_img["addhis"], label="Add HIS layer"),
-    "addshaded"  : MetaIcon (img=icons_img["addshaded"], label="Add shaded relief map layer"),
-    "addrarrow"  : MetaIcon (img=icons_img["addrarrow"], label="Add raster flow arrows"),
-    "addrnum"    : MetaIcon (img=icons_img["addrnum"], label="Add raster cell numbers"),
-    "elvect"     : MetaIcon (img=icons_img["elvect"], label=""),
-    "addthematic": MetaIcon (img=icons_img["addthematic"], label="Add thematic layer"),
-    "addchart"   : MetaIcon (img=icons_img["addchart"], label="Add thematic chart layer"),
-    "addgrid"    : MetaIcon (img=icons_img["addgrid"], label="Add grid layer"),
-    "addgeodesic": MetaIcon (img=icons_img["addgeodesic"], label="Add geodesic line layer"),
-    "addrhumb"   : MetaIcon (img=icons_img["addrhumb"], label="Add rhumbline layer"),
-    "addlabels"  : MetaIcon (img=icons_img["addlabels"], label="Add labels"),
-    "addtext"    : MetaIcon (img=icons_img["addtext"], label="Add text layer"),
+    "addrast"    : MetaIcon (img=icons_img["addrast"],
+                             label=_("Add raster map layer")),
+    "addvect"    : MetaIcon (img=icons_img["addvect"],
+                             label=_("Add vector map layer")),
+    "addcmd"     : MetaIcon (img=icons_img["addcmd"],
+                             label=_("Add command layer")),
+    "addgrp"     : MetaIcon (img=icons_img["addgrp"],
+                             label=_("Add layer group")),
+    "addovl"     : MetaIcon (img=icons_img["addovl"],
+                             label=_("Add grid or vector labels overlay")),
+    "delcmd"     : MetaIcon (img=icons_img["delcmd"],
+                             label=_("Delete selected layer")),
+    "quit"       : MetaIcon (img=icons_img["quit"],
+                             label=_("Quit")),
+    "attrtable"  : MetaIcon (img=icons_img["attrtable"],
+                             label=_("Show attribute table")),
+    "addrgb"     : MetaIcon (img=icons_img["addrgb"],
+                             label=_("Add RGB layer")),
+    "addhis"     : MetaIcon (img=icons_img["addhis"],
+                             label=_("Add HIS layer")),
+    "addshaded"  : MetaIcon (img=icons_img["addshaded"],
+                             label=_("Add shaded relief map layer")),
+    "addrarrow"  : MetaIcon (img=icons_img["addrarrow"],
+                             label=_("Add raster flow arrows")),
+    "addrnum"    : MetaIcon (img=icons_img["addrnum"],
+                             label=_("Add raster cell numbers")),
+    "elvect"     : MetaIcon (img=icons_img["elvect"],
+                             label=_("")),
+    "addthematic": MetaIcon (img=icons_img["addthematic"],
+                             label=_("Add thematic layer")),
+    "addchart"   : MetaIcon (img=icons_img["addchart"],
+                             label=_("Add thematic chart layer")),
+    "addgrid"    : MetaIcon (img=icons_img["addgrid"],
+                             label=_("Add grid layer")),
+    "addgeodesic": MetaIcon (img=icons_img["addgeodesic"],
+                             label=_("Add geodesic line layer")),
+    "addrhumb"   : MetaIcon (img=icons_img["addrhumb"],
+                             label=_("Add rhumbline layer")),
+    "addlabels"  : MetaIcon (img=icons_img["addlabels"],
+                             label=_("Add labels")),
+    "addtext"    : MetaIcon (img=icons_img["addtext"],
+                             label=_("Add text layer")),
     # digit
-    "digAddPoint": MetaIcon (img=icons_img["digAddPoint"], label="Digitize new point",
-                             desc="Left: new point"),
-    "digAddLine" : MetaIcon (img=icons_img["digAddLine"], label="Digitize new line",
-                             desc="Left: new point; Middle: undo last point; Right: close line"),
-    "digAddBoundary": MetaIcon (img=icons_img["digAddBoundary"], label="Digitize new boundary",
-                             desc="Left: new point; Middle: undo last point; Right: close line"),
-    "digAddCentroid": MetaIcon (img=icons_img["digAddCentroid"], label="Digitize new centroid",
-                             desc="Left: new point"),
-    "digAddVertex": MetaIcon (img=icons_img["digAddVertex"], label="Add new vertex",
-                              desc="Left: Select; Middle: Unselect; Right: Confirm"),
-    "digCopyCats": MetaIcon (img=icons_img["digCopyCats"], label="Copy categories",
-                              desc="Left: Select; Middle: Unselect; Right: Confirm"),
-    "digDeleteLine": MetaIcon (img=icons_img["digDeleteLine"], label="Delete feature(s)",
-                              desc="Left: Select; Middle: Unselect; Right: Confirm"),
-    "digDispAttr": MetaIcon (img=icons_img["digDispAttr"], label="Display/update attributes",
-                              desc="Left: Select"),
-    "digDispCats": MetaIcon (img=icons_img["digDispCats"], label="Display/update categories",
-                              desc="Left: Select"),
-    "digEditLine": MetaIcon (img=icons_img["digEditLine"], label="Edit line/boundary",
-                              desc="Left: new point; Middle: undo last point; Right: close line"),
-    "digMoveLine": MetaIcon (img=icons_img["digMoveLine"], label="Move feature(s)",
-                              desc="Left: Select; Middle: Unselect; Right: Confirm"),
-    "digMoveVertex": MetaIcon (img=icons_img["digMoveVertex"], label="Move vertex",
-                              desc="Left: Select; Middle: Unselect; Right: Confirm"),
-    "digRemoveVertex": MetaIcon (img=icons_img["digRemoveVertex"], label="Remove vertex",
-                              desc="Left: Select; Middle: Unselect; Right: Confirm"),
-    "digSettings": MetaIcon (img=icons_img["digSettings"], label="Settings",
-                              desc="Settings dialog for digitization tool"),
-    "digSplitLine": MetaIcon (img=icons_img["digSplitLine"], label="Split line/boundary",
-                              desc="Left: Select; Middle: Unselect; Right: Confirm"),
-    "digExit"    : MetaIcon (img=icons_img["quit"], label="Quit digitization tool"),
-    "digAdditionalTools" : MetaIcon (img=icons_img["digAdditionalTools"], label="Additional tools " \
-                                         "(copy, flip, connect, etc.)",
-                                     desc="Left: Select; Middle: Unselect; Right: Confirm"),
-    "digUndo" : MetaIcon (img=icons_img["digUndo"], label="Undo",
-                          desc="Undo previous changes"),
+    "digAddPoint": MetaIcon (img=icons_img["digAddPoint"],
+                             label=_("Digitize new point"),
+                             desc=_("Left: new point")),
+    "digAddLine" : MetaIcon (img=icons_img["digAddLine"],
+                             label=_("Digitize new line"),
+                             desc=_("Left: new point; Middle: undo last point; Right: close line")),
+    "digAddBoundary": MetaIcon (img=icons_img["digAddBoundary"],
+                                label=_("Digitize new boundary"),
+                                desc=_("Left: new point; Middle: undo last point; Right: close line")),
+    "digAddCentroid": MetaIcon (img=icons_img["digAddCentroid"],
+                                label=_("Digitize new centroid"),
+                             desc=_("Left: new point")),
+    "digAddVertex": MetaIcon (img=icons_img["digAddVertex"],
+                              label=_("Add new vertex"),
+                              desc=_("Left: Select; Middle: Unselect; Right: Confirm")),
+    "digCopyCats": MetaIcon (img=icons_img["digCopyCats"],
+                             label=_("Copy categories"),
+                             desc=_("Left: Select; Middle: Unselect; Right: Confirm")),
+    "digDeleteLine": MetaIcon (img=icons_img["digDeleteLine"],
+                               label=_("Delete feature(s)"),
+                               desc=_("Left: Select; Middle: Unselect; Right: Confirm")),
+    "digDispAttr": MetaIcon (img=icons_img["digDispAttr"],
+                             label=_("Display/update attributes"),
+                             desc=_("Left: Select")),
+    "digDispCats": MetaIcon (img=icons_img["digDispCats"],
+                             label=_("Display/update categories"),
+                             desc=_("Left: Select")),
+    "digEditLine": MetaIcon (img=icons_img["digEditLine"],
+                             label=_("Edit line/boundary"),
+                             desc=_("Left: new point; Middle: undo last point; Right: close line")),
+    "digMoveLine": MetaIcon (img=icons_img["digMoveLine"],
+                             label=_("Move feature(s)"),
+                             desc=_("Left: Select; Middle: Unselect; Right: Confirm")),
+    "digMoveVertex": MetaIcon (img=icons_img["digMoveVertex"],
+                               label=_("Move vertex"),
+                               desc=_("Left: Select; Middle: Unselect; Right: Confirm")),
+    "digRemoveVertex": MetaIcon (img=icons_img["digRemoveVertex"],
+                                 label=_("Remove vertex"),
+                                 desc=_("Left: Select; Middle: Unselect; Right: Confirm")),
+    "digSettings": MetaIcon (img=icons_img["digSettings"],
+                             label=_("Settings"),
+                             desc=_("Settings dialog for digitization tool")),
+    "digSplitLine": MetaIcon (img=icons_img["digSplitLine"],
+                              label=_("Split line/boundary"),
+                              desc=_("Left: Select; Middle: Unselect; Right: Confirm")),
+    "digExit"    : MetaIcon (img=icons_img["quit"],
+                             label=_("Quit digitization tool")),
+    "digAdditionalTools" : MetaIcon (img=icons_img["digAdditionalTools"],
+                                     label=_("Additional tools " \
+                                                 "(copy, flip, connect, etc.)"),
+                                     desc=_("Left: Select; Middle: Unselect; Right: Confirm")),
+    "digUndo" : MetaIcon (img=icons_img["digUndo"],
+                          label=_("Undo"),
+                          desc=_("Undo previous changes")),
     # analyze raster
-    "analyze"    : MetaIcon (img=icons_img["analyze"], label="Analyze map"),
-    "measure"    : MetaIcon (img=icons_img["measure"], label="Measure distance"),
-    "transect"   : MetaIcon (img=icons_img["transect"], label="Draw transect in map display window to profile"),
-    "profile"    : MetaIcon (img=icons_img["profile"], label="Profile surface map"),
-    "profiledraw": MetaIcon (img=icons_img["profiledraw"], label="Draw/re-draw profile"),
-    "profileopt" : MetaIcon (img=icons_img["profileopt"], label="Profile options"),
-    "histogram"  : MetaIcon (img=icons_img["histogram"], label="Create histogram of image or raster file"),
-    "font"       : MetaIcon (img=icons_img["font"], label="Select font"),
-    "color"      : MetaIcon (img=icons_img["color"], label="Select color"),
-    "options"    : MetaIcon (img=icons_img["options"], label="Set histogram options"),
-    "analyze"    : MetaIcon (img=icons_img["analyze"], label="Analyze"),
+    "analyze"    : MetaIcon (img=icons_img["analyze"],
+                             label=_("Analyze map")),
+    "measure"    : MetaIcon (img=icons_img["measure"],
+                             label=_("Measure distance")),
+    "transect"   : MetaIcon (img=icons_img["transect"],
+                             label=_("Draw transect in map display window to profile")),
+    "profile"    : MetaIcon (img=icons_img["profile"],
+                             label=_("Profile surface map")),
+    "profiledraw": MetaIcon (img=icons_img["profiledraw"],
+                             label=_("Draw/re-draw profile")),
+    "profileopt" : MetaIcon (img=icons_img["profileopt"],
+                             label=_("Profile options")),
+    "histogram"  : MetaIcon (img=icons_img["histogram"],
+                             label=_("Create histogram of image or raster file")),
+    "font"       : MetaIcon (img=icons_img["font"],
+                             label=_("Select font")),
+    "color"      : MetaIcon (img=icons_img["color"],
+                             label=_("Select color")),
+    "options"    : MetaIcon (img=icons_img["options"],
+                             label=_("Set histogram options")),
+    "analyze"    : MetaIcon (img=icons_img["analyze"],
+                             label=_("Analyze")),
     # georectify
-    'cleargcp'   : MetaIcon (img=icons_img["cleargcp"], label="Clear selected GCP"),
-    'gcpset'     : MetaIcon (img=icons_img["gcpset"], label="Set GCP"),
-    'georect'    : MetaIcon (img=icons_img["georect"], label="Georectify"),
-    'rms'        : MetaIcon (img=icons_img["rms"], label="Recalculate RMS error"),
-    'refreshgcp' : MetaIcon (img=icons_img["refreshgcp"], label="Redraw GCP markers in map displays")}
+    'grGcpSet'     : MetaIcon (img=icons_img["grGcpSet"],
+                             label=_("Set GCP"),
+                             desc=_("Define GCP (Ground Control Points)")),
+    'grGeorect'    : MetaIcon (img=icons_img["grGeorect"],
+                             label=_("Georectify")),
+    'grGcpRms'        : MetaIcon (img=icons_img["grGcpRms"],
+                                  label=_("Recalculate RMS error")),
+    'grGcpRefresh' : MetaIcon (img=icons_img["grGcpRefresh"],
+                               label=_("Redraw GCP markers in map displays")),
+    'grGcpSave' : MetaIcon (img=icons_img["grGcpSave"],
+                            label=_("Save GCPs to POINTS file")),
+    'grGcpAdd' : MetaIcon (img=icons_img["grGcpAdd"],
+                           label=_("Add new GCP")),
+    'grGcpDelete' : MetaIcon (img=icons_img["grGcpDelete"],
+                              label=_("Delete selected GCP")),
+    'grGcpClear' : MetaIcon (img=icons_img["grGcpClear"],
+                             label=_("Clear selected GCP")),
+    'grGcpReload' : MetaIcon (img=icons_img["grGcpReload"],
+                              label=_("Reload GCPs from selected POINTS file")),
+    'grGcpQuit' : MetaIcon (img=icons_img["quit"],
+                            label=_("Quit georectification module")),
+    "grSettings": MetaIcon (img=icons_img["grSettings"],
+                            label=_("Settings"),
+                            desc=_("Settings dialog for georectification tool")),
+    }
 
 # testing ...
 if __name__ == "__main__":

+ 11 - 1
gui/wxpython/icons/silk/__init__.py

@@ -80,7 +80,17 @@ IconsSilk = {
     "addchart"   : 'chart_bar.png',
     # profile analysis
     "transect"   : 'image_edit.png',
-#    "profiledraw"   : 'page_white_lightning.png',
     "profiledraw"  : 'arrow_refresh.png',
     "profileopt"   : 'color_swatch.png',
+    # georectify
+    "grGcpSet"     : 'bullet_add.png',
+    'grGcpClear'   : 'cross.png',
+    'grGeorect'    : 'application_lightning.png',
+    'grGcpRms'     : 'error.png',
+    'grGcpRefresh' : 'arrow_refresh.png',
+    "grGcpSave"    : 'picture_save.png',
+    "grGcpAdd"     : 'bullet_add.png', 
+    "grGcpDelete"  : 'bullet_delete.png',
+    "grGcpReload"  : 'arrow_refresh.png',
+    "grSettings"   : 'color_swatch.png',
     }