[GRASS-SVN] r50311 - grass/trunk/gui/wxpython/iclass

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jan 20 05:01:01 EST 2012


Author: annakrat
Date: 2012-01-20 02:01:01 -0800 (Fri, 20 Jan 2012)
New Revision: 50311

Modified:
   grass/trunk/gui/wxpython/iclass/dialogs.py
   grass/trunk/gui/wxpython/iclass/frame.py
Log:
wxGUI/wxIClass: don't bind context menu action again

Modified: grass/trunk/gui/wxpython/iclass/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/iclass/dialogs.py	2012-01-20 09:28:44 UTC (rev 50310)
+++ grass/trunk/gui/wxpython/iclass/dialogs.py	2012-01-20 10:01:01 UTC (rev 50311)
@@ -358,11 +358,11 @@
         item, flags = self.HitTest((event.GetX(), event.GetY()))
         if item != wx.NOT_FOUND and flags & wx.LIST_HITTEST_ONITEM:
             self.rightClickedItemIdx = item
-            
-        self.popupZoomtoAreas = wx.NewId()
+           
+        if not hasattr(self, "popupZoomtoAreas"):
+            self.popupZoomtoAreas = wx.NewId()
+            self.Bind(wx.EVT_MENU, self.OnZoomToAreasByCat, id = self.popupZoomtoAreas)
 
-        self.Bind(wx.EVT_MENU, self.OnZoomToAreasByCat, id = self.popupZoomtoAreas)
-
         # generate popup-menu
         menu = wx.Menu()
         menu.Append(self.popupZoomtoAreas, _("Zoom to training areas of selected class"))

Modified: grass/trunk/gui/wxpython/iclass/frame.py
===================================================================
--- grass/trunk/gui/wxpython/iclass/frame.py	2012-01-20 09:28:44 UTC (rev 50310)
+++ grass/trunk/gui/wxpython/iclass/frame.py	2012-01-20 10:01:01 UTC (rev 50311)
@@ -672,6 +672,7 @@
         #check if vector has any areas
         vectorInfo = grass.vector_info(vector)
         numAreas = Vect_get_num_areas(self.poMapInfo)
+        print numAreas
         
         if numAreas <= 0:
             GMessage(parent = self,
@@ -681,7 +682,7 @@
             
         # check if vector is inside raster
         rasterInfo = grass.raster_info(groupLayers[0])
-        
+        print vectorInfo
         if vectorInfo['north'] > rasterInfo['north'] or \
            vectorInfo['south'] < rasterInfo['south'] or \
            vectorInfo['east'] > rasterInfo['east'] or \



More information about the grass-commit mailing list