|
2. Connect with other Component
To do this, we need to set Associate
property to point on some Component on Form (or created in Run-Time).
Example:
Associate := Button1;
3. Map Property to Item
After we have connect PropertiesView with other Component, we can
add some Items in PropertiesView and MAP them to some properties
inside associated Component.
To map Item to some property of associated Component, we use MapProperty
property. Inside this property we need to place a Name of mapped
property. Example:
MapProperty := 'Width';
MapProperty := 'Font.Size';
MapProperty := 'Color';
MapProperty := 'Constraints.MaxHeight';
After you set MapProperty, Caption
property of Item will be automatically set to MapProperty
(if Caption is empty).
4. SET property and Toolbar Item
Toolbar Items are ideal for SET properties such as Font.Style
, Anchors , BevelEdges
or even Options property in PropertiesView.
User may click on Button in Toolbar Item and to set Flags of mapped
property. All you have to do is to map Item to property and to add
Buttons. One more thing you need to do is to set Text
property of Buttons to desired flag.
Example:
TMySet = set of (msOne, msTwo, msThree);
You need to add 3 Buttons and to set Text
property for first button to msOne, for
second to msTwo and for third to msThree.
How to set Toolbar Item for Font.Style
property:
- Place one TPropertiesView (PropertiesView1)
and one TButton (Button1)
component on Form
- Set Associate Property of PropertiesView1
to Button1.
- Add First Category and one TFontStyleItem
inside it. TFontStyleItem is a TToolbarItem
descendant.
- Select this new added Toolbar Item in Items Editor
- Set MapProperty to Font.Style
- Click on ... button beside Button
property of Item to open Buttons Editor.
- Set Text property of Bold Button to
fsBold, for Italic Button to fsItalic
and for Underline to fsUnderline. This
step is required.
5. ENUMERATION property and TComboBoxItem
ComboBox Items are ideal for ENUMERATION Properties like Align
, Visible or even Style
Property of PropertiesView. In Delphi IDE, all this properties have
Drop-down List when you click on it in ObjectInspector. To map Item
to ENUM property, you need to manually add desired members of ENUM
property into Lines property of ComboBox
Item.
Example:
TPropertiesStyle = (psDefault, psOffice2003, psWhidbey);
All you need is to click on ... button
beside Lines property of Item and to add all this members inside.
We recommend downloading attached demo source for more details.
if you have some comments please send us email to support@bergsoftware.net
|