Class TGUIListBox

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TGUIListBox = class(TGUIElement)

Description

Default list box GUI element.

Hierarchy

Overview

Methods

Public function AddItem(const Text: StringType; Icon: LongInt=-1): LongWord; inline;
Public function GetItemDefaultColor(ColorType: TGUIListBoxColor): TARGBColor; inline;
Public function GetItemIcon(Index: LongWord): LongInt; inline;
Public function GetItemOverrideColor(Index: LongWord; ColorType: TGUIListBoxColor): TARGBColor; inline;
Public function GetItemText(Index: LongWord): StringType; inline;
Public function HasItemOverrideColor(Index: LongWord; ColorType: TGUIListBoxColor): Boolean; inline;
Public function InsertItem(Index: LongWord; const Text: StringType; Icon: LongInt=-1): LongInt; inline;
Public procedure Clear; inline;
Public procedure ClearItemOverrideColor(Index: LongWord); overload; inline;
Public procedure ClearItemOverrideColor(Index: LongWord; ColorType: TGUIListBoxColor); overload; inline;
Public procedure RemoveItem(Index: LongWord); inline;
Public procedure SelectItem(const Text: StringType); overload; inline;
Public procedure SelectItem(Index: LongWord); overload; inline;
Public procedure SetItemOverrideColor(Index: LongWord; Color: TARGBColor); overload; inline;
Public procedure SetItemOverrideColor(Index: LongWord; ColorType: TGUIListBoxColor; Color: TARGBColor); overload; inline;
Public procedure SetItemProperties(Index: LongWord; const Text: StringType; Icon: LongInt=1); inline;
Public procedure SetSpriteBank(Bank: TGUISpriteBank); inline;
Public procedure SwapItems(Index1, Index2: LongWord); inline;

Properties

Public property AutoScroll: Boolean read IsAutoScrollEnabled write SetAutoScrollEnabled;
Public property DrawBackground: Boolean write SetDrawBackground;
Public property ItemCount: LongWord read GetItemCount;
Public property ItemHeight: LongInt write SetItemHeight;
Public property SelectedItem: LongInt read GetSelected;

Description

Methods

Public function AddItem(const Text: StringType; Icon: LongInt=-1): LongWord; inline;

Adds an list item with an icon.

Parameters
Text
Text of list entry.
Icon
Sprite index of the Icon within the current sprite bank. Set it to -1 if you want no icon.
Returns

The ID of the new created item.

Public function GetItemDefaultColor(ColorType: TGUIListBoxColor): TARGBColor; inline;

Resolves a TGUIListBoxColor to the color used by default.

Parameters
ColorType
The default color name.
Returns

The default color which is used for the given ColorType. This value can be overridden by calling SetItemOverrideColor.

Public function GetItemIcon(Index: LongWord): LongInt; inline;

Returns the icon of an item.

Returns

The index of the item's index in the associated GUISpriteBank. If there is none, -1 will be returned.

Public function GetItemOverrideColor(Index: LongWord; ColorType: TGUIListBoxColor): TARGBColor; inline;

Gets the real color an item uses to draw a default color.

Parameters
Index
The zero-based index of the item to read.
ColorType
The default color name to resolve.
Returns

The overridden color value, if any, else the default color.

Public function GetItemText(Index: LongWord): StringType; inline;

Returns the caption for an Item.

Public function HasItemOverrideColor(Index: LongWord; ColorType: TGUIListBoxColor): Boolean; inline;

Checks whether a color type is overridden on an item.

Parameters
Index
The zero-based index of the item to read.
ColorType
The default color name to check for.
Returns

True if the default color is overridden, False otherwise.

Public function InsertItem(Index: LongWord; const Text: StringType; Icon: LongInt=-1): LongInt; inline;

Inserts a new item at a given index.

Parameters
Index
The index the new item will appear at.
Text
The caption of the new item.
Icon
The zero-based index of the new item's icon in the sprite bank. If this value is -1, no icon will be drawn.
Returns

The index of the new item on success, -1 on failure.

Public procedure Clear; inline;

Clears the list, deleting all items in the listbox.

Public procedure ClearItemOverrideColor(Index: LongWord); overload; inline;

Clears all overridden colors for an item.

Parameters
Index
The zero-based index of the item to clear.
Public procedure ClearItemOverrideColor(Index: LongWord; ColorType: TGUIListBoxColor); overload; inline;

Clears a single overridden color for an item.

Parameters
Index
The zero-based index of the item to clear.
ColorType
The overridden color type.
Public procedure RemoveItem(Index: LongWord); inline;

Returns an item.

Parameters
Index
The zero-based index of the item to remove.
Public procedure SelectItem(const Text: StringType); overload; inline;

Selects an item by caption.

Parameters
Text
The caption to search for.
Public procedure SelectItem(Index: LongWord); overload; inline;

Selects an item by index.

Parameters
Index
The zero-based index of the item to select.
Public procedure SetItemOverrideColor(Index: LongWord; Color: TARGBColor); overload; inline;

Overrides all default colors for an item with the same value.

Parameters
Index
The zero-based index of the item to modify.
The
new color.
Public procedure SetItemOverrideColor(Index: LongWord; ColorType: TGUIListBoxColor; Color: TARGBColor); overload; inline;

Overrides a default color for a single item.

Parameters
Index
The zero-based index of the item to modify.
ColorType
The default color name to override.
The
new color.
Public procedure SetItemProperties(Index: LongWord; const Text: StringType; Icon: LongInt=1); inline;

Replaces an existing item with a new one.

Parameters
Index
The zero-based index of the item to modify.
Text
The new caption.
Icon
The zero-based index of the new item's icon in the sprite bank. If this value is -1, no icon will be drawn.
Public procedure SetSpriteBank(Bank: TGUISpriteBank); inline;

Sets the sprite bank which should be used to draw list icons. This font is set to the sprite bank of the built-in-font by default. A sprite can be displayed in front of every list item. An icon is an index within the icon sprite bank. Several default icons are available in the skin through GetIcon.

Public procedure SwapItems(Index1, Index2: LongWord); inline;

Swaps two items.

Parameters
Index1
The zero-based index of the first item.
Index2
The zero-based index of the second item.

Properties

Public property AutoScroll: Boolean read IsAutoScrollEnabled write SetAutoScrollEnabled;

Specifies whether the list box should scroll automatically when an otherwise invisible item is selected.

Public property DrawBackground: Boolean write SetDrawBackground;

Specifies whether the list box should draw its own background, or if it will be transparent.

Public property ItemCount: LongWord read GetItemCount;

The currrent item count.

Public property ItemHeight: LongInt write SetItemHeight;

Sets the default item height in pixels.

Public property SelectedItem: LongInt read GetSelected;

The ID of the selected item, if any, else -1.


Generated by PasDoc 0.12.1 on 2012-09-14 17:32:22