浏览代码

wxGUI/wxIClass: don't bind context menu action again

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@50311 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 13 年之前
父节点
当前提交
381ea65d0c
共有 2 个文件被更改,包括 6 次插入5 次删除
  1. 4 4
      gui/wxpython/iclass/dialogs.py
  2. 2 1
      gui/wxpython/iclass/frame.py

+ 4 - 4
gui/wxpython/iclass/dialogs.py

@@ -358,10 +358,10 @@ class CategoryListCtrl(wx.ListCtrl,
         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()
-
-        self.Bind(wx.EVT_MENU, self.OnZoomToAreasByCat, id = self.popupZoomtoAreas)
+           
+        if not hasattr(self, "popupZoomtoAreas"):
+            self.popupZoomtoAreas = wx.NewId()
+            self.Bind(wx.EVT_MENU, self.OnZoomToAreasByCat, id = self.popupZoomtoAreas)
 
         # generate popup-menu
         menu = wx.Menu()

+ 2 - 1
gui/wxpython/iclass/frame.py

@@ -672,6 +672,7 @@ class IClassMapFrame(DoubleMapFrame):
         #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 @@ class IClassMapFrame(DoubleMapFrame):
             
         # 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 \