Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Column.Init problem or Bug ?
Message
De
18/03/2003 13:43:31
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
Column.Init problem or Bug ?
Divers
Thread ID:
00767181
Message ID:
00767181
Vues:
49
Hi all

1. create one SCX form.
2. add 1 grid
3. set grid1.ColumnCount=2
4. On Column1.Init() write
RETURN .F.
5. On Form.Init() write
MESSAGEBOX('Columns'+STR(this.controls[1].ColumnCount,2))
6. run form

Message is 'Columns 1' OK I expected this number.

run this code:
*************************
PUBLIC oform1

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

DEFINE CLASS ftest AS form

Caption = "test grid"

ADD OBJECT gr AS grid WITH ColumnCount = 2

PROCEDURE gr.Column1.init
MESSAGEBOX('remove')
RETURN .F.

PROCEDURE init
MESSAGEBOX('Columns'+STR(this.controls[1].ColumnCount,2))

ENDDEFINE
***************************

Message is 'Columns 2' NOK I do not expected this number.

This problem occur also with subclass Grid
Control, the column is not release complete, and all Column
attributes they become inconsistent;
internal VFP C pointers structure are lost
( see Debugger.Watch column structure )

I use a master grid subclass with 4 columns;
in particular situations I must destroy the 1 column before the init of the 2 column.

Only this.Parent.removeobject(m.this.name) on Column.Init remove it.

I cannot use grid.addObject because there is the bug of the columnOrder,

grid.columns[grid.ActiveColumn] is wrong if the order of the columns is various from the construction order.

This problem occur also on pageframe ? I will make to know you.

Fabio
Répondre
Fil
Voir

Click here to load this message in the networking platform