Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: Form Gotfocus is fired with not enabled
Message
De
31/03/2004 07:03:35
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
BUG: Form Gotfocus is fired with not enabled
Divers
Thread ID:
00891120
Message ID:
00891120
Vues:
48
After VFP Activate a Enabled Form,
it search a Focus object ( for when event ),
this search routine have a bug, and do this:
if all controls are enabled
and all do not have when,
then the ruotine returns false and the form it does not shoot GotFocus
.

This do a paradox:

if i put a object without When
and
if object.Enabled is true
then Form.GotFocus is not fired
else Form.GotFocus is fired


Repro:
PUBLIC oform1

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

DEFINE CLASS form1 AS form

	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"

* 
	ADD OBJECT timer1 AS timer WITH ;
		Enabled = .T., ;	&& if you put .F. Form.GotFocus/LostFocus occurs
		Height = 17, ;
		Left = 138, ;
		Top = 88, ;
		Width = 100
		
	ADD OBJECT shape1 AS shape WITH ;
		Enabled = .T., ;	&& if you put .F. Form.GotFocus/LostFocus occurs
		Height = 17, ;
		Left = 138, ;
		Top = 88, ;
		Width = 100
	
	ADD OBJECT line1 AS line WITH ;
		Enabled = .T., ;	&& if you put .F. Form.GotFocus/LostFocus occurs
		Height = 17, ;
		Left = 138, ;
		Top = 88, ;
		Width = 100

	PROCEDURE GotFocus
		? 'gotfocus'
	ENDPROC


	PROCEDURE LostFocus
		? 'lostfocus'
	ENDPROC


	PROCEDURE Activate
		? 'activate'
	ENDPROC

	PROCEDURE Deactivate
		? 'deactivate'
	ENDPROC
ENDDEFINE
Correct is:
GotFocus it is fired always.
Répondre
Fil
Voir

Click here to load this message in the networking platform