[GRASS-SVN] r35129 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 30 23:54:04 EST 2008


Author: cmbarton
Date: 2008-12-30 23:54:04 -0500 (Tue, 30 Dec 2008)
New Revision: 35129

Modified:
   grass/trunk/gui/wxpython/gui_modules/mapdisp.py
Log:
More fixes to dragging and setting overlays.

Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2008-12-31 04:52:33 UTC (rev 35128)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2008-12-31 04:54:04 UTC (rev 35129)
@@ -891,7 +891,7 @@
         """
         Drag an overlay decoration item
         """
-        if id == 99: return
+        if id == 99 or id == '' or id == None: return
         Debug.msg (5, "BufferedWindow.DragItem(): id=%d" % id)
         x, y = self.lastpos
         dx = event.GetX() - x
@@ -1694,17 +1694,24 @@
                 self.redrawAll = None
                 ### self.OnPaint(None)
                 
-        elif self.mouse['use'] == 'pointer' and self.dragid != None:
+        elif (self.mouse['use'] == 'pointer' and 
+                self.dragid >= 0):
             # end drag of overlay decoration
+            
             if self.dragid < 99 and self.overlays.has_key(self.dragid):
                 self.overlays[self.dragid]['coords'] = self.pdc.GetIdBounds(self.dragid)
-            elif self.dragid > 100:
+            elif self.dragid > 100 and self.textdict.has_key(self.dragid):
                 self.textdict[self.dragid]['coords'] = self.pdc.GetIdBounds(self.dragid)
-                                
-            self.dragid = None
-            self.currtxtid = None
-            self.UpdateMap(render=True)
-               
+            else:
+                pass
+            
+        else:
+            pass
+
+        self.dragid = None
+        self.currtxtid = None
+        self.UpdateMap(render=True)
+                                                               
         event.Skip()
 
     def OnButtonDClick(self, event):



More information about the grass-commit mailing list