adding properties of stringgrid
Ls.
Read the docs/*.pas but can't (my lack of knowledge, I guess) figure out how to add the stringgrid property cells to be known to a script. Came as far as:
with fsscript1.AddClass(TAdvStringGrid,'TGrid') do
AddProperty('Cells', 'String'...
... anyone can help me out?
Regards,
H
Read the docs/*.pas but can't (my lack of knowledge, I guess) figure out how to add the stringgrid property cells to be known to a script. Came as far as:
with fsscript1.AddClass(TAdvStringGrid,'TGrid') do
AddProperty('Cells', 'String'...
... anyone can help me out?
Regards,
H
Comments
Also you should use fsGlobalUnit to add classes.
with fsGlobalUnit do
begin
AddClass(TCustomGrid, 'TCustomControl');
AddClass(TDrawGrid, 'TCustomGrid');
with AddClass(TStringGrid, 'TDrawGrid') do
begin
AddIndexProperty('Cells', 'Integer,Integer', 'String', CallMethod);
end;
end;
Example of CallMethod you can found in the fs_i*rtti.pas files. Also read the manual how to add a property, index property, method.
...
AddClass(TCustomGrid, 'TCustomControl');
AddClass(TDrawGrid, 'TCustomGrid');
AddClass(TStringGrid, 'TDrawGrid');
AddClass(TBaseGrid, 'TStringGrid');
with AddClass(TAdvStringGrid, 'TBaseGrid') do begin
AddIndexProperty('Cells', 'Integer,Integer', 'String', CallMethod);
end;
...
function TfrmMain.CallMethod(Instance: TObject; ClassType: TClass;
const MethodName: String; var Params: Variant): Variant;
begin
Result := 0;
if MethodName = 'CELL.GET' then Result := .....
?
H