1

I read many articles on stackoverflow about extending TFrame to have its own published properties.

I have followed basically the aproach of John Thomas

Repeating the code here:

unit myUnit;

uses
 ...

type
  TmyComp = class(TFrame) //set your frame name to be the name your component 
    ToolBar1: TToolBar; //different components added in the form designer
    aliMain: TActionList;
    ...
  published //this section is added by hand
    property DataSource: TDataSource read FDataSource write SetDataSource; //some     published properties added just for exemplification
    property DefFields: string read FDefFields write SetDefFields;
    ...
  end;


procedure Register; //added by hand

implementation

{$R *.DFM}

procedure Register;
begin
  RegisterComponents('MyFrames', [TmyComp]); //register the frame in the desired component category
end;

The new frame component shows up on the component pallete just fine. I can add the new frame to a form and works.

However I need to work with my new frame as a standalone unit, like created by file->new->other->vcl frame

I have my frames all created like, in separated units, then inserted on a form when needed.

What should be done for my new MyFrame works like that?

Community
  • 1
  • 1
Eduardo Elias
  • 1,742
  • 1
  • 22
  • 49
  • I have not worked in delphi in ages but I have in the past packed component packages in dpk's as was the norm. Create you components as a package and then install them. Your application only uses the code in the dpk. – Ross Bush Dec 15 '13 at 02:02

0 Answers0