Home › Forums › DropMaster › Not Sure How to Do This.
- This topic has 6 replies, 3 voices, and was last updated 2018-10-30 at 8:45 am by DropMaster Support.
-
AuthorPosts
-
-
October 26, 2018 at 8:44 pm #436
Hi Ray,
I’ve tried implementing this using DropMaster, which I just purchased, but can’t quite work out how to do it.
Firstly, I would like to drag when the user holds down the <shift> key and the left mouse button, not just the left mouse button.
The second part is, I want to drag from a grid row in one application to a grid in another application. On the drop, the row will be added to the grid in the second application by passing it to a method that actually sends it to a database and then refreshes the grid.
Here’s the difficult part I can’t work out. I don’t actually want to copy the text from the grid row because it doesn’t contain all of the information I need. So what I want to do is copy additional information that’s not in the grid row. Now that’s easy to lookup but I’m not sure how to add it to the copied text.
Thanks.
Regards,
Steve
-
October 26, 2018 at 8:45 pm #437
Hi Ray,
Actually I think I’ve worked out the second part.
Regards,
Steve
-
October 26, 2018 at 8:54 pm #438
Hi Ray,
I should explain why I want to use the <shift> key with the left mouse button. I’m using a non-data aware grid that allows multiple rows to be selected. However, if I use drag and drop with the grid just using the left mouse button it causes issues with the multiple selection.
Or I guess I could just use the right mouse button, as long as that doesn’t interfere with the popup menu. I’ll give it a try.
Regards,
Steve
-
October 30, 2018 at 12:39 am #444
Hi Ray,
I tried using the right mouse button but the popup menu interferes with the drag process. I don’t really want to use the centre mouse button as I don’t know how many users have 3 button mice.
Regards,
Steve
-
October 30, 2018 at 2:23 am #445
Hi Steve,
I’ll have Jim, who is the architect of DropMaster, respond to your questions.Ray
-
October 30, 2018 at 4:47 am #448
Hi Ray,
Thanks for the reply. It’s ok now. I worked out how to do it using <shift> and right mouse button.
Regards,
Steve
-
October 30, 2018 at 8:45 am #449
Glad you got things working the way you like. I’m creating a reply below anyway for future reference in case anyone else has similar questions.
Buttons and dragging. There are lots of different possibilities for starting a drag.
TDMTextSource
has aMouseButton
property so the components know when to process a drop, and you can detect a drag with a non-standard button using the WinAPIDragDetectEx()
instead ofDragDetect()
. Take a look at the Demos\Delphi\Feedback\MouseButton.dpr project and/or search forDragDetect()
in the Demos folder to see examples.Shift key. You can detect whether the shift key is down when you’re detecting a drag by calling the WinAPI like
aShiftKeyIsDown := GetAsyncKeyState(VK_LSHIFT) or GetAsyncKeyState(VK_RSHIFT);
which will be true if either the left or right shift key is down at the moment the function is called.In terms of adding the extra data to a drag, you can either forgo the
DonorComponent
assignment and directly assign the desired content to theTDMTextSource.Text
property just before callingTDMTextSource.Execute
, or use a custom format instead of text. For the latter, see the Demos\Delphi\CustomFormats folder for examples.- This reply was modified 6 years ago by DropMaster Support.
- This reply was modified 6 years ago by DropMaster Support.
-
-
AuthorPosts
- You must be logged in to reply to this topic.