Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MouseEnter
Message
From
24/02/2012 14:08:34
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Vista
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01536382
Message ID:
01536472
Views:
51
>I think the issue is with Wait Window Nowait not with MouseEnter or MouseLeave, as as soon as you move the mouse the wait window closes, so you need to stop your mouse movement just when the wait windows appear, which must be why you see it working occasionally, ie try this:

Wait waits for a click or keypress, and shouldn't be sensitive to mouse movements. However, it can interfere with MouseEnter, as it's a window unto itself, and its (implied) .show() may disturb the events, your form may briefly lose focus and generally gets in the way. I suspect the same with your
ACTIVATE SCREEN, which would fire .deactivate() of the current form. Even though are supposed to happen after the observed event occurs, they may influence the events which should happen next.

For tracking stuff like this, I don't even trust the debugger, as it's a set of windows unto itself, and interferes with activate/deactivate because it takes focus. I'd rather do some silent logging - event tracking, coverage, my own logging, debugout - whichever is handier at the moment.

>
>loForm		= CREATEOBJECT('myForm')
>loForm.Show(1)
>
>
>DEFINE CLASS myForm as Form
>	ADD OBJECT myTextbox as myTextbox
>	ADD OBJECT myWWTextbox as myWWTextbox WITH TOP = 22
>ENDDEFINE
>
>DEFINE CLASS myTextbox as TextBox
>	PROCEDURE MouseEnter(nButton, nShift, nXCoord, nYCoord)
>		ACTIVATE SCREEN
>		? 'Mouse entered at ', DATETIME()
>	ENDPROC
>	
>	PROCEDURE MouseLeave(nButton, nShift, nXCoord, nYCoord)
>		ACTIVATE SCREEN
>		? 'Mouse left at ', DATETIME()
>	ENDPROC
>ENDDEFINE
>
>DEFINE CLASS myWWTextbox as TextBox
>	PROCEDURE MouseEnter(nButton, nShift, nXCoord, nYCoord)
>		WAIT WINDOW 'Mouse entered at ' + TRANSFORM(DATETIME()) NOWAIT
>	ENDPROC
>	
>	PROCEDURE MouseLeave(nButton, nShift, nXCoord, nYCoord)
>		WAIT WINDOW 'Mouse left at ' + TRANSFORM(DATETIME()) NOWAIT
>	ENDPROC
>ENDDEFINE
>
>
>
>
>>Hi All
>>Is there a trick to get MouseEnter and MouseLeave to work on a Textbox?
>>If I use the Wait Window Nowait function in MouseEnter nothing happens most of the time when the mouse enters. Very occasionally it does, but very intermittant.
>>Thanks and regards
>>John

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform