General information
Category:
Object Oriented Programming
Title:
Column.Init problem or Bug ?
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
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only