IDE Window: Object Inspector

From Free Pascal wiki
Jump to: navigation, search

Deutsch (de) English (en) suomi (fi) français (fr)

Object Inspector

The "Object Inspector" window allows you to explore and edit the properties of objects. Objects here are TPersistent descendants like a TForm or a TButton or a TOpenDialog.

On the top there is a tree showing the components of the currently edited designer form (or datamodule or frame or whatever).

The biggest part of the Object Inspector are the 3 property grids called 'Properties', 'Events' and 'Favorites'. Each property grid show a subset of the published properties of the selected components.

The Object Inspector is a useful tool for debugging your own programs. How to add the Object Inspector to your own programs is demonstrated in examples/objectinspector.

Keyboard Shortcuts

Shortcut Description
Up, Down Navigate rows
Alt + Left Collapse level
Alt + Right Expand level
Ctrl + Enter Cycle enumerated values

You can use keyboard for fast Property Name search and edit.

Let's assume you want to modify Form's Caption and Width properties

- Click Form.
- Go to Object inspector (caret is on Property Value column).
- Press Tab to switch to Property Name column (caret will disappear from Value column).
- Type "caption". Property row "Caption" will be found.
- Press Tab or Enter to go to Property Value and edit it.
- Press Tab to switch to Property Name column again.
- Type "width". Width row will be found.
- Press Tab or Enter and edit it.

If you misspelled property name you can press Esc and retype it. Or you can use Backspace to remove few last chars.

Popup Menu

Set to default

Set the property value to the default value. For example:

 property Position: TPosition read FPosition write SetPosition default poDesigned;

Here poDesigned is the default.

Note: Not every property has a default value. Default values defined by the stored functions are ignored by this function.

Undo

Discard changes of the edit field and restore the value of the current property. Do not confuse this with the value from the disk.

Jump to declaration

Jump to the source declaration of the property. This will be the last one. For example TForm.Left is published in the class TForm and defined in TControl. You can jump easily to the other declaration, by doing a find declaration on the name again and again, until you are the lowest definition (Alt+Up or Ctrl+LeftClick). You can jump back with Ctrl+H.

Cut

Copy property to clipboard and set the value empty.

Copy

Copy property to clipboard.

Paste

Paste value from clipboard to property.

Delete

Set value empty.

Show hints

Enable showing hints. Hints are shown, when mouse stops a few seconds over a property.

Show component tree

Show or Hide the component tree at the top of the object inspector.

Options

Configure some options of the Object Inspector.