Sonntag, 25. März 2007

Tips and Tricks: Keyboard navigation in Delphis Object Inspector

I'm a keyboard person and I absolutely hate having to switch to the mouse while I'm in the middle of a coding session. Because of that I'm always on the lookout for keyboard shortcuts.

This time I want to share some tricks on how you can navigate Delphis Object Inspector!
Note: most if not all of these shortcuts have been supported since Delphi 1, so while I'm referring to the brand new Delphi 2007 now, everything should apply to older Delphi versions too!

While the Object Inspector is active, you can switch between the 2 columns of the inspector, using the Tab key. This is very handy, because you can use incremental search to navigate to a property! Just start typing while the cursor is in the name column, i.e. after pressing Tab.
While the name column is active you can also use "." (dot), to expand a subproperty! Similarily, use Backspace to collapse a subproperty.

Now back to the value column: when editing a property where you can only choose from a list of distinct values (i.e. a combobox), for example TForm.Align, use Alt+Down to drop down the list of values. Use the cursor keys to select a different item, Enter to confirm the selection and Esc to cancel the operation.

For properties supporting a property editor, such as TForm.Font, press Ctrl+Enter to invoke that editor - in the case of .Font that opens the Font common dialog.

Then there's also the instance list above Object Inspector - use Ctrl+Down to activate that! Note that this drop down also supports incremental search, so you can just start typing. Again, use Enter to select the highlighted component in Object Inspector.

Finally there's also the Events page. Note that you can switch between those 2 pages by pressing Ctrl+Tab! On the events page, use Ctrl+Enter to create a new event handler or switch to the code of the already assigned event handler.

That's about all the OI related shortcuts I know. If I missed one, please leave a note and I'll update the post!

2 Kommentare: