[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Patch for selecting objects
From: |
Ralf Engels |
Subject: |
Patch for selecting objects |
Date: |
Tue, 24 Dec 2002 12:02:58 +0100 |
Hi,
I wanted to contribute a little bit to the Sketch project (and learn a little
bit Python)
I attached a little patch for selecting objects. Substracting, Adding and
SubSelecting did not work when another object was selected. It did toggle the
transformation frame the whole time.
Please check the patch and include it.
Then another point.
Is it possible to copy, cut and paste objects with the CVS version? The menu
entries seem to be missing.
By the way, merry chrismass....
Ralf
--
--- Sketch/Editor/selectiontool.py.old Mon Dec 23 22:47:45 2002
+++ Sketch/Editor/selectiontool.py Tue Dec 24 01:19:36 2002
@@ -28,7 +28,7 @@
import Sketch
from Sketch import _, Point, Polar, Identity, Trafo, TrafoType, Rotation
from Sketch.Base.warn import pdebug
-from Sketch.Base.const import SelectSet, SelectDrag, SELECTION, EDITED
+from Sketch.Base.const import SelectSet, SelectAdd, SelectSubtract,
SelectSubobjects, SelectDrag, SELECTION, EDITED
from Sketch.UI.skpixmaps import bitmaps
from drawer import SelectAndDrag
@@ -382,13 +382,14 @@
self.rectangle = SizeRectangle(coord_rect)
def ButtonPress(self, context, p, snapped, button, state, handle = None):
+ type = selection_type(state)
test = context.test_device()
if handle is not None:
# The user pressed the button over a handle. Prepare to drag
# at the handle
self.rectangle.SelectHandle(handle, SelectDrag)
object = self.rectangle
- elif self.editor.SelectionHit(p, test):
+ elif type == SelectSet and self.editor.SelectionHit(p, test):
# The user pressed the button over an already selected object,
# but not on a handle.
# Prepare to edit/transform the current selection
________________________
Ralf Engels
Software design engineer
www.rengels.de
- Patch for selecting objects,
Ralf Engels <=