[GRASS-SVN] r39038 - in grass/branches/develbranch_6/gui/wxpython: . gui_modules icons

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 6 02:51:21 EDT 2009


Author: martinl
Date: 2009-09-06 02:51:21 -0400 (Sun, 06 Sep 2009)
New Revision: 39038

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py
   grass/branches/develbranch_6/gui/wxpython/icons/icon.py
   grass/branches/develbranch_6/gui/wxpython/wxgui.py
Log:
wxGUI: new hotkeys (Alt+R/V) to raster/vector map layer
       (merge from trunk, r39037)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py	2009-09-06 06:44:19 UTC (rev 39037)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py	2009-09-06 06:51:21 UTC (rev 39038)
@@ -556,8 +556,7 @@
         event.Skip()
         
     def OnKeyDown (self, event):
-        """
-        Do some work when the user press on the keys: up and down:
+        """!Do some work when the user press on the keys: up and down:
         move the cursor left and right: move the search
         """
         skip = True

Modified: grass/branches/develbranch_6/gui/wxpython/icons/icon.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/icons/icon.py	2009-09-06 06:44:19 UTC (rev 39037)
+++ grass/branches/develbranch_6/gui/wxpython/icons/icon.py	2009-09-06 06:51:21 UTC (rev 39038)
@@ -187,9 +187,9 @@
                                 label=_("Save current workspace to file")),
     # TODO: "layer" is not conformant with GRASS vocabulary (vector layer: 1..x) ! 
     "addrast"    : MetaIcon (img=Icons["addrast"],
-                             label=_("Add raster map layer")),
+                             label=_("Add raster map layer (Alt+R)")),
     "addvect"    : MetaIcon (img=Icons["addvect"],
-                             label=_("Add vector map layer")),
+                             label=_("Add vector map layer (Alt+V)")),
     "addcmd"     : MetaIcon (img=Icons["addcmd"],
                              label=_("Add command layer")),
     "addgrp"     : MetaIcon (img=Icons["addgrp"],

Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2009-09-06 06:44:19 UTC (rev 39037)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2009-09-06 06:51:21 UTC (rev 39038)
@@ -137,8 +137,8 @@
         self.toolbar   = self.__createToolBar()
         
         # bindings
-        self.Bind(wx.EVT_CLOSE,     self.OnCloseWindow)
-        self.Bind(wx.EVT_LEFT_DOWN, self.AddRaster, self.notebook)
+        self.Bind(wx.EVT_CLOSE,    self.OnCloseWindow)
+        self.Bind(wx.EVT_KEY_UP,   self.OnKey)
 
         # minimal frame size
         self.SetMinSize((500, 400))
@@ -1473,6 +1473,22 @@
                 self.curr_page.maptree.DeleteChildren(layer)
             self.curr_page.maptree.Delete(layer)
         
+    def OnKey(self, event):
+        """!Check hotkey"""
+        try:
+            kc = chr(event.GetKeyCode())
+        except ValueError:
+            event.Skip()
+            return
+        
+        if event.AltDown():
+            if kc == 'R':
+                self.OnAddRaster(None)
+            elif kc == 'V':
+                self.OnAddVector(None)
+        
+        event.Skip()
+        
     def OnCloseWindow(self, event):
         """!Cleanup when wxGUI is quit"""
         if not self.curr_page:



More information about the grass-commit mailing list