Inspector Customization

Global Filters
Local Filter
Property Context Menus
Sub Editors
Conditions

Figure 11.7. Global Filters


The Figure 11.7, “Global Filters” , presents a customization dialog dedicated to the Inspector. Global Filters are categorized according to the Inspector sections.

Sections

  • Properties, of Items, Styles, Gradients, Images and Windows.

  • Geometry, size, position and coordinates of Items and Windows.

  • Published, the interface definition; these section contains the same entries as »Properties«.

Global Filters are disabled for event handlers. It does not make sense to use global filters for events.

The filter entries are regular expressions. The filter entry »Button (.*)ground« matches all properties ending with »ground« for the window class »Button«. The Gistbox in the left matches entries for any class.

Global Filters features a less frequent used section hidden in the bottom. The entries in the hidden part renders properties in the Inspector read-only. See also Figure 4.6, “Read-only Properties”.

Entries, in the global filters, are excluded from the Inspector, the entries are out-filtered. The filter has a negative working mechanism.

A filtered property can be simultaneously disabled globally, disabled for a window class, read-only globally and read-only for a window class.

Any Inspector window may have its own filter set. This filter set is called a »Local Filter«. Local Filters have a positive working mechanism. Any entry in a local filter appears inside the Inspector, everything else is out-filtered. See also Figure 9.3, “Local Filter”.

Normally both local and the section called “Global Filters” are used at the same time. Here the local filter is applied after the the section called “Global Filters”. This behavior can be changed through the Inspector context menu to the right side of the tabset. Where the menu entry »Disable Global Filters« disables the the section called “Global Filters” for this Inspector. After which the local filter is the sole used filter.

Each Inspector section uses its own local filter! Re-calling »Customize Local Filter« after selecting another section, actualizes the local filter dialog. In addition, the new section is listed in the dialog’s title bar.

Conditions are script evaluated for a given property and category. There are two ways to assign a condition for a property: Directly for the property, and as a regular expression.

There is currently no Graphical User Interface for customizing conditions. Conditions are assigned via the global settings.


The condition, presented in Example 11.10, “Transparent Colour Condition” expects two terms as a colour definition in »value«; the first term is the colour. The second term is the opacity of said colour. The condition queries for the parent window’s »background« colour and mixes both colours according to the opacity value. The entry inside the Inspector is then altered and the calculated colour applied.

The Example 11.10, “Transparent Colour Condition” is registered for »(.*)ground$« and »(.*)color$« inside the »Configure« category. Example 11.11, “Transparent Colour Registration” explains how the condition is registered.


Another condition is registered for images. The image condition test whether a specified Tk image does already exist, and opens a file browser if it does not yet exist.