Page 1 of 1

MultiColumnList Drag & Drop

Posted: Sun Nov 01, 2009 19:22
by Tiresias
Hello

I would like to implement a simple drag & drop (one item in a list dragged and dropped in the very same list, but at another position), if y could have some help to start because i have no idea ,

thanks

Re: MultiColumnList Drag & Drop

Posted: Mon Nov 02, 2009 20:40
by Jamarr
Hi. What search terms did you try?

I am not familiar with the Drag & Drop feature, however from searching the forum and searching the wiki it sounds like Drag & Drop is only supported for window-based elements. Since MultiColumnList uses ListboxItem which is not window-based (as mentioned in those links) it appears that the MultiColumnList does not support Drag & Drop by default.

Re: MultiColumnList Drag & Drop

Posted: Tue Nov 03, 2009 17:01
by Tiresias
Hello

yes i found the topics and i wanted to be sure it was not really possible, thinking that i may have missed something,

actuallymulticolumnlist is window based, so maybe creating dragcontainer for each item something like this?

dont know maybe someone managed to build a custom class?

Re: MultiColumnList Drag & Drop

Posted: Tue Nov 03, 2009 19:25
by Jamarr
Tiresias wrote:actuallymulticolumnlist is window based


Jamarr wrote:Since MultiColumnList uses ListboxItem which is not window-based

Re: MultiColumnList Drag & Drop

Posted: Wed Nov 04, 2009 08:01
by Tiresias
Actually maybe i have an idea, why not doing something like:

get the event click on the list,
if this is on listitem , store "a drag flag", store list position , and change MouseCursor to listitem image (i am associating image with each listitem),
then capture event click release (would have to check if there is such event),
if drag flag was on then find new position, delete item from list and reinsert it new position?

of course if mouse move outside list maybe clear drag flag etc, need to think about this,

if someone did it this way it would be nice to hear from him,

dont know if cegui handle mousemove need to check this, not sure at all actually,

(edit: i checked and all events are there (EventMouseMove, MouseLeave, etc), so i believe it *should* work , i will try and let you know, if someone (jamar yes i know its not supported :lol: ) please let me know)

cheers

Re: MultiColumnList Drag & Drop

Posted: Wed Nov 04, 2009 17:19
by Jamarr
It's not supported by default. I never said you couldn't do it yourself. Had you actually searched the forum you would see that others have implemented it themselves. It's obvious you do not understand English that well. Anyway, your approach sounds reasonable, good luck.