Class TRbwRowDataGrid

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TRbwRowDataGrid = class(TCustomRBWDataGrid)

Description

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

.

Hierarchy

Overview

Fields

Private FColumns: TAutoAdjustColumns;
Private FFixedCols: integer;
Private FFixedRows: integer;
Private FRows: TRbwDataGridRows;

Methods

Private procedure AdjustColWidths(const ACol: integer);
Private function GetFixedCols: integer;
Private function RequiredCellWidth(const ACol, ARow: integer): integer;
Private procedure SetCells(ACol, ARow: Integer; const Value: string);
Private procedure SetColumns(const Value: TAutoAdjustColumns);
Private procedure SetFixedCols(const Value: integer);
Private procedure SetRows(const Value: TRbwDataGridRows);
Protected function CollectionItem(const ACol, ARow: Longint): TCustomRowOrColumn; override;
Protected procedure ColumnMoved(FromIndex, ToIndex: Longint); override;
Protected function CreateColumns: TAutoAdjustColumns; dynamic;
Protected function CreateRows: TRbwDataGridRows; dynamic;
Protected function GetFixedRows: integer; virtual;
Protected procedure Loaded; override;
Protected procedure RowMoved(FromIndex, ToIndex: Longint); override;
Protected procedure SetFixedRows(const Value: integer); virtual;
Protected procedure SizeChanged(OldColCount, OldRowCount: Longint); override;
Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public procedure InsertColumn(ACol: Integer); override;
Public procedure InsertRow(ARow: Integer); override;

Properties

Public property Cells[ACol, ARow: Integer]: string read GetCells write SetCells;
Published property Columns: TAutoAdjustColumns read FColumns write SetColumns;
Published property FixedCols: integer read GetFixedCols write SetFixedCols;
Published property FixedRows: integer read GetFixedRows write SetFixedRows;
Published property Rows: TRbwDataGridRows read FRows write SetRows;

Description

Fields

Private FColumns: TAutoAdjustColumns;

FColumns : TAutoAdjustColumns;

See Columns.

Private FFixedCols: integer;

FFixedCols : integer;

See FixedCols.

Private FFixedRows: integer;

FFixedRows : integer;

See FixedRows.

Private FRows: TRbwDataGridRows;

FRows : TRbwDataGridRows;

See Rows.

Methods

Private procedure AdjustColWidths(const ACol: integer);

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

Private function GetFixedCols: integer;

See FixedCols.

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: TAutoAdjustColumns);

See Columns.

Private procedure SetFixedCols(const Value: integer);

See FixedCols.

Private procedure SetRows(const Value: TRbwDataGridRows);

See Rows.

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

CollectionItem returns Rows[ARow].

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

ColumnMoved adjusts Columns when the user moves a column.

Protected function CreateColumns: TAutoAdjustColumns; dynamic;

CreateColumns creates and returns an instance of TAutoAdjustColumns.

Protected function CreateRows: TRbwDataGridRows; dynamic;

CreateRows creates and returns an instance of TRbwDataGridRows.

Protected function GetFixedRows: integer; virtual;

See FixedRows.

Protected procedure Loaded; override;

Loaded sets the FixedCols and FixedRows and calls AdjustColWidths for each column.

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

RowMoved adjusts Rows when the user moves a row.

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

See FixedRows.

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

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

Public constructor Create(AOwner: TComponent); override;

Create initializes grid.

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.

Public procedure InsertRow(ARow: Integer); override;

Use InsertRow to insert a row at position ARow.

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 of the cell may be changed if required.

Published property Columns: TAutoAdjustColumns read FColumns write SetColumns;

Columns is used to specify if the width of a column should be automatically adjusted to fit its content.

Published property FixedCols: integer read GetFixedCols write SetFixedCols;

FixedCols is the number of fixed columns in the grid.

Published property FixedRows: integer read GetFixedRows write SetFixedRows;

FixedRows is the number of fixed rows in the grid.

Published property Rows: TRbwDataGridRows read FRows write SetRows;

Rows allows properties of individual rows to be specified. See TRbwDataGridRows.


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