Thread: Make Robot do a double click

1. Make Robot do a double click

User Peter Dunkinson (Devtest) - EB (Peter.Dunkinson@vec.vic.gov.au.nospam) posted:

I have a function that interrogates a grid control and finds the number of
rows. Number of rows is dynamic.
I can then find the row I want (eg: row 47)
I then want the robot to double click the row to activate.

How can I tell the robot to perform a double click without knowing the
co-ordinates of row 47?

Thanks

Peter Dunkinson

Peter Dunkinson
Devtest
0416-080-745

---

2. Re: Make Robot do a double click

User DAVID MARSH (DAVID.MARSH@thales-cs.com.nospam) posted:

It depends on your grid control, I had one where I could Highlight a cell
(any cell), then used the home key and I think shift page up to reach the
top lefthand corner.

Then I had 2 choices, to use the cursor key to go down one at a time to the
correct enttry, or the page down to get a new page.

Then when the cell would be in view I could work out the relative
cordinates.

So if I used cursor keys I needed to know tha maximum number of rows, and
work out if I got to my cell would it then be on the top or another line.
For this I would need to know could I continue with the down arrow to the
end, or did it stop scrolling sooner.

The Page down stuf was slight ly different, say you have 20 entries on
screen, so after the home keys trick you see 1-20, page down 21-40, page
down 41-60, then you know the horizontal coord is constant so you just have
to work out the vertical.

Nice if you do it that each row = an amount (say 10) so click point = start
point(top row) + ((required cell -1) * 10) so you want the 7th cell so 60
down from the top point.

Regards

Dave

3. Re: Make Robot do a double click

User (lgoodwin@russell.com.nospam) posted:

Once you know which row/column you want to select, you can calculate the
Coords based on cell height and width. To do this reliably, you need to
playback using the same display resolution (or add case statement that
specifies correct Coords for each resolution) and maximize the window.

Record a click on the first row/column in the grid. This is your starting
point.

If clicking anywhere on the row (any column/cell) gives you the desired
result, all you need to do is determine the height of each cell and
multiply that by the row number. If you have to click in a specific
column, you'll need to calculate the cell width(s) as well (gets a bit
more complex if each column is a different width).

HTH,

Luke

---

4. Re: Make Robot do a double click

what about just sending the keys inputKeys "{Enter}"

------------------
Robby

5. Re: Make Robot do a double click

what is known up front - meaning since the rows are dynamic how will you know which row you want to dc?

------------------

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 06:03 PM.