OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: EricStiles on June 19, 2012, 07:11:00 PM

Title: Need a list that allows dragging to change the order
Post by: EricStiles on June 19, 2012, 07:11:00 PM
What would be the tool, if any, that would put a list on the screen and then allow you to drag items in the list to change the order items in the list?
Title: Re: Need a list that allows dragging to change the order
Post by: owenwengerd on June 19, 2012, 10:40:07 PM
You can use a listbox control with "Drag/Drop Allow Begin" and "Drag/Drop Allow Drop" both set to true.
Title: Re: Need a list that allows dragging to change the order
Post by: EricStiles on June 20, 2012, 12:02:00 PM
Thank you, I'll investigate that.   
Title: Re: Need a list that allows dragging to change the order
Post by: EricStiles on June 20, 2012, 12:11:24 PM
Ok I'm working and shouldn't be doing this since I don't get paid to program but I had to see if that was what I was looking for, and IT IS!!!   Thank you, OWENWENGERD!
Title: Re: Need a list that allows dragging to change the order
Post by: Jim Short on July 11, 2016, 06:17:15 PM
This does work. What event would fire after dropping in new location so new list could be save immediately?
Title: Re: Need a list that allows dragging to change the order
Post by: Fred Tomke on July 11, 2016, 09:32:16 PM
Hi, Jim, I always set up my controls this way:

source control:
enable OnDragnDropBegin to ensure the user is allowed to drag the selected items

destination control:
enable OnDragOverFromControl to ensure the user is allowed to drop the selected items to the target
enable OnDragnDropFromControl to execute code to store the state into the databases

Regards, Fred
Title: Re: Need a list that allows dragging to change the order
Post by: Jim Short on July 12, 2016, 05:12:54 AM
Thanks Fred,
Does this work when dragging only within the same control like just changing order of the items?
Run built-in code DragDropBegin
Save with KillFocus.

Selecting additional events messes with built-in behavior.
Jim
Title: Re: Need a list that allows dragging to change the order
Post by: Fred Tomke on July 12, 2016, 07:03:08 AM
Hi, Jim,
Quote from: Jim Short on July 12, 2016, 05:12:54 AM
Does this work when dragging only within the same control like just changing order of the items?

yes, it does. Just check in the code of OnDragOverFromControl and/or OnDragnDropFromControl that the source control name is the same as the destination control name.

Regards, Fred