Alexsander Rosa wrote:
My plan is to mimic Delphi as close as possible. 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:
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...

Some connect:

1) Don't rely in a "first" private, it may not exist. IMO it should be "first" private/protected/public/published

2) Is it only for forms, or also dataform/service etc ?

Marc



Alex

2005/9/27, Marc Weustink <[EMAIL PROTECTED]>:

Micha Nelissen wrote:

Marc Weustink wrote:


Only published methods that are an event handler, AFAIK.


Correction: all methods declared between the class declaration and the
first section (private/protected/public/published)


"First section" means "first different section by use of keyword private
protected public published"? Ok, in general those are the methods that
delphi autocreated, right?

Yes, and also those you put in there yourself.


Delpi doesnt remove empty methods declared in a published section


So if you copy the event handler method from the top section to another
published section, delphi won't remove it anymore when saving ?

Indeed.

Marc

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




--
Atenciosamente,

Alexsander da Rosa

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


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

Reply via email to