Board index » delphi » How to create a form expert to generate froms using form inheritance

How to create a form expert to generate froms using form inheritance

On Sun, 17 Aug 1997 11:40:25 +0200, Tauvic Ritter

Quote
<t.rit...@trendsoft.nl> wrote:
>I'm have tried to make a form expert wich generates a form inheriting
>from another form. I have used the Expertdemo source code. Instead of
>creating a form of class TForm i want to inherit it from a self defined
>class TParentform containing a toolbar and some buttons.

How do you create the new module? Make sure you specify the ancestor
name in CreateModuleEx. If you are using Delphi 3, you can also use a
module creator and call ModuleCreate. Hidden Paths of Delphi 3 goes
into the full details, much more than does Secrets of Delphi 2.

--
Ray Lischner (http://www.tempest-sw.com/)
Author of "Hidden Paths of Delphi 3: Experts, Wizards, and the Open Tools API"

 

Re:How to create a form expert to generate froms using form inheritance


I'm have tried to make a form expert wich generates a form inheriting
from another form. I have used the Expertdemo source code. Instead of
creating a form of class TForm i want to inherit it from a self defined
class TParentform containing a toolbar and some buttons. According to my
knowledge and "Secrects of Delphi 2" by Ray Lischner the following code
should work:

implementation

uses .....,updodh; //Updodh contains TFWijzigform

function TDlgExpert.DoFormCreation(const FormIdent: string): TForm;
var
  BtnPos: TPoint;
  PgCtrl: TPageControl;
  I: Integer;
begin
  Result := TParentform.Create(nil);
  Proxies.CreateSubClass(Result, 'T' + FormIdent, TParentform);
  with Result do
  begin
      ...
     //Insert additional components
  end;
  ......
end;

When i execute this code a form is created containing all components fro
TParentform, but NOT inherited from TParentform. Its form definition is
simply copied.

Question:

How can i create a new form wich inherits from a parentform.

Other Threads