TMS TInspectorBar Developers Guide
TMS TInspectorBar Developers Guide
TMS TInspectorBar
DEVELOPERS GUIDE
TMS TInspectorBar
DEVELOPERS GUIDE
June 2020
1
TMS SOFTWARE
TMS TInspectorBar
DEVELOPERS GUIDE
Index
Availability .......................................................................................................... 3
List of included components ...................................................................................... 3
Online references .................................................................................................. 3
Purchase a license ................................................................................................. 3
Main features ....................................................................................................... 4
Getting started ..................................................................................................... 5
TInspectorPanel with Items collection ....................................................................... 6
TInspectorItem .................................................................................................. 7
Custom editors .................................................................................................10
Events ...............................................................................................................12
Styles ...............................................................................................................14
Metro style ......................................................................................................14
TAdvFormStyler, TAdvAppStyler .............................................................................15
Tips and FAQ .......................................................................................................17
2
TMS SOFTWARE
TMS TInspectorBar
DEVELOPERS GUIDE
Availability
TMS TInspectorBar is a VCL component for Win32 & Win64 application development and is available
for Delphi 7, 2007, 2009, 2010, XE, XE2, XE3, XE4, XE5, XE6, XE7, XE8, 10 Seattle,10.1 Berlin, 10.2
Tokyo, 10.3 Rio, 10.4 Sydney C++Builder 2007, 2009, 2010, XE, XE2, XE3, XE4, XE5, XE6, XE7, XE8,
10 Seattle, 10.1 Berlin, 10.2 Tokyo, 10.3 Rio, 10.4 Sydney (Prof/Enterprise/Architect)
- TInspectorBar
- TDBInspectorBar
- TRTTIInspectorBar
- TAEInspectorEditLink
- TColComboInspectorEditLink
- TMemoInspectorEditLink
- TAdvMoneyEditInspectorEditLink
- TAdvSpinEditInspectorEditLink
Online references
Purchase a license
TMS TInspectorBar is available in the following bundles:
3
TMS SOFTWARE
TMS TInspectorBar
DEVELOPERS GUIDE
Main features
• TInspectorbar, TINIInspectorbar, TRTTIInspectorbar, TDBInspectorbar
• Standard Outlook large and small icon size panels
• Can accept controls in InspectorPanels
• Build in support for checkboxes, edits, comboboxes, spin editors, datetime pickers, font editing,
color picker, password edit ..
• Custom inplace editors support
• Visual Studio .NET toolbox style
• Optional build-in DBNavigator in DBInspectorBar
• Background textures, gradients, images in items
• Various shading styles for panel captions, including XP button style & bitmap effects
• Various hover effects
• Full visual styles support on Windows XP
• GlyFX DBNavigator glyphs
• Compatible with TMS TAdvFormStyler / TAdvAppStyler
4
TMS SOFTWARE
TMS TInspectorBar
DEVELOPERS GUIDE
Getting started
Drop a TInspectorBar on the form and right-click to open the panels editor via the context menu to
add panels to the TInspectorbar1.
The method ‘clear’ is also available from the context menu and removes all existing panels.
1
TIP: When using the TMS Component Pack and the context menu Panels to add TInspecorPanels
does not appear, this means you have not installed the design time package. Make sure that the
package TMSDExx.DPK is effectively installed and active in the IDE and this issue will be solved.
5
TMS SOFTWARE
TMS TInspectorBar
DEVELOPERS GUIDE
Via the items editor we can add new items, delete an existing item or move a selected item
up/down.
6
TMS SOFTWARE
TMS TInspectorBar
DEVELOPERS GUIDE
The InspectorPanel has 4 styles. It can be used as navigational control where each item represents a
selection. The selection can be shown as a small image with caption text on the right side, a larger
image with caption at the bottom and a radiobutton.
In addition to this mode, there is the psProperties style where an item represents a property shown
as a name in the left column and a value with optionally an editor for the value in the right column.
When using the InspectorPanel in style psProperties, the left column shows the caption of
properties. The caption text is set with the Item's Caption property. The value is shown in the right
column and the value can be set in different ways depending on the type:
The width of the left column is set with InspectorPanel.CaptionWidth and the background color of
the left column is set with InspectorPanel.CaptionColor. The font for the caption can also be set
with a different font. It is controlled by InspectorPanel.CaptionFont. When
InspectorPanel.AllowResize is set to true and InspectorPanel.ShowGridLines is also set to true, the
left column can be resized at runtime by clicking and dragging the column grid line. The type of the
editor is set with InspectorItem.PropertyType.
TInspectorItem
7
TMS SOFTWARE
TMS TInspectorBar
DEVELOPERS GUIDE
When the InspectorItem is used in a TInspectorPanel with style psButton, psLargeIcon, psSmallIcon,
the properties that are used are the caption and several properties that can be used to set the
image:
When the InspectorItem is used in a TInspectorPanel with style psProperties, several additional
properties are used. The PropertyType will determine how the property is shown in the right column
and what editor will be used to edit it.
8
TMS SOFTWARE
TMS TInspectorBar
DEVELOPERS GUIDE
9
TMS SOFTWARE
TMS TInspectorBar
DEVELOPERS GUIDE
Custom editors
(More information on custom editors can be found in the InspectorBarCustomEditors demo that is
included in the samples distribution.)
TAEInspectorEditLink
TColComboInspectorEditLink
TMemoInspectorEditLink
10
TMS SOFTWARE
TMS TInspectorBar
DEVELOPERS GUIDE
TAdvMoneyEditInspectorEditLink
TAdvSpinEditInspectorEditLink
11
TMS SOFTWARE
TMS TInspectorBar
DEVELOPERS GUIDE
Events
Following events are available in the TInspectorBar:
- OnButtonClick
- OnCustomEditButton
- OnCustomEditDraw
- OnEditAutoAdvance
- OnEditBtnClick
- OnEditCheckChange
- OnEditColorChange
- OnEditComboChange
- OnEditDblClick
- OnEditSpinChange
- OnEditSpinDown
- OnEditSpinUp
- OnEditStart
- OnEditStop
- OnEditUpdate
- OnFileDrop
- OnGetValueList
- OnHelpAnchorClick
- OnItemAnchorClick
- OnItemClick
- OnItemClose
- OnItemDblClick
- OnItemDraw
- OnItemOpen
- OnItemRightClick
12
TMS SOFTWARE
TMS TInspectorBar
DEVELOPERS GUIDE
- OnItemValue
- OnPanelCaptionClick
- OnPanelCaptionRightClick
- OnPanelClose
- OnPanelDraw
- OnPanelOpen
- OnPanelOpened
- OnStartLabelEdit
- OnStopLabelEdit
- OnURLClick
- OnURLDrop
13
TMS SOFTWARE
TMS TInspectorBar
DEVELOPERS GUIDE
Styles
Metro style
To make it easier and faster, TInspectorBar has built-in presets for Office colors and can also set the
TInspectorBar in Metro style.
The Metro style can also be set in code. The TInspectorBar component implements the ITMSTones
interface (see TMS Metro Controls guide for more background on this interface and Metro style in
general). As such, the method InspectorBar.SetColorTones(ATones: TColorTones) can be called. To
set the default Metro tones, add the unit AdvStyleIF and the code:
14
TMS SOFTWARE
TMS TInspectorBar
DEVELOPERS GUIDE
TAdvFormStyler, TAdvAppStyler
A TAdvFormStyler is supposed to be dropped on a form and it will control the style of all TMS
components on the form that implement the ITMSStyle interface. TInspectorBar implements this
interface. A TAdvFormStyler will only affect components on the form itself. For application-wide
appearance control, in addition to a TAdvFormStyler on a form, a TAdvAppStyler component can be
dropped on a datamodule and is connected to the TAdvFormStyler components on the forms. By
setting then a single property in TAdvAppStyler on the datamodule, the complete application
appearance can change, both at design-time but also dynamically at run-time.
Please see the article: http://www.tmssoftware.com/site/atbdev3.asp that explains how you can
use the TAdvFormStyler /TAdvAppStyler.
15
TMS SOFTWARE
TMS TInspectorBar
DEVELOPERS GUIDE
16
TMS SOFTWARE
TMS TInspectorBar
DEVELOPERS GUIDE
A tree structure can be added in InspectorBar items by using the item's Level property. By default,
all items have Level = 0, meaning that all items are treated as root items. When Level is set to a
value different from zero, this means that the item becomes the child item of another item before
this item with a smaller Level property value. In this sample code snippet, a panel is
programmatically created and a tree structure of a root item, a child item and a child of this child
item is inserted.
Following code:
begin
InspectorBar1.Panels.Add;
InspectorBar1.PanelCaption.SideDisplay := true;
InspectorBar1.PanelCaption.SideWidth := 20;
InspectorBar1.PanelCaption.OpenCloseGraphic := ocgCross;
InspectorBar1.Mode := imMultiPanelActive;
InspectorBar1.Panels[0].Caption := 'A panel';
InspectorBar1.Panels[0].ItemHeight := 23;
InspectorBar1.Panels[0].Items.Add;
InspectorBar1.Panels[0].Items.Add;
InspectorBar1.Panels[0].Items.Add;
InspectorBar1.Panels[0].Items.Add;
InspectorBar1.Panels[0].Style := psProperties;
InspectorBar1.Panels[0].Items[0].Level := 0;
InspectorBar1.Panels[0].Items[0].Caption := 'Root 0';
InspectorBar1.Panels[0].Items[1].Level := 1;
InspectorBar1.Panels[0].Items[1].Caption := 'Item';
InspectorBar1.Panels[0].Items[2].Level := 2;
InspectorBar1.Panels[0].Items[2].Caption := 'SubItem';
InspectorBar1.Panels[0].Items[3].Level := 0;
InspectorBar1.Panels[0].Items[3].Caption := 'Root 1';
end;
Results in:
17
TMS SOFTWARE
TMS TInspectorBar
DEVELOPERS GUIDE
This code adds a new panel in property style and adds on regular editable item:
var
pnl: TInspectorPanel;
inspi: TInspectorItem;
begin
pnl := inspectorbar1.Panels.Add;
pnl.Style := psProperties;
inspi := pnl.Items.Add;
inspi.PropertyType := ptText;
inspi.Caption := 'Edit';
end;
This item can be programmatically set into edit mode with the code:
begin
inspectorbar1.SetFocus;
inspectorbar1.StartEdit(inspectorbar1.Panels[0].Items[0]);
end;
You can programmatically open / close a panel in imMultiPanelActive mode by toggling the
Panel.Open: Boolean property.
18