Not Sure How to Do This.

Home Forums DropMaster Not Sure How to Do This.

Viewing 6 reply threads
  • Author
    Posts
    • #436
      Steve Gill
      Participant

        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

      • #437
        Steve Gill
        Participant

          Hi Ray,

          Actually I think I’ve worked out the second part.

          Regards,

          Steve

        • #438
          Steve Gill
          Participant

            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

          • #444
            Steve Gill
            Participant

              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

            • #445
              Ray Konopka
              Keymaster

                Hi Steve,
                I’ll have Jim, who is the architect of DropMaster, respond to your questions.

                Ray

              • #448
                Steve Gill
                Participant

                  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

                • #449
                  DropMaster Support
                  Participant

                    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 a MouseButton property so the components know when to process a drop, and you can detect a drag with a non-standard button using the WinAPI DragDetectEx() instead of DragDetect(). Take a look at the Demos\Delphi\Feedback\MouseButton.dpr project and/or search for DragDetect() 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 the TDMTextSource.Text property just before calling TDMTextSource.Execute, or use a custom format instead of text. For the latter, see the Demos\Delphi\CustomFormats folder for examples.

                Viewing 6 reply threads
                • You must be logged in to reply to this topic.