delphi-shortcut to implement interface method and abstract method from ancestor interface or class

I have example code like this

IExample=interface
   procedure Test;
end;

TBaseClass=class
   function Check:boolean;abstract;
end;

TExampleObject=class(TInterfacedObject,IExample)
end;

TAnotherObject=class(TBaseClass)
end;

My question is, how I can implement interface method and abstract method from ancestor?

I use Visual Studio and C#, very simple to make implementation from abstract method and interface method, I just right click on my class, and Implement method.

Does RAD Studio XE2 have similiar tool or third party tool that have same function? because is annoying if I must write down all abstract and interface method manually

Answers


I suppose there are IDE plugins out there that offer the functionality you want.

I use this method every day:

Copy the methods from your interface to the public section of your class, set cursor on one of these methods and execute shortcut CTRL-SHIFT-C. Delphi will automagically create the functions/procedures in the implementation section for you!

This works for all classes...


Yeah, it would be nice if this worked for functions inherited through Interfaces too and it would be nice if it worked in Interfaces themselves for creating Getter / Setters for Interface Properties!

That said, I will log it with QC (if its not already) as its a good suggestion.

Update: Here you go :) - http://qc.embarcadero.com/wc/qcmain.aspx?d=121748


Need Your Help

Aligning text objects next to each other - KineticJS

html5 kineticjs

I have text objects and label objects which are seperate. They need to be aligned next to each other when being drawn. I'm adding the x and y co-ordinates but the objects are off by some pixels and...

Using perl's XML::LibXML how do you use XML Prefixes and not xmlns attributes?

xml perl libxml2 xml-namespaces

I believe this question might have been previously attempted in 2006 on a different site. But, my current XML/RDF writer (XML::LibXML 1.70) outputs element namespaces in the form of xmlns attributes.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.