Hello all,
I have a PythonCard application using a tree control displaying
something akin to this:
- Root Item
- Foo
.Sub1
.Sub2
- Bar
.Sub3
.Sub4
And I want to enable a drag and drop feature where a user could just
grab "Bar" and drag it to "Foo" to get something akin to this:
- Root Item
- Foo
.Sub1
.Sub2
.Sub3
.Sub4
I haven't really gone very far into the drag and drop functionality yet;
I am putting this out to the mailing list for feedback, etc. I'm
basically trying to merge items via drag and drop. =20
Using the message watcher, I can see there is a mouseDrag event
occurring so I am quite sure I can do a .HitTest to determine which item
is being dragged. I don't see a "mouseDrop" type event but I figure I
can just flag that a drag started and then trap the mouseUp event, do
another HitTest to determine which item the first was dropped onto and
go from there.
One thing I'd like to do as part of this for user feedback is to make it
visually appear the original item is indeed being "dragged" across the
screen. I am thinking I could create a small opaque-ish window much
like a tooltip window that starts out on top of the selected item (the
item being dragged), with the same text in it, and moves with the mouse
during the drag, but is there any built-in functionality for doing that?
Also, as a dragged item moves across other items, I want to update the
selected item to reflect which item the user would be dropping the
dragged one onto as well as update the mouse cursor to indicate items
that cannot be dropped onto. (For instance, items could only be merged
with items of the same depth on the tree or possibly promoted to a
higher level, but not demoted, so to speak.) Is there a "circle with a
line through it" mouse pointer? =20
Lastly, should I be able to do this in a way that will work seamlessly
on both Linux and Windows systems?
I'm just getting started adding the drag and drop to this application so
I'll be testing ideas over the next few days. Any feedback is greatly
appreciated.
Thanks in advance,
-Aaron Howard
Infinity Thrice, LLC
http://www.inthri.com
|