[Lazarus] Override method ?

Michael Van Canneyt michael at freepascal.org
Mon Mar 10 10:57:57 CET 2014



On Mon, 10 Mar 2014, Mattias Gaertner wrote:

> On Mon, 10 Mar 2014 09:51:59 +0100 (CET)
> Michael Van Canneyt <michael at freepascal.org> wrote:
>
>> Hi,
>>
>> Is there a reason why the "abstract methods" refactoring dialog cannot be altered to show all virtual methods ?
>
> Well, virtual methods are not abstract anymore, are they?
> Then the dialog would need another name.
> But beside this obvious reason, I see none.
>
>
>> (maybe through some checkbox in the dialog, possibly a dropdown showing all parent classes for filtering)
>>
>> When writing components, a popular method for overriding is Notification from TComponent.
>> I consistently find myself looking for its declaration.
>>
>> Or did I miss some already existing goodie in the IDE (always a possibility) ?
>
> You can select Notification in the completion box. For example:
> If your class has not yet a 'protected' section add one.
> Then add a new line. Press Ctrl-Space. Type 'no' to select Notification
> procedure. Press return. The header is added. Now press Ctrl+Shift+C.

Aha, I was right to ask :)

Thank you. This is more than sufficient for my needs :-)

The only use case for using the dialog is then if you want to override multiple methods at once.
Which, I think, is justification enough; but you just significantly lowered the urgency :)

Michael.





More information about the Lazarus mailing list