Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi: keystroke or IDE option to populate interface elements on a class

I am looking for any IDE menu option, keystroke, shorcut, mouse clicks or something to populate all interface elements (methods, properties, etc) inside a class implementing it.

Are there any way to do it ?

like image 650
ferpega Avatar asked Apr 24 '11 11:04

ferpega


3 Answers

There is a shortcut that will let you autocomplete your class: Ctrl + Shift + C will autocomplete your functions, procedures and properties...

example:

inside the class write "procedure myproc;" then type Ctrl+Shift+C and Delphi will create the procedure body.

if you type "property myprop:String;" and then type Ctrl+Shift+C Delphi will create the get and set functions for your property.

Another good shortcut is Ctrl+Shift+Up to go to the procedure/function declaration and Ctrl+Shift+Down to go to the procedure/function implementation.

Hope that helps.

like image 92
Cesar Avatar answered Oct 06 '22 00:10

Cesar


There is no such shortcut, sadly.

A rather similar question was asked recently here: How to automatically implement inherited abstract methods in Delphi XE

like image 40
David Heffernan Avatar answered Oct 06 '22 01:10

David Heffernan


The OmniPascal plugin for Visual Studio Code does support this feature.

If you have a correct setup then you will see a green line marking all incomplete interfaces of a class. Clicking the lightbulb (or pressing CTRL+. when the cursor is placed inside the name of the interface) it will generate the code stub for this interface.

enter image description here

like image 21
Wosi Avatar answered Oct 06 '22 01:10

Wosi