An item's multivalue settings.

Usage

Set_Property(OLECtrlEntID, "OLE.Item[key]", Array)

Values

Array has the following structure:

 
PosNameTypeDescriptionDefault
<1>
DataTextThe item's data
""
<2>
Data Type
 <2, 1>
TypeOptionThe item's data type, used to make sorting accurate and efficient
Text
 <2, 2>
FormatFormatted StringThe item's data format, used to present the data to the user
""
<3>
ClassTextThe item's class, an application specific string used for classification purposes
""
<4>
ImageFormatted StringThe item's image, either a file or a key pointing to a global image
""
<5>
Colors
 <5, 1>
Text ColorColorThe color of the item's text
WindowText
 <5, 2>
BackgroundColor FillThe item's background
Window
<6>
FontFontThe font used to render the item's data
Tahoma, 8 pt.
<7>
Alignment
 <7, 1>
HorizontalOptionThe horizontal alignment of the item's data
Left
 <7, 2>
VerticalOptionThe vertical alignment of the item's data
Center
<8>
SortOptionThe item's sort setting
None
<9>
Check BoxOptionThe item's check box setting
None
<10>
ExpandableBooleanWhether or not the item can be expanded or collapsed by the user
1
<11>
HeightIntegerThe item's height
16
<12>
HyperlinkBooleanWhether or not the item displays hyperlink feedback to the user
0
<13>
SelectableBooleanWhether or not the item can be selected by the user
1
<14>
Swatch ColorColor FillA custom colored rectangle that appears at the beginning or end of an item
None
<15>
Swatch PositionOptionThe position of the swatch, if there is one: Left or Right
Left
<16>
Swatch Size
 <16, 1>
WidthIntegerThe swatch width, in pixels, if there is one
13
 <16, 2>
HeightIntegerThe swatch height, in pixels, if there is one
13
<17>
FieldsList of user defined fields and their values: each value has the following format:
""
 <17, x, 1>
Field NameTextThe unique field name
""
 <17, x, 2>
Field ValueTextThe field's value
""

Indices

 Description
Indexkey An item's unique key

Remarks

The Item property gets and sets multiple attributes of an item at once. This property is useful if you plan to alter many elements of an item at the same time. Each field of this large multivalue structure is detailed below.

Data

This field sets the item's data. The data is the text that is displayed to the user. Usually, this is just simple text, but you can display other kinds of data as well by modifying the next field. See ItemData for details.

Data Type

The data type field establishes the type of data and its output format. The first value of this field sets the data type and the second value determines how that data type is formatted. The data type will be used to determine how the items are sorted, since sorting dates is different than sorting strings. See ItemType for details.

Class

This field sets the item's class. The class is simply a mechanism for classifying items, and the data you put here can be anything you deem appropriate. Think of it as a generic label. For example, you might have item whose data is "Maple" while setting its class to "Tree". This property becomes extremely useful when using Conditions. See ItemClass for details.

Image

The image field establishes the item's image, that is, the icon that appears next to the item's data. You can set this field to an actual image file, or just set it to a key that points to a global image. See the ItemImage property for details.

Colors

This two-part field sets the item's colors. The first value sets the text color and the second value sets the item's background. The text can be any valid Color value while the background utilizes the powerful Color Fill technology. See ItemColors for details.

Font

This field sets the font used to render the item's data. See the Font documentation for more details on its multivalued structure. See ItemFont for details.

Alignment

The alignment field has two values for justifying the data. The first value aligns the data horizontally and can be set to "Left", "Center", or "Right". The second value aligns the data vertically and can be set to "Top", "Center", or "Bottom". See ItemAlignment for details.

Sort

The sort field sets the item's persistent sort setting. Set this to "None", "Ascending", or "Descending". See ItemSort for details.

Check Box

This field determines if a check box should appear next to the item. You can set this field to "None", "Left", or "Right". See ItemCheckBox for details.

Expandable

The expandable field establishes whether or not the item can be expanded or collapsed by the user. If disabled, then no expansion button will appear next to the item. See ItemExpandable for details.

Height

The height field sets the item's height, in pixels. By default, items are 16 pixels high. Use this field to customize the height. See ItemHeight for details.

This field determines whether or not the item will react like a hyperlink when the user hovers over it. When enabled, the cursor changes to a hand and the data is underlined. See ItemHyperlink for details.

Selectable

This field establishes whether or not the item can be selected by the user. Disable this if you don't want the user to select the item for any reason. See ItemSelectable for details.

Swatches

Swatches are custom colored rectangles that appear before or after an item's content. This little feature can be used in some applications to indicate some kind of status for an item. Perhaps a red swatch indicates an error that needs to be addressed. Three fields define a swatch. Field <14> defines it's color, field <15> sets its position, and field <16> sets it's size. See ItemSwatchColorItemSwatchPosition, and ItemSwatchSize for details.

Fields

Each item can have any number of user defined fields added to it. Field <17> allows you to set them all at once. Each value in this field is a key/value pair. Each value has two sub-values: field name and field value. The field name can be any unique string, and the value can be anything you want. See ItemField or ItemFields for details.

Example

// Convert an item into a non-selectable blue hyperlink 
// In this example, the item's key is "Link" 
Item = Get_Property(@Window:".OLE_TREE", "OLE.Item[Link]") 

Item<5, 1> = "Blue"     ; // Make it blue 
Item<12> = 1            ; // Make it a hyperlink 
Item<13> = 0            ; // Make it non-selectable 

* Set the item's new attributes 
Set_Property(@Window:".OLE_TREE", "OLE.Item[Link]", Item)

See Also

ItemAlignmentItemCheckBoxItemClassItemColorsItemDataItemExpandableItemFieldItemFieldsItemFontItemHeightItemHyperlinkItemImageItemSelectableItemSortItemSwatchColorItemSwatchPosition, ItemSwatchSizeItemType

  • No labels