[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/designer/src LayoutEditor.py
From: |
Jason Cater |
Subject: |
gnue/designer/src LayoutEditor.py |
Date: |
Wed, 27 Jun 2001 19:41:49 -0700 |
CVSROOT: /home/cvs
Module name: gnue
Changes by: Jason Cater <address@hidden> 01/06/27 19:41:48
Modified files:
designer/src : LayoutEditor.py
Log message:
Implemented new focus method in LayoutEditor
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/LayoutEditor.py.diff?cvsroot=OldCVS&tr1=1.11&tr2=1.12&r1=text&r2=text
Patches:
Index: gnue/designer/src/LayoutEditor.py
diff -u gnue/designer/src/LayoutEditor.py:1.11
gnue/designer/src/LayoutEditor.py:1.12
--- gnue/designer/src/LayoutEditor.py:1.11 Wed Jun 27 19:26:19 2001
+++ gnue/designer/src/LayoutEditor.py Wed Jun 27 19:41:48 2001
@@ -175,8 +175,8 @@
self.getBlocks()
EVT_CHAR(self.panel, self.keyTrap)
- EVT_LEFT_UP(self.panel, self.OnLeftUp)
- EVT_LEFT_DOWN(self.panel, self.OnLeftDown)
+# EVT_LEFT_UP(self.panel, self.OnLeftUp)
+# EVT_LEFT_DOWN(self.panel, self.OnLeftDown)
EVT_RIGHT_UP(self.panel, self.OnRightUp)
EVT_MOTION(self.panel, self.OnMotion)
@@ -237,38 +237,6 @@
b = self.blockList[event.GetSelection()]
# if p != self.page:
self._instance.onSetCurrentObject(b, None)
-
-
- def OnLeftDown(self, event):
- x,y = event.GetPositionTuple()
- if wxPyTypeCast(event.GetEventObject(),'wxWindow').GetId() !=
self.panel.GetId():
- xa, ya =
wxPyTypeCast(event.GetEventObject(),'wxWindow').GetPositionTuple()
- x = x + xa
- y = y + ya
- self.x = x
- self.y = y
- self.panel.CaptureMouse()
- if not event.ShiftDown():
- for selection in self._currentSelection.keys():
- selection.setSelected(0)
- self._currentSelection = {}
- selection = None
- for t in self.positionMappings.values():
- if x >= t[0] and x <= t[2] and y >= t[1] and y <= t[3]:
- selection = t[4]
- break
- if selection != None:
- if self._currentSelection.has_key(selection):
- del self._currentSelection[selection]
- selection.setSelected(0)
- else:
- self._currentSelection[selection] = 1
- self._instance.onSetCurrentObject(selection.object,__name__)
- selection.setSelected(1)
-
-
- def OnLeftUp(self, event):
- self.panel.ReleaseMouse()
def OnRightUp(self, event):
@@ -329,24 +297,22 @@
self.recalcBoundaries()
for widget in self.mainWidget.widgets:
- widget.SetCursor (wxNullCursor)
-# if hasattr(widget, 'SetEditable'):
-# widget.SetEditable(0)
+ widget.SetCursor (wxSTANDARD_CURSOR)
if isinstance(widget, wxControl):
widget.Enable(0)
self.setAllChildren(EVT_KEY_UP, widget, self.instance.keyTrap)
self.setAllChildren(EVT_SET_FOCUS, widget, self.focusGainedTrap)
self.setAllChildren(EVT_KILL_FOCUS, widget, self.focusLostTrap)
- self.setAllChildren(EVT_LEFT_UP, widget, self.instance.OnLeftUp)
- self.setAllChildren(EVT_LEFT_DOWN, widget, self.instance.OnLeftDown)
+ self.setAllChildren(EVT_LEFT_UP, widget, self.OnLeftUp)
+ self.setAllChildren(EVT_LEFT_DOWN, widget, self.OnLeftDown)
self.setAllChildren(EVT_RIGHT_UP, widget, self.OnRightUp)
self.setAllChildren(EVT_MOTION, widget, self.instance.OnMotion)
self.setAllChildren(EVT_KEY_UP, self.highlightBox, self.instance.keyTrap)
self.setAllChildren(EVT_SET_FOCUS, self.highlightBox, self.focusGainedTrap)
self.setAllChildren(EVT_KILL_FOCUS, self.highlightBox, self.focusLostTrap)
- self.setAllChildren(EVT_LEFT_UP, self.highlightBox, self.instance.OnLeftUp)
- self.setAllChildren(EVT_LEFT_DOWN, self.highlightBox,
self.instance.OnLeftDown)
+ self.setAllChildren(EVT_LEFT_UP, self.highlightBox, self.OnLeftUp)
+ self.setAllChildren(EVT_LEFT_DOWN, self.highlightBox, self.OnLeftDown)
self.setAllChildren(EVT_RIGHT_UP, self.highlightBox, self.OnRightUp)
self.setAllChildren(EVT_MOTION, self.highlightBox, self.instance.OnMotion)
@@ -391,10 +357,29 @@
def focusLostTrap(self, event):
pass
+ def OnLeftDown(self, event):
+# self.instance.panel.CaptureMouse()
+ if not event.ShiftDown():
+ for selection in self.instance._currentSelection.keys():
+ selection.setSelected(0)
+ self.instance._currentSelection = {}
+ selection = self
+ if self.instance._currentSelection.has_key(selection):
+ del self.instance._currentSelection[selection]
+ selection.setSelected(0)
+ else:
+ self.instance._currentSelection[selection] = 1
+ self.instance._instance.onSetCurrentObject(selection.object,__name__)
+ selection.setSelected(1)
+
+
+ def OnLeftUp(self, event):
+ pass
+# self.instance.panel.ReleaseMouse()
+
def OnRightUp(self, event):
pt = event.GetPosition()
- if not self.highlightBox.selected:
- self.instance._instance.onSetCurrentObject(self.object, None)
+ self.instance._instance.onSetCurrentObject(self.object, None)
wxPyTypeCast(event.GetEventObject(),'wxWindow') \
.PopupMenu(self.object._popupMenu, pt)
- gnue/designer/src LayoutEditor.py,
Jason Cater <=