Page 6 of 7

Re: Drag grid item to another grid

Posted: Fri Jan 11, 2019 4:28 pm
by EduardoLuis
Hey Edward. What a great job. Excelente and usefull implementación. Congratulaciones.

Re: Drag grid item to another grid

Posted: Fri Jan 11, 2019 8:48 pm
by esgici
edk wrote:
Fri Jan 11, 2019 1:50 pm
As promised here is the next version.
Added:
- support for Ctrl and Shift while dragging and dropping.
With the Shift key, you can move items by changing the position in the tree, with the Ctrl key we perform a copy operation.
- handling the context menu when dropping the right mouse button on tree # 2 (Copy / Move)
- handling the context menu of tree # 2 (on the tree item/node: Rename / Delete / Add as child ; in the empty tree space: Add New As Root )
- there is a new method for the tree: InsertItem
As I did not integrate this method with HMG sources, we call it as a function: _InsertItem (ControlName, FormName, cValue, nInsertPos, [aImage], [Id]).

Now you can build a tree using the context menu. :)
Tree.gif
DragAndDrop_0.006.zip
Enjoy.
We have many contribution code like this;

thanks to these successful participants.

Sadly adding this useful codes to the core of HMG not likely in the near future :(

there isn't a way adding them to next releases of HMG under a new section namely such "contributions" :?:


Viva HMG, builder, developers, contributors, participants and followers :D

Re: Drag grid item to another grid

Posted: Fri Jan 11, 2019 9:45 pm
by mol
We have no leader now, who will create new versions.
It's really sad.

Thanks Edward for your great work!

Re: Drag grid item to another grid

Posted: Sat Jan 12, 2019 4:30 am
by bpd2000
mol wrote:
Fri Jan 11, 2019 9:45 pm
We have no leader now, who will create new versions.
It's really sad.

Thanks Edward for your great work!
+1

Re: Drag grid item to another grid

Posted: Sat Jan 12, 2019 5:56 pm
by edk
A small bug fix when adding / inserting a node to the root of the tree.
DragAndDrop_0.006b.zip
(17.99 KiB) Downloaded 42 times

Re: Drag grid item to another grid

Posted: Sun Jan 13, 2019 9:25 am
by mol
thank you!

Re: Drag grid item to another grid

Posted: Mon Jan 14, 2019 8:27 am
by mol
In last sample, when I move Item 2.2.8 to Item 2.2.7 - look ok, but when I drag Item 2.2.7 to Item 2.2 (its parent - nothing should happened) Item 2.2.8 is lost

Re: Drag grid item to another grid

Posted: Tue Jan 15, 2019 9:46 am
by edk
mol wrote:
Mon Jan 14, 2019 8:27 am
In last sample, when I move Item 2.2.8 to Item 2.2.7 - look ok, but when I drag Item 2.2.7 to Item 2.2 (its parent - nothing should happened) Item 2.2.8 is lost
Fixed.
I apologize to all interested. :oops:
DragAndDrop_0.006b.zip
(17.99 KiB) Downloaded 32 times

Re: Drag grid item to another grid

Posted: Tue Jan 15, 2019 10:34 am
by serge_girard
Thanks Edward ! And no need to apologize !!!

Serge

Re: Drag grid item to another grid

Posted: Tue Jan 15, 2019 11:18 am
by edk
Sample for a tree that uses IDs.
Unfortunately, in this variant there are constraints based on the necessity of assigning new IDs when copying/adding tree elements. Also, you would need to give ID for elements dragged from other controls like textbox or from other trees, which is why these functionalities have been removed.
DragAndDrop_0.006b_IDs.zip
(11.58 KiB) Downloaded 27 times
(DragAndDrop.prg is untouched)