you can create yourself "helpers" too... if the class/type dont have it...
Vcl.Grids,
Vcl.StdCtrls;
type
TSGMyHelper = class helper for TStringGrid
type
TMyHack = class(TStringGrid);
procedure MyRowMove(IdxFrom, IdxTo: integer);
end;
TForm1 = class(TForm)
StringGrid1: TStringGrid;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TSGMyHelper }
procedure TSGMyHelper.MyRowMove(IdxFrom, IdxTo: integer);
begin
TMyHack(Self).RowMoved(IdxFrom, IdxTo);
end;
{ Form1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
for var i: integer := 0 to (StringGrid1.RowCount - 1) do
StringGrid1.Cells[1, i] := 'hello ' + i.ToString;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
StringGrid1.MyRowMove(3, 1);
end;
end.