CnPack Forum


 
Subject: [feature idea #3] collect class
klemm
普通灌水员
Rank: 2



UID 4759
Digest Posts 0
Credits 79
Posts 38
点点分 79
Reading Access 10
Registered 2007-1-19
Status Offline
Post at 2007-1-30 11:11  Profile | Blog | P.M. 
[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
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2007-2-14 11:16  Profile | Blog | P.M. 
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.
Top
 




All times are GMT++8, the time now is 2024-11-25 09:16

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.008202 second(s), 9 queries , Gzip enabled

Clear Cookies - Contact Us - CnPack Website - Archiver - WAP