Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: set ActivePage doesn't lostfocus of Activecontrol
Message
From
29/09/2005 02:59:52
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Title:
BUG: set ActivePage doesn't lostfocus of Activecontrol
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01054360
Message ID:
01054360
Views:
79
Expected: set ActivePage perform the correct "change focus sequence of events"

Observed:
- Page1 is active, with Page1.Activecontrol=Text1
- set ActivePage=2
- Page2 is activate, but Page1.Activecontrol=Text1

Repro:
double click on Textbox have to fire Lostfocus
and reset Page2.forecolor to black.
This doesn't happen because Valid/lostfocus is not fired.

Repro.
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form


	ADD OBJECT pageframe1 AS pframe WITH ;
		Top = 28, ;
		Left = 46, ;
		Width = 290, ;
		Height = 188;

	PROCEDURE pageframe1.Page2.Activate
		IF TYPE("THISFORM.PAGeframe1.PAGE1.ActiveControl")=="O";
		AND THISFORM.PAGeframe1.PAGE1.ActiveControl.name=="Text1"
			MESSAGEBOX("BUG: PAGE1'S TEXTBOX IS ACTIVE")
		ENDIF
	ENDPROC
ENDDEFINE

DEFINE CLASS pframe as PageFrame 

	ADD OBJECT Page1 as Pagex

	ADD OBJECT Page2 as Page

ENDDEFINE

DEFINE CLASS Pagex as Page
	ADD OBJECT Text1 as Textbox with;
			Value = "double click here", ;
			Left = 60, ;
			ReadOnly = .T., ;
			Top = 38, ;
			Width = 151
			
	PROCEDURE text1.LostFocus
		THIS.Parent.Parent.pages[2].ForeColor = 0
	ENDPROC


	PROCEDURE text1.GotFocus
		THIS.Parent.Parent.pages[2].ForeColor = 255
	ENDPROC


	PROCEDURE text1.DblClick
		THIS.Parent.Parent.ActivePage = 2
	ENDPROC	

ENDDEFINE
Reply
Map
View

Click here to load this message in the networking platform