Ancestral Forms 1.11
Intelligent Form Inheritance for Delphi 1.0
(C) Sam Liddicott 1996
sam@csluk.demon.co.uk
This product is not related to the company I work for.

This product only *may* do what it claims; and also *may* damage your data.
On the otherhand it probably will do most of what it claims, and probably
won't damage your data.  But no gurantees, monkeys law applies.

This was inspired by what I saw of Markus Mayers form inheritance.
It's been changed so much that nothing is left of his code.  (Except in
version 1.0 his company name and comments were left}
Version 1.11 is much improved.

I spent many hours hacking and came up with this good system of form
inheritance.

Changes And Bug Fixes Since Version 1.1

* .Loaded now works *really* properly.  Thanks to Jerry Bell for pointing out
  the symptoms.

Features!

* Base your Ancestor form on TRootForm.

* Base your child form on your Ancestor form; base any form on that... etc.

* Any components on your ancestor forms will appear on your child forms
  automatically.

* An event (e.g. ButtonClick) in the child form can modify properties of
  components which exist in the ancestor form, the child form or both!
  Completely transparently!

* If a component on the child form has the same name as a component on
  the ancestor form then it will OVERRIDE the component on the ancestor
  form, and take its new position as defined on the child form but RETAIN
  the same child components it was given on the ancestor form.

  E.G.  Panel1 in ancestor has Button1 as a child.
        Panel1 in ancestor is a child of Panel2 and has a child Button2

        At runtime the child form will have Panel2 containing Panel1 which
        contains BOTH buttons!

  Just look at the demo application to see what can be done.

* Overridden components have their default values restored automatically
  before the overriding properties are read.  (This means that you can
  override a panel bevel width of 7 with the default of 1, although the
  default values are not stored - see the demo app for example)

* The components of the forms are loaded ancestor first, up the line of
  descendancy until the form loads its own components last.

* No need to call RegisterClass by hand for classes on the ancester form,
  like some other form inheritance schemes.  (No offence to Markus).

* csLoading and csReading in ComponentState fully honoured.

* The .loaded method for components is only called ONCE, and only at
  the END, when ALL the components of ALL the ancestors have loaded.

* The .loaded method for the form will be called once for each level of
  inheritance.  In your loaded method your can examine the TRootForm
  properties CurrentClass and ClassLevel to see which level loaded is being
  called for.  The last call will have CurrentClass set to the forms class
  and ClassLevel set to 0.

Caveats:

* You MUST call the inherited .loaded if you specify your own .loaded
  If you want your .loaded code to be executed once at the end then enclose
  it in "If ClassLevel=0 then begin...end;" after the inherited call.

* This is for Delphi version 1.  You won't need it under version 2 and don't
  expect it to work.

* The delphi IDE does not support inherited forms so at design time. You
  only see what you put on each form. (Which is perhaps a good thing).

* If a component exists on the descendant form with the same name as a
  component on the ancestral form it MUST be a compatable type.  I.E. the
  same type or a direct descendant.  Otherwise an exception is raised.

* This version displays a demo message if it is not run under the IDE.

Improvments Scheduled For Version 2.0

* A drop-in component 'helper' which allows you to specify which properties
  should be overridden from the ancestor component and which should not.
  This will allow you to override the style, but not parentage of a child
  component, or the parentage but not style.

  For example, in the ancestor form you could define a TMemo full of text,
  with certain fonts and positions.

  In the child form you could cause the TMemo to be placed in a notebook
  with no other changes.

  You can select individually whether each property should be overridden or not.

* Registered users will get a free upgrade to version 2.0

--------------

As you can tell this is just a demo.
A real version without the message is available.

The special introductory prices are:
15 UK pounds for a copy without the demo notice.
50 UK pounds for a copy of the source.

Foreign funds accepted if you add 10 UK pounds to the price and use the current
exchange rate.

Alternatively you can PAY ONLINE with regnet.
For pricing and info point your browser at:
s
http://www.ndmedia.com/~samjam/saac/saac.html

Copies will be emailed, or snail mailed if you prefer.
Please add 2 uk pounds for snail mail.



I can be contacted at:
sam@csluk.demon.co.uk

Sam Liddicott
34A Anson Rd
Shepshed
Loughborough
United Kingdom
LE12 9PU

+44-1509 503856

