2005/9/29, Mattias Gaertner <[EMAIL PROTECTED]>:
> 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? ;)

Of course, but this better version is labeled "post 1.0"... ;-)

>
> > > 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'?

OK, being pedantic: if there's nothing typed by a human. Or: it's
empty if after the ";" of the end of the method signature, there's
<one or more spaces> "begin" <one or more spaces> "end;". It could be
a function named "MethodIsEmpty". Or whatever.

> > > 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

Maybe it could be: all published methods (the default is to be
published, right?) from the start (i.e., defined after the "class"
keyword) until the first non-published method (that would be after the
first "private/public/protected" keyword).

> > 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
>

OK

--
Atenciosamente,

Alexsander da Rosa

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

Reply via email to