[GRASS-SVN] r30591 - in grass/branches/releasebranch_6_3/gui: icons/silk wxpython wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Mar 16 15:55:34 EDT 2008


Author: martinl
Date: 2008-03-16 15:55:34 -0400 (Sun, 16 Mar 2008)
New Revision: 30591

Added:
   grass/branches/releasebranch_6_3/gui/icons/silk/application_add.png
   grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/goutput.py
Modified:
   grass/branches/releasebranch_6_3/gui/wxpython/Makefile
   grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/__init__.py
   grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/digit.py
   grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/globalvar.py
   grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/gselect.py
   grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/menudata.py
   grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/menuform.py
   grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/preferences.py
   grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/utils.py
   grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/wxgui_utils.py
   grass/branches/releasebranch_6_3/gui/wxpython/wxgui.py
Log:
wxGUI: synchronized with trunk

Added: grass/branches/releasebranch_6_3/gui/icons/silk/application_add.png
===================================================================
(Binary files differ)


Property changes on: grass/branches/releasebranch_6_3/gui/icons/silk/application_add.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: grass/branches/releasebranch_6_3/gui/wxpython/Makefile
===================================================================
--- grass/branches/releasebranch_6_3/gui/wxpython/Makefile	2008-03-16 19:28:50 UTC (rev 30590)
+++ grass/branches/releasebranch_6_3/gui/wxpython/Makefile	2008-03-16 19:55:34 UTC (rev 30591)
@@ -21,8 +21,8 @@
 	$(INSTALL_DATA) icons/*.* $(ETCDIR)/icons/
 	$(INSTALL_DATA) icons/silk/* $(ETCDIR)/icons/silk/
 	$(INSTALL_DATA) images/* $(ETCDIR)/images/
-	$(INSTALL_DATA) scripts/* $(ETCDIR)/scripts/
 	$(INSTALL_DATA) gis_set.py wxgui.py README $(ETCDIR)/
+	$(INSTALL) -m 755 scripts/* $(ETCDIR)/scripts/	
 	$(INSTALL) -m 755 wxgui $(ETCDIR)/scripts/
 
 clean: cleansubdirs

Modified: grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/__init__.py
===================================================================
--- grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/__init__.py	2008-03-16 19:28:50 UTC (rev 30590)
+++ grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/__init__.py	2008-03-16 19:55:34 UTC (rev 30591)
@@ -7,6 +7,7 @@
         "globalvar",
         "grassenv",
         "gselect",
+        "goutput",
         "histogram",
         "location_wizard",
         "mapdisp",

Modified: grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/digit.py
===================================================================
--- grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/digit.py	2008-03-16 19:28:50 UTC (rev 30590)
+++ grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/digit.py	2008-03-16 19:55:34 UTC (rev 30591)
@@ -1748,7 +1748,7 @@
         if self.snappingUnit.GetStringSelection() == "map units":
             threshold = value
         else:
-            threshold = self.parent.digit.driver.GetThreshold(value)
+            threshold = self.parent.digit.driver.GetThreshold(value=value)
 
         self.snappingInfo.SetLabel(_("Snapping threshold is %(value).1f %(units)s") % 
                                    {'value' : threshold,
@@ -1760,7 +1760,7 @@
         """Snapping units change -> update static text"""
         value = self.snappingValue.GetValue()
         units = self.snappingUnit.GetStringSelection()
-        threshold = self.parent.digit.driver.GetThreshold(value, units)
+        threshold = self.parent.digit.driver.GetThreshold(value=value, units=units)
 
         if units == "map units":
             self.snappingInfo.SetLabel(_("Snapping threshold is %(value).1f %(units)s") % 
@@ -1943,16 +1943,16 @@
 
         layerNewTxt = wx.StaticText(parent=self, id=wx.ID_ANY,
                                  label="%s:" % _("Layer"))
-        self.layerNew = wx.TextCtrl(parent=self, id=wx.ID_ANY, size=(50, -1),
-                                    value="1")
+        self.layerNew = wx.SpinCtrl(parent=self, id=wx.ID_ANY, size=(50, -1),
+                                    initial=1, min=1, max=1e9)
         catNewTxt = wx.StaticText(parent=self, id=wx.ID_ANY,
                                label="%s:" % _("Category"))
         try:
             newCat = max(self.cats[1]) + 1
         except:
             newCat = 1
-        self.catNew = wx.TextCtrl(parent=self, id=wx.ID_ANY, size=(50, -1),
-                                  value=str(newCat))
+        self.catNew = wx.SpinCtrl(parent=self, id=wx.ID_ANY, size=(75, -1),
+                                  initial=newCat, min=-1e9, max=1e9)
         btnAddCat = wx.Button(self, wx.ID_ADD)
         flexSizer.Add(item=layerNewTxt, proportion=0,
                       flag=wx.FIXED_MINSIZE | wx.ALIGN_CENTER_VERTICAL)
@@ -2240,7 +2240,7 @@
         self.itemDataMap = self.list.Populate(update=True)
 
         # update category number for add
-        self.catNew.SetValue(str(cat + 1))
+        self.catNew.SetValue(cat + 1)
 
         event.Skip()
 

Modified: grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/globalvar.py	2008-03-16 19:28:50 UTC (rev 30590)
+++ grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/globalvar.py	2008-03-16 19:55:34 UTC (rev 30591)
@@ -64,31 +64,28 @@
     EXT_BIN = ''
     EXT_SCT = ''
 
-def __getGRASSCmds(bin=True, scripts=True):
+def __getGRASSCmds(bin=True, scripts=True, gui_scripts=True):
     """
     Create list of all available GRASS commands to use when
     parsing string from the command line
     """
     gisbase = os.environ['GISBASE']
-    binlst = []
+    list = []
     if bin is True:
-        binlst = os.listdir(os.path.join(gisbase, 'bin'))
-        if subprocess.mswindows:
-            for idx in range(len(binlst)):
-                binlst[idx] = binlst[idx].replace(EXT_BIN, '')
-                binlst[idx] = binlst[idx].replace(EXT_SCT, '')
-    sctlst = []
+        list = os.listdir(os.path.join(gisbase, 'bin'))
     if scripts is True:
-        sctlst = sctlst + os.listdir(os.path.join(gisbase, 'scripts'))
-        if subprocess.mswindows:
-            for idx in range(len(binlst)):
-                binlst[idx] = binlst[idx].replace(EXT_BIN, '')
-                binlst[idx] = binlst[idx].replace(EXT_SCT, '')
+        list = list + os.listdir(os.path.join(gisbase, 'scripts')) 
+    if gui_scripts is True:
+        os.environ["PATH"] = os.getenv("PATH") + ':%s' % os.path.join(gisbase, 'etc', 'gui', 'scripts')
+        list = list + os.listdir(os.path.join(gisbase, 'etc', 'gui', 'scripts'))
+       
+    if subprocess.mswindows:
+        for idx in range(len(list)):
+            list[idx] = list[idx].replace(EXT_BIN, '')
+            list[idx] = list[idx].replace(EXT_SCT, '')
 
-    # self.gcmdlst = self.gcmdlst + os.listdir(os.path.join(gisbase,'etc','gm','script'))
+    return list
 
-    return binlst + sctlst
-
 """@brief Collected GRASS-relared binaries/scripts"""
 grassCmd = {}
 grassCmd['all'] = __getGRASSCmds()

Added: grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/goutput.py	                        (rev 0)
+++ grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/goutput.py	2008-03-16 19:55:34 UTC (rev 30591)
@@ -0,0 +1,461 @@
+"""
+ at package goutput
+
+ at brief Command output log widget
+
+Classes:
+ - GMConsole
+ - GMStc
+ - GMStdout
+ - GMStderr
+
+(C) 2007-2008 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 (Arizona State University)
+Martin Landa <landa.martin gmail.com>
+"""
+
+import os
+import textwrap
+import time
+
+import wx
+import wx.stc
+
+import globalvar
+import gcmd
+from debug import Debug as Debug
+
+class GMConsole(wx.Panel):
+    """
+    Create and manage output console for commands entered on the
+    GIS Manager command line.
+    """
+    def __init__(self, parent, id=wx.ID_ANY, margin=False,
+                 pos=wx.DefaultPosition, size=wx.DefaultSize,
+                 style=wx.TAB_TRAVERSAL | wx.FULL_REPAINT_ON_RESIZE):
+        wx.Panel.__init__(self, parent, id, pos, size, style)
+
+        # initialize variables
+        self.Map             = None
+        self.parent          = parent # GMFrame
+        self.cmdThreads      = []     # list of running commands (alive or dead)
+
+        # progress bar
+        self.console_progressbar = wx.Gauge(parent=self, id=wx.ID_ANY,
+                                            range=100, pos=(110, 50), size=(-1, 25),
+                                            style=wx.GA_HORIZONTAL)
+
+        # text control for command output
+        self.cmd_output = GMStc(parent=self, id=wx.ID_ANY, margin=margin)
+        # redirect
+        self.cmd_stdout = GMStdout(self.cmd_output)
+        self.cmd_stderr = GMStderr(self.cmd_output,
+                                   self.console_progressbar)
+
+        # buttons
+        self.console_clear = wx.Button(parent=self, id=wx.ID_CLEAR)
+        self.console_save  = wx.Button(parent=self, id=wx.ID_SAVE)
+        self.Bind(wx.EVT_BUTTON, self.ClearHistory, self.console_clear)
+        self.Bind(wx.EVT_BUTTON, self.SaveHistory,  self.console_save)
+
+        # output control layout
+        boxsizer1 = wx.BoxSizer(wx.VERTICAL)
+        gridsizer1 = wx.GridSizer(rows=1, cols=2, vgap=0, hgap=0)
+        boxsizer1.Add(item=self.cmd_output, proportion=1,
+                      flag=wx.EXPAND | wx.ADJUST_MINSIZE, border=0)
+        gridsizer1.Add(item=self.console_clear, proportion=0,
+                       flag=wx.ALIGN_CENTER_HORIZONTAL | wx.ADJUST_MINSIZE, border=0)
+        gridsizer1.Add(item=self.console_save, proportion=0,
+                       flag=wx.ALIGN_CENTER_HORIZONTAL | wx.ADJUST_MINSIZE, border=0)
+
+
+        boxsizer1.Add(item=gridsizer1, proportion=0,
+                      flag=wx.EXPAND | wx.ALIGN_CENTRE_VERTICAL | wx.TOP | wx.BOTTOM,
+                      border=5)
+        boxsizer1.Add(item=self.console_progressbar, proportion=0,
+                      flag=wx.EXPAND | wx.ADJUST_MINSIZE, border=0)
+
+        boxsizer1.Fit(self)
+        boxsizer1.SetSizeHints(self)
+
+        # set up event handler for any command thread results
+        gcmd.EVT_RESULT(self, self.OnResult)
+
+        # layout
+        self.SetAutoLayout(True)
+        self.SetSizer(boxsizer1)
+
+    def WriteCmdLog(self, line, pid=None):
+        """Write out line in selected style"""
+        self.cmd_output.GotoPos(self.cmd_output.GetEndStyled())
+        p1 = self.cmd_output.GetCurrentPos()
+        if pid:
+            line = '(' + str(pid) + ') ' + line
+        if len(line) < 80:
+            diff = 80 - len(line)
+            line += diff * ' '
+            line += '%s' % os.linesep
+            self.cmd_output.AddText(line)
+            self.cmd_output.EnsureCaretVisible()
+            p2 = self.cmd_output.GetCurrentPos()
+            self.cmd_output.StartStyling(p1, 0xff)
+            self.cmd_output.SetStyling(p2 - p1, self.cmd_output.StyleCommand)
+        
+    def RunCmd(self, command):
+        """
+        Run in GUI GRASS (or other) commands typed into
+        console command text widget, and send stdout output to output
+        text widget.
+
+        Command is transformed into a list for processing.
+
+        TODO: Display commands (*.d) are captured and
+        processed separately by mapdisp.py. Display commands are
+        rendered in map display widget that currently has
+        the focus (as indicted by mdidx).
+        """
+        
+        # map display window available ?
+        try:
+            curr_disp = self.parent.curr_page.maptree.mapdisplay
+            self.Map = curr_disp.GetRender()
+        except:
+            curr_disp = None
+
+        if len(self.GetListOfCmdThreads()) > 0:
+            # only one running command enabled (per GMConsole instance)
+            busy = wx.BusyInfo(message=_("Unable to run the command, another command is running..."),
+                               parent=self)
+            wx.Yield()
+            time.sleep(3)
+            busy.Destroy()
+            return 
+
+        # command given as a string ?
+        try:
+            cmdlist = command.strip().split(' ')
+        except:
+            cmdlist = command
+
+        if cmdlist[0] in globalvar.grassCmd['all']:
+            # send GRASS command without arguments to GUI command interface
+            # except display commands (they are handled differently)
+            if cmdlist[0][0:2] == "d.": # display GRASS commands
+                try:
+                    layertype = {'d.rast'         : 'raster',
+                                 'd.rgb'          : 'rgb',
+                                 'd.his'          : 'his',
+                                 'd.shaded'       : 'shaded',
+                                 'd.legend'       : 'rastleg',
+                                 'd.rast.arrow'   : 'rastarrow',
+                                 'd.rast.num'     : 'rastnum',
+                                 'd.vect'         : 'vector',
+                                 'd.vect.thematic': 'thememap',
+                                 'd.vect.chart'   : 'themechart',
+                                 'd.grid'         : 'grid',
+                                 'd.geodesic'     : 'geodesic',
+                                 'd.rhumbline'    : 'rhumb',
+                                 'd.labels'       : 'labels'}[cmdlist[0]]
+                except KeyError:
+                    wx.MessageBox(message=_("Command '%s' not yet implemented.") % cmdlist[0])
+                    return False
+
+                # add layer into layer tree
+                self.parent.curr_page.maptree.AddLayer(ltype=layertype,
+                                                       lcmd=cmdlist)
+
+            else: # other GRASS commands (r|v|g|...)
+                if self.parent.notebook.GetSelection() != 1:
+                    # select 'Command output' tab
+                    self.parent.notebook.SetSelection(1)
+                
+                # activate computational region (set with g.region)
+                # for all non-display commands.
+                tmpreg = os.getenv("GRASS_REGION")
+                os.unsetenv("GRASS_REGION")
+                if len(cmdlist) == 1:
+                    import menuform
+                    # process GRASS command without argument
+                    menuform.GUI().ParseCommand(cmdlist, parentframe=self)
+                else:
+                    # process GRASS command with argument
+                    self.cmdPID = len(self.cmdThreads)+1
+                    self.WriteCmdLog('%s' % ' '.join(cmdlist), pid=self.cmdPID)
+                    
+                    grassCmd = gcmd.Command(cmdlist, wait=False,
+                                            stdout=self.cmd_stdout,
+                                            stderr=self.cmd_stderr)
+                    
+                    self.cmdThreads.append(grassCmd.cmdThread)
+                    
+                    return grassCmd
+                # deactivate computational region and return to display settings
+                if tmpreg:
+                    os.environ["GRASS_REGION"] = tmpreg
+        else:
+            # Send any other command to the shell. Send output to
+            # console output window
+            if self.parent.notebook.GetSelection() != 1:
+                # select 'Command output' tab
+                self.parent.notebook.SetSelection(1)
+
+            print "$ " + ' '.join(cmdlist)
+            
+            # if command is not a GRASS command, treat it like a shell command
+            generalCmd = subprocess.Popen(cmdlist,
+                                          stdout=subprocess.PIPE,
+                                          stderr=subprocess.PIPE)
+            
+            for outline in generalCmd.stdout:
+                print outline
+                   
+            return None
+
+    def ClearHistory(self, event):
+        """Clear history of commands"""
+        self.cmd_output.ClearAll()
+        self.console_progressbar.SetValue(0)
+
+    def SaveHistory(self, event):
+        """Save history of commands"""
+        self.history = self.cmd_output.GetSelectedText()
+        if self.history == '':
+            self.history = self.cmd_output.GetText()
+
+        # add newline if needed
+        if len(self.history) > 0 and self.history[-1] != os.linesep:
+            self.history += os.linesep
+
+        wildcard = "Text file (*.txt)|*.txt"
+        dlg = wx.FileDialog(
+            self, message=_("Save file as..."), defaultDir=os.getcwd(),
+            defaultFile="grass_cmd_history.txt", wildcard=wildcard,
+            style=wx.SAVE|wx.FD_OVERWRITE_PROMPT)
+
+        # Show the dialog and retrieve the user response. If it is the OK response,
+        # process the data.
+        if dlg.ShowModal() == wx.ID_OK:
+            path = dlg.GetPath()
+
+            output = open(path, "w")
+            output.write(self.history)
+            output.close()
+
+        dlg.Destroy()
+
+    def GetListOfCmdThreads(self, onlyAlive=True):
+        """Return list of command threads)"""
+        list = []
+        for t in self.cmdThreads:
+            Debug.msg (4, "GMConsole.GetListOfCmdThreads(): name=%s, alive=%s" %
+                       (t.getName(), t.isAlive()))
+            if onlyAlive and not t.isAlive():
+                continue
+            list.append(t)
+
+        return list
+
+    def OnResult(self, event):
+        """Show result status"""
+        if event.cmdThread is None:
+            # Thread aborted (using our convention of None return)
+            self.WriteCmdLog(_('Command aborted'),
+                             pid=self.cmdPID)
+        else:
+            # Process results here
+            self.WriteCmdLog(_('Command finished (%d sec)') % (time.time() - event.cmdThread.startTime),
+                             pid=self.cmdPID)
+
+        self.console_progressbar.SetValue(0) # reset progress bar on '0%'
+        if hasattr(self.parent.parent, "btn_run"): # menuform.mainFrame
+            dialog = self.parent.parent
+            dialog.btn_run.Enable(True)
+            if dialog.get_dcmd is None and \
+                   dialog.closebox.IsChecked():
+                time.sleep(1)
+                dialog.Close()
+
+class GMStdout:
+    """GMConsole standard output
+
+    Based on FrameOutErr.py
+
+    Name:      FrameOutErr.py
+    Purpose:   Redirecting stdout / stderr
+    Author:    Jean-Michel Fauth, Switzerland
+    Copyright: (c) 2005-2007 Jean-Michel Fauth
+    Licence:   GPL
+    """
+    def __init__(self, gmstc):
+        self.gmstc  = gmstc
+
+    def write(self, s):
+        if len(s) == 0:
+            return
+        s = s.replace('\n', os.linesep)
+        for line in s.split(os.linesep):
+            p1 = self.gmstc.GetCurrentPos() # get caret position
+            self.gmstc.AddTextWrapped(line)
+            self.gmstc.EnsureCaretVisible()
+            p2 = self.gmstc.GetCurrentPos()
+            self.gmstc.StartStyling(p1, 0xff)
+            self.gmstc.SetStyling(p2 - p1 + 1, self.gmstc.StyleOutput)
+
+class GMStderr:
+    """GMConsole standard error output
+
+    Based on FrameOutErr.py
+
+    Name:      FrameOutErr.py
+    Purpose:   Redirecting stdout / stderr
+    Author:    Jean-Michel Fauth, Switzerland
+    Copyright: (c) 2005-2007 Jean-Michel Fauth
+    Licence:   GPL
+    """
+    def __init__(self, gmstc, gmgauge):
+        self.gmstc   = gmstc
+        self.gmgauge = gmgauge
+
+    def write(self, s):
+        s = s.replace('\n', os.linesep)
+        message = ''
+        for line in s.split(os.linesep):
+            if len(line) == 0:
+                continue
+
+            if 'GRASS_INFO_PERCENT' in line:
+                # 'GRASS_INFO_PERCENT: 10' -> value=10
+                value = int(line.split(':')[1].strip())
+                if value < 100:
+                    self.gmgauge.SetValue(value)
+                else:
+                    self.gmgauge.SetValue(0) # reset progress bar on '0%'
+            elif 'GRASS_INFO_MESSAGE' in line:
+                type = 'message'
+                message += line.split(':')[1].strip()
+            elif 'GRASS_INFO_WARNING' in line:
+                type = 'warning'
+                message += line.split(':')[1].strip()
+            elif 'GRASS_INFO_ERROR' in line:
+                type = 'error'
+                message += line.split(':')[1].strip()
+            elif 'GRASS_INFO_END' in line:
+                message = ''
+            else:
+                if len(line) > 0:
+                    p1 = self.gmstc.GetCurrentPos()
+                    self.gmstc.AddTextWrapped(line)
+                    self.gmstc.EnsureCaretVisible()
+                    p2 = self.gmstc.GetCurrentPos()
+                    self.gmstc.StartStyling(p1, 0xff)
+                    self.gmstc.SetStyling(p2 - p1 + 1, self.gmstc.StyleUnknown)
+
+            if len(message) > 0:
+                p1 = self.gmstc.GetCurrentPos()
+                if type == 'warning':
+                    message = 'WARNING: ' + message
+                elif type == 'error':
+                    message = 'ERROR: ' + message
+                self.gmstc.AddTextWrapped(message)
+                self.gmstc.EnsureCaretVisible()
+                p2 = self.gmstc.GetCurrentPos()
+                self.gmstc.StartStyling(p1, 0xff)
+                if type == 'error':
+                    self.gmstc.SetStyling(p2 - p1 + 1, self.gmstc.StyleError)
+                elif type == 'warning':
+                    self.gmstc.SetStyling(p2 - p1 + 1, self.gmstc.StyleWarning)
+                elif type == 'message':
+                    self.gmstc.SetStyling(p2 - p1 + 1, self.gmstc.StyleMessage)
+
+class GMStc(wx.stc.StyledTextCtrl):
+    """Styled GMConsole
+
+    Based on FrameOutErr.py
+
+    Name:      FrameOutErr.py
+    Purpose:   Redirecting stdout / stderr
+    Author:    Jean-Michel Fauth, Switzerland
+    Copyright: (c) 2005-2007 Jean-Michel Fauth
+    Licence:   GPL
+    """    
+    def __init__(self, parent, id, margin=False):
+        wx.stc.StyledTextCtrl.__init__(self, parent, id)
+        self.parent = parent
+        
+        #
+        # styles
+        #
+        self.StyleDefault     = 0
+        self.StyleDefaultSpec = "face:Courier New,size:10,fore:#000000,back:#FFFFFF"
+        self.StyleCommand     = 1
+        self.StyleCommandSpec = "face:Courier New,size:10,fore:#000000,back:#bcbcbc"
+        self.StyleOutput      = 2
+        self.StyleOutputSpec  = "face:Courier New,size:10,fore:#000000,back:#FFFFFF"
+        # fatal error
+        self.StyleError       = 3
+        self.StyleErrorSpec   = "face:Courier New,size:10,fore:#7F0000,back:#FFFFFF"
+        # warning
+        self.StyleWarning     = 4
+        self.StyleWarningSpec = "face:Courier New,size:10,fore:#0000FF,back:#FFFFFF"
+        # message
+        self.StyleMessage     = 5
+        self.StyleMessageSpec = "face:Courier New,size:10,fore:#000000,back:#FFFFFF"
+        # unknown
+        self.StyleUnknown     = 6
+        self.StyleUnknownSpec = "face:Courier New,size:10,fore:#7F0000,back:#FFFFFF"
+        
+        # default and clear => init
+        self.StyleSetSpec(wx.stc.STC_STYLE_DEFAULT, self.StyleDefaultSpec)
+        self.StyleClearAll()
+        self.StyleSetSpec(self.StyleCommand, self.StyleCommandSpec)
+        self.StyleSetSpec(self.StyleOutput,  self.StyleOutputSpec)
+        self.StyleSetSpec(self.StyleError,   self.StyleErrorSpec)
+        self.StyleSetSpec(self.StyleWarning, self.StyleWarningSpec)
+        self.StyleSetSpec(self.StyleMessage, self.StyleMessageSpec)
+        self.StyleSetSpec(self.StyleUnknown, self.StyleUnknownSpec)
+
+        #
+        # line margins
+        #
+        # TODO print number only from cmdlog
+        self.SetMarginWidth(1, 0)
+        self.SetMarginWidth(2, 0)
+        if margin:
+            self.SetMarginType(0, wx.stc.STC_MARGIN_NUMBER)
+            self.SetMarginWidth(0, 30)
+        else:
+            self.SetMarginWidth(0, 0)
+
+        #
+        # miscellaneous
+        #
+        self.SetViewWhiteSpace(False)
+        self.SetTabWidth(4)
+        self.SetUseTabs(False)
+        self.UsePopUp(True)
+        self.SetSelBackground(True, "#FFFF00")
+        self.SetUseHorizontalScrollBar(True)
+
+        #
+        # bindins
+        #
+        self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroy)
+
+    def OnDestroy(self, evt):
+        """The clipboard contents can be preserved after
+        the app has exited"""
+        
+        wx.TheClipboard.Flush()
+        evt.Skip()
+
+    def AddTextWrapped(self, str, wrap=80):
+        """Add string to text area.
+
+        String is wrapped and linesep is also added to the end
+        of the string"""
+        str = textwrap.fill(str, wrap) + os.linesep
+        self.AddText(str)

Modified: grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/gselect.py	2008-03-16 19:28:50 UTC (rev 30590)
+++ grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/gselect.py	2008-03-16 19:55:34 UTC (rev 30591)
@@ -25,45 +25,9 @@
 import gcmd
 from preferences import globalSettings as UserSettings
 
-class SelectDialog(wx.Dialog):
-    def __init__(self, parent, id=wx.ID_ANY, title='Select GIS element',
-                pos=wx.DefaultPosition, size=(-1,-1), type='cell', multiple=False,
-                style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER):
-        """
-        A dialog box for the GIS element selector control so that it can be launched
-        from a button or other control.
-        """
-
-        wx.Dialog.__init__(self, parent, id, title, pos, size, style)
-
-        self.selection = None
-
-        sizer = wx.BoxSizer(wx.VERTICAL)
-
-        self.selection = Select(self, id=wx.ID_ANY, size=(300,-1), type=type,
-                                multiple=multiple)
-        sizer.Add(self.selection, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-
-        line = wx.StaticLine(self, -1, size=(20,-1), style=wx.LI_HORIZONTAL)
-        sizer.Add(line, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.RIGHT|wx.TOP, 5)
-
-        btnsizer = wx.StdDialogButtonSizer()
-
-        btn = wx.Button(self, wx.ID_OK)
-        btn.SetDefault()
-        btnsizer.AddButton(btn)
-
-        btn = wx.Button(self, wx.ID_CANCEL)
-        btnsizer.AddButton(btn)
-        btnsizer.Realize()
-
-        sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-
-        self.SetSizer(sizer)
-        sizer.Fit(self)
-
 class Select(wx.combo.ComboCtrl):
-    def __init__(self, parent, id, size, type, multiple=False):
+    def __init__(self, parent, id, size,
+                 type, multiple=False, mapsets=None):
         """
         Custom control to create a ComboBox with a tree control
         to display and select GIS elements within acessible mapsets.
@@ -71,10 +35,11 @@
         argument multiple=True. Multiple selections are separated by commas.
         """
         wx.combo.ComboCtrl.__init__(self, parent=parent, id=id, size=size)
+
         self.tcp = TreeCtrlComboPopup()
         self.SetPopupControl(self.tcp)
         self.SetPopupExtents(0,100)
-        self.tcp.GetElementList(type)
+        self.tcp.GetElementList(type, mapsets)
         self.tcp.SetMultiple(multiple)
 
     def SetElementList(self, type):
@@ -151,17 +116,19 @@
     def GetAdjustedSize(self, minWidth, prefHeight, maxHeight):
         return wx.Size(minWidth, min(200, maxHeight))
 
-    def GetElementList(self, element):
+    def GetElementList(self, element, mapsets=None):
         """
         Get list of GIS elements in accessible mapsets and display as tree
         with all relevant elements displayed beneath each mapset branch
         """
-        #set environmental variables
+        # get current mapset
         cmdlist = ['g.gisenv', 'get=MAPSET']
         curr_mapset = gcmd.Command(cmdlist).ReadStdOutput()[0]
+        
+        # list of mapsets in current location
+        if mapsets is None:
+            mapsets = UserSettings.Get(group='general', key='mapsetPath', subkey='value', internal=True)
 
-        #mapsets in current location
-        mapsets = UserSettings.Get(group='general', key='mapsetPath', subkey='value', internal=True)
         # map element types to g.mlist types
         elementdict = {'cell':'rast',
                        'raster':'rast',
@@ -209,7 +176,7 @@
                        '3D view parameters':'3dview'}
 
         if element not in elementdict:
-            self.AddItem('Not selectable element')
+            self.AddItem(_('Not selectable element'))
             return
 
         # get directory tree nodes
@@ -218,6 +185,7 @@
             if i > 0 and mapsets[i] == curr_mapset:
                 mapsets[i] = mapsets[0]
                 mapsets[0] = curr_mapset
+
         for dir in mapsets:
             dir_node = self.AddItem('Mapset: '+dir)
             self.seltree.SetItemTextColour(dir_node,wx.Colour(50,50,200))

Modified: grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/menudata.py
===================================================================
--- grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/menudata.py	2008-03-16 19:28:50 UTC (rev 30590)
+++ grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/menudata.py	2008-03-16 19:55:34 UTC (rev 30591)
@@ -1,21 +1,19 @@
 """
-MODULE:     menudata.py
+ at package menudata.py
 
-CLASSES:
-    * Data
+ at brief Complex list for main menu entries for GRASS wxPython GUI.
 
-PURPOSE:    Complex list for main menu entries for GRASS wxPython GUI.
+Classes:
+ - Data
 
-AUTHORS:    The GRASS Development Team
-            Michael Barton (Arizona State University)
-            Yann Chemin
-            Martin Landa <landa.martin gmail.com>
-            
 COPYRIGHT:  (C) 2007-2008 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.
+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 (Arizona State University)
+ at author Yann Chemin
+ at author Martin Landa <landa.martin gmail.com>
 """
 
 import os
@@ -25,529 +23,1537 @@
     Probably could be changed to XML or *.dtd file.'''
     def GetMenu(self):
         return [(
-          ("File", (
-              ("Workspace", (
-                 ("New workspace", "Create new workspace file (erase current workspace settings first)", "self.OnWorkspaceNew", ""),
-                 ("Open existing workspace", "Open existing workspace file", "self.OnWorkspaceOpen", ""),
-                 ("Load map layers", "Load map layers into layer tree", "self.OnWorkspaceLoad", ""),
-                 ("Save workspace", "Save current workspace to file", "self.OnWorkspaceSave", ""),
-                 ("Save workspace as", "Save current workspace as file", "self.OnWorkspaceSaveAs", ""),
-                 ("Close current workspace", "Close current workspace", "self.OnWorkspaceClose", ""),
-                 )),
-              ("","","", ""),
-              ("Import raster map", (
-                 ("Multiple import formats using GDAL", "Import multiple formats using GDAL", "self.OnMenuCmd", "r.in.gdal"),
-                 ("","","", ""),
-                 ("Aggregate ASCII xyz import", "Import aggregate ASCII xyz data", "self.OnMenuCmd", "r.in.xyz"),
-                 ("ASCII grid import", "Import ASCII GRID (includes GRASS ASCII)", "self.OnMenuCmd", "r.in.ascii"),
-                 ("ASCII polygons and lines import", "Import Polygons and lines from ASCII file", "self.OnMenuCmd", "r.in.poly"),
-                 ("","","", ""),
-                 ("Binary import", "Import binary file (includes GTOPO30 format)", "self.OnMenuCmd", "r.in.bin"),
-                 ("ESRI ASCII grid import", "Import ESRI Arc/Info ASCII grid", "self.OnMenuCmd", "r.in.arc"),
-                 ("GRIDATB.FOR import", "Import GRIDATB.FOR map file (TOPMODEL)", "self.OnMenuCmd", "r.in.gridatb"),
-                 ("MAT-File (v.4) import", "Import MAT-File (v.4) array (Matlab or Octave)", "self.OnMenuCmd", "r.in.mat"),
-                 ("SPOT NDVI import", "Import SPOT vegetation NDVI data sets", "self.OnMenuCmd", "r.in.spotvgt"),
-                 ("SRTM HGT import", "Import SRTM hgt files", "self.OnMenuCmd", "r.in.srtm"),
-                 ("Terra ASTER HDF import", "Import Terra ASTER HDF files", "self.OnMenuCmd", "r.in.aster"),
-                 ("","","", ""),
-                 ("WMS import", "Import Web Mapping Server", "self.OnMenuCmd", "r.in.wms"),
-                 )),
-              ("Import vector map", (
-                 ("Multiple import formats using OGR", "Import multiple formats using OGR", "self.OnMenuCmd", "v.in.ogr"),
-                 ("","","", ""),
-                 ("ASCII points/GRASS ASCII vector import", "Import ASCII points file or GRASS ASCII vector file", "self.OnMenuCmd", "v.in.ascii"),
-                 ("Old GRASS vector import", "Import old GRASS vector format", "self.OnMenuCmd", "v.convert"),
-                 ("","","", ""),
-                 ("DXF import", "Import DXF file", "self.OnMenuCmd", "v.in.dxf"),
-                 ("ESRI e00 import", "Import ESRI e00 file", "self.OnMenuCmd", "v.in.e00"),
-                 ("Garmin GPS import", "Import Garmin GPS Waypoints/Routes/Tracks", "self.OnMenuCmd", "v.in.garmin"),
-                 ("GPSBabel GPS import", "Import GPS Waypoints/Routes/Tracks using GPSBabel", "self.OnMenuCmd", "v.in.gpsbabel"),
-                 ("GEOnet import", "Import GEOnet Name server country files (US-NGA GNS)", "self.OnMenuCmd", "v.in.gns"),
-                 ("Matlab and MapGen import", "Import Matlab and MapGen files", "self.OnMenuCmd", "v.in.mapgen"),
-                 )),
-              ("Import grid 3D volume", (
-                 ("ASCII 3D import", "Import ASCII 3D file", "self.OnMenuCmd", "r3.in.ascii"),
-                 ("Vis5D import", "Import Vis5D file", "self.OnMenuCmd", "r3.in.v5d"),
-                 )),
-              ("Import database table", (
-                 ("Multiple import formats using OGR", "Import multiple formats using OGR", "self.OnMenuCmd", "db.in.ogr"),
-                 )),
-              ("","","", ""),
-              ("Export raster map", (
-                 ("Multiple export formats using GDAL", "Export multiple formats using GDAL", "self.OnMenuCmd", "r.out.gdal"),
-                 ("","","", ""),
-                 ("ASCII grid export", "Export ASCII grid (for GRASS, Surfer, Modflow, etc)", "self.OnMenuCmd", "r.out.ascii"),
-                 ("ASCII x,y,z export", "Export ASCII x,y,z values of cell centers", "self.OnMenuCmd", "r.out.xyz"),
-                 ("","","", ""),
-                 ("ESRI ASCII grid export", "Export ESRI Arc/Info ASCII grid", "self.OnMenuCmd", "r.out.arc"),
-                 ("GRIDATB.FOR export", "Export GRIDATB.FOR map file (TOPMODEL)", "self.OnMenuCmd", "r.out.gridatb"),
-                 ("MAT-File (v.4) export", "Export MAT-File (v.4) array (Matlab or Octave)", "self.OnMenuCmd", "r.out.mat"),
-                 ("","","", ""),
-                 ("Binary export", "Export binary file", "self.OnMenuCmd", "r.out.bin"),
-                 ("","","", ""),
-                 ("MPEG-1 export", "Export MPEG-1 animations", "self.OnMenuCmd", "r.out.mpeg"),
-                 ("PNG export", "Export PNG image (not georeferenced)", "self.OnMenuCmd", "r.out.png"),
-                 ("PPM export", "Export PPM image (24bit)", "self.OnMenuCmd", "r.out.ppm"),
-                 ("PPM from RGB export", "Export PPM image from red, green, blue raster maps", "self.OnMenuCmd", "r.out.ppm3"),
-                 ("POV-Ray export", "Export POVray height-field", "self.OnMenuCmd", "r.out.pov"),
-                 ("TIFF export", "Export TIFF image (8/24bit)", "self.OnMenuCmd", "r.out.tiff"),
-                 ("VRML export", "Export VRML file", "self.OnMenuCmd", "r.out.vrml"),
-                 ("VTK export", "Export VTK ASCII file", "self.OnMenuCmd", "r.out.vtk"),
-                 )),
-              ("Export vector map", (
-                 ("Multiple export formats using OGR", "Export multiple formats using OGR", "self.OnMenuCmd", "v.out.ogr"),
-                 ("","","", ""),
-                 ("ASCII points/GRASS ASCII vector export", "Import ASCII points file or GRASS ASCII vector file", "self.OnMenuCmd", "v.out.ascii"),
-                 ("DXF export", "Export DXF file", "self.OnMenuCmd", "v.out.dxf"),
-                 ("POV-Ray export", "Export POV-Ray format file", "self.OnMenuCmd", "v.out.pov"),
-                 ("SVG export", "Export SVG file", "self.OnMenuCmd", "v.out.svg"),
-                 ("VTK export", "Export VTK ASCII file", "self.OnMenuCmd", "v.out.vtk"),
-                 )),
-              ("Export grid 3D volume", (
-                 ("ASCII 3D export", "Export ASCII 3D file", "self.OnMenuCmd", "r3.out.ascii"),
-                 ("Vis5D export", "Export Vis5D file", "self.OnMenuCmd", "r3.out.v5d"),
-                 ("VTK export", "Export VTK ASCII file", "self.OnMenuCmd", "r3.out.vtk"),
-                 )),
-              ("","","", ""),
-              ("Manage maps and volumes", (
-                ("Copy", "Copy maps within mapsets or between mapsets", "self.OnMenuCmd", "g.copy"),
-                ("","","", ""),
-                ("List", "List maps by type", "self.OnMenuCmd", "list"),
-                ("List filtered", "List maps filtered by expressions and wildcards", "self.OnMenuCmd", "g.mlist"),
-                ("","","", ""),
-                ("Rename", "Rename maps", "self.OnMenuCmd", "g.rename"),
-                ("","","", ""),
-                ("Delete", "Delete maps", "self.OnMenuCmd", "g.remove"),
-                ("Delete filtered", "Delete maps using expressions and wildcards", "self.OnMenuCmd", "g.mremove"),
-                )),
-              ("Map type conversions", (
-                ("Raster to vector", "Convert raster to vector map", "self.OnMenuCmd", "r.to.vect"),
-                ("Raster series to volume", "Convert raster map series to volume", "self.OnMenuCmd", "r.to.rast3"),
-                ("Raster 2.5D to volume", "Convert raster 2.5D map to volume", "self.OnMenuCmd", "r.to.rast3elev"),
-                ("","","", ""),
-                ("Vector to raster", "Convert vector to raster map", "self.OnMenuCmd", "v.to.rast"),
-                ("Vector to volume", "Convert vector 3D points to volume voxels", "self.OnMenuCmd", "v.to.rast3"),
-                ("Sites to vector", "Convert sites (GRASS 5) to vector map", "self.OnMenuCmd", "v.in.sites"),
-                ("","","", ""),
-                ("Volume to raster series", "Convert raster to vector map", "self.OnMenuCmd", "r3.to.rast"),
-                )),
-              ("","","", ""),
-              ("Georectify", "Georectify raster and vector maps", "self.OnGeorectify", ""),
-              ("","","", ""),
-              ("NViz (requires TclTk)", "N-Dimensional visualization of maps and volumes", "self.OnMenuCmd", "nviz"),
-              ("","","", ""),
-              ("Bearing/distance to coordinates", "Convert between bearing/distance and coordinates", "self.OnMenuCmd", "m.cogo"),
-              ("","","", ""),
-              ("Postscript plot", "Create cartographic PostScript plot", "self.OnMenuCmd", "ps.map"),
-              ("","","", ""),
-              ("E&xit", "Exit from wxgui.py", "self.OnCloseWindow", ""),
-              )),
-          ("Config", (
-              ("Region", (
-                ("Display region", "Display region settings", "self.RunMenuCmd", "g.region -p"),
-                ("Set region", "Change region settings", "self.OnMenuCmd", "g.region"),
-              )),
-              ("GRASS working environment", (
-                ("Mapset access", "Set/unset access to other mapsets in current location", "self.OnMapsets", ""),
-                ("Change working environment", "Change current working session to new mapset, location, or data directory", "self.OnMenuCmd", "g.mapset"),
-                ("User access", "Change access by other users to current mapset", "self.OnMenuCmd", "g.access"),
-                ("Show settings", "Show current GRASS environment settings", "self.RunMenuCmd", "g.gisenv"),
-                ("Change settings", "Change GRASS environment settings", "self.OnMenuCmd", "g.gisenv"),
-                ("Version", "Show current GRASS version", "self.RunMenuCmd", "g.version -c"),
-              )),
-              ("Manage projections", (
-                ("Manage projections", "Show projection information and create projection files", "self.OnMenuCmd", "g.proj"),
-                ("Projection for current location", "Create/edit projection information for current location", "self.OnXTerm", "g.setproj"),
-                ("","","", ""),
-                ("Convert coordinates", "Convert coordinates from one projection to another", "self.OnMenuCmd", "m.proj"),
-              )),
-              ("Preferences", "User preferences (display font, etc.)", "self.OnPreferences", ""),
-              )),
-          ("Raster", (
-              ("Develop map", (
-                ("Digitize raster (requires XTerm)", "Digitize new raster map", "self.OnXTerm", "r.digit"),
-                ("","","", ""),
-                ("Compress/decompress", "Compress/decompress raster file", "self.OnMenuCmd", "r.compress"),
-                ("","","", ""),
-                ("Boundaries", "Manage boundary definition", "self.OnMenuCmd", "r.region"),
-                ("Manage NULL values", "Manage NULL values", "self.OnMenuCmd", "r.null"),
-                ("Quantization", "Quantization for floating-point maps", "self.OnMenuCmd", "r.quant"),
-                ("Timestamp", "Manage timestamp for files", "self.OnMenuCmd", "r.timestamp"),
-                ("","","", ""),
-                ("Resample using aggregate statistics", "Resample (change resolution) using aggregate statistics", "self.OnMenuCmd", "r.resamp.stats"),
-                ("Resample using multiple methods", "Resample (change resolution) using nearest neighbor, bilinear, or bicubic interpolation", "self.OnMenuCmd", "r.resamp.interp"),
-                ("Resample using nearest neighbor", "Resample (change resolution) using nearest neighbor interpolation", "self.OnMenuCmd", "r.resample"),
-                ("Resample using spline tension", "Resample (change resolution) using regularized spline tension", "self.OnMenuCmd", "r.resamp.rst"),
-                ("","","", ""),
-                ("Support file maintenance", "Support file creation and maintenance", "self.OnMenuCmd", "r.support"),
-                ("Update map statistics", "Update map statistics", "self.OnMenuCmd", "r.support.stats"),
-                ("","","", ""),
-                ("Reproject raster", "Reproject raster from other location", "self.OnMenuCmd", "r.proj"),
-                ("Tiling", "Generate tiling for other projection", "self.OnMenuCmd", "r.tileset"),
-                )),
-              ("Manage map colors", (
-                ("Color tables", "Set colors to predefined color tables", "self.OnMenuCmd", "r.colors"),
-                ("Color rules", "Set colors interactively by entering color rules", "self.RulesCmd", "r.colors"),
-                ("","","", ""),
-                ("Blend 2 color maps", "Blend 2 color maps to produce 3 RGB files", "self.OnMenuCmd", "r.blend"),
-                ("Create RGB", "Create color image from RGB files", "self.OnMenuCmd", "r.composite"),
-                ("RGB to HIS", "Create 3 RGB (red, green, blue) maps from 3 HIS (hue, intensity, saturation) maps", "self.OnMenuCmd", "r.his"),
-                )),
-              ("Query by coordinates", "Query by coordinates", "self.OnMenuCmd", "r.what"),
-              ("","","", ""),
-              ("Buffer rasters", "Create raster buffers around raster objects", "self.OnMenuCmd", "r.buffer"),
-              ("Closest points", "r.distance", "self.OnMenuCmd", "r.distance"),
-              ("MASK", "Develop raster mask", "self.OnMenuCmd", "r.mask"),
-              ("Map calculator", "Map calculator for map algebra", "self.DispMapCalculator", ""),
-              ("Neighborhood analysis", (
-                ("Moving window", "Moving window analysis of raster cells", "self.OnMenuCmd", "r.neighbors"),
-                ("Neighborhood points", "Analyze vector points in neighborhood of raster cells", "self.OnMenuCmd", "v.neighbors"),
-                )),
-              ("Overlay maps", (
-                ("Cross product", "Cross product", "self.OnMenuCmd", "r.cross"),
-                ("Map series", "Function of map series (time series)", "self.OnMenuCmd", "r.series"),
-                ("Patch raster maps", "Patch maps", "self.OnMenuCmd", "r.patch"),
-                ("","","", ""),
-                ("Statistical overlay", "Statistical calculations for cover map over base map", "self.OnMenuCmd", "r.statistics"),
-                )),
-              ("Solar radiance and shadows", (
-                ("Solar irradiance and irradiation", "Solar irradiance and daily irradiation", "self.OnMenuCmd", "r.sun"),
-                ("Shadows map", "Shadows map for sun position or date/time", "self.OnMenuCmd", "r.sunmask"),
-                )),
-              ("Terrain analysis", (
-                ("Cumulative movement costs", "Calculate cumulative movement costs between locales", "self.OnMenuCmd", "r.walk"),
-                ("Cost surface", "cost surface", "self.OnMenuCmd", "r.cost"),
-                ("Least cost route or flow", "Least cost route or flow", "self.OnMenuCmd", "r.drain"),
-                ("","","", ""),
-                ("Shaded relief", "Shaded relief map", "self.OnMenuCmd", "r.shaded.relief"),
-                ("","","", ""),
-                ("Slope and aspect", "Slope and aspect", "self.OnMenuCmd", "r.slope.aspect"),
-                ("Terrain parameters", "Terrain parameters", "self.OnMenuCmd", "r.param.scale"),
-                ("Textural features", "Textural features", "self.OnMenuCmd", "r.texture"),
-                ("","","", ""),
-                ("Visibility", "Visibility and line of sight", "self.OnMenuCmd", "r.los"),
-                )),
-              ("Transform features", (
-                ("Clump", "Clump small areas (statistics calculated by r.volume)", "self.OnMenuCmd", "r.clump"),
-                ("Grow", "Grow areas", "self.OnMenuCmd", "r.grow"),
-                ("Thin", "Thin linear features", "self.OnMenuCmd", "r.thin"),
-                )),
-              ("","","", ""),
-              ("Hydrologic modeling", (
-                ("Carve stream channels", "Carve stream channels into elevation map using vector streams map", "self.OnMenuCmd", "r.carve"),
-                ("Fill lake", "Fill lake from seed point to specified level", "self.OnMenuCmd", "r.lake"),
-                ("","","", ""),
-                ("Depressionless map and flowlines", "Depressionless elevation map and flowline map", "self.OnMenuCmd", "r.fill.dir"),
-                ("Flow accumulation", "Flow accumulation for massive grids", "self.OnMenuCmd", "r.terraflow"),
-                ("Flow lines", "Generate flow lines for raster map", "self.OnMenuCmd", "r.flow"),
-                ("","","", ""),
-                ("SIMWE Overland flow modeling", "SIMWE overland flow modeling", "self.OnMenuCmd", "r.sim.water"),
-                ("SIMWE Sediment flux modeling", "SIMWE sediment erosion, transport, deposition modeling", "self.OnMenuCmd", "r.sim.sediment"),
-                ("","","", ""),
-                ("Topographic index map", "Topographic index map", "self.OnMenuCmd", "r.topidx"),
-                ("TOPMODEL simulation", "TOPMODEL simulation", "self.OnMenuCmd", "r.topmodel"),
-                ("","","", ""),
-                ("Watershed subbasins", "Watershed subbasins", "self.OnMenuCmd", "r.basins.fill"),
-                ("Watershed analysis", "Watershed analysis", "self.OnMenuCmd", "r.watershed"),
-                ("Watershed basin creation", "Watershed basin creation", "self.OnMenuCmd", "r.water.outlet"),
-                )),
-              ("Landscape structure modeling", (
-                ("Set up (requires XTerm)", "Set up sampling and analysis framework", "self.OnXTerm", "r.le.setup"),
-                ("","","", ""),
-                ("Analyze landscape", "Analyze landscape characteristics", "self.OnMenuCmd", "r.le.pixel"),
-                ("Analyze patches", "Analyze landscape patch characteristics", "self.OnMenuCmd", "r.le.patch"),
-                ("Output", "Output landscape patch information", "self.OnMenuCmd", "r.le.trace"),
-                )),
-              ("Landscape patch analysis", (
-                ("Set up sampling and analysis framework", "Configure and create patch map for analysis", "self.OnMenuCmd", "r.li.setup"),
-                ("","","", ""),
-                ("Edge density", "Calculate edge density index using a 4 neighbour algorithm", "self.OnMenuCmd", "r.li.edgedensity"),
-                ("Contrast weighted edge density", "Calculate contrast weighted edge density index", "self.OnMenuCmd", "r.li.cwed"),
-                ("","","", ""),
-                ("Patch area mean", "Calculate mean patch size index using a 4 neighbour algorithm", "self.OnMenuCmd", "r.li.mps"),
-                ("Patch area range", "Calculate range of patch area size", "self.OnMenuCmd", "r.li.padrange"),
-                ("Patch area Std Dev", "Calculate standard deviation of patch area", "self.OnMenuCmd", "r.li.padsd"),
-                ("Patch area Coeff Var", "Calculate coefficient of variation of patch area", "self.OnMenuCmd", "r.li.padcv"),
-                ("Patch density", "Calculate patch density index using a 4 neighbour algorithm", "self.OnMenuCmd", "r.li.patchdensity"),
-                ("Patch number", "Calculate patch number index using a 4 neighbour algorithm", "self.OnMenuCmd", "r.li.patchnum"),
-                ("","","", ""),
-                ("Dominance's diversity", "Calculate Dominance's diversity index", "self.OnMenuCmd", "r.li.dominance"),
-                ("Shannon's diversity", "Calculate Shannon's diversity index", "self.OnMenuCmd", "r.li.shannon"),
-                ("Simpson's diversity", "Calculate Simpson's diversity index", "self.OnMenuCmd", "r.li.simpson"),
-                ("","","", ""),
-                ("Richness", "Calculate richness index", "self.OnMenuCmd", "r.li.richness"),
-                ("Shape index", "Calculate shape index", "self.OnMenuCmd", "r.li.shape"),
-                )),
-              ("Wildfire modeling", (
-                ("Rate of spread", "Generate rate of spread (ROS) maps", "self.OnMenuCmd", "r.ros"),
-                ("Least-cost spread paths", "Generate least-cost spread paths", "self.OnMenuCmd", "r.spreadpath"),
-                ("Anisotropic spread simulation", "Simulate anisotropic spread phenomena", "self.OnMenuCmd", "r.spread"),
-                )),
-              ("","","", ""),
-              ("Change category values and labels", (
-                ("Interactively edit category values", "Edit category values of individual cells for displayed raster map", "self.OnMenuCmd", "d.rast.edit"),
-                ("","","", ""),
-                ("Reclassify by size", "Reclassify categories for areas of specified sizes", "self.OnMenuCmd", "r.reclass.area"),
-                ("Reclassify interactively", "Reclassify categories interactively by entering reclass rules", "self.RulesCmd", "r.reclass"),
-                ("Reclassify using rules file", "Reclassify categories by inputting reclass rules from a text file", "self.OnMenuCmd", "r.reclass"),
-                ("","","", ""),
-                ("Recode interactively", "Recode categories interactively by entering recode rules (create new map)", "self.RulesCmd", "r.recode"),
-                ("Recode using rules file", "Recode categories by inputting recode rules from a text file (create new map)", "self.OnMenuCmd", "r.recode.file"),
-                ("","","", ""),
-                ("Rescale", "Rescale categories (create new map)", "self.OnMenuCmd", "r.rescale"),
-                ("Rescale with histogram", "Rescale categories with equalized histogram (create new map)", "self.OnMenuCmd", "r.rescale.eq"),
-                )),
-              ("","","", ""),
-              ("Concentric circles", "Generate concentric circles around points", "self.OnMenuCmd", "r.circle"),
-              ("Generate random cells", (
-                ("Random cells", "Generate random cells", "self.OnMenuCmd", "r.random.cells"),
-                ("Random cells and vector points ", "Generate random cells and vector points from raster map", "self.OnMenuCmd", "r.random"),
-                )),
-              ("Generate surfaces", (
-                ("Fractal surface", "Generate fractal surface", "self.OnMenuCmd", "r.surf.fractal"),
-                ("","","", ""),
-                ("Gaussian kernel density surface", "Generate density surface using moving Gaussian kernel", "self.OnMenuCmd", "v.kernel"),
-                ("Gaussian deviates surface", "Generate gaussian deviates surface", "self.OnMenuCmd", "r.surf.gauss"),
-                ("","","", ""),
-                ("Plane", "Generate plane", "self.OnMenuCmd", "r.plane"),
-                ("","","", ""),
-                ("Random deviates surface", "Generate random deviates surface", "self.OnMenuCmd", "r.surf.random"),
-                ("Random surface with spatial dependence", "Generate random surface with spatial dependence", "self.OnMenuCmd", "r.random.surface"),
-                )),
-              ("Generate contour lines", "Generate vector contour lines", "self.OnMenuCmd", "r.contour"),
-              ("Interpolate surfaces", (
-                ("Bilinear from raster points", "Bilinear interpolation from raster points", "self.OnMenuCmd", "r.bilinear"),
-                ("Bilinear and bicubic from vector points", "Bicubic and bilinear interpolation with Tykhonov regularization from vector points", "self.OnMenuCmd", "v.surf.bspline"),
-                ("","","", ""),
-                ("IDW from raster points", "Inverse distance weighted interpolation from raster points", "self.OnMenuCmd", "r.surf.idw"),
-                ("IDW from vector points", "Inverse distance weighted interpolation from vector points", "self.OnMenuCmd", "v.surf.idw"),
-                ("","","", ""),
-                ("Raster contours", "Interpolation from raster contour", "self.OnMenuCmd", "r.surf.contour"),
-                ("Regularized spline tension ", "Regularized spline tension interpolation from vector points or contours", "self.OnMenuCmd", "v.surf.rst"),
-                ("","","", ""),
-                ("Fill NULL cells", "Fill NULL cells by interpolation using regularized spline tension", "self.OnMenuCmd", "r.fillnulls"),
-                )),
-              ("","","", ""),
-              ("Report and statistics", (
-                ("Basic raster information", "Report basic file information", "self.OnMenuCmd", "r.info"),
-                ("Manage category information", "Manage category labels and values", "self.OnMenuCmd", "r.category"),
-                ("","","", ""),
-                ("General statistics", "General statistics", "self.OnMenuCmd", "r.stats"),
-                ("Range of category values", "Range of all category values", "self.OnMenuCmd", "r.describe"),
-                ("Sum cell category values", "Sum all cell category values", "self.OnMenuCmd", "r.sum"),
-                ("Sum area by map and category", "Sum area by map and category", "self.OnMenuCmd", "r.report"),
-                ("Statistics for clumped cells", "Summary statistics for clumped cells (work with r.clump)", "self.OnMenuCmd", "r.volume"),
-                ("Total corrected area", "Total surface area corrected for topography", "self.OnMenuCmd", "r.surf.area"),
-                ("Univariate raster statistics", "Calculate univariate statistics for raster categories", "self.OnMenuCmd", "r.univar"),
-                ("","","", ""),
-                ("Sample transects", "Sample values along transects", "self.OnMenuCmd", "r.profile"),
-                ("Sample transects (bearing/distance)", "Sample values along transects (use azimuth, distance)", "self.OnMenuCmd", "r.transect"),
-                ("","","", ""),
-                ("Covariance/correlation", "Covariance/correlation", "self.OnMenuCmd", "r.covar"),
-                ("Linear regression", "Linear regression between 2 maps", "self.OnMenuCmd", "r.regression.line"),
-                ("Mutual category occurrences", "Mutual category occurrences (coincidence)", "self.OnMenuCmd", "r.coin"),
-                )),
-              )),
-          ("Vector", (
-              ("Develop vector map", (
-                ("Create empty vector map", "Create new empty vector map", "self.OnMenuCmd", "v.edit tool=create"),
-                ("Digitize vector map", "Digitize/edit vector map", "self.OnMenuCmd", "v.digit"),
-                ("","","", ""),
-                ("Create/rebuild topology", "Create or rebuild topology of vector objects", "self.OnMenuCmd", "v.build"),
-                ("Clean vector map", "Clean vector objects", "self.OnMenuCmd", "v.clean"),
-                ("Generalization", "Smooth, simplify, displace, or generalize a vector map", "self.OnMenuCmd", "v.generalize"),
-                ("","","", ""),
-                ("Convert object types", "Convert vector objects from one feature type to another", "self.OnMenuCmd", "v.type.sh"),
-                ("","","", ""),
-                ("Add centroids", "Add centroids to closed boundaries to create areas", "self.OnMenuCmd", "v.centroids"),
-                ("","","", ""),
-                ("Build polylines", "Build polylines from adjacent segments", "self.OnMenuCmd", "v.build.polylines"),
-                ("Split polylines", "Split polylines into points and segments", "self.OnMenuCmd", "v.segment"),
-                ("Parallel lines", "Create lines parallel to existing lines", "self.OnMenuCmd", "v.parallel"),
-                ("","","", ""),
-                ("Dissolve boundaries", "Dissolve common boundaries of areas", "self.OnMenuCmd", "v.dissolve"),
-                ("","","", ""),
-                ("Create 3D vector map over raster", "Create 3D objects by sampling raster with 2D vector", "self.OnMenuCmd", "v.drape"),
-                ("Extrude 3D vector map", "Extrude 3D objects from 2D vector", "self.OnMenuCmd", "v.extrude"),
-                ("","","", ""),
-                ("Link to OGR", "Create new vector as link to external OGR layer", "self.OnMenuCmd", "v.external"),
-                ("","","", ""),
-                ("Create labels", "Create text label file for vector features", "self.OnMenuCmd", "v.label"),
-                ("","","", ""),
-                ("Reposition vector map", "Reposition (shift, rotate, skew) vector file in coordinate space", "self.OnMenuCmd", "v.transform"),
-                ("Reproject vector map", "Reproject vector from other location", "self.OnMenuCmd", "v.proj"),
-                )),
-              ("","","", ""),
-              ("Query with attributes", "Query vector objects by attribute values", "self.OnMenuCmd", "v.extract"),
-              ("Query with coordinate(s)", "Query vector objects by coordinate(s)", "self.OnMenuCmd", "v.what"),
-              ("Query with another vector map", "Query objects using objects from a second map", "self.OnMenuCmd", "v.select"),
-              ("","","", ""),
-              ("Buffer vectors", "Create vector buffers around vector objects", "self.OnMenuCmd", "v.buffer"),
-              ("Lidar analysis", (
-                ("Detect edges", "Detect object edges in Lidar data", "self.OnMenuCmd", "v.lidar.edgedetection"),
-                ("Detect interiors", "Detect interiors of objects in Lidar data", "self.OnMenuCmd", "v.lidar.growing"),
-                ("Correct and reclassify objects", "Correct and reclassify objects detected in Lidar data", "self.OnMenuCmd", "v.lidar.correction"),
-                )),
-              ("Linear referencing", (
-                ("Create LRS", "Create linear reference system", "self.OnMenuCmd", "v.lrs.create"),
-                ("Create stationing", "Create stationing from input lines, and linear reference system", "self.OnMenuCmd", "v.lrs.label"),
-                ("Create points/segments", "Create points/segments from input lines, linear reference system and positions read from stdin", "self.OnMenuCmd", "v.lrs.segment"),
-                ("Find line id and offset", "Find line id and real km+offset for given points in vector map using linear reference system", "self.OnMenuCmd", "v.lrs.where"),
-                )),
-              ("Nearest features", "Locate nearest feature to points or centroids", "self.OnMenuCmd", "v.distance"),
-              ("Network analysis", (
-                ("Allocate subnets", "Allocate subnets for nearest centers", "self.OnMenuCmd", "v.net.alloc"),
-                ("Network maintenance", "Network maintenance", "self.OnMenuCmd", "v.net"),
-                ("Visibility network", "Create and maintain a visibility network", "self.OnMenuCmd", "v.net.visibility"),
-                ("Shortest route", "Calculate shortest route along network between 2 nodes", "self.OnMenuCmd", "v.net.path"),
-                ("Display shortest route (requires XTerm)", " Display shortest route along network between 2 nodes (visualization only)", "self.OnXTerm", "d.path"),
-                ("Split net", "Split net into bands between cost isolines", "self.OnMenuCmd", "v.net.iso"),
-                ("Steiner tree", "Create Steiner tree for network and given terminals", "self.OnMenuCmd", "v.net.steiner"),
-                ("Traveling salesman analysis", "Calculate shortest route connecting given set of nodes (Traveling salesman analysis)", "self.OnMenuCmd", "v.net.salesman"),
-                )),
-              ("Overlay vector maps", (
-                ("Overlay vector maps", "Boolean overlay of 2 vector maps", "self.OnMenuCmd", "v.overlay"),
-                ("Patch vector maps", "Patch/combine multiple maps (Boolean OR)", "self.OnMenuCmd", "v.patch"),
-                )),
-              ("","","", ""),
-              ("Change attributes", (
-                ("Manage or report categories", "Attach/delete, or report categories", "self.OnMenuCmd", "v.category"),
-                ("Reclassify objects interactively", "Reclassify vector objects interactively by entering SQL rules", "self.RulesCmd", "v.reclass"),
-                ("Reclassify objects using rules file", "Reclassify vector objects by inputting SQL rules from a text file", "self.OnMenuCmd", "v.reclass"),
-                )),
-              ("","","", ""),
-              ("Generate area for current region", "Generate area object for extent of current region", "self.OnMenuCmd", "v.in.region"),
-              ("Generate areas from points", (
-                  ("Convex hull", "Generate convex hull for point set", "self.OnMenuCmd", "v.hull"),
-                  ("Delaunay triangles", "Generate Delaunay triangles for point set", "self.OnMenuCmd", "v.delaunay"),
-                  ("Voronoi diagram/Thiessen polygons", "Generate Voronoi diagram/Thiessen polygons for point set", "self.OnMenuCmd", "v.voronoi"),
-                  )),
-              ("Generate grid", "Generate rectangular vector grid", "self.OnMenuCmd", "v.mkgrid"),
-              ("Generate points", (
-                  ("Generate from database", "Generate points from database with x/y coordinates", "self.OnMenuCmd", "v.in.db"),
-                  ("Generate points along lines", "Generate points along vector lines/boundaries", "self.OnMenuCmd", "v.to.points"),
-                  ("Generate random points", "Generate random points", "self.OnMenuCmd", "v.random"),
-                  ("Perturb points", "Random perturbations of point locations", "self.OnMenuCmd", "v.perturb"),
-                  )),
-              ("","","", ""),
-              ("Remove outliers in point sets", "Remove outliers from vector point set", "self.OnMenuCmd", "v.outlier"),
-              ("Test/training point sets", "Partition points into test/training sets for k-fold cross validation", "self.OnMenuCmd", "v.kcv"),
-              ("","","", ""),
-              ("Update area attributes from raster", "Update area attribute data from univariate statistics on raster map", "self.OnMenuCmd", "v.rast.stats"),
-              ("Update point attributes from areas", "Update point attribute data from vector area map", "self.OnMenuCmd", "v.what.vect"),
-              ("Update point attributes from raster", (
-                  ("Sample raster maps at point locations", "Sample raster maps at point locations", "self.OnMenuCmd", "v.what.rast"),
-                  ("Sample raster neighborhood around points", "Sample raster neighborhood around points", "self.OnMenuCmd", "v.sample"),
-                  )),
-              ("","","", ""),
-              ("Reports and statistics", (
-                ("Basic vector information", "Basic vector information", "self.OnMenuCmd", "v.info"),
-                ("","","", ""),
-                ("Report topology by category", "Report areas for vector attribute categories", "self.OnMenuCmd", "v.report"),
-                ("Upload or report topology", "Update database fields or create reports from vector topology", "self.OnMenuCmd", "v.to.db"),
-                ("","","", ""),
-                ("Univariate attribute statistics", "Calculate univariate statistics for vector attributes", "self.OnMenuCmd", "v.univar"),
-                ("","","", ""),
-                ("Quadrat indices", "Indices of point counts in quadrats", "self.OnMenuCmd", "v.qcount"),
-                ("Test normality", "Test normality of point distribution", "self.OnMenuCmd", "v.normal"),
-                )),
-              )),
-          ("Imagery", (
-              ("Develop images and groups", (
-                ("Create/edit group", "Create/edit imagery group", "self.OnMenuCmd", "i.group"),
-                ("Target group", "Target imagery group", "self.OnMenuCmd", "i.target"),
-                ("","","", ""),
-                ("Mosaic images", "Mosaic up to 4 adjacent images", "self.OnMenuCmd", "i.image.mosaic"),
-                )),
-              ("Manage image colors", (
-                ("Color balance for RGB", "Color balance and enhance color tables of multiband imagery for rgb display", "self.OnMenuCmd", "i.landsat.rgb"),
-                ("HIS to RGB", "Transform HIS (Hue/Intensity/Saturation) color image to RGB (Red/Green/Blue)", "self.OnMenuCmd", "i.his.rgb"),
-                ("RGB to HIS", "Transform RGB (Red/Green/Blue) color image to HIS (Hue/Intensity/Saturation)", "self.OnMenuCmd", "i.rgb.his"),
-                )),
-              ("Rectify image or raster", "Rectifies raster using information in previously created POINTS file", "self.OnMenuCmd", "i.rectify"),
-              ("Ortho photo rectification (requires Xterm)", "Ortho Photo rectification", "self.OnXTerm", "i.ortho.photo"),
-              ("","","", ""),
-              ("Brovey sharpening", "Brovey transformation and pan sharpening", "self.OnMenuCmd", "i.fusion.brovey"),
-              ("Classify image", (
-                ("Clustering input for unsupervised classification", "Clustering input for unsupervised classification", "self.OnMenuCmd", "i.cluster"),
-                ("","","", ""),
-                ("Maximum likelihood classification (MLC)", "Maximum likelihood Classification", "self.OnMenuCmd", "i.maxlik"),
-                ("Sequential maximum a posteriori classification (SMAP)", "Sequential maximum a posteriori classification (SMAP)", "self.OnMenuCmd", "i.smap"),
-                ("","","", ""),
-                ("Interactive input for supervised classification (requires Xterm)", "Interactive input for supervised classification", "self.OnXTerm", "i.class"),
-                ("Input for supervised MLC", "Non-interactive input for supervised classification (MLC)", "self.OnMenuCmd", "i.gensig"),
-                ("Input for supervised SMAP", "Non-interactive input for supervised classification (SMAP)", "self.OnMenuCmd", "i.gensigset"),
-                )),
-              ("Filter image", (
-                ("Edge detection", "Zero edge crossing detection", "self.OnMenuCmd", "i.zc"),
-                ("Matrix/convolving filter", "User defined matrix/convolving filter", "self.OnMenuCmd", "r.mfilter"),
-                )),
-              ("Histogram image", "Histogram image", "self.DispHistogram", ""),
-              ("Spectral response", "Spectral response", "self.OnMenuCmd", "i.spectral"),
-              ("Tasseled cap vegetation index", "Tasseled cap vegetation index", "self.OnMenuCmd", "i.tasscap"),
-              ("Transform image", (
-                ("Canonical correlation", "Canonical correlation (discriminant analysis)", "self.OnMenuCmd", "i.cca"),
-                ("Principal components", "Principal components analysis", "self.OnMenuCmd", "i.pca"),
-                ("Fast Fourier", "Fast Fourier Transform", "self.OnMenuCmd", "i.fft"),
-                ("Inverse Fast Fourier", "Inverse Fast Fourier Transform", "self.OnMenuCmd", "i.ifft"),
-                )),
-              ("","","", ""),
-              ("Report and statistics", (
-                ("Bit pattern comparison ", "Bit pattern comparison for ID of low quality pixels", "self.OnMenuCmd", "r.bitpattern"),
-                ("Kappa analysis", "Kappa classification accuracy assessment", "self.OnMenuCmd", "r.kappa"),
-                ("OIF for LandSat TM", "Optimum index factor for LandSat TM", "self.OnMenuCmd", "i.oif"),
-                )),
-              )),
-          ("Volumes", (
-              ("Develop grid3D volumes", (
-                ("Manage 3d NULL values", "Manage NULL values for grid3D volume", "self.OnMenuCmd", "r3.null"),
-                ("Manage timestamp", "Manage timestamp for grid3D volume", "self.OnMenuCmd", "r3.timestamp"),
-                )),
-              ("","","", ""),
-              ("3D MASK", "Create 3D mask for grid3D operations", "self.OnMenuCmd", "r3.mask"),
-              ("3D map calculator", "Map calculator for volumetric map algebra", "self.Disp3DMapCalculator", ""),
-              ("Cross section", "Create 2D raster cross section from grid3d volume", "self.OnMenuCmd", "r3.cross.rast"),
-              ("Interpolate volume from points", "Interpolate volume from vector points using splines", "self.OnMenuCmd", "v.vol.rst"),
-              ("","","", ""),
-              ("Report and Statistics", (
-                ("Basic volume information", "Report basic information about grid3D volume", "self.OnMenuCmd", "r3.info"),
-                )),
-              )),
-          ("Database", (
-              ("Database information", (
-                ("Describe table", "Describe table structure and attributes", "self.OnMenuCmd", "db.describe"),
-                ("List columns", "List columns for selected table", "self.OnMenuCmd", "db.columns"),
-                ("List drivers", "List available database drivers", "self.OnMenuCmd", "db.drivers"),
-                ("List tables", "List tables in database", "self.OnMenuCmd", "db.tables"),
-                )),
-              ("","","", ""),
-              ("Manage databases", (
-                ("Connect", "Connect to database", "self.OnMenuCmd", "db.connect"),
-                ("Login", "Login to database", "self.OnMenuCmd", "db.login"),
-                ("","","", ""),
-                ("Copy table", "Copy attribute table", "self.OnMenuCmd", "db.copy"),
-                ("New table", "Create and connect new attribute table to vector map", "self.OnMenuCmd", "v.db.addtable"),
-                ("Remove table", "Remove existing attribute table for vector map", "self.OnMenuCmd", "db.login"),
-                ("","","", ""),
-                ("Add columns", "Add columns to table", "self.OnMenuCmd", "v.db.addcol"),
-                ("Change values", "Change values in a column", "self.OnMenuCmd", "v.db.update"),
-                ("Rename column", "Rename a column", "self.OnMenuCmd", "v.db.renamecol"),
-                ("","","", ""),
-                ("Test", "Test database", "self.OnMenuCmd", "db.test"),
-                )),
-              ("Query", (
-                ("Query any table", "Query data in any table", "self.OnMenuCmd", "db.select"),
-                ("Query vector attribute table", "Query vector attribute data", "self.OnMenuCmd", "v.db.select"),
-                ("SQL statement", "Execute SQL statement", "self.OnMenuCmd", "db.execute"),
-                )),
-              ("","","", ""),
-              ("Vector<->database connections", (
-                ("Reconnect vector to database", "Reconnect vector map to attribute database", "self.OnMenuCmd", "v.db.reconnect.all"),
-                ("Set vector - database connection", "Set database connection for vector attributes", "self.OnMenuCmd", "v.db.connect"),
-                )),
-              )),
-          ("Help", (
-              ("GRASS GIS help", "GRASS GIS Reference Manual", "self.RunMenuCmd", "g.manual -i"),
-              ("GRASS GIS GUI help", "GUI-related Reference Manual", "self.RunMenuCmd", "g.manual wxGUI"),
-              ("About GRASS GIS", "About GRASS GIS", "self.OnAboutGRASS", ""),
-              )))]
+                (_("File"), (
+                        (_("Workspace"), (
+                                (_("New workspace"),
+                                 _("Create new workspace file (erase current workspace settings first)"),
+                                 "self.OnWorkspaceNew",
+                                 ""),
+                                (_("Open existing workspace"),
+                                 _("Open existing workspace file"),
+                                 "self.OnWorkspaceOpen",
+                                 ""),
+                                (_("Load map layers"),
+                                 _("Load map layers into layer tree"),
+                                 "self.OnWorkspaceLoad",
+                                 ""),
+                                (_("Save workspace"),
+                                 _("Save current workspace to file"),
+                                 "self.OnWorkspaceSave",
+                                 ""),
+                                (_("Save workspace as"),
+                                 _("Save current workspace as file"),
+                                 "self.OnWorkspaceSaveAs",
+                                 ""),
+                                (_("Close current workspace"),
+                                 _("Close current workspace file"),
+                                 "self.OnWorkspaceClose",
+                                 ""),
+                                )
+                         ),
+                        ("","","", ""),
+                        (_("Import raster map"), (
+                                (_("Multiple import formats using GDAL"),
+                                 _("Import file in format supported by GDAL"),
+                                 "self.OnMenuCmd",
+                                 "r.in.gdal"),
+                                ("","","", ""),
+                                (_("Aggregate ASCII xyz import"),
+                                 _("Import aggregated ASCII xyz data"),
+                                 "self.OnMenuCmd",
+                                 "r.in.xyz"),
+                                (_("ASCII grid import"),
+                                 _("Import ASCII GRID (includes GRASS ASCII)"),
+                                 "self.OnMenuCmd",
+                                 "r.in.ascii"),
+                                (_("ASCII polygons and lines import"),
+                                 _("Import polygons and lines from ASCII file"),
+                                 "self.OnMenuCmd",
+                                 "r.in.poly"),
+                                ("","","", ""),
+                                (_("Binary file import"),
+                                 _("Import binary file (includes GTOPO30 format)"),
+                                 "self.OnMenuCmd",
+                                 "r.in.bin"),
+                                (_("ESRI ASCII grid import"),
+                                 _("Import ESRI Arc/Info ASCII grid"),
+                                 "self.OnMenuCmd",
+                                 "r.in.arc"),
+                                (_("GRIDATB.FOR import"),
+                                 _("Import GRIDATB.FOR map file (TOPMODEL)"),
+                                 "self.OnMenuCmd",
+                                 "r.in.gridatb"),
+                                (_("MAT-File (v.4) import"),
+                                 _("Import MAT-File (v.4) array (Matlab or Octave)"),
+                                 "self.OnMenuCmd",
+                                 "r.in.mat"),
+                                (_("SPOT NDVI import"),
+                                 _("Import SPOT vegetation NDVI data sets"),
+                                 "self.OnMenuCmd",
+                                 "r.in.spotvgt"),
+                                (_("SRTM HGT import"),
+                                 _("Import SRTM HGT files"),
+                                 "self.OnMenuCmd", "r.in.srtm"),
+                                (_("Terra ASTER HDF import"),
+                                 _("Import Terra ASTER HDF files"),
+                                 "self.OnMenuCmd",
+                                 "r.in.aster"),
+                                ("","","", ""),
+                                (_("WMS import"),
+                                 _("Import Web Mapping Server layer"),
+                                 "self.OnMenuCmd",
+                                 "r.in.wms"),
+                                )
+                         ),
+                        (_("Import vector map"), (
+                                (_("Multiple import formats using OGR"),
+                                 _("Import file in format supported by OGR (e.g. Shapefile)"),
+                                 "self.OnMenuCmd",
+                                 "v.in.ogr"),
+                                ("","","", ""),
+                                (_("ASCII points/GRASS ASCII vector import"),
+                                 _("Import ASCII points file or GRASS ASCII vector file"),
+                                 "self.OnMenuCmd",
+                                 "v.in.ascii"),
+                                (_("Old GRASS vector import"),
+                                 _("Import file in old GRASS vector format"),
+                                 "self.OnMenuCmd",
+                                 "v.convert"),
+                                ("","","", ""),
+                                (_("DXF import"),
+                                 _("Import DXF file"),
+                                 "self.OnMenuCmd",
+                                 "v.in.dxf"),
+                                (_("ESRI e00 import"),
+                                 _("Import ESRI e00 file"),
+                                 "self.OnMenuCmd",
+                                 "v.in.e00"),
+                                (_("Garmin GPS import"),
+                                 _("Import Garmin GPS Waypoints/Routes/Tracks"),
+                                 "self.OnMenuCmd",
+                                 "v.in.garmin"),
+                                (_("GPSBabel GPS import"),
+                                 _("Import GPS Waypoints/Routes/Tracks using GPSBabel"),
+                                 "self.OnMenuCmd",
+                                 "v.in.gpsbabel"),
+                                (_("GEOnet import"),
+                                 _("Import GEOnet Name server country files (US-NGA GNS)"),
+                                 "self.OnMenuCmd",
+                                 "v.in.gns"),
+                                (_("Matlab and MapGen import"),
+                                 _("Import Matlab and MapGen files"),
+                                 "self.OnMenuCmd",
+                                 "v.in.mapgen"),
+                                )
+                         ),
+                        (_("Import grid 3D volume"), (
+                                (_("ASCII 3D import"),
+                                 _("Import ASCII Raster 3D file"),
+                                 "self.OnMenuCmd",
+                                 "r3.in.ascii"),
+                                (_("Vis5D import"),
+                                 _("Import Vis5D file"),
+                                 "self.OnMenuCmd",
+                                 "r3.in.v5d"),
+                                )
+                         ),
+                        (_("Import database table"), (
+                                (_("Multiple import formats using OGR"),
+                                 _("Import database file in format supported by OGR"),
+                                 "self.OnMenuCmd",
+                                 "db.in.ogr"),
+                                )
+                         ),
+                        ("","","", ""),
+                        (_("Export raster map"), (
+                                (_("Multiple export formats using GDAL"),
+                                 _("Export raster map to format supported by GDAL"),
+                                 "self.OnMenuCmd",
+                                 "r.out.gdal"),
+                                ("","","", ""),
+                                (_("ASCII grid export"),
+                                 _("Export ASCII grid (for GRASS, Surfer, Modflow, etc.)"),
+                                 "self.OnMenuCmd",
+                                 "r.out.ascii"),
+                                (_("ASCII x,y,z export"),
+                                 _("Export ASCII x,y,z values of cell centers"),
+                                 "self.OnMenuCmd",
+                                 "r.out.xyz"),
+                                ("","","", ""),
+                                (_("ESRI ASCII grid export"),
+                                 _("Export ESRI Arc/Info ASCII grid"),
+                                 "self.OnMenuCmd",
+                                 "r.out.arc"),
+                                (_("GRIDATB.FOR export"),
+                                 _("Export GRIDATB.FOR map file (TOPMODEL)"),
+                                 "self.OnMenuCmd",
+                                 "r.out.gridatb"),
+                                (_("MAT-File (v.4) export"),
+                                 _("Export MAT-File (v.4) array (Matlab or Octave)"),
+                                 "self.OnMenuCmd",
+                                 "r.out.mat"),
+                                ("","","", ""),
+                                (_("Binary export"),
+                                 _("Export binary file"),
+                                 "self.OnMenuCmd",
+                                 "r.out.bin"),
+                                ("","","", ""),
+                                (_("MPEG-1 export"),
+                                 _("Export MPEG-1 animations"),
+                                 "self.OnMenuCmd",
+                                 "r.out.mpeg"),
+                                (_("PNG export"),
+                                 _("Export PNG image (not georeferenced)"),
+                                 "self.OnMenuCmd",
+                                 "r.out.png"),
+                                (_("PPM export"),
+                                 _("Export PPM image (24bit)"),
+                                 "self.OnMenuCmd",
+                                 "r.out.ppm"),
+                                (_("PPM from RGB export"),
+                                 _("Export PPM image from red, green, blue raster maps"),
+                                 "self.OnMenuCmd",
+                                 "r.out.ppm3"),
+                                (_("POV-Ray export"),
+                                 _("Export POVray height-field"),
+                                 "self.OnMenuCmd",
+                                 "r.out.pov"),
+                                (_("TIFF export"),
+                                 _("Export TIFF image (8/24bit)"),
+                                 "self.OnMenuCmd",
+                                 "r.out.tiff"),
+                                (_("VRML export"),
+                                 _("Export VRML file"),
+                                 "self.OnMenuCmd",
+                                 "r.out.vrml"),
+                                (_("VTK export"),
+                                 _("Export VTK ASCII file"),
+                                 "self.OnMenuCmd",
+                                 "r.out.vtk"),
+                                )
+                         ),
+                        (_("Export vector map"), (
+                                (_("Multiple export formats using OGR"),
+                                 _("Export vector map to format supported by OGR (e.g. Shapefile)"),
+                                 "self.OnMenuCmd",
+                                 "v.out.ogr"),
+                                ("","","", ""),
+                                (_("ASCII points/GRASS ASCII vector export"),
+                                 _("Export vector map into ASCII points file or GRASS ASCII vector file"),
+                                 "self.OnMenuCmd",
+                                 "v.out.ascii"),
+                                (_("DXF export"),
+                                 _("Export vector map into DXF file"),
+                                 "self.OnMenuCmd",
+                                 "v.out.dxf"),
+                                (_("POV-Ray export"),
+                                 _("Export vector map into POV-Ray format file"),
+                                 "self.OnMenuCmd",
+                                 "v.out.pov"),
+                                (_("SVG export"),
+                                 _("Export vector map into SVG file"),
+                                 "self.OnMenuCmd",
+                                 "v.out.svg"),
+                                (_("VTK export"),
+                                 _("Export vector map into VTK ASCII file"),
+                                 "self.OnMenuCmd",
+                                 "v.out.vtk"),
+                                )
+                         ),
+                        (_("Export grid 3D volume"), (
+                                (_("ASCII 3D export"),
+                                 _("Export ASCII 3D file"),
+                                 "self.OnMenuCmd",
+                                 "r3.out.ascii"),
+                                (_("Vis5D export"),
+                                 _("Export Vis5D file"),
+                                 "self.OnMenuCmd",
+                                 "r3.out.v5d"),
+                                (_("VTK export"),
+                                 _("Export VTK ASCII file"),
+                                 "self.OnMenuCmd",
+                                 "r3.out.vtk"),
+                                )
+                         ),
+                        ("","","", ""),
+                        (_("Manage maps and volumes"), (
+                                (_("Copy"),
+                                 _("Copy maps (GIS elements) within mapsets or between mapsets"),
+                                 "self.OnMenuCmd",
+                                 "g.copy"),
+                                ("","","", ""),
+                                (_("List"),
+                                 _("List by type"),
+                                 "self.OnMenuCmd",
+                                 "g.list"),
+                                (_("List filtered"),
+                                 _("List maps (GIS elements) filtered by expressions and wildcards"),
+                                 "self.OnMenuCmd",
+                                 "g.mlist"),
+                                ("","","", ""),
+                                (_("Rename"),
+                                 _("Rename maps (GIS elements)"),
+                                 "self.OnMenuCmd",
+                                 "g.rename"),
+                                ("","","", ""),
+                                (_("Delete"),
+                                 _("Delete maps (GIS elements)"),
+                                 "self.OnMenuCmd",
+                                 "g.remove"),
+                                (_("Delete filtered"),
+                                 _("Delete maps (GIS elements) using expressions and wildcards"),
+                                 "self.OnMenuCmd",
+                                 "g.mremove"),
+                                )
+                         ),
+                        (_("Map type conversions"), (
+                                (_("Raster to vector"),
+                                 _("Convert raster to vector map"),
+                                 "self.OnMenuCmd",
+                                 "r.to.vect"),
+                                (_("Raster series to volume"),
+                                 _("Convert raster map series to volume"),
+                                 "self.OnMenuCmd",
+                                 "r.to.rast3"),
+                                (_("Raster 2.5D to volume"),
+                                 _("Convert raster 2.5D map to volume"),
+                                 "self.OnMenuCmd",
+                                 "r.to.rast3elev"),
+                                ("","","", ""),
+                                (_("Vector to raster"),
+                                 _("Convert vector to raster map"),
+                                 "self.OnMenuCmd",
+                                 "v.to.rast"),
+                                (_("Vector to volume"),
+                                 _("Convert vector 3D points to volume voxels"),
+                                 "self.OnMenuCmd",
+                                 "v.to.rast3"),
+                                (_("Sites to vector"),
+                                 _("Convert sites (GRASS 5) to vector map"),
+                                 "self.OnMenuCmd",
+                                 "v.in.sites"),
+                                ("","","", ""),
+                                (_("Volume to raster series"),
+                                 _("Convert 3D raster to raster series map"),
+                                 "self.OnMenuCmd",
+                                 "r3.to.rast"),
+                                )
+                         ),
+                        ("","","", ""),
+                        (_("Georectify"),
+                         _("Georectify raster and vector maps"),
+                         "self.OnGeorectify",
+                         ""),
+                        ("","","", ""),
+                        (_("NVIZ (requires Tcl/Tk)"),
+                         _("N-Dimensional visualization of 2D and 3D raster/vector maps"),
+                         "self.OnMenuCmd",
+                         "nviz"),
+                        ("","","", ""),
+                        (_("Bearing/distance to coordinates"),
+                         _("Convert between bearing/distance and coordinates"),
+                         "self.OnMenuCmd",
+                         "m.cogo"),
+                        ("","","", ""),
+                        (_("Postscript plot"),
+                         _("Create cartographic PostScript plot"),
+                         "self.OnMenuCmd",
+                         "ps.map"),
+                        ("","","", ""),
+                        (_("E&xit"),
+                         _("Exit GUI"),
+                         "self.OnCloseWindow",
+                         ""),
+                        )
+                 ),
+                (_("Config"), (
+                        (_("Region"), (
+                                (_("Display region"),
+                                 _("Display region settings (bounding box and resolution)"),
+                                 "self.RunMenuCmd",
+                                 "g.region -p"),
+                                (_("Set region"),
+                                 _("Change region settings"),
+                                 "self.OnMenuCmd",
+                                 "g.region"),
+                                )
+                         ),
+                        (_("GRASS working environment"), (
+                                (_("Mapset access"),
+                                 _("Set/unset access to other mapsets in current location"),
+                                 "self.OnMapsets",
+                                 ""),
+                                (_("Change working environment"),
+                                 _("Change current working session to new mapset, location, or data directory"),
+                                 "self.OnMenuCmd",
+                                 "g.mapset"),
+                                (_("User access"),
+                                 _("Change access by other users to current mapset"),
+                                 "self.OnMenuCmd",
+                                 "g.access"),
+                                (_("Show settings"),
+                                 _("Show current GRASS environment settings"),
+                                 "self.RunMenuCmd",
+                                 "g.gisenv --v"),
+                                (_("Change settings"),
+                                 _("Change GRASS environment settings"),
+                                 "self.OnMenuCmd",
+                                 "g.gisenv"),
+                                (_("Version"),
+                                 _("Show current GRASS version"),
+                                 "self.RunMenuCmd",
+                                 "g.version -c"),
+                                )
+                         ),
+                        (_("Manage projections"), (
+                                (_("Manage projections"),
+                                 _("Show projection information and create projection files"),
+                                 "self.OnMenuCmd",
+                                 "g.proj"),
+                                (_("Projection for current location"),
+                                 _("Create/edit projection information for current location"),
+                                 "self.OnXTerm",
+                                 "g.setproj"),
+                                ("","","", ""),
+                                (_("Convert coordinates"),
+                                 _("Convert coordinates from one projection to another"),
+                                 "self.OnMenuCmd",
+                                 "m.proj"),
+                                )
+                         ),
+                        (_("Preferences"),
+                         _("User GUI preferences (display font, commands, digitizer, etc.)"),
+                         "self.OnPreferences",
+                         ""),
+                        )
+                 ),
+                (_("Raster"), (
+                        (_("Develop raster map"), (
+                                (_("Digitize raster (requires XTerm)"),
+                                 _("Digitize raster map"),
+                                 "self.OnXTerm",
+                                 "r.digit"),
+                                ("","","", ""),
+                                (_("Compress/decompress"),
+                                 _("Compress/decompress raster file"),
+                                 "self.OnMenuCmd",
+                                 "r.compress"),
+                                ("","","", ""),
+                                (_("Region boundaries"),
+                                 _("Manage region boundary definition"),
+                                 "self.OnMenuCmd",
+                                 "r.region"),
+                                (_("Manage NULL values"),
+                                 _("Manage NULL values"),
+                                 "self.OnMenuCmd",
+                                 "r.null"),
+                                (_("Quantization"),
+                                 _("Quantization for floating-point maps"),
+                                 "self.OnMenuCmd",
+                                 "r.quant"),
+                                (_("Timestamp"),
+                                 _("Manage timestamp for files"),
+                                 "self.OnMenuCmd",
+                                 "r.timestamp"),
+                                ("","","", ""),
+                                (_("Resample using aggregate statistics"),
+                                 _("Resample raster map (change resolution) using aggregate statistics"),
+                                 "self.OnMenuCmd",
+                                 "r.resamp.stats"),
+                                (_("Resample using multiple methods"),
+                                 _("Resample raster map (change resolution) using nearest neighbor, bilinear, or bicubic interpolation"),
+                                 "self.OnMenuCmd",
+                                 "r.resamp.interp"),
+                                (_("Resample using nearest neighbor"),
+                                 _("Resample raster map (change resolution) using nearest neighbor interpolation"),
+                                 "self.OnMenuCmd",
+                                 "r.resample"),
+                                (_("Resample using spline tension"),
+                                 _("Resample raster map (change resolution) using regularized spline tension"),
+                                 "self.OnMenuCmd",
+                                 "r.resamp.rst"),
+                                ("","","", ""),
+                                (_("Support file maintenance"),
+                                 _("Support raster map file creation and maintenance"),
+                                 "self.OnMenuCmd",
+                                 "r.support"),
+                                (_("Update map statistics"),
+                                 _("Update raster map statistics"),
+                                 "self.OnMenuCmd",
+                                 "r.support.stats"),
+                                ("","","", ""),
+                                (_("Reproject raster"),
+                                 _("Reproject raster map from other location"),
+                                 "self.OnMenuCmd",
+                                 "r.proj"),
+                                (_("Tiling"),
+                                 _("Generate tiling for other projection"),
+                                 "self.OnMenuCmd",
+                                 "r.tileset"),
+                                )),
+                        (_("Manage colors"), (
+                                (_("Color tables"),
+                                 _("Set colors to predefined color tables"),
+                                 "self.OnMenuCmd",
+                                 "r.colors"),
+                                (_("Color rules"),
+                                 _("Set colors interactively by entering color rules"),
+                                 "self.RulesCmd",
+                                 "r.colors"),
+                                ("","","", ""),
+                                (_("Blend 2 color rasters"),
+                                 _("Blend 2 color raster maps to produce 3 RGB files"),
+                                 "self.OnMenuCmd",
+                                 "r.blend"),
+                                (_("Create RGB"),
+                                 _("Create color image from RGB raster maps"),
+                                 "self.OnMenuCmd",
+                                 "r.composite"),
+                                (_("RGB to HIS"),
+                                 _("Create 3 RGB (red, green, blue) maps from 3 HIS (hue, intensity, saturation) maps"),
+                                 "self.OnMenuCmd",
+                                 "r.his"),
+                                )),
+                        (_("Query by coordinates"),
+                         _("Query raster map by coordinates"),
+                         "self.OnMenuCmd",
+                         "r.what"),
+                        ("","","", ""),
+                        (_("Buffer rasters"),
+                         _("Create raster buffers around raster objects"),
+                         "self.OnMenuCmd",
+                         "r.buffer"),
+                        (_("Closest points"),
+                         _("r.distance"),
+                         "self.OnMenuCmd",
+                         "r.distance"),
+                        (_("Mask"),
+                         _("Develop raster mask"),
+                         "self.OnMenuCmd",
+                         "r.mask"),
+                        (_("Map calculator"),
+                         _("Map calculator for raster map algebra"),
+                         "self.DispMapCalculator",
+                         ""),
+                        (_("Neighborhood analysis"), (
+                                (_("Moving window"),
+                                 _("Moving window analysis of raster cells"),
+                                 "self.OnMenuCmd",
+                                 "r.neighbors"),
+                                (_("Neighborhood points"),
+                                 _("Analyze vector points in neighborhood of raster cells"),
+                                 "self.OnMenuCmd",
+                                 "v.neighbors"),
+                                )
+                         ),
+                        (_("Overlay rasters"), (
+                                (_("Cross product"),
+                                 _("Create raster cross product"),
+                                 "self.OnMenuCmd",
+                                 "r.cross"),
+                                (_("Raster series"),
+                                 _("Function of raster map series (time series)"),
+                                 "self.OnMenuCmd",
+                                 "r.series"),
+                                (_("Patch raster maps"),
+                                 _("Patch several raster maps"),
+                                 "self.OnMenuCmd",
+                                 "r.patch"),
+                                ("","","", ""),
+                                (_("Statistical overlay"),
+                                 _("Statistical calculations for cover raster map over base raster map"),
+                                 "self.OnMenuCmd",
+                                 "r.statistics"),
+                                )
+                         ),
+                        (_("Solar radiance and shadows"), (
+                                (_("Solar irradiance and irradiation"),
+                                 _("Solar irradiance and daily irradiation"),
+                                 "self.OnMenuCmd",
+                                 "r.sun"),
+                                (_("Shadows map"),
+                                 _("Shadows raster map for sun position or date/time"),
+                                 "self.OnMenuCmd",
+                                 "r.sunmask"),
+                                )
+                         ),
+                        (_("Terrain analysis"), (
+                                (_("Cumulative movement costs"),
+                                 _("Calculate cumulative movement costs between locales"),
+                                 "self.OnMenuCmd",
+                                 "r.walk"),
+                                (_("Cost surface"),
+                                 _("Create raster map of cost surface"),
+                                 "self.OnMenuCmd",
+                                 "r.cost"),
+                                (_("Least cost route or flow"),
+                                 _("Create raster map of least cost route or flow"),
+                                 "self.OnMenuCmd",
+                                 "r.drain"),
+                                ("","","", ""),
+                                (_("Shaded relief"),
+                                 _("Shaded relief raster map"),
+                                 "self.OnMenuCmd",
+                                 "r.shaded.relief"),
+                                ("","","", ""),
+                                (_("Slope and aspect"),
+                                 _("Create raster map of slope and aspect"),
+                                 "self.OnMenuCmd",
+                                 "r.slope.aspect"),
+                                (_("Terrain parameters"),
+                                 _("Calculate terrain parameters"),
+                                 "self.OnMenuCmd",
+                                 "r.param.scale"),
+                                (_("Textural features"),
+                                 _("Textural features analysis"),
+                                 "self.OnMenuCmd",
+                                 "r.texture"),
+                                ("","","", ""),
+                                (_("Visibility"),
+                                 _("Visibility and line of sight"),
+                                 "self.OnMenuCmd",
+                                 "r.los"),
+                                )
+                         ),
+                        (_("Transform features"), (
+                                (_("Clump"),
+                                 _("Clump small areas (statistics calculated by r.volume)"),
+                                 "self.OnMenuCmd",
+                                 "r.clump"),
+                                (_("Grow"),
+                                 _("Grow raster areas"),
+                                 "self.OnMenuCmd",
+                                 "r.grow"),
+                                (_("Thin"),
+                                 _("Thin linear features"),
+                                 "self.OnMenuCmd",
+                                 "r.thin"),
+                                )
+                         ),
+                        ("","","", ""),
+                        (_("Hydrologic modeling"), (
+                                (_("Carve stream channels"),
+                                 _("Carve stream channels into elevation map using vector streams map"),
+                                 "self.OnMenuCmd",
+                                 "r.carve"),
+                                (_("Fill lake"),
+                                 _("Fill lake from seed point to specified level"),
+                                 "self.OnMenuCmd",
+                                 "r.lake"),
+                                ("","","", ""),
+                                (_("Depressionless map and flowlines"),
+                                 _("Depressionless elevation map and flowline map"),
+                                 "self.OnMenuCmd",
+                                 "r.fill.dir"),
+                                (_("Flow accumulation"),
+                                 _("Flow accumulation for massive grids"),
+                                 "self.OnMenuCmd",
+                                 "r.terraflow"),
+                                (_("Flow lines"),
+                                 _("Generate flow lines for raster map"),
+                                 "self.OnMenuCmd",
+                                 "r.flow"),
+                                ("","","", ""),
+                                (_("SIMWE Overland flow modeling"),
+                                 _("SIMWE overland flow modeling analysis"),
+                                 "self.OnMenuCmd",
+                                 "r.sim.water"),
+                                (_("SIMWE Sediment flux modeling"),
+                                 _("SIMWE sediment erosion, transport, deposition modeling"),
+                                 "self.OnMenuCmd",
+                                 "r.sim.sediment"),
+                                ("","","", ""),
+                                (_("Topographic index map"),
+                                 _("Create topographic index raster map"),
+                                 "self.OnMenuCmd",
+                                 "r.topidx"),
+                                (_("TOPMODEL simulation"),
+                                 _("TOPMODEL simulation analysis"),
+                                 "self.OnMenuCmd",
+                                 "r.topmodel"),
+                                ("","","", ""),
+                                (_("Watershed subbasins"),
+                                 _("Watershed subbasins modelling"),
+                                 "self.OnMenuCmd",
+                                 "r.basins.fill"),
+                                (_("Watershed analysis"),
+                                 _("Run watershed analysis"),
+                                 "self.OnMenuCmd",
+                                 "r.watershed"),
+                                (_("Watershed basin creation"),
+                                 _("Watershed basin creation"),
+                                 "self.OnMenuCmd",
+                                 "r.water.outlet"),
+                                )
+                         ),
+                        (_("Landscape structure modeling"), (
+                                (_("Set up (requires XTerm)"),
+                                 _("Set up sampling and analysis framework"),
+                                 "self.OnXTerm",
+                                 "r.le.setup"),
+                                ("","","", ""),
+                                (_("Analyze landscape"),
+                                 _("Analyze landscape characteristics"),
+                                 "self.OnMenuCmd",
+                                 "r.le.pixel"),
+                                (_("Analyze patches"),
+                                 _("Analyze landscape patch characteristics"),
+                                 "self.OnMenuCmd",
+                                 "r.le.patch"),
+                                (_("Output"),
+                                 _("Output landscape patch information"),
+                                 "self.OnMenuCmd",
+                                 "r.le.trace"),
+                                )
+                         ),
+                        (_("Landscape patch analysis"), (
+                                (_("Set up sampling and analysis framework"),
+                                 _("Configure and create patch map for analysis"),
+                                 "self.OnMenuCmd",
+                                 "r.li.setup"),
+                                ("","","", ""),
+                                (_("Edge density"),
+                                 _("Calculate edge density index using a 4 neighbour algorithm"),
+                                 "self.OnMenuCmd",
+                                 "r.li.edgedensity"),
+                                (_("Contrast weighted edge density"),
+                                 _("Calculate contrast weighted edge density index"),
+                                 "self.OnMenuCmd",
+                                 "r.li.cwed"),
+                                ("","","", ""),
+                                (_("Patch area mean"),
+                                 _("Calculate mean patch size index using a 4 neighbour algorithm"),
+                                 "self.OnMenuCmd",
+                                 "r.li.mps"),
+                                (_("Patch area range"),
+                                 _("Calculate range of patch area size"),
+                                 "self.OnMenuCmd",
+                                 "r.li.padrange"),
+                                (_("Patch area Std Dev"),
+                                 _("Calculate standard deviation of patch area"),
+                                 "self.OnMenuCmd",
+                                 "r.li.padsd"),
+                                (_("Patch area Coeff Var"),
+                                 _("Calculate coefficient of variation of patch area"),
+                                 "self.OnMenuCmd",
+                                 "r.li.padcv"),
+                                (_("Patch density"),
+                                 _("Calculate patch density index using a 4 neighbour algorithm"),
+                                 "self.OnMenuCmd",
+                                 "r.li.patchdensity"),
+                                (_("Patch number"),
+                                 _("Calculate patch number index using a 4 neighbour algorithm"),
+                                 "self.OnMenuCmd",
+                                 "r.li.patchnum"),
+                                ("","","", ""),
+                                (_("Dominance's diversity"),
+                                 _("Calculate Dominance's diversity index"),
+                                 "self.OnMenuCmd",
+                                 "r.li.dominance"),
+                                (_("Shannon's diversity"),
+                                 _("Calculate Shannon's diversity index"),
+                                 "self.OnMenuCmd",
+                                 "r.li.shannon"),
+                                (_("Simpson's diversity"),
+                                 _("Calculate Simpson's diversity index"),
+                                 "self.OnMenuCmd",
+                                 "r.li.simpson"),
+                                ("","","", ""),
+                                (_("Richness"),
+                                 _("Calculate richness index"),
+                                 "self.OnMenuCmd",
+                                 "r.li.richness"),
+                                (_("Shape index"),
+                                 _("Calculate shape index"),
+                                 "self.OnMenuCmd",
+                                 "r.li.shape"),
+                                )
+                         ),
+                        (_("Wildfire modeling"), (
+                                (_("Rate of spread"),
+                                 _("Generate rate of spread (ROS) maps"),
+                                 "self.OnMenuCmd",
+                                 "r.ros"),
+                                (_("Least-cost spread paths"),
+                                 _("Generate least-cost spread paths"),
+                                 "self.OnMenuCmd",
+                                 "r.spreadpath"),
+                                (_("Anisotropic spread simulation"),
+                                 _("Simulate anisotropic spread phenomena"),
+                                 "self.OnMenuCmd",
+                                 "r.spread"),
+                                )
+                         ),
+                        ("","","", ""),
+                        (_("Change category values and labels"), (
+                                (_("Interactively edit category values"),
+                                 _("Edit category values of individual cells for displayed raster map"),
+                                 "self.OnMenuCmd",
+                                 "d.rast.edit"),
+                                ("","","", ""),
+                                (_("Reclassify by size"),
+                                 _("Reclassify raster categories for raster areas of specified sizes"),
+                                 "self.OnMenuCmd",
+                                 "r.reclass.area"),
+                                (_("Reclassify interactively"),
+                                 _("Reclassify raster categories interactively by entering reclass rules"),
+                                 "self.RulesCmd",
+                                 "r.reclass"),
+                                (_("Reclassify using rules file"),
+                                 _("Reclassify raster categories by inputting reclass rules from a text file"),
+                                 "self.OnMenuCmd",
+                                 "r.reclass"),
+                                ("","","", ""),
+                                (_("Recode interactively"),
+                                 _("Recode raster categories interactively by entering recode rules (create new raster map)"),
+                                 "self.RulesCmd",
+                                 "r.recode"),
+                                (_("Recode using rules file"),
+                                 _("Recode raster categories by inputting recode rules from a text file (create new map)"),
+                                 "self.OnMenuCmd",
+                                 "r.recode.file"),
+                                ("","","", ""),
+                                (_("Rescale"),
+                                 _("Rescale raster categories (create new raster map)"),
+                                 "self.OnMenuCmd",
+                                 "r.rescale"),
+                                (_("Rescale with histogram"),
+                                 _("Rescale raster categories with equalized histogram (create new raster map)"),
+                                 "self.OnMenuCmd",
+                                 "r.rescale.eq"),
+                                )
+                         ),
+                        ("","","", ""),
+                        (_("Concentric circles"),
+                         _("Generate concentric circles around points"),
+                         "self.OnMenuCmd",
+                         "r.circle"),
+                        (_("Generate random cells"), (
+                                (_("Random cells"),
+                                 _("Generate random raster cells"),
+                                 "self.OnMenuCmd",
+                                 "r.random.cells"),
+                                (_("Random cells and vector points"),
+                                 _("Generate random raster cells and vector points from raster map"),
+                                 "self.OnMenuCmd",
+                                 "r.random"),
+                                )
+                         ),
+                        (_("Generate surfaces"), (
+                                (_("Fractal surface"),
+                                 _("Generate fractal surface"),
+                                 "self.OnMenuCmd",
+                                 "r.surf.fractal"),
+                                ("","","", ""),
+                                (_("Gaussian kernel density surface"),
+                                 _("Generate density surface using moving Gaussian kernel"),
+                                 "self.OnMenuCmd",
+                                 "v.kernel"),
+                                (_("Gaussian deviates surface"),
+                                 _("Generate gaussian deviates surface"),
+                                 "self.OnMenuCmd",
+                                 "r.surf.gauss"),
+                                ("","","", ""),
+                                (_("Plane"),
+                                 _("Generate plane"),
+                                 "self.OnMenuCmd",
+                                 "r.plane"),
+                                ("","","", ""),
+                                (_("Random deviates surface"),
+                                 _("Generate random deviates surface"),
+                                 "self.OnMenuCmd",
+                                 "r.surf.random"),
+                                (_("Random surface with spatial dependence"),
+                                 _("Generate random surface with spatial dependence"),
+                                 "self.OnMenuCmd",
+                                 "r.random.surface"),
+                                )
+                         ),
+                        (_("Generate contour lines"),
+                         _("Generate vector contour lines"),
+                         "self.OnMenuCmd",
+                         "r.contour"),
+                        (_("Interpolate surfaces"), (
+                                (_("Bilinear from raster points"),
+                                 _("Bilinear interpolation from raster points"),
+                                 "self.OnMenuCmd",
+                                 "r.bilinear"),
+                                (_("Bilinear and bicubic from vector points"),
+                                 _("Bicubic and bilinear interpolation with Tykhonov regularization from vector points"),
+                                 "self.OnMenuCmd",
+                                 "v.surf.bspline"),
+                                ("","","", ""),
+                                (_("IDW from raster points"),
+                                 _("Inverse distance weighted interpolation from raster points"),
+                                 "self.OnMenuCmd",
+                                 "r.surf.idw"),
+                                (_("IDW from vector points"),
+                                 _("Inverse distance weighted interpolation from vector points"),
+                                 "self.OnMenuCmd",
+                                 "v.surf.idw"),
+                                ("","","", ""),
+                                (_("Raster contours"),
+                                 _("Interpolation from raster contour"),
+                                 "self.OnMenuCmd",
+                                 "r.surf.contour"),
+                                (_("Regularized spline tension"),
+                                 _("Regularized spline tension interpolation from vector points or contours"),
+                                 "self.OnMenuCmd",
+                                 "v.surf.rst"),
+                                ("","","", ""),
+                                (_("Fill NULL cells"),
+                                 _("Fill NULL raster cells by interpolation using regularized spline tension"),
+                                 "self.OnMenuCmd",
+                                 "r.fillnulls"),
+                                )
+                         ),
+                        ("","","", ""),
+                        (_("Report and statistics"), (
+                                (_("Basic raster metadata"),
+                                 _("Report basic raster map metadata"),
+                                 "self.OnMenuCmd",
+                                 "r.info"),
+                                (_("Manage category information"),
+                                 _("Manage raster categories labels and values"),
+                                 "self.OnMenuCmd",
+                                 "r.category"),
+                                ("","","", ""),
+                                (_("General statistics"),
+                                 _("General raster map statistics"),
+                                 "self.OnMenuCmd",
+                                 "r.stats"),
+                                (_("Range of category values"),
+                                 _("Range of all raster category values"),
+                                 "self.OnMenuCmd",
+                                 "r.describe"),
+                                (_("Sum category values"),
+                                 _("Sum all raster category values"),
+                                 "self.OnMenuCmd",
+                                 "r.sum"),
+                                (_("Sum area by raster map and category"),
+                                 _("Calculate sum of area by raster map and category"),
+                                 "self.OnMenuCmd",
+                                 "r.report"),
+                                (_("Statistics for clumped cells"),
+                                 _("Summary statistics for clumped raster map (work with r.clump)"),
+                                 "self.OnMenuCmd",
+                                 "r.volume"),
+                                (_("Total corrected area"),
+                                 _("Total surface area corrected for topography"),
+                                 "self.OnMenuCmd",
+                                 "r.surf.area"),
+                                (_("Univariate raster statistics"),
+                                 _("Calculate univariate statistics for raster categories"),
+                                 "self.OnMenuCmd",
+                                 "r.univar"),
+                                ("","","", ""),
+                                (_("Sample transects"),
+                                 _("Sample values along transects"),
+                                 "self.OnMenuCmd",
+                                 "r.profile"),
+                                (_("Sample transects (bearing/distance)"),
+                                 _("Sample values along transects (use azimuth, distance)"),
+                                 "self.OnMenuCmd",
+                                 "r.transect"),
+                                ("","","", ""),
+                                (_("Covariance/correlation"),
+                                 _("Covariance/correlation calculation"),
+                                 "self.OnMenuCmd",
+                                 "r.covar"),
+                                (_("Linear regression"),
+                                 _("Linear regression between 2 raster maps"),
+                                 "self.OnMenuCmd",
+                                 "r.regression.line"),
+                                (_("Mutual category occurrences"),
+                                 _("Mutual category occurrences (coincidence)"),
+                                 "self.OnMenuCmd",
+                                 "r.coin"),
+                                )
+                         ),
+                        )
+                 ),
+                (_("Vector"), (
+                        (_("Develop vector map"), (
+                                (_("Create new vector map"),
+                                 _("Create new empty vector map"),
+                                 "self.OnMenuCmd",
+                                 "v.edit tool=create"),
+                                #                                 (_("Digitize vector map"),
+                                #                                  _("Digitize/edit vector map"),
+                                #                                  "self.OnMenuCmd",
+                                #                                 "v.digit"),
+                                ("","","", ""),
+                                (_("Create/rebuild topology"),
+                                 _("Create or rebuild topology of vector objects"),
+                                 "self.OnMenuCmd",
+                                 "v.build"),
+                                (_("Clean vector map"),
+                                 _("Clean vector objects (topologically incorect)"),
+                                 "self.OnMenuCmd",
+                                 "v.clean"),
+                                (_("Generalization"),
+                                 _("Smooth, simplify, displace, or generalize a vector map"),
+                                 "self.OnMenuCmd",
+                                 "v.generalize"),
+                                ("","","", ""),
+                                (_("Convert object types"),
+                                 _("Convert vector objects from one feature type to another"),
+                                 "self.OnMenuCmd",
+                                 "v.type.sh"),
+                                ("","","", ""),
+                                (_("Add centroids"),
+                                 _("Add centroids to closed boundaries to create areas"),
+                                 "self.OnMenuCmd",
+                                 "v.centroids"),
+                                ("","","", ""),
+                                (_("Build polylines"),
+                                 _("Build polylines from adjacent segments"),
+                                 "self.OnMenuCmd",
+                                 "v.build.polylines"),
+                                (_("Split polylines"),
+                                 _("Split polylines into points and segments"),
+                                 "self.OnMenuCmd",
+                                 "v.segment"),
+                                (_("Parallel lines"),
+                                 _("Create lines parallel to existing lines"),
+                                 "self.OnMenuCmd",
+                                 "v.parallel"),
+                                ("","","", ""),
+                                (_("Dissolve boundaries"),
+                                 _("Dissolve common boundaries of areas"),
+                                 "self.OnMenuCmd",
+                                 "v.dissolve"),
+                                ("","","", ""),
+                                (_("Create 3D vector over raster"),
+                                 _("Create 3D objects by sampling raster map with 2D vector map"),
+                                 "self.OnMenuCmd",
+                                 "v.drape"),
+                                (_("Extrude 3D vector map"),
+                                 _("Extrude 3D objects from 2D vector map"),
+                                 "self.OnMenuCmd",
+                                 "v.extrude"),
+                                ("","","", ""),
+                                (_("Link to OGR"),
+                                 _("Create new vector map as link to external OGR layer"),
+                                 "self.OnMenuCmd",
+                                 "v.external"),
+                                ("","","", ""),
+                                (_("Create labels"),
+                                 _("Create text label file for vector features"),
+                                 "self.OnMenuCmd",
+                                 "v.label"),
+                                ("","","", ""),
+                                (_("Reposition vector map"),
+                                 _("Reposition (shift, rotate, skew) vector map in coordinate space"),
+                                 "self.OnMenuCmd",
+                                 "v.transform"),
+                                (_("Reproject vector map"),
+                                 _("Reproject vector map from other location"),
+                                 "self.OnMenuCmd",
+                                 "v.proj"),
+                                )
+                         ),
+                        ("","","", ""),
+                        (_("Query with attributes"),
+                         _("Query vector objects by attribute values (create new vector map)"),
+                         "self.OnMenuCmd",
+                         "v.extract"),
+                        (_("Query with coordinate(s)"),
+                         _("Query vector objects by coordinate(s)"),
+                         "self.OnMenuCmd",
+                         "v.what"),
+                        (_("Query with another vector map"),
+                         _("Query objects using objects from a second vector map"),
+                         "self.OnMenuCmd",
+                         "v.select"),
+                        ("","","", ""),
+                        (_("Buffer vectors"),
+                         _("Create vector buffers around vector objects"),
+                         "self.OnMenuCmd",
+                         "v.buffer"),
+                        (_("Lidar analysis"), (
+                                (_("Detect edges"),
+                                 _("Detect object edges in Lidar data"),
+                                 "self.OnMenuCmd",
+                                 "v.lidar.edgedetection"),
+                                (_("Detect interiors"),
+                                 _("Detect interiors of objects in Lidar data"),
+                                 "self.OnMenuCmd",
+                                 "v.lidar.growing"),
+                                (_("Correct and reclassify objects"),
+                                 _("Correct and reclassify objects detected in Lidar data"),
+                                 "self.OnMenuCmd",
+                                 "v.lidar.correction"),
+                                )
+                         ),
+                        (_("Linear referencing"), (
+                                (_("Create LRS"),
+                                 _("Create linear reference system"),
+                                 "self.OnMenuCmd",
+                                 "v.lrs.create"),
+                                (_("Create stationing"),
+                                 _("Create stationing from input lines, and linear reference system"),
+                                 "self.OnMenuCmd",
+                                 "v.lrs.label"),
+                                (_("Create points/segments"),
+                                 _("Create points/segments from input lines, linear reference system and positions read from stdin"),
+                                 "self.OnMenuCmd",
+                                 "v.lrs.segment"),
+                                (_("Find line id and offset"),
+                                 _("Find line id and real km+offset for given points in vector map using linear reference system"),
+                                 "self.OnMenuCmd",
+                                 "v.lrs.where"),
+                                )
+                         ),
+                        (_("Nearest features"),
+                         _("Locate nearest feature to points or centroids"),
+                         "self.OnMenuCmd",
+                         "v.distance"),
+                        (_("Network analysis"), (
+                                (_("Allocate subnets"),
+                                 _("Allocate subnets for nearest centers"),
+                                 "self.OnMenuCmd",
+                                 "v.net.alloc"),
+                                (_("Network maintenance"),
+                                 _("Network maintenance support"),
+                                 "self.OnMenuCmd",
+                                 "v.net"),
+                                (_("Visibility network"),
+                                 _("Create and maintain a visibility network"),
+                                 "self.OnMenuCmd",
+                                 "v.net.visibility"),
+                                (_("Shortest path"),
+                                 _("Calculate shortest route along network between 2 nodes"),
+                                 "self.OnMenuCmd",
+                                 "v.net.path"),
+                                (_("Display shortest route (requires XTerm)"),
+                                 _("Display shortest route along network between 2 nodes (visualization only, requires XTerm))"),
+                                 "self.OnXTerm",
+                                 "d.path"),
+                                (_("Split net"),
+                                 _("Split net into bands between cost isolines"),
+                                 "self.OnMenuCmd",
+                                 "v.net.iso"),
+                                (_("Steiner tree"),
+                                 _("Create Steiner tree for network and given terminals"),
+                                 "self.OnMenuCmd",
+                                 "v.net.steiner"),
+                                (_("Traveling salesman analysis"),
+                                 _("Calculate shortest route connecting given set of nodes (Traveling salesman analysis)"),
+                                 "self.OnMenuCmd",
+                                 "v.net.salesman"),
+                                )
+                         ),
+                        (_("Overlay vector maps"), (
+                                (_("Overlay vector maps"),
+                                 _("Boolean overlay of 2 vector maps"),
+                                 "self.OnMenuCmd",
+                                 "v.overlay"),
+                                (_("Patch vector maps"),
+                                 _("Patch/combine multiple maps (boolean OR)"),
+                                 "self.OnMenuCmd",
+                                 "v.patch"),
+                                )
+                         ),
+                        ("","","", ""),
+                        (_("Change attributes"), (
+                                (_("Manage or report categories"),
+                                 _("Attach/delete, or report vector categories"),
+                                 "self.OnMenuCmd",
+                                 "v.category"),
+                                (_("Reclassify objects interactively"),
+                                 _("Reclassify vector objects interactively by entering SQL rules"),
+                                 "self.RulesCmd",
+                                 "v.reclass"),
+                                (_("Reclassify objects using rules file"),
+                                 _("Reclassify vector objects by inputting SQL rules from a text file"),
+                                 "self.OnMenuCmd",
+                                 "v.reclass"),
+                                )
+                         ),
+                        ("","","", ""),
+                        (_("Generate area for current region"),
+                         _("Generate area object for extent of current region"),
+                         "self.OnMenuCmd",
+                         "v.in.region"),
+                        (_("Generate areas from points"), (
+                                (_("Convex hull"),
+                                 _("Generate convex hull for point set"),
+                                 "self.OnMenuCmd",
+                                 "v.hull"),
+                                (_("Delaunay triangles"),
+                                 _("Generate Delaunay triangles for point set"),
+                                 "self.OnMenuCmd",
+                                 "v.delaunay"),
+                                (_("Voronoi diagram/Thiessen polygons"),
+                                 _("Generate Voronoi diagram/Thiessen polygons for point set"),
+                                 "self.OnMenuCmd",
+                                 "v.voronoi"),
+                                )
+                         ),
+                        (_("Generate grid"),
+                         _("Generate rectangular vector grid"),
+                         "self.OnMenuCmd",
+                         "v.mkgrid"),
+                        (_("Generate points"), (
+                                (_("Generate from database"),
+                                 _("Generate vector points from database with x/y coordinates"),
+                                 "self.OnMenuCmd",
+                                 "v.in.db"),
+                                (_("Generate points along lines"),
+                                 _("Generate vector points along vector lines/boundaries"),
+                                 "self.OnMenuCmd",
+                                 "v.to.points"),
+                                (_("Generate random points"),
+                                 _("Generate random vector points"),
+                                 "self.OnMenuCmd",
+                                 "v.random"),
+                                (_("Perturb points"),
+                                 _("Random perturbations of point locations"),
+                                 "self.OnMenuCmd",
+                                 "v.perturb"),
+                                )
+                         ),
+                        ("","","", ""),
+                        (_("Remove outliers in point sets"),
+                         _("Remove outliers from vector point set"),
+                         "self.OnMenuCmd",
+                         "v.outlier"),
+                        (_("Test/training point sets"),
+                         _("Partition points into test/training sets for k-fold cross validation"),
+                         "self.OnMenuCmd",
+                         "v.kcv"),
+                        ("","","", ""),
+                        (_("Update area attributes from raster"),
+                         _("Update area attribute data from univariate statistics on raster map"),
+                         "self.OnMenuCmd",
+                         "v.rast.stats"),
+                        (_("Update point attributes from areas"),
+                         _("Update point attribute data from vector area map"),
+                         "self.OnMenuCmd",
+                         "v.what.vect"),
+                        (_("Update point attributes from raster"), (
+                                (_("Sample raster maps at point locations"),
+                                 _("Update attribute based on sample raster maps at point locations"),
+                                 "self.OnMenuCmd",
+                                 "v.what.rast"),
+                                (_("Sample raster neighborhood around points"),
+                                 _("Update attributes based on sample raster neighborhood around points"),
+                                 "self.OnMenuCmd",
+                                 "v.sample"),
+                                )
+                         ),
+                        ("","","", ""),
+                        (_("Reports and statistics"), (
+                                (_("Basic vector metadata"),
+                                 _("Rebort basic vector map metadata"),
+                                 "self.OnMenuCmd",
+                                 "v.info"),
+                                ("","","", ""),
+                                (_("Report topology by category"),
+                                 _("Report areas for vector attribute categories"),
+                                 "self.OnMenuCmd",
+                                 "v.report"),
+                                (_("Upload or report topology"),
+                                 _("Update database fields or create reports from vector topology"),
+                                 "self.OnMenuCmd",
+                                 "v.to.db"),
+                                ("","","", ""),
+                                (_("Univariate attribute statistics"),
+                                 _("Calculate univariate statistics for vector attributes"),
+                                 "self.OnMenuCmd",
+                                 "v.univar"),
+                                ("","","", ""),
+                                (_("Quadrat indices"),
+                                 _("Indices of point counts in quadrats"),
+                                 "self.OnMenuCmd",
+                                 "v.qcount"),
+                                (_("Test normality"),
+                                 _("Test normality of point distribution"),
+                                 "self.OnMenuCmd",
+                                 "v.normal"),
+                                )
+                         ),
+                        )
+                 ),
+                (_("Imagery"), (
+                        (_("Develop images and groups"), (
+                                (_("Create/edit group"),
+                                 _("Create/edit imagery group"),
+                                 "self.OnMenuCmd",
+                                 "i.group"),
+                                (_("Target group"),
+                                 _("Define target imagery group"),
+                                 "self.OnMenuCmd",
+                                 "i.target"),
+                                ("","","", ""),
+                                (_("Mosaic images"),
+                                 _("Mosaic up to 4 adjacent images"),
+                                 "self.OnMenuCmd",
+                                 "i.image.mosaic"),
+                                )
+                         ),
+                        (_("Manage image colors"), (
+                                (_("Color balance for RGB"),
+                                 _("Color balance and enhance color tables of multiband imagery for RGB display"),
+                                 "self.OnMenuCmd",
+                                 "i.landsat.rgb"),
+                                (_("HIS to RGB"),
+                                 _("Transform HIS (Hue/Intensity/Saturation) color image to RGB (Red/Green/Blue)"),
+                                 "self.OnMenuCmd",
+                                 "i.his.rgb"),
+                                (_("RGB to HIS"),
+                                 _("Transform RGB (Red/Green/Blue) color image to HIS (Hue/Intensity/Saturation)"),
+                                 "self.OnMenuCmd",
+                                 "i.rgb.his"),
+                                )
+                         ),
+                        (_("Rectify image or raster"),
+                         _("Rectifies raster map using information in previously created POINTS file"),
+                         "self.OnMenuCmd",
+                         "i.rectify"),
+                        (_("Ortho photo rectification (requires Xterm)"),
+                         _("Ortho Photo rectification"),
+                         "self.OnXTerm",
+                         "i.ortho.photo"),
+                        ("","","", ""),
+                        (_("Brovey sharpening"),
+                         _("Brovey transformation and pan sharpening"),
+                         "self.OnMenuCmd",
+                         "i.fusion.brovey"),
+                        (_("Classify image"), (
+                                (_("Clustering input for unsupervised classification"),
+                                 _("Clustering input for unsupervised classification analysis"),
+                                 "self.OnMenuCmd",
+                                 "i.cluster"),
+                                ("","","", ""),
+                                (_("Maximum likelihood classification (MLC)"),
+                                 _("Maximum Likelihood Classification analysis"),
+                                 "self.OnMenuCmd",
+                                 "i.maxlik"),
+                                (_("Sequential maximum a posteriori classification (SMAP)"),
+                                 _("Sequential Maximum A Posteriori Classification (SMAP) analysis"),
+                                 "self.OnMenuCmd",
+                                 "i.smap"),
+                                ("","","", ""),
+                                (_("Interactive input for supervised classification (requires Xterm)"),
+                                 _("Interactive input for supervised classification"),
+                                 "self.OnXTerm",
+                                 "i.class"),
+                                (_("Input for supervised MLC"),
+                                 _("Non-interactive input for supervised classification (MLC)"),
+                                 "self.OnMenuCmd",
+                                 "i.gensig"),
+                                (_("Input for supervised SMAP"),
+                                 _("Non-interactive input for supervised classification (SMAP)"),
+                                 "self.OnMenuCmd",
+                                 "i.gensigset"),
+                                )
+                         ),
+                        (_("Filter image"), (
+                                (_("Edge detection"),
+                                 _("Zero edge crossing detection"),
+                                 "self.OnMenuCmd",
+                                 "i.zc"),
+                                (_("Matrix/convolving filter"),
+                                 _("User defined matrix/convolving filter"),
+                                 "self.OnMenuCmd",
+                                 "r.mfilter"),
+                                )
+                         ),
+                        (_("Histogram"),
+                         _("Generate histogram of image"),
+                         "self.DispHistogram",
+                         ""),
+                        (_("Spectral response"),
+                         _("Calculate spectral response"),
+                         "self.OnMenuCmd",
+                         "i.spectral"),
+                        (_("Tasseled cap vegetation index"),
+                         _("Tasseled cap vegetation index analysis"),
+                         "self.OnMenuCmd",
+                         "i.tasscap"),
+                        (_("Transform image"), (
+                                (_("Canonical correlation"),
+                                 _("Canonical correlation (discriminant analysis)"),
+                                 "self.OnMenuCmd",
+                                 "i.cca"),
+                                (_("Principal components"),
+                                 _("Principal components analysis"),
+                                 "self.OnMenuCmd",
+                                 "i.pca"),
+                                (_("Fast Fourier"),
+                                 _("Fast Fourier Transform"),
+                                 "self.OnMenuCmd",
+                                 "i.fft"),
+                                (_("Inverse Fast Fourier"),
+                                 _("Inverse Fast Fourier Transform"),
+                                 "self.OnMenuCmd",
+                                 "i.ifft"),
+                                )
+                         ),
+                        ("","","", ""),
+                        (_("Report and statistics"), (
+                                (_("Bit pattern comparison "),
+                                 _("Bit pattern comparison for ID of low quality pixels"),
+                                 "self.OnMenuCmd",
+                                 "r.bitpattern"),
+                                (_("Kappa analysis"),
+                                 _("Kappa classification accuracy assessment"),
+                                 "self.OnMenuCmd",
+                                 "r.kappa"),
+                                (_("OIF for LandSat TM"),
+                                 _("Optimum index factor for LandSat TM"),
+                                 "self.OnMenuCmd",
+                                 "i.oif"),
+                                )
+                         ),
+                        )
+                 ),
+                (_("Volumes"), (
+                        (_("Develop volumes"), (
+                                (_("Manage 3D NULL values"),
+                                 _("Manage NULL values for volume"),
+                                 "self.OnMenuCmd",
+                                 "r3.null"),
+                                (_("Manage timestamp"),
+                                 _("Manage timestamp for volume"),
+                                 "self.OnMenuCmd",
+                                 "r3.timestamp"),
+                                )),
+                        ("","","", ""),
+                        (_("3D Mask"),
+                         _("Create 3D mask for 3D raster operations"),
+                         "self.OnMenuCmd",
+                         "r3.mask"),
+                        (_("3D raster map calculator"),
+                         _("Map calculator for volumetric map algebra"),
+                         "self.Disp3DMapCalculator",
+                         ""),
+                        (_("Cross section"),
+                         _("Create 2D raster cross section from volume"),
+                         "self.OnMenuCmd",
+                         "r3.cross.rast"),
+                        (_("Interpolate volume from points"),
+                         _("Interpolate volume from vector points using splines"),
+                         "self.OnMenuCmd",
+                         "v.vol.rst"),
+                        ("","","", ""),
+                        (_("Report and Statistics"), (
+                                (_("Basic volume metadata"),
+                                 _("Report basic volume metadata"),
+                                 "self.OnMenuCmd",
+                                 "r3.info"),
+                                )
+                         ),
+                        )
+                 ),
+                (_("Database"), (
+                        (_("Database information"), (
+                                (_("Describe table"),
+                                 _("Describe table structure and attributes"),
+                                 "self.OnMenuCmd",
+                                 "db.describe"),
+                                (_("List columns"),
+                                 _("List columns for selected table"),
+                                 "self.OnMenuCmd",
+                                 "db.columns"),
+                                (_("List drivers"),
+                                 _("List available database drivers"),
+                                 "self.OnMenuCmd",
+                                 "db.drivers"),
+                                (_("List tables"),
+                                 _("List tables in selected database"),
+                                 "self.OnMenuCmd",
+                                 "db.tables"),
+                                )
+                         ),
+                        ("","","", ""),
+                        (_("Manage databases"), (
+                                (_("Connect"),
+                                 _("Connect to database"),
+                                 "self.OnMenuCmd",
+                                 "db.connect"),
+                                (_("Login"),
+                                 _("Login to database"),
+                                 "self.OnMenuCmd",
+                                 "db.login"),
+                                ("","","", ""),
+                                (_("Copy table"),
+                                 _("Copy attribute table"),
+                                 "self.OnMenuCmd",
+                                 "db.copy"),
+                                (_("New table"),
+                                 _("Create and connect new attribute table to vector map"),
+                                 "self.OnMenuCmd",
+                                 "v.db.addtable"),
+                                (_("Remove table"),
+                                 _("Remove existing attribute table for vector map"),
+                                 "self.OnMenuCmd",
+                                 "db.login"),
+                                ("","","", ""),
+                                (_("Add columns"),
+                                 _("Add columns to table"),
+                                 "self.OnMenuCmd",
+                                 "v.db.addcol"),
+                                (_("Change values"),
+                                 _("Change values in a column"),
+                                 "self.OnMenuCmd",
+                                 "v.db.update"),
+                                (_("Rename column"),
+                                 _("Rename a column"),
+                                 "self.OnMenuCmd",
+                                 "v.db.renamecol"),
+                                ("","","", ""),
+                                (_("Test"),
+                                 _("Test database"),
+                                 "self.OnMenuCmd",
+                                 "db.test"),
+                                )
+                         ),
+                        (_("Query"), (
+                                (_("Query any table"),
+                                 _("Query data in any table"),
+                                 "self.OnMenuCmd",
+                                 "db.select"),
+                                (_("Query vector attribute data"),
+                                 _("Query vector attribute data"),
+                                 "self.OnMenuCmd",
+                                 "v.db.select"),
+                                (_("SQL statement"),
+                                 _("Execute SQL statement"),
+                                 "self.OnMenuCmd",
+                                 "db.execute"),
+                                )
+                         ),
+                        ("","","", ""),
+                        (_("Vector database connections"), (
+                                (_("Reconnect vector to database"), 
+                                 _("Reconnect vector map to attribute database"),
+                                 "self.OnMenuCmd",
+                                 "v.db.reconnect.all"),
+                                (_("Set vector map - database connection"),
+                                 _("Set database connection for vector attributes"),
+                                 "self.OnMenuCmd",
+                                 "v.db.connect"),
+                                )
+                         ),
+                        )
+                 ),
+                (_("Help"), (
+                        (_("GRASS GIS help"),
+                         _("GRASS GIS Reference Manual"),
+                         "self.RunMenuCmd",
+                         "g.manual -i"),
+                        (_("GRASS GIS GUI help"),
+                         _("GUI-related Reference Manual"),
+                         "self.RunMenuCmd",
+                         "g.manual wxGUI"),
+                        (_("About GRASS GIS"),
+                         _("About GRASS GIS"),
+                         "self.OnAboutGRASS",
+                         ""),
+                        )
+                 )
+                )
+                ]

Modified: grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/menuform.py	2008-03-16 19:28:50 UTC (rev 30590)
+++ grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/menuform.py	2008-03-16 19:55:34 UTC (rev 30591)
@@ -88,33 +88,31 @@
 import grassenv
 import gselect
 import gcmd
-import wxgui_utils
+import goutput
+import utils
 from preferences import globalSettings as UserSettings
 try:
     import subprocess
 except:
     from compat import subprocess
 
-def reexec_with_pythonw():
-    if sys.platform == 'darwin' and\
-        not sys.executable.endswith('MacOS/Python'):
-        print >>sys.stderr,'re-executing using pythonw'
-        os.execvp('pythonw',['pythonw',__file__] + sys.argv[1:])
+utils.reexec_with_pythonw()
 
-reexec_with_pythonw()
-
 ID_ABOUT_COMMAND = 102
 
-VSPACE = 4
-HSPACE = 4
-MENU_HEIGHT = 25
-STATUSBAR_HEIGHT = 30
-# ENTRY_HEIGHT = 25
-ENTRY_HEIGHT = -1
-STRING_ENTRY_WIDTH = 300
-BUTTON_HEIGHT = 44
-BUTTON_WIDTH = 100
+#
+# Widgets dimension
+#
+SPIN_SIZE = (150, -1)
+COMBOBOX_SIZE = (300, -1)
+GSELECT_SIZE = (400, -1)
+TEXTCTRL_SIZE = (400, -1)
 
+#
+# Global GRASS variables
+#
+CURR_MAPSET = grassenv.GetGRASSVariable('MAPSET')
+
 # From lib/gis/col_str.c, except purple which is mentioned
 # there but not given RGB values
 str2rgb = {'aqua': (100, 128, 255),
@@ -476,6 +474,7 @@
 
         If 'text' is given, it must be the HTML text to be presented in the Panel.
         """
+
         wx.html.HtmlWindow.__init__(self, *args, **kwargs)
         self.fspath = gisbase + "/docs/html/"
         self.SetStandardFonts ( size = 10 )
@@ -487,6 +486,7 @@
                 self.fillContentsFromFile ( self.fspath + grass_command + ".html",
                                             skip_description=skip_description )
             else:
+                ### FIXME: calling self.LoadPage is too time costly (why?)
                 self.LoadPage(self.fspath + grass_command + ".html")
                 self.Ok = True
         else:
@@ -876,7 +876,7 @@
         # are we running from command line?
         ### add 'command output' tab regardless standalone dialog
         #        if standalone:
-        self.goutput = wxgui_utils.GMConsole(parent=self, margin=False)
+        self.goutput = goutput.GMConsole(parent=self, margin=False)
         self.outpage = self.notebook.AddPage(self.goutput, text=_("Command output") )
         self.outpageid = self.notebook.GetPageCount() - 1
 
@@ -996,11 +996,11 @@
                             except ValueError:
                                 minValue = -1e6
                                 maxValue = 1e6
-                            txt2 = wx.SpinCtrl(parent=which_panel, id=wx.ID_ANY, size=(300, -1),
+                            txt2 = wx.SpinCtrl(parent=which_panel, id=wx.ID_ANY, size=SPIN_SIZE,
                                                min=minValue, max=maxValue)
                         else:
                             txt2 = wx.TextCtrl(parent=which_panel, value = p.get('default',''),
-                                               size = (STRING_ENTRY_WIDTH, ENTRY_HEIGHT))
+                                               size=TEXTCTRL_SIZE)
                         if p.get('value','') != '':
                             txt2.SetValue(p['value']) # parameter previously set
                         which_sizer.Add(item=txt2, proportion=0,
@@ -1014,7 +1014,7 @@
                         which_sizer.Add(item=txt, proportion=0,
                                         flag=wx.ADJUST_MINSIZE | wx.TOP | wx.RIGHT | wx.LEFT, border=5)
                         cb = wx.ComboBox(parent=which_panel, id=wx.ID_ANY, value=p.get('default',''),
-                                         size=wx.Size(STRING_ENTRY_WIDTH, -1),
+                                         size=COMBOBOX_SIZE,
                                          choices=valuelist, style=wx.CB_DROPDOWN)
                         if p.get('value','') != '':
                             cb.SetValue(p['value']) # parameter previously set
@@ -1036,13 +1036,13 @@
                 if p.get('multiple','yes') == 'yes' or \
                         p.get('type','string') == 'string':
                     txt3 = wx.TextCtrl(parent=which_panel, value = p.get('default',''),
-                                   size = (STRING_ENTRY_WIDTH, ENTRY_HEIGHT))
+                                   size=TEXTCTRL_SIZE)
                     txt3.Bind(wx.EVT_TEXT, self.OnSetValue)
                 else:
                     minValue = -1e9
                     maxValue = 1e9
                     txt3 = wx.SpinCtrl(parent=which_panel, value=p.get('default',''),
-                                       size = (STRING_ENTRY_WIDTH, ENTRY_HEIGHT),
+                                       size=SPIN_SIZE,
                                        min=minValue, max=maxValue)
                     txt3.Bind(wx.EVT_SPINCTRL, self.OnSetValue)
                     txt3.Bind(wx.EVT_TEXT, self.OnSetValue)
@@ -1063,8 +1063,13 @@
                         multiple = True
                     else:
                         multiple = False
-                    selection = gselect.Select(parent=which_panel, id=wx.ID_ANY, size=(400,-1),
-                                               type=p.get('element',''), multiple=multiple)
+                    if p.get('age','') == 'new':
+                        mapsets = [CURR_MAPSET,]
+                    else:
+                        mapsets = None
+
+                    selection = gselect.Select(parent=which_panel, id=wx.ID_ANY, size=GSELECT_SIZE,
+                                               type=p.get('element',''), multiple=multiple, mapsets=mapsets)
                     if p.get('value','') != '':
                         selection.SetValue(p['value']) # parameter previously set
 
@@ -1114,10 +1119,10 @@
                 # file selector
                 elif p.get('prompt','') != 'color' and p.get('element', '') == 'file':
                     fbb = filebrowse.FileBrowseButton(parent=which_panel, id=wx.ID_ANY, 
-                                                      size=(350, -1), labelText='',
-                                                      dialogTitle=_( 'Choose %s' ) % \
+                                                      size=GSELECT_SIZE, labelText='',
+                                                      dialogTitle=_('Choose %s') % \
                                                           p.get('description',_('File')),
-                                                      buttonText=_( 'Browse' ),
+                                                      buttonText=_('Browse'),
                                                       startDirectory=os.getcwd(), fileMode=0,
                                                       changeCallback=self.OnSetValue)
                     if p.get('value','') != '':
@@ -1378,7 +1383,7 @@
                     if self.grass_task.get_param(key)['element'] in ['cell', 'vector']:
                         # mapname -> mapname at mapset
                         if '@' not in value:
-                            value = value + '@' + grassenv.GetGRASSVariable('MAPSET')
+                            value = value + '@' + CURR_MAPSET
                     self.grass_task.set_param(key, value)
                     cmd_validated.append(key + '=' + value)
                     i = i + 1

Modified: grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/preferences.py
===================================================================
--- grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/preferences.py	2008-03-16 19:28:50 UTC (rev 30590)
+++ grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/preferences.py	2008-03-16 19:55:34 UTC (rev 30591)
@@ -57,7 +57,6 @@
             #
             'display': {
                 'displayFont' : { 'value' : '' },
-                'rasterOverlay' : { 'enabled' : False },
                 },
             #
             # advanced
@@ -81,6 +80,7 @@
             'overwrite' : { 'enabled' : False },
             'closeDlg' : { 'enabled' : False },
             'verbosity' : { 'selection' : 'grassenv' },
+            'rasterOverlay' : { 'enabled' : False },
             },
             #
             # vdigit
@@ -332,7 +332,7 @@
 
 class PreferencesDialog(wx.Dialog):
     """User preferences dialog"""
-    def __init__(self, parent, title=_("User settings"),
+    def __init__(self, parent, title=_("User GUI settings"),
                  settings=globalSettings,
                  style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER):
         self.parent = parent # GMFrame
@@ -453,7 +453,7 @@
         row = 0
         gridSizer.Add(item=wx.StaticText(parent=panel, id=wx.ID_ANY,
                                          label=_("Default font for GRASS displays:")),
-                       flag=wx.ALIGN_LEFT |
+                      flag=wx.ALIGN_LEFT |
                       wx.ALIGN_CENTER_VERTICAL,
                       pos=(row, 0))
         fontButton = wx.Button(parent=panel, id=wx.ID_ANY,
@@ -466,31 +466,6 @@
         sizer.Add(item=gridSizer, proportion=1, flag=wx.ALL | wx.EXPAND, border=5)
         border.Add(item=sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=3)
 
-        #
-        # raster settings
-        #
-        box   = wx.StaticBox (parent=panel, id=wx.ID_ANY, label=" %s " % _("Raster settings"))
-        sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
-
-        gridSizer = wx.GridBagSizer (hgap=3, vgap=3)
-        gridSizer.AddGrowableCol(0)
-
-        #
-        # raster overlay
-        #
-        row = 0
-        rasterOverlay = wx.CheckBox(parent=panel, id=wx.ID_ANY,
-                                    label=_("Overlay raster maps"),
-                                    name='IsChecked')
-        rasterOverlay.SetValue(self.settings.Get(group='display', key='rasterOverlay', subkey='enabled'))
-        self.winId['display:rasterOverlay:enabled'] = rasterOverlay.GetId()
-
-        gridSizer.Add(item=rasterOverlay,
-                      pos=(row, 0), span=(1, 2))
-        
-        sizer.Add(item=gridSizer, proportion=1, flag=wx.ALL | wx.EXPAND, border=5)
-        border.Add(item=sizer, proportion=0, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=3)
-
         panel.SetSizer(border)
         
         # bindings
@@ -552,6 +527,31 @@
         sizer.Add(item=gridSizer, proportion=1, flag=wx.ALL | wx.EXPAND, border=5)
         border.Add(item=sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=3)
 
+        #
+        # raster settings
+        #
+        box   = wx.StaticBox (parent=panel, id=wx.ID_ANY, label=" %s " % _("Raster settings"))
+        sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
+
+        gridSizer = wx.GridBagSizer (hgap=3, vgap=3)
+        gridSizer.AddGrowableCol(0)
+
+        #
+        # raster overlay
+        #
+        row = 0
+        rasterOverlay = wx.CheckBox(parent=panel, id=wx.ID_ANY,
+                                    label=_("Overlay raster maps"),
+                                    name='IsChecked')
+        rasterOverlay.SetValue(self.settings.Get(group='cmd', key='rasterOverlay', subkey='enabled'))
+        self.winId['cmd:rasterOverlay:enabled'] = rasterOverlay.GetId()
+
+        gridSizer.Add(item=rasterOverlay,
+                      pos=(row, 0), span=(1, 2))
+        
+        sizer.Add(item=gridSizer, proportion=1, flag=wx.ALL | wx.EXPAND, border=5)
+        border.Add(item=sizer, proportion=0, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=3)
+
         panel.SetSizer(border)
         
         return panel
@@ -627,7 +627,7 @@
         pageSizer.Add(item=dataBrowserSizer,
                       proportion=0,
                       flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND,
-                      border=5)
+                      border=3)
 
         panel.SetSizer(pageSizer)
 

Modified: grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/utils.py	2008-03-16 19:28:50 UTC (rev 30590)
+++ grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/utils.py	2008-03-16 19:55:34 UTC (rev 30591)
@@ -191,3 +191,10 @@
 def ListSortLower(list):
     """Sort list items (not case-sensitive)"""
     list.sort(cmp=lambda x, y: cmp(x.lower(), y.lower()))
+
+def reexec_with_pythonw():
+    """Re-execute Python on Mac OS"""
+    if sys.platform == 'darwin' and \
+            not sys.executable.endswith('MacOS/Python'):
+        print >> sys.stderr, 're-executing using pythonw'
+        os.execvp('pythonw', ['pythonw', __file__] + sys.argv[1:])

Modified: grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/wxgui_utils.py	2008-03-16 19:28:50 UTC (rev 30590)
+++ grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/wxgui_utils.py	2008-03-16 19:55:34 UTC (rev 30591)
@@ -28,13 +28,10 @@
 import os
 import sys
 import string
-import time
-import textwrap
 
 import wx
 import wx.lib.customtreectrl as CT
 import wx.combo
-import wx.stc
 import wx.lib.newevent
 
 import globalvar
@@ -560,7 +557,7 @@
             self.GetPyData(layer)[0]['cmd'] = cmdValidated
         elif ltype == 'raster':
             cmd = ['d.rast']
-            if UserSettings.Get(group='display', key='rasterOverlay', subkey='enabled'):
+            if UserSettings.Get(group='cmd', key='rasterOverlay', subkey='enabled'):
                 cmd.append('-o')
             menuform.GUI().ParseCommand(cmd, completed=(self.GetOptData,layer,params),
                                         parentframe=self)
@@ -1017,436 +1014,6 @@
 
         return None
 
-class GMConsole(wx.Panel):
-    """
-    Create and manage output console for commands entered on the
-    GIS Manager command line.
-    """
-    def __init__(self, parent, id=wx.ID_ANY, margin=False,
-                 pos=wx.DefaultPosition, size=wx.DefaultSize,
-                 style=wx.TAB_TRAVERSAL | wx.FULL_REPAINT_ON_RESIZE):
-        wx.Panel.__init__(self, parent, id, pos, size, style)
-
-        # initialize variables
-        self.Map             = None
-        self.parent          = parent # GMFrame
-        self.cmdThreads      = []     # list of running commands (alive or dead)
-
-        # progress bar
-        self.console_progressbar = wx.Gauge(parent=self, id=wx.ID_ANY,
-                                            range=100, pos=(110, 50), size=(-1, 25),
-                                            style=wx.GA_HORIZONTAL)
-
-        # text control for command output
-        self.cmd_output = GMStc(parent=self, id=wx.ID_ANY, margin=margin)
-        # redirect
-        self.cmd_stdout = GMStdout(self.cmd_output)
-        self.cmd_stderr = GMStderr(self.cmd_output,
-                                   self.console_progressbar)
-
-        # buttons
-        self.console_clear = wx.Button(parent=self, id=wx.ID_CLEAR)
-        self.console_save  = wx.Button(parent=self, id=wx.ID_SAVE)
-        self.Bind(wx.EVT_BUTTON, self.ClearHistory, self.console_clear)
-        self.Bind(wx.EVT_BUTTON, self.SaveHistory,  self.console_save)
-
-        # output control layout
-        boxsizer1 = wx.BoxSizer(wx.VERTICAL)
-        gridsizer1 = wx.GridSizer(rows=1, cols=2, vgap=0, hgap=0)
-        boxsizer1.Add(item=self.cmd_output, proportion=1,
-                      flag=wx.EXPAND | wx.ADJUST_MINSIZE, border=0)
-        gridsizer1.Add(item=self.console_clear, proportion=0,
-                       flag=wx.ALIGN_CENTER_HORIZONTAL | wx.ADJUST_MINSIZE, border=0)
-        gridsizer1.Add(item=self.console_save, proportion=0,
-                       flag=wx.ALIGN_CENTER_HORIZONTAL | wx.ADJUST_MINSIZE, border=0)
-
-
-        boxsizer1.Add(item=gridsizer1, proportion=0,
-                      flag=wx.EXPAND | wx.ALIGN_CENTRE_VERTICAL | wx.TOP | wx.BOTTOM,
-                      border=5)
-        boxsizer1.Add(item=self.console_progressbar, proportion=0,
-                      flag=wx.EXPAND | wx.ADJUST_MINSIZE, border=0)
-
-        boxsizer1.Fit(self)
-        boxsizer1.SetSizeHints(self)
-
-        # set up event handler for any command thread results
-        gcmd.EVT_RESULT(self, self.OnResult)
-
-        # layout
-        self.SetAutoLayout(True)
-        self.SetSizer(boxsizer1)
-
-    def WriteCmdLog(self, line, pid=None):
-        """Write out line in selected style"""
-        self.cmd_output.GotoPos(self.cmd_output.GetEndStyled())
-        p1 = self.cmd_output.GetCurrentPos()
-        if pid:
-            line = '(' + str(pid) + ') ' + line
-        if len(line) < 80:
-            diff = 80 - len(line)
-            line += diff * ' '
-            line += '%s' % os.linesep
-            self.cmd_output.AddText(line)
-            self.cmd_output.EnsureCaretVisible()
-            p2 = self.cmd_output.GetCurrentPos()
-            self.cmd_output.StartStyling(p1, 0xff)
-            self.cmd_output.SetStyling(p2 - p1, self.cmd_output.StyleCommand)
-        
-    def RunCmd(self, command):
-        """
-        Run in GUI GRASS (or other) commands typed into
-        console command text widget, and send stdout output to output
-        text widget.
-
-        Command is transformed into a list for processing.
-
-        TODO: Display commands (*.d) are captured and
-        processed separately by mapdisp.py. Display commands are
-        rendered in map display widget that currently has
-        the focus (as indicted by mdidx).
-        """
-        
-        # map display window available ?
-        try:
-            curr_disp = self.parent.curr_page.maptree.mapdisplay
-            self.Map = curr_disp.GetRender()
-        except:
-            curr_disp = None
-
-        if len(self.GetListOfCmdThreads()) > 0:
-            # only one running command enabled (per GMConsole instance)
-            busy = wx.BusyInfo(message=_("Unable to run the command, another command is running..."),
-                               parent=self)
-            wx.Yield()
-            time.sleep(3)
-            busy.Destroy()
-            return 
-
-        # command given as a string ?
-        try:
-            cmdlist = command.strip().split(' ')
-        except:
-            cmdlist = command
-
-        if cmdlist[0] in globalvar.grassCmd['all']:
-            # send GRASS command without arguments to GUI command interface
-            # except display commands (they are handled differently)
-            if cmdlist[0][0:2] == "d.": # display GRASS commands
-                try:
-                    layertype = {'d.rast'         : 'raster',
-                                 'd.rgb'          : 'rgb',
-                                 'd.his'          : 'his',
-                                 'd.shaded'       : 'shaded',
-                                 'd.legend'       : 'rastleg',
-                                 'd.rast.arrow'   : 'rastarrow',
-                                 'd.rast.num'     : 'rastnum',
-                                 'd.vect'         : 'vector',
-                                 'd.vect.thematic': 'thememap',
-                                 'd.vect.chart'   : 'themechart',
-                                 'd.grid'         : 'grid',
-                                 'd.geodesic'     : 'geodesic',
-                                 'd.rhumbline'    : 'rhumb',
-                                 'd.labels'       : 'labels'}[cmdlist[0]]
-                except KeyError:
-                    wx.MessageBox(message=_("Command '%s' not yet implemented.") % cmdlist[0])
-                    return False
-
-                # add layer into layer tree
-                self.parent.curr_page.maptree.AddLayer(ltype=layertype,
-                                                       lcmd=cmdlist)
-
-            else: # other GRASS commands (r|v|g|...)
-                if self.parent.notebook.GetSelection() != 1:
-                    # select 'Command output' tab
-                    self.parent.notebook.SetSelection(1)
-                
-                # activate computational region (set with g.region)
-                # for all non-display commands.
-                tmpreg = os.getenv("GRASS_REGION")
-                os.unsetenv("GRASS_REGION")
-                if len(cmdlist) == 1:
-                    # process GRASS command without argument
-                    menuform.GUI().ParseCommand(cmdlist, parentframe=self)
-                else:
-                    # process GRASS command with argument
-                    self.cmdPID = len(self.cmdThreads)+1
-                    self.WriteCmdLog('%s' % ' '.join(cmdlist), pid=self.cmdPID)
-                    
-                    grassCmd = gcmd.Command(cmdlist, wait=False,
-                                            stdout=self.cmd_stdout,
-                                            stderr=self.cmd_stderr)
-                    
-                    self.cmdThreads.append(grassCmd.cmdThread)
-                    
-                    return grassCmd
-                # deactivate computational region and return to display settings
-                if tmpreg:
-                    os.environ["GRASS_REGION"] = tmpreg
-        else:
-            # Send any other command to the shell. Send output to
-            # console output window
-            if self.parent.notebook.GetSelection() != 1:
-                # select 'Command output' tab
-                self.parent.notebook.SetSelection(1)
-
-            print "$ " + ' '.join(cmdlist)
-            
-            # if command is not a GRASS command, treat it like a shell command
-            generalCmd = subprocess.Popen(cmdlist,
-                                          stdout=subprocess.PIPE,
-                                          stderr=subprocess.PIPE)
-            
-            for outline in generalCmd.stdout:
-                print outline
-                   
-            return None
-
-    def ClearHistory(self, event):
-        """Clear history of commands"""
-        self.cmd_output.ClearAll()
-        self.console_progressbar.SetValue(0)
-
-    def SaveHistory(self, event):
-        """Save history of commands"""
-        self.history = self.cmd_output.GetSelectedText()
-        if self.history == '':
-            self.history = self.cmd_output.GetText()
-
-        # add newline if needed
-        if len(self.history) > 0 and self.history[-1] != os.linesep:
-            self.history += os.linesep
-
-        wildcard = "Text file (*.txt)|*.txt"
-        dlg = wx.FileDialog(
-            self, message=_("Save file as..."), defaultDir=os.getcwd(),
-            defaultFile="grass_cmd_history.txt", wildcard=wildcard,
-            style=wx.SAVE|wx.FD_OVERWRITE_PROMPT)
-
-        # Show the dialog and retrieve the user response. If it is the OK response,
-        # process the data.
-        if dlg.ShowModal() == wx.ID_OK:
-            path = dlg.GetPath()
-
-            output = open(path, "w")
-            output.write(self.history)
-            output.close()
-
-        dlg.Destroy()
-
-    def GetListOfCmdThreads(self, onlyAlive=True):
-        """Return list of command threads)"""
-        list = []
-        for t in self.cmdThreads:
-            Debug.msg (4, "GMConsole.GetListOfCmdThreads(): name=%s, alive=%s" %
-                       (t.getName(), t.isAlive()))
-            if onlyAlive and not t.isAlive():
-                continue
-            list.append(t)
-
-        return list
-
-    def OnResult(self, event):
-        """Show result status"""
-        if event.cmdThread is None:
-            # Thread aborted (using our convention of None return)
-            self.WriteCmdLog(_('Command aborted'),
-                             pid=self.cmdPID)
-        else:
-            # Process results here
-            self.WriteCmdLog(_('Command finished (%d sec)') % (time.time() - event.cmdThread.startTime),
-                             pid=self.cmdPID)
-
-        self.console_progressbar.SetValue(0) # reset progress bar on '0%'
-        if hasattr(self.parent.parent, "btn_run"): # menuform.mainFrame
-            dialog = self.parent.parent
-            dialog.btn_run.Enable(True)
-            if dialog.get_dcmd is None and \
-                   dialog.closebox.IsChecked():
-                time.sleep(1)
-                dialog.Close()
-
-class GMStdout:
-    """GMConsole standard output
-
-    Based on FrameOutErr.py
-
-    Name:      FrameOutErr.py
-    Purpose:   Redirecting stdout / stderr
-    Author:    Jean-Michel Fauth, Switzerland
-    Copyright: (c) 2005-2007 Jean-Michel Fauth
-    Licence:   GPL
-    """
-    def __init__(self, gmstc):
-        self.gmstc  = gmstc
-
-    def write(self, s):
-        if len(s) == 0:
-            return
-        s = s.replace('\n', os.linesep)
-        for line in s.split(os.linesep):
-            p1 = self.gmstc.GetCurrentPos() # get caret position
-            self.gmstc.AddTextWrapped(line)
-            self.gmstc.EnsureCaretVisible()
-            p2 = self.gmstc.GetCurrentPos()
-            self.gmstc.StartStyling(p1, 0xff)
-            self.gmstc.SetStyling(p2 - p1 + 1, self.gmstc.StyleOutput)
-
-class GMStderr:
-    """GMConsole standard error output
-
-    Based on FrameOutErr.py
-
-    Name:      FrameOutErr.py
-    Purpose:   Redirecting stdout / stderr
-    Author:    Jean-Michel Fauth, Switzerland
-    Copyright: (c) 2005-2007 Jean-Michel Fauth
-    Licence:   GPL
-    """
-    def __init__(self, gmstc, gmgauge):
-        self.gmstc   = gmstc
-        self.gmgauge = gmgauge
-
-    def write(self, s):
-        s = s.replace('\n', os.linesep)
-        message = ''
-        for line in s.split(os.linesep):
-            if len(line) == 0:
-                continue
-
-            if 'GRASS_INFO_PERCENT' in line:
-                # 'GRASS_INFO_PERCENT: 10' -> value=10
-                value = int(line.split(':')[1].strip())
-                if value < 100:
-                    self.gmgauge.SetValue(value)
-                else:
-                    self.gmgauge.SetValue(0) # reset progress bar on '0%'
-            elif 'GRASS_INFO_MESSAGE' in line:
-                type = 'message'
-                message += line.split(':')[1].strip()
-            elif 'GRASS_INFO_WARNING' in line:
-                type = 'warning'
-                message += line.split(':')[1].strip()
-            elif 'GRASS_INFO_ERROR' in line:
-                type = 'error'
-                message += line.split(':')[1].strip()
-            elif 'GRASS_INFO_END' in line:
-                message = ''
-            else:
-                if len(line) > 0:
-                    p1 = self.gmstc.GetCurrentPos()
-                    self.gmstc.AddTextWrapped(line)
-                    self.gmstc.EnsureCaretVisible()
-                    p2 = self.gmstc.GetCurrentPos()
-                    self.gmstc.StartStyling(p1, 0xff)
-                    self.gmstc.SetStyling(p2 - p1 + 1, self.gmstc.StyleUnknown)
-
-            if len(message) > 0:
-                p1 = self.gmstc.GetCurrentPos()
-                if type == 'warning':
-                    message = 'WARNING: ' + message
-                elif type == 'error':
-                    message = 'ERROR: ' + message
-                self.gmstc.AddTextWrapped(message)
-                self.gmstc.EnsureCaretVisible()
-                p2 = self.gmstc.GetCurrentPos()
-                self.gmstc.StartStyling(p1, 0xff)
-                if type == 'error':
-                    self.gmstc.SetStyling(p2 - p1 + 1, self.gmstc.StyleError)
-                elif type == 'warning':
-                    self.gmstc.SetStyling(p2 - p1 + 1, self.gmstc.StyleWarning)
-                elif type == 'message':
-                    self.gmstc.SetStyling(p2 - p1 + 1, self.gmstc.StyleMessage)
-
-class GMStc(wx.stc.StyledTextCtrl):
-    """Styled GMConsole
-
-    Based on FrameOutErr.py
-
-    Name:      FrameOutErr.py
-    Purpose:   Redirecting stdout / stderr
-    Author:    Jean-Michel Fauth, Switzerland
-    Copyright: (c) 2005-2007 Jean-Michel Fauth
-    Licence:   GPL
-    """    
-    def __init__(self, parent, id, margin=False):
-        wx.stc.StyledTextCtrl.__init__(self, parent, id)
-        self.parent = parent
-        
-        #
-        # styles
-        #
-        self.StyleDefault     = 0
-        self.StyleDefaultSpec = "face:Courier New,size:10,fore:#000000,back:#FFFFFF"
-        self.StyleCommand     = 1
-        self.StyleCommandSpec = "face:Courier New,size:10,fore:#000000,back:#bcbcbc"
-        self.StyleOutput      = 2
-        self.StyleOutputSpec  = "face:Courier New,size:10,fore:#000000,back:#FFFFFF"
-        # fatal error
-        self.StyleError       = 3
-        self.StyleErrorSpec   = "face:Courier New,size:10,fore:#7F0000,back:#FFFFFF"
-        # warning
-        self.StyleWarning     = 4
-        self.StyleWarningSpec = "face:Courier New,size:10,fore:#0000FF,back:#FFFFFF"
-        # message
-        self.StyleMessage     = 5
-        self.StyleMessageSpec = "face:Courier New,size:10,fore:#000000,back:#FFFFFF"
-        # unknown
-        self.StyleUnknown     = 6
-        self.StyleUnknownSpec = "face:Courier New,size:10,fore:#7F0000,back:#FFFFFF"
-        
-        # default and clear => init
-        self.StyleSetSpec(wx.stc.STC_STYLE_DEFAULT, self.StyleDefaultSpec)
-        self.StyleClearAll()
-        self.StyleSetSpec(self.StyleCommand, self.StyleCommandSpec)
-        self.StyleSetSpec(self.StyleOutput,  self.StyleOutputSpec)
-        self.StyleSetSpec(self.StyleError,   self.StyleErrorSpec)
-        self.StyleSetSpec(self.StyleWarning, self.StyleWarningSpec)
-        self.StyleSetSpec(self.StyleMessage, self.StyleMessageSpec)
-        self.StyleSetSpec(self.StyleUnknown, self.StyleUnknownSpec)
-
-        #
-        # line margins
-        #
-        # TODO print number only from cmdlog
-        self.SetMarginWidth(1, 0)
-        self.SetMarginWidth(2, 0)
-        if margin:
-            self.SetMarginType(0, wx.stc.STC_MARGIN_NUMBER)
-            self.SetMarginWidth(0, 30)
-        else:
-            self.SetMarginWidth(0, 0)
-
-        #
-        # miscellaneous
-        #
-        self.SetViewWhiteSpace(False)
-        self.SetTabWidth(4)
-        self.SetUseTabs(False)
-        self.UsePopUp(True)
-        self.SetSelBackground(True, "#FFFF00")
-        self.SetUseHorizontalScrollBar(True)
-
-        #
-        # bindins
-        #
-        self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroy)
-
-    def OnDestroy(self, evt):
-        """The clipboard contents can be preserved after
-        the app has exited"""
-        
-        wx.TheClipboard.Flush()
-        evt.Skip()
-
-    def AddTextWrapped(self, str, wrap=80):
-        """Add string to text area.
-
-        String is wrapped and linesep is also added to the end
-        of the string"""
-        str = textwrap.fill(str, wrap) + os.linesep
-        self.AddText(str)
-
 class LoadMapLayersDialog(wx.Dialog):
     """Load selected map layers (raster, vector) into layer tree"""
     def __init__(self, parent, title, style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER):

Modified: grass/branches/releasebranch_6_3/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/releasebranch_6_3/gui/wxpython/wxgui.py	2008-03-16 19:28:50 UTC (rev 30590)
+++ grass/branches/releasebranch_6_3/gui/wxpython/wxgui.py	2008-03-16 19:55:34 UTC (rev 30591)
@@ -82,6 +82,7 @@
 import gui_modules.dbm as dbm
 import gui_modules.globalvar as globalvar
 import gui_modules.workspace as workspace
+import gui_modules.goutput as goutput
 from   gui_modules.debug import Debug as Debug
 from   icons.icon import Icons as Icons
 
@@ -108,7 +109,7 @@
         self._auimgr = wx.aui.AuiManager(self)
 
         # initialize variables
-        self.disp_idx      = 0            # index value for map displays and layer trees
+        self.disp_idx      = 1            # index value for map displays and layer trees
         self.curr_page     = ''           # currently selected page for layer tree notebook
         self.curr_pagenum  = ''           # currently selected page number for layer tree notebook
         self.encoding      = 'ISO-8859-1' # default encoding for display fonts
@@ -250,7 +251,7 @@
             return
 
         if len(gcmd) > 0:
-            helpString = gcmd + ' (' + help + ')'
+            helpString = gcmd + ' -- ' + help
         else:
             helpString = help
 
@@ -281,7 +282,7 @@
         self.notebook.AddPage(self.gm_cb, text=_("Map layers for each display"))
 
         # create command output text area and add it to main notebook page
-        self.goutput = wxgui_utils.GMConsole(self)
+        self.goutput = goutput.GMConsole(self)
         self.outpage = self.notebook.AddPage(self.goutput, text=_("Command output"))
 
         # bingings
@@ -918,6 +919,7 @@
         if not label:
             toolbar.AddSeparator()
             return
+
         tool = toolbar.AddLabelTool(id=wx.ID_ANY, label=label, bitmap=icon, shortHelp=help)
         self.Bind(wx.EVT_TOOL, handler, tool)
 
@@ -1294,12 +1296,6 @@
 
         return True
 
-def reexec_with_pythonw():
-  if sys.platform == 'darwin' and \
-    not sys.executable.endswith('MacOS/Python'):
-    print >> sys.stderr, 're-executing using pythonw'
-    os.execvp('pythonw', ['pythonw', __file__] + sys.argv[1:])
-
 class Usage(Exception):
     def __init__(self, msg):
         self.msg = msg
@@ -1331,7 +1327,7 @@
     #
     # reexec for MacOS
     #
-    reexec_with_pythonw()
+    utils.reexec_with_pythonw()
 
     #
     # process command-line arguments



More information about the grass-commit mailing list