Board logo

Subject: [feature idea #3] collect class [Print This Page]

Author: klemm    Time: 2007-1-30 11:11     Subject: [feature idea #3] collect class

A spinoff from previous idea:

A tool to order method bodies in implementation according to interface order.

Example:

type
  TMyClass = class
  private
    FText: String;
    procedure SetText(Value: String);
  public
    constructor Create(AText: String);
    procedure Show(Canvas: TCanvas);
    function GetSize(Canvas: TCanvas): TPoint; virtual;
    procedure Whatever; virtual; abstract;
    property Text: String read FText write SetText;
  end;

  TMyClass2 = class(TMyClass)
  public
    procedure Whatever; override;
  end;

implementation

constructor TMyClass.Create(AText: String);
begin
  {$MESSAGE WARN 'Not implemented yet!'}
end;

procedure TMyClass.SetText(Value: String);
begin
  {$MESSAGE WARN 'Not implemented yet!'}
end;

procedure TMyClass2.Whatever;
begin
  {$MESSAGE WARN 'Not implemented yet!'}
end;

function TMyClass.GetSize(Canvas: TCanvas): TPoint;
begin
  {$MESSAGE WARN 'Not implemented yet!'}
end;

procedure TMyClass.Show(Canvas: TCanvas);
begin
  {$MESSAGE WARN 'Not implemented yet!'}
end;


After running the wizard, the implementation would look like this:


procedure TMyClass.SetText(Value: String);
begin
  {$MESSAGE WARN 'Not implemented yet!'}
end;

constructor TMyClass.Create(AText: String);
begin
  {$MESSAGE WARN 'Not implemented yet!'}
end;

procedure TMyClass.Show(Canvas: TCanvas);
begin
  {$MESSAGE WARN 'Not implemented yet!'}
end;

function TMyClass.GetSize(Canvas: TCanvas): TPoint;
begin
  {$MESSAGE WARN 'Not implemented yet!'}
end;

procedure TMyClass2.Whatever;
begin
  {$MESSAGE WARN 'Not implemented yet!'}
end;


--
BR,
Lauri -- the idea generator
Author: Passion    Time: 2007-2-14 11:16

Sorry for late relpy.

Syntax Parsing is a weak point in CnWizards. There're some difficut for CnWizards to do such jobs.

And actually, MMX CodeExplorer does it better than us.




Welcome to CnPack Forum (http://bbs.cnpack.org/) Powered by Discuz! 5.0.0