Though RAD Studio IDE supports a lot of features to boost productivity sometimes as a Delphi/C++ Builder Developer and as an end-user we may think to modify/extend the IDE capabilities for our own custom needs. Don’t know where to start with? Don’t worry! Delphi/C++ Builder has the Flexibility to extend the IDE capabilities using the Open Tools API. Using this Developers can extend some text, graphics, and installs to the IDE.
Open Tools API (OTA) The Open Tools API (OTA) is a set of interfaces that allow developers to add features to the BDS, Delphi, and C++Builder IDEs. These additions are called wizards or experts. Wizards can use the OTA interfaces to modify the IDE, obtain information about the IDE’s state, and receive notification of important events. Check some useful FAQs here
How to decorate your Editor using OTA: e.g) Need to do visualization of code coverage in the Delphi Source editor with some Text and Graphics representation.
- How to decorate your IDE with symbols and graphics to the Source editor?
- How to make sure that these decorations are in sync when editing the content?
In ToolsAPI.pas, a lot of interfaces available to Modify IDE, information about IDE’s state, etc. For Visualizing code coverage in the Source editor, use the INTAEditViewNotifier interface PaintLine procedure. Create the Canvas state and draw the graphics required in the implementation of the procedure.
procedure PaintLine(const View: IOTAEditView; LineNumber: Integer;
const LineText: PAnsiChar; const TextWidth: Word; const LineAttributes: TOTAAttributeArray;
const Canvas: TCanvas; const TextRect: TRect; const LineRect: TRect; const CellSize: TSize);
BeginPaint is called before the code editor is repainted, and use the EndPaint procedure to clean up any data structures that have been maintained over the course of
Check the below Video Demonstration for decorating the Source Editor.