Dragging inside and outside of a view
Dragging inside and outside of a view
- Subject: Dragging inside and outside of a view
- From: Simon Stapleton <email@hidden>
- Date: Mon, 23 Sep 2002 11:48:59 +0200
Hi
Current project involves a graphical editor view (somewhat similar to
that of OmniGraffle) for layout and connection of arbitrary (well,
dynamically loaded, anyway) items. Think UML editor (not that it is,
but similar functionality). Anyroadup, it's all working quite nicely -
I can drag objects in from a palette, have popup menus working for the
view and (where provided) the objects, selction, box selection and
dragging within the view are all 100%. Nice.
However. I have a few little additions that I want to add, as follows:
- Where dragging of selected items goes out of the view _but is still
inside the window_, scroll (and dynamically resize the view if
necessary) to allow the objects to be dropped within the view.
- Where dragging of selected items goes outside of the window, shove
details of the seleted items onto the pasteboard (in
application-specific format to allow dropping onto other views in the
same application, in image format for graphical destinations, and in
RTF and text formats for textual destinations. Oh, and creation of
files for finder might be nice, too, just to drop a fly or two into the
ointment ;-) If this was an UML editor, think the ability to drag to
the finder to create files for the selected objects, drag to (for
example) PBX for class definitions, to (again, for example) preview for
a printable object diagram...
My drag handling is currently internal to the view - I'm using
-mouseDown: and -mouseUp: to pick up the start and end of internal
drags for undo/redo purposes, and doing the actual dragging in
-mouseDragged:
I'm 'rolling my own' rather than using full drag-drop functionality
here as it allows live redrawing of connections to non-selected items.
however, I suspect that I'm going to need to move to full drag and drop
for all this functionality in order to cover the requirements above - I
don't want to have to use (solely) cut and paste, 'export as' etc. to
cover that as drag and drop seems so much more usable. I don't want to
resort to modifier keys on the drag, either.
Any ideas how I can keep my live redrawing _and_ get drag and drop
working to external targets? I'm sure I'm missing something stupid.
Simon
--
PGP Key Id : 0x50D0698D
--
Well, we finally have an indoor toilet. But what new disasters have
struck the Alpenproject?
Find out at : <
http://www.tufty.co.uk/Move/index.html>
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.