Class TRbwDataGrid

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TRbwDataGrid = class(TCustomRBWDataGrid)

Description

TRbwDataGrid is a TStringGrid that restricts the data displayed in a cell based on the Format of the TRbwColumn associated with the cell. Cells can also display a combobox or button in a cell

.

Hierarchy

Overview

Fields

Private FColumns: TRbwDataGridColumns;
Private FCurRow: integer;
Private FFixedCols: integer;

Methods

Private procedure AdjustColWidths(const ACol: integer);
Private procedure AdjustRowHeights(const ARow: integer);
Private procedure FillCaptionList(CellCaption: string; const CaptionList: TStringList; Width: integer);
Private function RequiredCellHeight(const ACol, ARow: integer): integer;
Private function RequiredCellWidth(const ACol, ARow: integer): integer;
Private procedure SetCells(ACol, ARow: Integer; const Value: string);
Private procedure SetColumns(const Value: TRbwDataGridColumns);
Protected function CollectionItem(const ACol, ARow: Longint): TCustomRowOrColumn; override;
Protected procedure ColumnMoved(FromIndex, ToIndex: Longint); override;
Protected function CreateColumns: TRbwDataGridColumns; dynamic;
Protected procedure DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState); override;
Protected function GetFixedCols: integer; virtual;
Protected procedure Loaded; override;
Protected procedure SetEditText(ACol, ARow: Longint; const Value: WideString); override;
Protected procedure SetFixedCols(const Value: integer); virtual;
Protected procedure SizeChanged(OldColCount, OldRowCount: Longint); override;
Public constructor Create(AOwner: TComponent); override;
Public function DistributeText(const ACol, ARow: integer; CellContents: string): boolean;
Public destructor Destroy; override;
Public procedure InsertColumn(ACol: Integer); override;

Properties

Public property Cells[ACol, ARow: Integer]: string read GetCells write SetCells;
Published property Columns: TRbwDataGridColumns read FColumns write SetColumns;
Published property FixedCols: integer read GetFixedCols write SetFixedCols;

Description

Fields

Private FColumns: TRbwDataGridColumns;

FColumns : TRbwDataGridColumns;

See Columns.

Private FCurRow: integer;

FCurRow : integer;

In SetEditText FCurRow is set to Row. FCurRow is then used to adjust RowHeight.

Private FFixedCols: integer;

FFixedCols : integer;

See FixedCols.

Methods

Private procedure AdjustColWidths(const ACol: integer);

If AutoAdjustColWidths is true, AdjustColWidths is used to change the width of the columns.

Private procedure AdjustRowHeights(const ARow: integer);

If AutoAdjustRowHeights is true, AdjustRowHeights is used to change the height of the rows.

Private procedure FillCaptionList(CellCaption: string; const CaptionList: TStringList; Width: integer);

FillCaptionList breaks up the CellCaption into a group of lines that are narrow enough to fit in the cell (unless a single word is too long). The lines are put in CaptionList.

Private function RequiredCellHeight(const ACol, ARow: integer): integer;

RequiredCellHeight is used to calculate the height of the cell required to fit the text in the cell.

Private function RequiredCellWidth(const ACol, ARow: integer): integer;

RequiredCellWidth is used to calculate the width of the cell required to fit the text in the cell.

Private procedure SetCells(ACol, ARow: Integer; const Value: string);

See Cells.

Private procedure SetColumns(const Value: TRbwDataGridColumns);

See Columns.

Protected function CollectionItem(const ACol, ARow: Longint): TCustomRowOrColumn; override;

CollectionItem returns Columns[ACol];

Protected procedure ColumnMoved(FromIndex, ToIndex: Longint); override;

ColumnMoved calls inherited ColumnMoved and then adjusts the Checked array.

Protected function CreateColumns: TRbwDataGridColumns; dynamic;

CreateColumns creates the TRbwDataGridColumns;

Protected procedure DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState); override;

if WordWrapCaptions or WordWrapCells is true, DrawCell redraws the cell using word wrapping.

Protected function GetFixedCols: integer; virtual;

See FixedCols.

Protected procedure Loaded; override;

Set the FixedCols and Options when the grid is loaded.

Protected procedure SetEditText(ACol, ARow: Longint; const Value: WideString); override;

SetEditText Validates contents of the cell and may adjust the cell height or width if required.

Protected procedure SetFixedCols(const Value: integer); virtual;

See FixedCols.

Protected procedure SizeChanged(OldColCount, OldRowCount: Longint); override;

SizeChanged adds or removes items in Columns if the number of columns changes.

Public constructor Create(AOwner: TComponent); override;

initializes grid.

Public function DistributeText(const ACol, ARow: integer; CellContents: string): boolean;

DistributeText uses tabs and line breaks to split CellContents into a series of values which it uses to set Cells and Checked. ACol and ARow indicates the top left cell into which the values will be put.

Public destructor Destroy; override;

Destroy destroys the grid. Don't call Destroy directly. Call Free instead.

Public procedure InsertColumn(ACol: Integer); override;

Use InsertColumn to insert a column at position ACol.

Properties

Public property Cells[ACol, ARow: Integer]: string read GetCells write SetCells;

Cells is the text in the cell designated by ACol, ARow. The width or height of the cell may be changed if required.

Published property Columns: TRbwDataGridColumns read FColumns write SetColumns;

Columns allows properties of individual columns to be specified. See TRbwDataGridColumns.

Published property FixedCols: integer read GetFixedCols write SetFixedCols;

FixedCols is used to update inherited FixedCols during Loaded.


Generated by PasDoc 0.10.0 on 2006-10-31 09:56:43