Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BIG BUG: with Valid() .F. textbox can lose focus.
Message
De
27/11/2003 09:11:28
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
26/11/2003 09:35:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00853662
Message ID:
00854007
Vues:
23
>Hi,
>
>i use RETURN .F. on the Valid() event,
>so that the control does not lose focus
>when the input value is not valid.
>
>This is ok within a form, but with 2 or more forms :
>i can lose focus with a not valid value, and this is written on the Controlsource
>
>Repro code:
>
>PUBLIC ovalidviolation,oanother
>
>ovalidviolation=NEWOBJECT("valid_violation")
>oanother			=NEWOBJECT("another")
>ovalidviolation.Show
>oanother.Show
>RETURN
>
>DEFINE CLASS valid_violation AS form
>	Top = 10
>	Left = 10
>	Caption = "Form with valid check"
>
>	ADD OBJECT text2 AS textbox WITH ;
>		Left = 109, ;
>		Top = 54
>		
>	ADD OBJECT text1 AS textbox WITH ;
>		Left = 109 ;
>	,	Top = 14	;
>	,	Controlsource = "thisform.text2.Value"
>
>	ADD OBJECT label1 AS label WITH ;
>		AutoSize = .T., ;
>		Caption = "Valid if empty()", ;
>		Left = 18, ;
>		Top = 15
>
>	ADD OBJECT label2 AS label WITH ;
>		AutoSize = .T., ;
>		Caption = "ControlSource", ;
>		Left = 18, ;
>		Top = 55
>
>	PROCEDURE text1.Valid
>		RETURN EMPTY(m.this.value)
>	ENDPROC
>
>ENDDEFINE
>
>DEFINE CLASS another AS form
>	Top = 10
>	Left = 400
>	Caption = "Form with a control"
>
>	ADD OBJECT text1 AS textbox WITH ;
>		Left = 119, ;
>		Top = 14
>
>	ADD OBJECT label1 AS label WITH ;
>		AutoSize = .T., ;
>		Caption = "Click on this text", ;
>		Left = 18, ;
>		Top = 19
>
>ENDDEFINE
>
>
>User operations:
>
>0. Run This
>1. click on "Form with valid check"
>2. click on Top Textbox ( this is checked by the valid )
>3. write "pippo"
>4. click on TextBox bottom
>*** "pippo" is written on ControlSource
>*** Valid stop the lose focus
>5. click on "Form with control" title or formArea ( no textbox )
>*** Valid stop the lose focus, but events sequence is incorrect for me
>--> valid_violation.textbox.valid
>--> valid_violation.Deactivate  !!!!! why : the form is not deactivated
>--> valid_violation.Activate    !!!!! this is a patch
>--> otherForm.clickForm.MouseUp
>--> otherForm.clickForm.Click
>6. click on "Form with control" on the textBox
>*** VALID NOT STOP THE LOSE FOCUS
>--> valid_violation.textbox.Valid
>--> valid_violation.Deactivate
>--> valid_violation.Activate
>*** Now sequence continue !!!!!!
>--> otherForm.textbox.When
>--> valid_violation.textbox.LostFocus
>--> valid_violation.LostFocus
>--> valid_violation.Deactivate
>--> otherForm.Activate
>--> otherForm.GotFocus
>--> otherForm.textbox.GotFocus
>
>7. now click on "Form with valid check" on TextBox bottom
>*** you go on another control of the invalid form
>*** click on X window buton for close the invalid form
>
>
>Then the Valid() return .F. it is useless.
>
>Fabio

Fabio,
You caught a bug that exists since fox2.x (and probably 1.x) and has never been corrected.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform