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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How simulate mouse click

Status
Not open for further replies.

jematab

Programmer
Mar 4, 2002
2
BE
I have some button at top of a foxpro 2.6 screen (next, previous, quit etc ...), I want open a window if the user click on my screen (and data in window depend of location of click ...) I write

ON KEY LABEL MOUSE DO Myproc

But my buttons at top of screen don't works ...
I try, at end of procedure Myproc

KEYBOARD '{LEFTMOUSE}'

But this code don't work
I think write :

PROCEDURE Myproc
IF BETWEEN(MROW()1,3) && button's row
DO CASE
CASE BETWEEN(MCOL(),3,6) && button one
DO Button_one_proc
CASE BETWEEN(MCOL(),7,10) && button two
DO Button_two_proc
ETC. ...
ENDCASE
ELSE && body's row
... open data window
ENDIF

Someone have other idea ?

Thank you by advance




 
Jematab,
PROCEDURE Myproc
IF BETWEEN(MROW(),1,3) && button's row WITH COMMA!
DO CASE
CASE BETWEEN(MCOL(),3,6) && button one
DO Button_one_proc
CASE BETWEEN(MCOL(),7,10) && button two
DO Button_two_proc
ETC. ...
ENDCASE
ELSE && body's row
... open data window
ENDIF
* as position mouse not changed, your keyb is useless
* and create endless cycle!
retu
Tesar
 
Hmm! The problem with this is that control is ONLY with a mouse and my guess is not very tolerant of screen size!

If you define buttons e.g.
rm_pict ="canc.bmp;Next.bmp;Prev.bmp;add.bmp;edit.bmp;delete.bmp;print.bmp" (PICTURE BUTTONS)
or
rm_pict= "\?Cancel;\<Next;\<Previous;\<Add;\<Edit;\<Delete;\<Print"
(ORDINARY TEXT BUTTONS)

rm_exit=0
DO WHILE rm_exit#1

@ X,Y GET rm_exit FUNCTION "*BHT" PICTURE rm_pict SIZE 3.615,9.800,0.800 DEFAULT 0 FONT "MS Sans Serif", 8 MESSAGE "Select a Toolbar Button."

READ CYCLE
DO CASE
CASE rm_exit=2
DO mynext
CASE rm_exit=3
DO myprev
CASE rm_exit=4 etc etc
DO etc
ENDCASE
ENDDO

You will have tabable Keyboard cotrol aswell as mouse click



Bob Palmer
The most common solution is H2O!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top