Parametrize a class for generic data listings, with the corresponding editor class in each case

14 Views Asked by At
type

TGenericList = TClass(Tframe)
//
fClassEditor:TClassEditor;
public 
property ClassEditor:TClassEditor read fClassEditor write setClassEditor;
end;


TClassEditor class of TGenericEditor;

TGenericEditor = Class(TForm)
....
end;

TEspecific1_Editor = Class(TGenericEditor)
....
end;

TEspecific2_Editor = Class(TGenericEditor)
...
end;

in the Program

     f:=TGenericList.create(aDataModel);
     f.ClassEditor:=TEspecific1_Editor;

Is it possible to assign the editor class in a property of the listing class?

I am trying to have a generic class for listings that accepts the corresponding editor class as a property for that data.

0

There are 0 best solutions below