Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting mouse position?
Message
 
 
À
18/09/2011 09:40:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01523849
Message ID:
01523867
Vues:
21
>>>>>>Hi,
>>>>>>
>>>>>>How would you recommend to detect a current mouse position on the VFP application screen? What happens is a user clicks and a function from the www.news2news.com (wonderful tools) helps me to catch that the mouse was clicked. But I need to find it if it was clicked within a certain area. TIA.
>>>>>
>>>>>Would AMouseObj() do ?
>>>>
>>>>Possibly. The amouseobj() does return 3rd and 4th element having the values. Now I will have to figure out how to fine the coordinates of a button on the screen so that I can compare if click was within button. Just in case you are thinking why not simply check in the button properties, it does not work. The button is on the screen but the program is in a long DO WHILE loop and button click does not fire. I tried to put DOEVENT and somehow it didn't help. So I am working on an alternative approach.
>>>>Thank you very much for your help.
>>>
>>>
>>>Look at the first two elements of the array
>>>
>>>If I add a command button to _screen, move the mouse over it, and then do =AmouseObj(aa)
>>>
>>>aa[1] = the commandbutton
>>>aa[2] = _screen
>>
>>Thank you. Good point. I was only checking the 3rd and 4th elements.
>
>
>Right - be sure to check the return value of amouseobj()
>
>When the mouse is over the command window, it returns zero. I guess it only returns 4 when there's an object under the mouse - hence its name
>
>When the mouse in _screen ( and not on a command button or so) the first two elements of the array are _screen

Thank you for your help.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform