Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
2 BUGS/ISSUES: Column Autofit and CellTips
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
2 BUGS/ISSUES: Column Autofit and CellTips
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01031703
Message ID:
01031703
Vues:
71
With column's Sparse and Bound to false,

BUG/ISSUE #1: Autofit use Column.Controlsource
Workaround: disable Autofit

BUG/ISSUE #2: CellTips use Column.Controlsource
Workaround: disable Form.showTips.
PUBLIC oform1

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

DEFINE CLASS form1 AS form

	Top = 1
	Left = 0
	Height = 434
	Width = 589
	DoCreate = .T.
	ShowTips = .T.
	Caption = "Form1"
	showwindow = 2
	Name = "Form1"


	ADD OBJECT grid1 AS grid WITH ;
		Anchor = 10, ;
		Height = 332, ;
		Left = 16, ;
		Top = 76, ;
		Width = 548, ;
		Name = "Grid1"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 32, ;
		Left = 56, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "BUG: Autofit", ;
		Name = "Command1"


	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 32, ;
		Left = 172, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "BUG: ToolTips", ;
		Name = "Command2"


	PROCEDURE Load
		CREATE CURSOR grid_tips (f1 V(20),f2 V(20),f3 V(20),f4 V(20),f5 V(20),f6 V(20),f7 V(20))
		DIMENSION arec(FCOUNT())

		FOR k=1 TO ALEN(arec)
			arec[k]="FIELD "+TRANSFORM(K)+REPLICATE(TRANSFORM(K),K)
		NEXT
			INSERT INTO grid_tips FROM ARRAY arec
			INSERT INTO grid_tips FROM ARRAY arec
			INSERT INTO grid_tips FROM ARRAY arec
			INSERT INTO grid_tips FROM ARRAY arec
			INSERT INTO grid_tips FROM ARRAY arec
			LOCATE
	ENDPROC


	PROCEDURE grid1.Init
		this.SetAll("Sparse",.F.,"Column")
		this.SetAll("Bound",.F.,"Column")
		&& set all columns to max lenght
		this.SetAll("ControlSource",FIELD(thisform.grid1.ColumnCount),"Column")
	ENDPROC


	PROCEDURE command1.Click

		thisform.grid1.Autofit
	ENDPROC


	PROCEDURE command2.Click
		* force show tooltipText of the cell
		thisform.Grid1.SetAll("width",30,"Column")
		WAIT WINDOW "Move on grid cells"
	ENDPROC


ENDDEFINE
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform