Drag grid item to another grid

Utilities like DBU, Make, IDE written in HMG/ used to create HMG based applications

Moderator: Rathinagiri

EduardoLuis
Posts: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: Drag grid item to another grid

Post by EduardoLuis »

Hey Edward. What a great job. Excelente and usefull implementación. Congratulaciones.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Drag grid item to another grid

Post 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
Viva INTERNATIONAL HMG :D
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Drag grid item to another grid

Post by mol »

We have no leader now, who will create new versions.
It's really sad.

Thanks Edward for your great work!
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: Drag grid item to another grid

Post 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
BPD
Convert Dream into Reality through HMG
edk
Posts: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Drag grid item to another grid

Post 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 267 times
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Drag grid item to another grid

Post 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
edk
Posts: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Drag grid item to another grid

Post 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 265 times
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Drag grid item to another grid

Post by serge_girard »

Thanks Edward ! And no need to apologize !!!

Serge
There's nothing you can do that can't be done...
edk
Posts: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Drag grid item to another grid

Post 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 263 times
(DragAndDrop.prg is untouched)
Post Reply