[GRASS-SVN] r35127 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 30 23:45:47 EST 2008


Author: cmbarton
Date: 2008-12-30 23:45:47 -0500 (Tue, 30 Dec 2008)
New Revision: 35127

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

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2008-12-30 23:39:00 UTC (rev 35126)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2008-12-31 04:45:47 UTC (rev 35127)
@@ -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