[Lazarus] TControl.AssignTo() and TCustomAction relationship

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Thu Feb 11 16:29:45 CET 2016


Hi,

Why does TControl.AssignTo() have a special case for TCustomAction?
TCustomAction.AssignTo() already does property assignments, so what is
the reason for the special code in TControl.AssignTo?

Here is the code in question:

procedure TControl.AssignTo(Dest: TPersistent);
begin
  if Dest is TCustomAction then
    with TCustomAction(Dest) do begin
      Enabled := Self.Enabled;
      Hint := Self.Hint;
      Caption := Self.Caption;
      Visible := Self.Visible;
      OnExecute := Self.OnClick;
      HelpContext := Self.HelpContext;
      HelpKeyword := Self.HelpKeyword;
      HelpType := Self.HelpType;
    end
  else inherited AssignTo(Dest);
end;




Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp




More information about the Lazarus mailing list