Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Loosing What is Typed In a Field (even different)
Message
From
20/06/2011 17:39:58
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01515194
Message ID:
01515209
Views:
51
>>>>Any tricky code in the methods that fire when navigating from one page to another?
>>>
>>>Yes... the tabbing is grabbed by a method that moves the Mouse to a position on the screen (the Tabs of the PageFrame) and click on the tabs to move to the various pages....
>>
>>That seems complicated and problem-prone. It may be simpler to have the code set the PageFrame.ActivePage appropriately.
>
>I never liked the code that was in there for that.... I will take a closer look at it.... here is the code from that is from the
>
>Keypress Event of one of the currency text fields in question...
>
>
>LPARAMETERS nKeyCode, nShiftAltCtrl
>DO CASE
>	CASE nKeyCode = -1
>		SessionMgr("frmRx","forms_rx",-1,"Rx",.T.,"",0)
>	CASE nKeyCode = -2
>		Thisform.m_JumpToTab(2)
>		NODEFAULT
>	CASE nKeyCode = -3
>		Thisform.m_JumpToTab(3)
>		NODEFAULT
>	CASE nKeyCode = -4
>		Thisform.m_JumpToTab(4)
>		NODEFAULT
>	CASE nKeyCode = -5
>		Thisform.m_JumpToTab(5)
>		NODEFAULT
>	CASE nKeyCode = -6
>		Thisform.m_JumpToTab(6)
>		NODEFAULT
>	CASE nKeyCode = -7
>		Thisform.m_JumpToTab(7)
>		NODEFAULT
>ENDCASE
>
>
>and Thisform.m_JumpToTab
>
>
>LPARAMETERS tnPage
>LOCAL lnMouseRow, lnMouseCol
>
>* 2/24/05 STB
>* I would love to use pgfData.ActivePage = <Set to page>, but it does not work the same as
>* a mouse click.  Maybe someday perhaps?
>
>lnMouseRow = MROW("frmRx",3)
>lnMouseCol = MCOL("frmRx",3)
>
>WITH ThisForm.pgfScreen.RapidPage.pgfData
>	DO CASE
>		*TMN 10/26/2010 - to try and fix the random closing of Rx window from entering drug quantities
>		CASE tnPage = 1		&& Rx
>			MOUSE CLICK AT 20,1 PIXELS WINDOW "frmRx"
>		*TMN 10/26/2010
>	
>		CASE tnPage = 2		&& Patient
>			MOUSE CLICK AT 20,100 PIXELS WINDOW "frmRx"
>		CASE tnPage = 3		&& Drug
>			MOUSE CLICK AT 20,200 PIXELS WINDOW "frmRx"
>		CASE tnPage = 4		&& Pricing
>			* STB 2/23/05
>			* Mouse click required because of bug when refilling from profile, and out of refills, and 
>			* OK is selected without converting to a new #.  This could be changed on a rewrite 
>			* of the way the sessionmgr works
>			MOUSE CLICK AT 20,300 PIXELS WINDOW "frmRx"
>		CASE tnPage = 5		&& Sig
>			MOUSE CLICK AT 20,400 PIXELS WINDOW "frmRx"
>		CASE tnPage = 6		&& Doctor
>			MOUSE CLICK AT 20,500 PIXELS WINDOW "frmRx"
>		CASE tnPage = 7		&& Additional
>			MOUSE CLICK AT 20,600 PIXELS WINDOW "frmRx"
>	ENDCASE
>ENDWITH
>
>IF (lnMouseRow > 0) AND (lnMouseCol > 0)
>	MOUSE AT lnMouseRow,lnMouseCol PIXELS WINDOW "frmRx"
>ENDIF
>
Interesting that "STB" has already thought about using .ActivePage.

This looks like one of those projects where extremely tight control of the UI is required. I don't envy you debugging that.

If the issue is with fast typists, maybe keystrokes are being typed while some of this navigation code is executing, causing unexpected results. It might be nice to turn off the keyboard while the code is running, and turn it back on when finished but I don't know how to do that. Something else you might try would be to issue CLEAR TYPEAHEAD, maybe as the first command in the .KeyPress event or the m_JumpToTab method.

One downside to disabling the keyboard or using CLEAR TYPEAHEAD is it can annoy fast typists, as some of their keystrokes will be lost.

One other left-field idea: the guts of the m_JumpToTab method are wrapped in a WITH...ENDWITH which seems unnecessary - I don't see any wrapped code referencing that object. There have been some weird bugs reported with WITH...ENDWITH, if it isn't necessary you could try removing it, or use explicit references instead.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform