Mark Morgan Lloyd schrieb:
Given a fragment of code like this:

type
  TDbConfigFrame = class(TFrame)
..
  public
    { public declarations }
    property DbInit: TDbConfigInit write fdbInit;
  end;

A write-only property can be implemented by a (setter) procedure, to which you add whatever arguments may be useful (e.g. Sender).

is there any way of enforcing a rule that DbInit can only be written by (for example) a descendant of TForm or TNotebook? Or only being writable by e.g. the OnCreate() method of certain designated form instances?

You can check Sender against the owner of the frame, if that helps.

DoDi


--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to