Hi
I'm working in an application that it's like an extended "
InsertPanel" example.
Basically it adds an horizontal table on top of that that acts as a widget templates panel; the user can drag a widget and drop it into one of the columns. Because of the template nature, the widgets in the top horizontal table shouldn't dissappear when dropped in the columns, so to achieve that I've taken the
Palette Example approach and clone the item being dropped (overriding the remove(Widget w) method of the top horizontal panel, see the
PalettePanel file).
[ ] [ ] [ ]
[ Widget 1 ] [ Widget 2 ] [ Widget 3 ]
[ ] [ ] [ ]
[-- Column 1 --] [-- Column 2 --]
[Widget 1] [Widget 1]
[Widget 2] [Widget 2]
[Widget 2]This top horizontal panel doesn't have a drop handler associated (it doesn''t accept widgets).
The problem is that the item is cloned
before the user drops the widget, so if the user stops the drop operation the widget gets cloned in the horizontal panel. Even a mouse click "clones" the widget, as can be seen in the Palette Example.
How can I achieve this? I think that the widget must be cloned at the end of the dop operation, and not at the start of the drag, but how?
Regards
---
Asier.