Drag grid item to another grid

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

Moderator: Rathinagiri

EduardoLuis
Posts: 610
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina
Has thanked: 1 time
Been thanked: 40 times

Re: Drag grid item to another grid

Post by EduardoLuis » Fri Jan 11, 2019 4:28 pm

Hey Edward. What a great job. Excelente and usefull implementación. Congratulaciones.

User avatar
esgici
Posts: 4481
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 357 times
Been thanked: 108 times
Contact:

Post by esgici » Fri Jan 11, 2019 8:48 pm

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: 3097
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 188 times
Been thanked: 99 times
Contact:

Post by mol » 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!

User avatar
bpd2000
Posts: 1041
Joined: Sat Sep 10, 2011 4:07 am
Location: India
Has thanked: 176 times
Been thanked: 85 times

Post by bpd2000 » Sat Jan 12, 2019 4:30 am

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: 403
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 118 times
Been thanked: 321 times

Post by edk » Sat Jan 12, 2019 5:56 pm

A small bug fix when adding / inserting a node to the root of the tree.
DragAndDrop_0.006b.zip
(17.99 KiB) Downloaded 24 times


User avatar
mol
Posts: 3097
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 188 times
Been thanked: 99 times
Contact:

Post by mol » 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

edk
Posts: 403
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 118 times
Been thanked: 321 times

Post by edk » Tue Jan 15, 2019 9:46 am

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 11 times

User avatar
serge_girard
Posts: 2179
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 482 times
Been thanked: 108 times
Contact:

Post by serge_girard » Tue Jan 15, 2019 10:34 am

Thanks Edward ! And no need to apologize !!!

Serge

edk
Posts: 403
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 118 times
Been thanked: 321 times

Post by edk » Tue Jan 15, 2019 11:18 am

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

Post Reply