7

How do you implement overlay icons in the Delphi IDE like this:

  • on editor's files tabs;
  • on Project Manager's tree;
  • on Project Manager's popup menu?

Screenshot of Mercurial icon in the right-click menu on a file in the Project Manager

David
  • 13,360
  • 7
  • 66
  • 130
vlad_n
  • 123
  • 2
  • 7

1 Answers1

2

I have recently been playing around with the Project Manager's context menu and the context menu (TPopupMenu) doesn't have a TCustomImageList assigned to it.

So to get images on the context menu, you will need to assign a TCustomImageList (TImageList) to it. What I have done is to create one with the same owner as the TPopupMenu component.

For the others, I know very little:

  • The Project Manager's tree is a virtual tree view, so it might worth playing around with it in an application to see what can be done.

  • The editor tabs are a custom component, so some low level hooking maybe required. Have a look at how the Delphi IDE Colorizer handles the custom tabs; that might help with hooks.

Plea: Since this is playing around with the internals of the IDE, please don't assume you are the first person there and start over writing everyone else's work.

Edit: There is an EDN article on Extending the Project Manager Context menu

David
  • 13,360
  • 7
  • 66
  • 130
Nicholas Ring
  • 1,016
  • 7
  • 14
  • OK, I found the Project Manager's tree object. Its name ProjectTree2. But now I don't understand how to determine full path of Unit1.pas or Unit1.dfm nodes? – vlad_n Jun 08 '15 at 05:37
  • Since their node data size is 20 bytes (XE7), I suspect that you need to reverse engineer the node data layout to see if the file name is contained within it. – Nicholas Ring Jun 09 '15 at 09:05
  • Who can help with the definition of the structure Node.Data of ProjectTree2? – vlad_n Jun 11 '15 at 15:57
  • I suggest that you post another question instead of continuing with this one, as most people will not see it. You will also need to consider that it could change between versions of the IDE – Nicholas Ring Jun 12 '15 at 08:01