10

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 ?

ferpega
  • 3,182
  • 7
  • 45
  • 65
  • 2
    Code Completion (Ctrl+Space) if your cursor is inside a class declaration shows all methods you can declare, including the methods of implemented interfaces. Just select them one by one. That is what I usually do. – Rudy Velthuis Jan 27 '19 at 18:05

4 Answers4

8

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.

Cesar
  • 500
  • 5
  • 12
4

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

Community
  • 1
  • 1
Wosi
  • 41,986
  • 17
  • 75
  • 82
4

There is no such shortcut, sadly.

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

Community
  • 1
  • 1
David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • @daemon this downvote was one of 16 received in the space of a minute! – David Heffernan Apr 26 '11 at 19:05
  • @David - except this seems there are many people here with double (or more) personalities voting for themselves. I'll be glad (and proud of course :) to achieve one thousand to see the voting count. –  Apr 27 '11 at 12:47
  • @daemon you're nearly there! The 16 downvotes got magically removed by the serial voting correction scripts. What makes you assert that there are many people here that vote for themselves? – David Heffernan Apr 27 '11 at 12:50
  • @David - because sometimes I'm wondering how poorly asked questions like [this](http://stackoverflow.com/questions/5737820/delphi-gui-design-specifications-and-guidelines) for instance can get so many upvotes. When I'd like to find something what help me with IDE designing, I'll never look for "Design Specifications and Guidelines", but for something like "Delphi IDE enhancement". I see the OP probably didn't know the term "IDE", but he promised to correct it to be useful for someone else, but it remains meaningless. And that's one of the hundreds on SO. Anyway, thanks for the upvotes !!! –  Apr 27 '11 at 14:16
  • @daemon_x, I don't know if I understand you correctly... But are you talking about my "poorly" question or what ? And I also don't know what are you saying about "Design Specifications.." nor what I have promised to somebody... ? Sorry, I don't understand you. Perhaps I am really newbie in StackOverflow and I still don't understand all its terms/jargon right. – ferpega Apr 28 '11 at 08:52
  • @daemon_x. Sorry daemon_x I see now you are talking about another question. Regards. – ferpega Apr 28 '11 at 08:54
3

Delphi itself doesn't have a shortcut for this, but Modelmaker Code Explorer allows you to have a class implement an interface including generating all the empty method stubs.

Jeroen Wiert Pluimers
  • 23,965
  • 9
  • 74
  • 154