Class TTreeMapItem

Unit

Declaration

type TTreeMapItem = class(TObject)

Description

A single node in a treemap: a weighted, captioned rectangle.

The most important attribute is TTreeMapItem.Size, the weight from which the item's area in the layout is derived. Items live inside a TTreeMapContainer, which keeps them sorted by size and owns them. An item may itself own a container of child items (TTreeMapItem.Children), which are drawn as a nested treemap.

Hierarchy

Overview

Methods

Public constructor Create( asize: int64; acaption: string; afill: TColor = $203040; atext: TColor = $f8f8f8; adata: pointer = nil );
Public destructor Destroy; override;
Public function HasChildren: boolean;

Properties

Public property Size: int64 read fSize;
Public property Rect: TRect read fRect;
Public property Caption: string read fCaption write fCaption;
Public property Info: string read fInfo write fInfo;
Public property BackgroundColor: TColor read fBackgroundColor write fBackgroundColor;
Public property ForegroundColor: TColor read fForegroundColor write fForegroundColor;
Public property Data: pointer read fData write fData;
Public property Tag: integer read fTag write fTag;
Public property ImageIndex: integer read fImageIndex write fImageIndex;
Public property Children: TTreeMapContainer read GetChildren;
Public property Selected: boolean read fSelected;

Description

Methods

Public constructor Create( asize: int64; acaption: string; afill: TColor = $203040; atext: TColor = $f8f8f8; adata: pointer = nil );

Creates an item.

Parameters
asize
The item's size/weight, driving its area in the layout.
acaption
The caption text shown on the tile.
afill
The tile background/fill color.
atext
The caption/text color.
adata
An optional user pointer stored in TTreeMapItem.Data.
Public destructor Destroy; override;

Destroys the item and frees its child container, if any.

Public function HasChildren: boolean;

Returns True if the item owns at least one child item (that is, when TTreeMapItem.Children is non-empty).

Properties

Public property Size: int64 read fSize;

The item's size/weight. Set at creation; change it through TTreeMapContainer.UpdateSize so the owning container stays sorted.

Public property Rect: TRect read fRect;

The rectangle assigned to the item by the layouter, in the coordinate space of the surface it was laid out on. Read-only; updated during layout.

Public property Caption: string read fCaption write fCaption;

The caption text drawn on the tile.

Public property Info: string read fInfo write fInfo;

Secondary information text drawn on the tile (for example a formatted size).

Public property BackgroundColor: TColor read fBackgroundColor write fBackgroundColor;

The tile fill color.

Public property ForegroundColor: TColor read fForegroundColor write fForegroundColor;

The caption/text color.

Public property Data: pointer read fData write fData;

An arbitrary user pointer, for linking the item to application data.

Public property Tag: integer read fTag write fTag;

An arbitrary user integer, free for application use.

Public property ImageIndex: integer read fImageIndex write fImageIndex;

Index into the control's TTreeMap.Images list of the icon shown on the tile, or -1 for none.

Public property Children: TTreeMapContainer read GetChildren;

Optional child items, drawn as a nested treemap inside this item's tile. Their sizes and TTreeMapContainer.TotalSize are independent of this item's own TTreeMapItem.Size and of the TTreeMapContainer.TotalSize of the container holding this item. Reading this property creates the child container on demand.

Public property Selected: boolean read fSelected;

True when the item is selected. Change it through TTreeMap.SetSelected or TTreeMap.ClearSelection.


Generated by PasDoc 1.0.4.