Here's the thing. I have program X. It deals with certain classes that gets drawn to screen. User can drag some of these(which I can determine with class method) around with mouse. So far things are working allright.
The classes are stored in list<GUIObject*> in order that last dragged/clicked/whatever is in front.
Certain classes which inherit from GUIObject can contain new GUIObjects which are then moved around when parent object gets moved around. This also works ATM.
What I now need to figure out is how to implement drag&drop so that when object is dropped to object that accepts child objects pushes object to front of list and child is removed from parent objects list(if it had parent). If object is dropped into object that doesn't accept childs object should return to where it was(original position is stored when drag begins). Finally if dragged object has no parent it doesn't care if target doesn't accept childs(but is added if it does).
Thought it should be easy but so far every attempt has resulted in non-working system with segmentation faults added to mix. Doh.
Any suggestions?
Bookmarks