Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detect Click or Double Click in a Browse Win

Status
Not open for further replies.

RiverPlate

Programmer
Feb 5, 2004
5
AR
FPW Friends !

Is there a right way to detect mouse click or double click in a Browse window ?
Thanks !
RP
 
Have you looked at your Foxpro Help file for MDOWN()?

You can use this to determine if the Mouse has been clicked.

I have never needed the Double Click, but I am guessing that you could use the ON KEY LABEL to create your own routine to look for Double Click.

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
For a single click, you can just use:
Code:
ON KEY LABEL LeftMouse KEYBOARD('{ENTER}')

For a double click, you need a little more code. In your main or startup .prg, add these lines:
Code:
ON KEY LABEL leftmouse DO mhandler
STORE SECONDS() TO m.m_timeout
STORE .F. TO doubleclicked
_DBLCLICK = .25

Then, add this procedure, either in your main or some procedure file:
Code:
PROCEDURE mhandler
IF SECONDS() < m.m_timeout
   =INKEY(0, 'HM')
   doubleclicked = .T.
   KEYBOARD("{ENTER}")
ELSE
   STORE SECONDS()+_DBLCLICK TO m.m_timeout
ENDIF ( SECONDS() < m.m_timeout )
RETURN

Now keep in mind, it's not going to really sense where the mouse cursor is. Just the text cursor as if you had removed your hand from the mouse and pressedthe enter key.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top