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 18:01: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:
01515214
Views:
46
>>>>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
>
>
>Thanks!


Hi,

It could be that I dont undestand your problem, but for me when I

ThisForm.KeyPreview = .T.

and in ThisForm.KeyPress:
Lparameters nKeyCode, nShiftAltCtrl
Do Case
Case nKeyCode = -1 &&F2
	Thisform.Pageframe1.ActivePage = 1
Case nKeyCode = -2 &&F3
	Thisform.Pageframe1.ActivePage = 2
Case nKeyCode = -3 &&F4
	Thisform.Pageframe1.ActivePage = 3
Case nKeyCode = -4 &&F5
	Thisform.Pageframe1.ActivePage = 4
Case nKeyCode = -5 &&F6
	Thisform.Pageframe1.ActivePage = 5
Case nKeyCode = -6 &&F7
	Thisform.Pageframe1.ActivePage = 6
Case nKeyCode = -7  &&F8
	Thisform.Pageframe1.ActivePage = 7
Endcase
The form jumps to the pages as requested without the m_mouseJump method you have coded above.

Could very well be possible if you change your code to this your problem of loosing your typed values is also solved, although I would recommend to check before you jump to an other page if the already editted value in the text box needs to be saved or not. ( Tablebuffering(), GetnextModified() )

Regards,

Koen
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform