Hello,
Let's consider the following code fragment:
--------------------------------------------------
type

 TMyRecord = record
    Name : String;
    Value : Integer;
 end;

 TMyClass = class(TObject)
 private
    FButton : TButton;
    FRecord : TMyRecord;
 public
    property RecordName : String read FRecord.Name write
FRecord.Name;    // compiles
    property ButtonWidth: Integer read FButton.Width write
FButton.Width; // does not compile
 end;
--------------------------------------------------

Is it really too hard to make the compiler understand properties with
the second type of declaration as the ButtonWidth example? I would
prefer this to
--------------------------------------------------
property ButtonWidth: Integer read GetButtonWidth write SetButtonWidth;

function <class name>.GetButtonWidth: Integer;
begin
  Result := FButton.Width;
end;

procedure <class name>.SetButtonWidth(const AValue: Integer);
begin
  FButton.Width := AValue;
end;
--------------------------------------------------

Please state your comments on this idea. Is it good or not? Is this
something that you would like to have as a feature? Is it able to be
implemented?
How?
Maybe using hidden Get/Set methods?

Thanks.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to