Preliminary dragndrop
Charles Goodwin <[email protected]>
| Newsgroups | gmane.comp.java.xwt.widgets |
|---|---|
| Message-ID | <308906BE5D07D5119285009027D61C5722F738@NTFPS1> |
For internal drag and drop I'm going to implement a very simple model for
xwt.lib.draggable...
// useful for overriding to return
// alternative content - think 'text'
__content = function() {
root.dragndroptype = "box";
return thisbox;
}
_Press1 = function() {
_Enter = function() {
root.dragndrop = null;
}
_Leave = function() {
root.dragndrop = content;
}
root._Release1 = function() {
root.dragndrop = null;
_Enter = null;
_Leave = null;
root.Release1 = null;
}
}
Then, if an item is interested in dragndrop events, it simply does:
_Release1 = function() {
if ( root.dragndrop and root.dragndroptype == "yippee" ) ... etc