russell: thuban/Thuban/UI view.py,1.63,1.64

cvs@intevation.de cvs at intevation.de
Mon Dec 27 17:31:35 CET 2004


Author: russell

Update of /thubanrepository/thuban/Thuban/UI
In directory doto:/tmp/cvs-serv647/Thuban/UI

Modified Files:
	view.py 
Log Message:
The middle button now pans the map view.



Index: view.py
===================================================================
RCS file: /thubanrepository/thuban/Thuban/UI/view.py,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- view.py	13 Dec 2004 18:26:11 -0000	1.63
+++ view.py	27 Dec 2004 16:31:32 -0000	1.64
@@ -24,6 +24,7 @@
      wxPaintDC, wxColour, wxClientDC, wxINVERT, wxTRANSPARENT_BRUSH, wxFont,\
      EVT_PAINT, EVT_LEFT_DOWN, EVT_LEFT_UP, EVT_MOTION, EVT_LEAVE_WINDOW, \
      wxPlatform, wxBeginBusyCursor, wxEndBusyCursor, wxFileDialog, wxSAVE, \
+     EVT_MIDDLE_DOWN, EVT_MIDDLE_UP, \
      wxOVERWRITE_PROMPT, wxID_OK
 
 # Export related stuff
@@ -128,6 +129,8 @@
         EVT_PAINT(self, self.OnPaint)
         EVT_LEFT_DOWN(self, self.OnLeftDown)
         EVT_LEFT_UP(self, self.OnLeftUp)
+        EVT_MIDDLE_DOWN(self, self.OnMiddleDown)
+        EVT_MIDDLE_UP(self, self.OnMiddleUp)
         EVT_MOTION(self, self.OnMotion)
         EVT_LEAVE_WINDOW(self, self.OnLeaveWindow)
         wx.EVT_SIZE(self, self.OnSize)
@@ -352,6 +355,17 @@
 
     def GetPortSizeTuple(self):
         return self.GetSizeTuple()
+
+    def OnMiddleDown(self, event):
+        self.remembertool = self.tool
+        if self.tool:
+            self.PanTool()
+        self.OnLeftDown(event)
+
+    def OnMiddleUp(self, event):
+        self.OnLeftUp(event)
+        if self.remembertool:
+            self.SelectTool(self.remembertool)
 
     def OnLeftDown(self, event):
         self.MouseLeftDown(event)





More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)