Basically, you are writing a new component derived from a standard one.
See comments after code snippets.
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ValEdit,
Unit2;
type
{ TForm1 }
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
VLE : Unit2.TValueListEditor;
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
VLE := Unit2.TValueListEditor.Create(self);
VLE.parent := self;
VLE.align := alClient;
end;
{ TForm1 }
end.
You must reference the class you create with a unit qualifier matching the class where your new designed control is coded, at least in the .Create at line 32.
You would be better off defining a different descendant class name for your new class, such as maybe TValueListEdEgsuh(TValueListEditor), thus disambiguating instances types.
Then see attached unit2 for a very raw and basic beginning of implementing the new descendant control class, controlling the InplaceEdit will request some efforts.
Some points to note :
1 -
NEVER write on the canvas outside a paint event as controlled by the WinControl and LCLCode.
2 - Use
override for the methods you wish to implement to you liking. Try to take into account that methods in the ancestor frequently have most of the things you want to accomplish.
3 - When overriding methods, do not forget (most of the time) to call the inherited method you complemented, either at the beginning or at the end of your new method.
4 - The override method qualifier is very important. This qualifier drives the compiler to generate code that calls your enhanced method instead of that a referenced in the parent class. That leaves your method execute even if called in an ancestor class method.
5 - You'll quickly notice that using HeaderSizing to drive RowHeight sizing is not the right thing to do. That you have to calculate the rows height on a cell by cell basis that will be subsequently uses in the DrawCellText method call of your control.
6- Etc, etc...
Writing visual controls is a non trivial activity and I have quite a lot of respect for the guys who do it.