Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: SelStart not work in Column.Editbox when Sparse=.F.
Message
De
22/02/2006 11:12:51
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01098093
Message ID:
01098132
Vues:
12
>This sounds like a bug. When Column.Sparse=.F. we will not be able to programmatically control the cursor position in an Editbox of a column.
>

VFP have tons of these bug types

The cause it is the read of Editbox.Value

When VFP read Editbox.Value, it lost internal editbox status.
With Sparse = .F. you have this lost every time VFP redraw the column:
- refresh
- mousescroll
- Anchor resize
- .....

Look the Grid.When side effect:
Push Key Clear
On Key Label "S" _Screen.ActiveForm.Grid1.Column1.Editbox1.SelStart=3
ACTIVATE WINDOW "Debug Output"
o=NewObject("form1")
o.Show(1)
Pop Key

Define Class form1 As Form
	Width=500
	Height=300
	Add Object Grid1 As MyGrid
	Add Object Checkbox1 As Checkbox With Top=210, Caption='Sparse', Value=.T.
	Add Object Label1 As Label With AutoSize=.T.,Top=230;
		, Caption='Push F5 to run "_Screen.ActiveForm.Grid1.Column1.Editbox1.SelStart=3"'

	Procedure Load
		Create Cursor Test (f1 m)
		Insert Into Test Values ('Text Line 1')
		Insert Into Test Values ('Text Line 2')
		Insert Into Test Values ('Text Line 3')
		Go Top

		Function Checkbox1.InteractiveChange
			Thisform.Grid1.Column1.Sparse=This.Value
			Thisform.Grid1.Column1.SetFocus
EndDefine

Define Class MyGrid As Grid
	Height = 200
	RowHeight = 60
*	Anchor = 15
	
	Add Object Column1 As EditColumn
	
	PROCEDURE WHEN
		IF this.ActiveColumn>0
			DEBUGOUT "ATTENTION, ON KEY LABEL FIRE ",PROGRAM()
		ENDIF 
EndDefine

Define Class EditColumn As Column
	Add Object Header1 As Header
	Add Object Editbox1 As EditBox1
ENDDEFINE

DEFINE CLASS EditBox1 AS EditBox 
	ScrollBars = 0
	
	PROCEDURE Value_Access
		DEBUGOUT "WHEN VFP access Value, it reset SelStart",PROGRAM(),RECNO()
		RETURN this.value
ENDDEFINE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform