Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Capture left mouse button up for srp edit table

edited December 2021 in SRP EditTable Control
Hi,

I am trying to capture the left mouse button up for the SRP Edit table.
I do this:
rv = Send_Message(@window:".GRD_ORDERS",'QUALIFY_EVENT', '0x202' ,TRUE$)

but I'm not getting the event. Is the above code supposed to work?

Comments

  • No, that would be used for the OI edit table. Have you tried the OnClick event?
  • I just noticed you are trying to trap the left mouse button up. Is up relevant versus down?
  • edited December 2021
    Yes UP is relevant.

    I am trying to implement a function that allows the user to drag their mouse over a bunch of cells to select those cells.

    To do this, I use the onMouseMove event. And it works.

    However, the grid "flashes" sometimes, and I would like to stop this. To stop this, I need to enable the onMouseMove when OnClick fires, and disable it when mouseUp fires . That way, the OnMouseMove event is only active when the mouse is in "drag" mode. This will fix the "flashing" issue.
  • So when you click on the cell with the black box around it and then drag your mouse to the right, all of those cells get selected. That's what I am doing:

  • Basically, I only want the OnMouseMove event to fire when the left mouse button is down. Now that I think about it, perhaps I can detect that directly. I will try that.
  • I understand the feature you are trying to implement but maybe I'm missing something. If you are already working with the OnMouseMove event, can't you just check the Button argument to see when it is no longer being pressed?
  • Yes i just realized that lol

    "Now that I think about it, perhaps I can detect that directly. I will try that."

    I will see how to do that.

    Thanks
  • Actually, i don't think that will work...it's a bit complicated and It will take me a while to explain it .
  • If you need to go back to the Windows API approach, note that this will not be something that our control will be exposing but rather the OLE control that Revelation Software has provided. I have qualified 0x202 before but have found that it only works with some OI controls. I've never tried it with the OLE control because we've generally exposed our own event when needed.
  • Actually, your approach does work.

    Thanks!
  • grd_orders.OnMouseMove: cell = param1 button = param3 shift_button_down = param4 ctrl_button_down = param5 if button _eqc "left" then oryxctl_srp_grid_multiselect("update_selection_drag",grd_orders$,cell) end else Set_Property(grd_orders$, "OLE.SuppressMouseMoveEvent", true$) end return

    so if the user moves the mouse but the left button isn't clicked. that means drag is over.
  • The next feature will be to make the grid automatically scroll when the user has selected a cell in the last row and wants to keep going down...
Sign In or Register to comment.