Reorder group elements

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
kevin007
Posts: 40
Joined: Mon Sep 21, 2015 7:46 am

Reorder group elements

Post by kevin007 »

Hi all,

I have a group it contains another subgroup. Please see the below attached image. when I drag item1 below, all item inside item1 should be placed in current location, is it possible. :roll:

Thanks
Kevin
Attachments
drag.png
drag.png (6.9 KiB) Viewed 12402 times
--
Thanks
Kevin
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Reorder group elements

Post by dunbarx »

Hi.

Not sure what you mean. Is each of the "items" listed its own group? It may just be that you have to set "the selectGroupedControls" to "true". Read about this in the dictionary, and experiment.

Or if I am not understanding, write back.

Craig Newman
trinitylogics
Posts: 7
Joined: Mon Jul 02, 2018 4:17 am

Re: Reorder group elements

Post by trinitylogics »

I'm sure after three years Kevin, this has been solved. Any luck on a comprehensive solution? I'm working on this now for fun and just need to solve the scrolling issue.

Thanks,

E
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Reorder group elements

Post by jacque »

Look at the relayer command and see if that helps.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
trinitylogics
Posts: 7
Joined: Mon Jul 02, 2018 4:17 am

Re: Reorder group elements

Post by trinitylogics »

Thanks Jacque,

That’s great advice. I do use that command to reorder the list once an item is dropped into its new place. Of course this assumes the layers are supposed to be from top to bottom on the y-axis. Can’t think of a reason not to have it like that.

Anyway, the behavior is done and I’ll post a demo stack as soon as I clean it up if anyone is interested.
trinitylogics
Posts: 7
Joined: Mon Jul 02, 2018 4:17 am

Re: Reorder group elements

Post by trinitylogics »

Here's a demo of drag/drop to reorder a list of grouped items. It uses graphics as the list items for now, but should support any type of list item as well as mixed list items or different sizes.

Any feedback is welcome and if someone has solved this already, I'd love to see the code if available.
Attachments
DragOrderList.livecode.zip
(5.93 KiB) Downloaded 584 times
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2734
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Reorder group elements

Post by jmburnod »

Hi trinitylogics,
Thank you for sharing.
I noticed an issue when you drag an item to the end of the list.
For example if you drag item 1 to the end list it seems disappear but it comes just after item 11 with a reduced height.
DragOrderListIssue.png
DragOrderListIssue.png (6.67 KiB) Viewed 11955 times
Best regards
Jean-Marc
(OSX 10.13, LC indy 9.0.0)
https://alternatic.ch
trinitylogics
Posts: 7
Joined: Mon Jul 02, 2018 4:17 am

Re: Reorder group elements

Post by trinitylogics »

Thanks Jean-Marc,

Found the problem.
micmac
Posts: 57
Joined: Mon May 30, 2011 9:00 am

Re: Reorder group elements

Post by micmac »

Hi

Did anyone fix the bug mentioned in the next-last post

Mic
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2734
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Reorder group elements

Post by jmburnod »

Sorry no idea
You maybe try to send a private message to trinitylogics
Best regards
Jean-Marc
https://alternatic.ch
micmac
Posts: 57
Joined: Mon May 30, 2011 9:00 am

Re: Reorder group elements

Post by micmac »

I did, Jean-Marc, but have not had any reply.

This thread is his only share.

Looking at the code he looks like a pro.

Mic
micmac
Posts: 57
Joined: Mon May 30, 2011 9:00 am

Re: Reorder group elements

Post by micmac »

Hi

If it has interest for any of you, this is a horizontal version of the above stack by trinityLogics.

Mic
DragOrderListHorizontal.livecode.zip
(6.22 KiB) Downloaded 579 times
Post Reply