I want to use INTAIDEINsightService
perhaps AddItem
or AddActionList
to add an entry to the IDE insight feature in Delphi.
According to the Delphi OTA wiki, INTAIDEINsightService
allows you to register your own action. The only reference I can find is here, which mentions the name of the API, and that it exists at all. There is nothing in the Delphi help about it. The ToolsAPI.pas
unit in Delphi XE shows two methods in this interface that let you register actions:
function AddActionList( Actions: TCustomActionList; ... ): Integer;
procedure RemoveActionList(const Index: Integer);
The comments say "Items will be shown as[Description |] Category | TCustomAction.Caption. Contained actions which do not specify a category will not be shown.".
I haven't been able to find any other documentation or samples using actions. A simple "hello world" example where an action, or just an item, is registered with description or category "helloworld", that is then searchable and shows up when you hit F6 would be perfect, but Actions are preferred.
It looks like such a wizard would have to implement INTAIDEInsightItem
in order to render itself inside the IDE insight, but I'm not sure if that's "required" for a hello-world sample or not. I'm not really sure if you have to use actions, or if regular "item" adds are sufficient.
(My ultimate goal is to create a new gExperts-style expert to "open any unit in my library path by searching for it by name using IDE insight" but I'll start with adding unit names to the ide insight one item at a time.)
The following shows category 'Hello' under 'Commands':
The dfm is simply a datamodule with an action list, image list and an action:
Here I leave the optional parameters
Description
andCategory
of theAddActionList
method the default empty strings which ends up as 'Commands' and the value ofCategory
from the action list but you can specify your own values which will override these defaults.