Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-03

Override method ?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt

Hi,

Is there a reason why the "abstract methods" refactoring dialog cannot be altered to show all virtual methods ? (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) ?

Michael.

Mattias Gaertner
to Michael Van Canneyt
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.

Show quoted text 6 lines
(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.

Mattias

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 23 lines
On Mon, 10 Mar 2014 09:51:59 +0100 (CET) Michael Van Canneyt 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 , I think, is justification enough; but you just significantly lowered the urgency :)

Michael.