1 |
Index: Thuban/UI/view.py |
2 |
=================================================================== |
3 |
RCS file: /thubanrepository/thuban/Thuban/UI/view.py,v |
4 |
retrieving revision 1.59 |
5 |
diff -c -r1.59 view.py |
6 |
*** Thuban/UI/view.py 27 Oct 2003 13:01:58 -0000 1.59 |
7 |
--- Thuban/UI/view.py 25 Nov 2003 13:10:15 -0000 |
8 |
*************** |
9 |
*** 128,133 **** |
10 |
--- 128,134 ---- |
11 |
EVT_PAINT(self, self.OnPaint) |
12 |
EVT_LEFT_DOWN(self, self.OnLeftDown) |
13 |
EVT_LEFT_UP(self, self.OnLeftUp) |
14 |
+ wx.EVT_RIGHT_DOWN(self, self.OnRightDown) |
15 |
EVT_MOTION(self, self.OnMotion) |
16 |
EVT_LEAVE_WINDOW(self, self.OnLeaveWindow) |
17 |
wx.EVT_SIZE(self, self.OnSize) |
18 |
*************** |
19 |
*** 140,145 **** |
20 |
--- 141,150 ---- |
21 |
def PreviewBitmap(self): |
22 |
return self.bitmap |
23 |
|
24 |
+ def SelectTool(self, tool): |
25 |
+ ViewPort.SelectTool(self, tool) |
26 |
+ self.redraw() |
27 |
+ |
28 |
def PanTool(self): |
29 |
"""Start the canvas pan tool""" |
30 |
self.SelectTool(CanvasPanTool(self)) |
31 |
*************** |
32 |
*** 170,175 **** |
33 |
--- 175,182 ---- |
34 |
dc.DrawBitmap(self.bitmap, 0, 0) |
35 |
if self.selection_bitmap is not None: |
36 |
dc.DrawBitmap(self.selection_bitmap, 0, 0, True) |
37 |
+ if self.tool is not None: |
38 |
+ self.tool.DrawPermanent(dc) |
39 |
dc.EndDrawing() |
40 |
else: |
41 |
# If we've got no map or if the map is empty, simply clear |
42 |
*************** |
43 |
*** 384,389 **** |
44 |
--- 391,400 ---- |
45 |
self.drag_dc = None |
46 |
self.dragging = 0 |
47 |
self.MouseLeftUp(event) |
48 |
+ self.redraw() |
49 |
+ |
50 |
+ def OnRightDown(self, event): |
51 |
+ self.MouseRightDown(event) |
52 |
|
53 |
def OnMotion(self, event): |
54 |
if self.dragging: |
55 |
Index: Thuban/UI/viewport.py |
56 |
=================================================================== |
57 |
RCS file: /thubanrepository/thuban/Thuban/UI/viewport.py,v |
58 |
retrieving revision 1.15 |
59 |
diff -c -r1.15 viewport.py |
60 |
*** Thuban/UI/viewport.py 6 Oct 2003 17:31:31 -0000 1.15 |
61 |
--- Thuban/UI/viewport.py 25 Nov 2003 13:10:15 -0000 |
62 |
*************** |
63 |
*** 80,85 **** |
64 |
--- 80,88 ---- |
65 |
def draw(self, dc): |
66 |
pass |
67 |
|
68 |
+ def DrawPermanent(self, dc): |
69 |
+ pass |
70 |
+ |
71 |
def MouseDown(self, event): |
72 |
self.drag_start(event.m_x, event.m_y) |
73 |
|
74 |
*************** |
75 |
*** 598,603 **** |
76 |
--- 601,611 ---- |
77 |
self.set_current_position(event) |
78 |
if self.tool is not None: |
79 |
self.tool.MouseUp(event) |
80 |
+ |
81 |
+ def MouseRightDown(self, event): |
82 |
+ self.set_current_position(event) |
83 |
+ if self.tool is not None: |
84 |
+ self.tool.MouseDown(event) |
85 |
|
86 |
def MouseMove(self, event): |
87 |
self.set_current_position(event) |