basically what I try to do now is a basic GUI designer (it does not replicate Introjucer functionallity, those are different GUI elements). I decided to have a toolbar with possible elements and let the user drag the items he wants from the toolbar. My problem is that the dragging works only within the toolbar but when the items get's out, it is no longer visible until I move the mouse within the toolbar area again.
Well, this may not be toolbar related. It may actually be just that I don't use the Drag&Drop functionality in a correct way. In the docs, it is written, that the topmost component (the parent of the things to drag) should inherit DragAndDropContainer and the component to recieve the dropped items should inherit DragAndDropTarget. When the drag event occurs the dragged item should call the DragAndDropContainer's startDragging(). I tried to understand how the Demo application uses DragAndDrop so that I can implement it in the same way. The WidgetsDemo uses Drag&Drop but the it does not call the startDragging() method from anywhere. Fulltext search in the file is a no match.
Since I couldn't figure out the usage from the demo I did just what the documentation says. My top level content component inherits a DragAndDropContainer and it has two child objects. The toolbar and then something I called LayoutDesignComponent and it just inherits Component and DragAndDropTarget.
On the toolbar I have some buttons whith overloaded mouseDrag() method, which calls findParentDragContainerFor() which should return the top level content component (obviously it does) and call startDragging() on this object. The thing is - as stated on top of this post - the item being dragged is visible only until it leaves the toolbar. Also itemDropped() is never called.
Toolbar itself has some dragging functionality implemented to customize it's layout, so I hope it does not collide with what I try to do here. Is there any reason the above described hierarchy should not work?
This post is possibly longer than it should be, I just tried to be as descriptive as possible...