Happy New Year to all of you!
Last week I have had a look into the Object Inspector and have seen that it could be quite easy to implement my idea of a Favorite page. That Favorite page should show me properties and events that I need often for a specific control or component and releases me from scrolling and searching. In connection with that I have looked for reports in the Object Inspector area and found the report QC 10268 (January 11, 2005; so far 25 votes) that asks for a filter edit in the Object Inspector. As a little workaround you can so far use the Object Inspectors incremental search feature when you are looking for a specific property. If you do not know about this feature than see what Malcom wrote in this blog post. However I find that way a little bit cumbersome and it seems even to confuse QA, because they think it would not be able to find sub items, but how about using “an.” to jump to (Vcl.Forms.TForm.)Anchors.akLeft?
Meanwhile I have implemented the filter edit and the Favorite page for the case when the Object Inspector is used for the Form Designer. Even if I could leverage the existing filter mechanism, which separates the properties into the Properties and Events pages, there were a few hurdles to take.
Can anyone tell me for example how one can get the parents of IProperty?
[see $(BDS)\source\ToolsAPI\DesignIntf.pas]
Screenshots and description
Here is a screenshot of the upper part of the default Object Inspector in XE2.

XE2 Object Inspector for a TForm instance
Here are a few screenshots of the two new features in the revised Object Inspector with some explanation. At first comes a screenshot which shows the same as the prior image, but with my Object Inspector enhancements installed.

Revised Object Inspector for a TForm instance (differences are the filter edit and Favorites page on the top)
The filter edit enables you to filter the properties by the string in the edit. This filter is case-insensitive and that mean that actually I had not have to enter an upper case “S” in the following screenshot. The filter takes the child properties into account and thatswhy you do see the “Font” property, because it has the child property “Style” that contains “sty”. Right now there is no automatic expansion of the items with childs.

Revised Object Inspector with the filter “Sty” for a TForm instance (the filter is case-insensitive)
What you enter into the edit has to exists somewhere in the full qualified property name. By this I mean I add the parents with dots to the property name and that means the full qualified property name for “fsBold” of the “Style” property of TForm.Font is “Font.Style.fsBold”. You can use the dot in the filter and so “t.sty” does only show “Font.Style” and childs and not “BorderStyle” and so on as on the prior image.

Revised Object Inspector with the filter “t.sty” for a TForm instance (the filter is case-insensitive)
In order to make a property a favorite property you can use the “Add Favorite” popup menu item in the Object Inspector’s popup menu.

Popup menu item to add a property as favorite property to show up on Favorites page
After clicking on the popup menu item the following dialog is shown. It contains the full qualified class name and full qualified property name for the currently selected property (the one with the chevron). Favorite properties are not global by default, but you can make them global by clearing the class name edit. Note the asterisk char or partial names are not supported – so do not turn “Font.Style” into “Font.S*” or “Font.S” to show “Font.Size” and “Font.Style”. The same applies to the class names – you cannot just use “TForm” instead of “Vcl.Forms.TForm” or “FMX.Forms.TForm”.
If you accidentally added a property as favorite property or just needed some properties for some time for a special task then you can remove them with the “Remove Favorite” popup menu item on the Favorites page.

Popup menu item to remove a property from the Favorites page
If you like the Favorites page, but do not want to have the filter edit or the other way round then you can disable them in the Object Inspectors Properties dialog or in the Environment options on page “Environment Options | Object Inspector”. Note the filter edit gets automatically disabled when you disable the “Show instance list” option.

Object Inspector Properties with the two additional options “Show filter edit” and “Show Favorites page” at the bottom of the Options groupbox
Some more words on the favorites filter: When I do filter the properties I first gather a list of classes in the class hierarchie of the selected instance and for example for Vcl.Forms.TForm that means that this list does include Vcl.Forms.TCustomForm and Vcl.Controls.TControl. Afterwards a list of the favorite properties for each class in that list and for the “any type” properties is created and that list is used in the filter. That in connection with the following default properties explains why you see by default for every VCL control Left, Top, Height and Width on the Favorites page.
This are the default favorite properties:
- Left, Top, Height and Width for Vcl.Controls.TControl
- Caption, Text, Color and OnClick for any type
Before you ask why I have not removed that obviously useless description pane at the bottom of the Object Inspector, which Marco did not understood some time ago, then I have to tell you that it is actually used. To my knownledge it is not really used when the Object Inspector is used for the Form Designer, but it is when it is used by the Modelling feature or any other feature that uses the Object Inspector and so I will not just remove it. However I have to admit that some tuning could help here later.
Known issues
- When expanding the instance list with the filter edit visible the drop down width is bigger than the instance list combobox
- Multiselect in the Form Designer is supported, but then only the first type in the instance list is used to generate the list of the favorite properties
- The filter edit is also shown when Object Inspector is used for the Modelling feature. There the value in the edit has no effect and this is as expected. That the filter edit is shown is right now a side effect of the fact that the instance list combobox is visible too. I am not used to the Modelling feature, that is anyway limited in my Professional Edition and so I do not know right now if the instance list combobox is shown by intention or if this is a bug. For now I could not see any usage and have first to find out which bug needs to be fixed.
Setup
- Download the setup for XE and XE2 from here
- Follow the instructions in the setup
- Start the IDE
I hope you will find it as useful as I do and there are not too much bugs in the code.
Happy testing!

Happy New Year!
Brilliant idea! It sounds very useful. I had no idea the Object Inspector could be extended – you’re using the OTA?
I have a couple of questions:
* Is it likely to work in 2010, or does it rely on interfaces introduced in XE?
* Does it work with C++ Builder?
The expert uses the OTA partly, but the OTA isn’t enough to implement these features.
AFAICS it works with C++Builder VCL applications. It may be possible to adapt it for 2010, but I don’t have 2010 installed anymore nor plans to adapt it.
It looks very nice. I think it is the type of feature that many people would appreciate. I don’t know if this is something you want to open the source for someday, but if so, and you feel it becomes ready for general use, I’d love to talk to you about integrating this as part of GExperts. I could test with older IDEs to see which ones are easy to support. We’d probably need to move the settings into the GExperts dialog and registry area, but GExperts integration might not be terribly hard.
I am sorry, but I am not going to open source it.
Great idea! Now I know there is a solution to my problem.
“The expert uses the OTA partly, but the OTA isn’t enough to implement these features.”
what have you use it, apart of OTA, if I can ask?
Any chance to get this useful piece of software also for D2007 ?
The best answer I will give one to the first question is that I’ve used my knowledge about Delphi (Compiler) internals apart from the OTA. Sorry, but I won’t be more detailed.
I guess it isn’t impossible to port it to D2007, but that will for sure take several hours, which I don’t have in the near future. I do have items on my to-do list that are several months or years old and have a higher priority.
Unbelievably helpful
Pingback: Anonymous
Very nice work, Uwe!
Thank you so much, I’ve been wanting this feature for years!
I’ll use it. It’s simple and usefull as it should be. Thank You.
I wish there would be any chance while browsing the Properties page to see whether items are added to favourites or not. Thought of different text Colour or graphic mark – e.g. star. Or even to mark/unmark them by click.
I don’t know (yet) if and how favorite properties could be highlighted on the Properties or Events page, but the idea sounds interesting.
Pingback: Alessandro Savoiardo » Object Inspector ricerca “Properties” ed aggiungere “Favorites”
Ein kitzekleines Problem gibt es.
Der Installer benütigt zwingend Adminrechte, was ja insoweit auch OK ist.
Aber leider installiert er das Addon dann auch nur für den aktiven Benutzeraccount, welches nun also das Admin-Account ist.
In meinem Arbeits/Benuter-Account und dem dort laufenden Delphi ist demnach von diesem Plugin garnichts zu finden.
Ach ja, könnte man den Filter auch auf den Typ-Name der Property anwenden und eventuell auch auf deren Vorfahren/Nachfahren?
Manchmal weiß man nicht wie ein Property heißt, aber man weiß was man sucht “Irgendein Property, welches mir einen bestimmten Typen liefert”.
Wenn man z.B. TStrings eingibt, dann würden alle Property angezeigt, welche so heißen, oder welche TStrings als Typen besitzen, bzw. Nachfahren davon, wie z.B. die TStringList.
Also praktisch nicht nur den Namen der Property, sondern auch den Typen des Property und dessen Vorfahren in die Suche aufnehmen.
Genauso könnte man noch schauen ob es in der RTTI einen Typen gibt, der so heißt, wie das Suchwort. (kompletter Vergleich und nichts mit automatisch/impliziten Wildcards, um die Suchmenge nicht zu groß werden zu lassen)
Wurde was gefunden wurde und es eine Klasse ist, dann zusätzlich auch noch deren Namen als weitere Suchwörter benutzen.
Krass wäre es dann noch, wenn auch Subproperty mit beachtet werden könnten.
z.B. man sucht nach “charset”, welches ein Property von TFont ist und bekommt im TEdit den “Font” mit angezeigt, weil der ja ein Charset enthält. (hier muß man aber wegen Rekursionen aufpassen)
Funktionen, um die Vererbungsfolgen rauszufinden, könnte ich bestimmt zusammenschustern und bereitstellen.
Ich glaub 1-2 Checkboxen oder ein Popup im Edit/OI, um die zusätzlichen Filtererweiterungen abzuschalten, wären eventuell auch angebracht, zum schnellen umstellen zu können.
Aber das mit dem Installer wäre schon am wichtigstens und die einfache Prüfung nch dem einen Typ-Name der Property wäre vermutlich auch noch schnell/einfach machbar und extrem praktisch.
MfG Frank
Die Installation für andere Benutzeraccounts wirst Du wohl erst mal über das Eintragen “per Hand” in die Registry mit z.B. folgender Registrydatei (Beispiel für XE2 und Standardpfad bei Windows 6.x x64) erledigen müssen.
Es gibt wahrscheinlich zwei verschiedene Lösungswege, aber diese sind nicht trivial. Möglichkeit #1 ist das Ermitteln der HKCU Keys der anderen Nutzer und das Schreiben in diese, aber das unterstützt Inno Setup scheinbar nicht. Man müsste den Code in eine DLL packen und aus Inno Setup aufrufen. Möglichkeit #2 wäre das Schreiben in den HKLM Key der IDE, aber dann ist der Experte noch nicht verfügbar. Man muss das Mergen in den HKCU Key erzwingen, aber dass das frei von Nebenwirkungen ist bezweifle ich.
Im Filter den Typ zu verwenden sollte möglich sein inkl. der Berücksichtigung der Nachfahren – also das eben bei Eingabe von TStrings eben auch z.B. Properties vom Typ TStringList angezeigt werden. Was ist mit dem Nachschauen in der RTTI gemeint? Hast Du da ein Beispiel?
Das mit den Subproperties ist bereits enthalten und ich habe es auch so beschrieben – Eingabe von “Sty” findet auch TFont bzw. TFont.Style und Font wird auch bei Eingabe von “charset” angezeigt.
Na ein Glück das ich an zusammenschustern gewöhnt bin. Das mit der Vererbung ist bereits für die Favoriten implementiert, aber trotzdem Danke für das Angebot.