On Wed, 28 Sep 2005 10:53:31 +0200
Marc Weustink <[EMAIL PROTECTED]> wrote:

> Alexsander Rosa wrote:
> > My plan is to mimic Delphi as close as possible. 

Why not do it better? ;)


> > In Delphi, if you
> > type Ctrl-Shift-C to auto complete a class, then save, it does NOT
> > erase the newly created empty method, unless you type it BEFORE the
> > first auto-generated "private" keyword (the one followed by a comment
> > { Private declarations }). I think it's good enough for most people.
> > 
> > The algorithm could be like:
> > 1) Find the main class of the Form (like TForm1);
> > 2) For every method BEFORE the first "private", do:
> > 2.a) Find the code of the method;
> > 2.b) If the code is empty (only spaces between begin and end), do:

What about code in front of the 'begin'?


> > 2.b.1) Delete the code and the declaration;
> > 2.b.2) Call RemoveDanglingEvents (from the .lfm)
> > 
> > PS: D7 is not perfect: if you type "procedure dotest;" in a TForm
> > class BEFORE the first "private", then press Ctrl-Shift-C, it creates
> > the empty method with a comment { TForm1 }. When you save, it erases
> > the code but the comment remains...

The codetools contains functions to find this comment.

 
> Some connect:
> 
> 1) Don't rely in a "first" private, it may not exist. 

Correct. Packages can define their own form sources. Examples:

a)
  TForm1 = class(TForm)
  private

b)
  TForm1 = class(TForm)
  published
    Button1: TButton;

c)
  TForm1 = class(TForm)
    Button1: TButton;
  published


> IMO it should be 
> "first" private/protected/public/published
> 
> 2) Is it only for forms, or also dataform/service etc ?

I vote for all unit root components.


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to