Drag grid item to another grid

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

Moderator: Rathinagiri

huiyi_ch
Posts: 92
Joined: Sat May 21, 2016 5:27 am
Has thanked: 1 time
Been thanked: 10 times

Re: Drag grid item to another grid

Post by huiyi_ch » Tue Dec 19, 2017 6:50 am

Great and many thanks!

User avatar
tonton2
Posts: 290
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Has thanked: 7 times
Been thanked: 10 times
Contact:

Post by tonton2 » Tue Jan 09, 2018 7:37 pm

merci beaucoup!!
Beau travail
L'Algerie vous salut
Y.TABET

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

Post by mol » Tue Jan 01, 2019 1:01 pm

Hi Edward! Did you realised it for TREE control?

edk
Posts: 420
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 125 times
Been thanked: 331 times

Post by edk » Wed Jan 02, 2019 12:04 pm

Cześć Marku.
Niestety nie robiłem tego dla drzewa. Mam problem z określeniem id elementu drzewa, na którym znajduje się wskaźnik myszy w momencie rozpoczęcia przeciągania i upuszczenia (wiersz 414 i 528 w DragAndDrop.prg). Zwracana jest pozycja aktualnie wybranego elementu. 😒
Gdyby udało się to jakoś określić, dalej byłoby już "z górki". ;)
Chyba bez C się nie obejdzie, ale ja jestem "za cienki".
Attachments
DragAndDrop_0.005.7z
(4.85 KiB) Downloaded 32 times

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

Post by mol » Wed Jan 02, 2019 7:12 pm

Na razie mam nawał innej roboty - początek roku ;) no i klient jeszcze nie wymyślił, żeby przeciągać gałązki drzewa :) :)
Ale jak się odrobię, to popatrzę, czy w jakimś stopniu da się to zaadoptować do drzewa.

Pozdrawiam, Marek

edk
Posts: 420
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 125 times
Been thanked: 331 times

Post by edk » Fri Jan 04, 2019 11:40 am

Hi Marek. Just as I thought without C, it would not work.
I have made the TreeView_HitTest function, it returns the value of the handle of the tree node/item on which the mouse pointer is located. :geek:
In the attachment you have a sample using DragAndDrop on trees. You can move nodes/items within a given tree or drag from tree #1 to tree #2.
What I lack in using a tree is the insertion method "InsertItem" ;) .
The "AddItem" method adds items at the end of the node. To simulate the insert method, you would have to save the node structure, insert the item in the saved structure in the right place, delete the node and add item by item in its place. :idea:
Tree DragAndDrop.gif
Tree DragAndDrop.gif (34.8 KiB) Viewed 379 times
DragAndDrop_0.005.7z
(9.37 KiB) Downloaded 20 times

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

Post by EduardoLuis » Fri Jan 04, 2019 1:25 pm

Hi Edward:

Unfortunately i could not unzip de files (.7z), allways gives error.-
I don't want to disturb you, but could you upload in .ZIP format.-
Thanks in advance.-
Eduardo

edk
Posts: 420
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 125 times
Been thanked: 331 times

Post by edk » Fri Jan 04, 2019 1:44 pm

Here you go :
DragAndDrop_0.005.zip
(11.55 KiB) Downloaded 27 times

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

Post by EduardoLuis » Fri Jan 04, 2019 2:38 pm

Thanks EDK.-

Unziped successfully and works EXCELLENT.-
Thanks again.
Eduardo

chrisjx2002
Posts: 168
Joined: Wed Jan 06, 2010 5:39 pm
Been thanked: 2 times

Post by chrisjx2002 » Fri Jan 04, 2019 3:12 pm

Great demo!

Post Reply