Class TrStringGridEd

Unit

Declaration

type TrStringGridEd = class(TStringGrid)

Description

enhanced StringGrid component which introduce Columns property for setting and storing of properties for each column

Hierarchy

  • TStringGrid
  • TrStringGridEd

Overview

Methods

Public procedure BeginUpdate(UseChangeLog: boolean = false);
Public procedure EndUpdate;
Public function InplaceEditorEx: TrStringGridEdInplaceEdit;
Public function IsValidData(ACol, ARow: longint): TrStringGridEdDataState;
Public function GetDataType(ACol, ARow: longint): TrStringGridEdDataType;
Public function GetDataAlignment(ACol, ARow: longint): TAlignment;
Public function GetEditStyleEx(ACol, ARow: longint): TrStringGridEdEditStyle;
Public function GetNumFormat(ACol, ARow: longint): string;
Public procedure GetCellStyle(ACol, ARow: longint; ACanvas: TCanvas);
Public function CellInSelectedRange(ACol, ARow: longint): boolean;
Public procedure ClearSelRange;
Public function CopySelRange: string;
Public procedure PasteSelRange(CanExpandGrid: boolean; const PasteData: string = '');
Public function CopyEntireTable(IncludingFixedRows: boolean = true; IncludingFixedColumns: boolean = true): string;
Public procedure PasteEntireTable(CanExpandGrid: boolean; const PasteData: string = '');
Public procedure ClearEntireTable(IncludingFixedCells: boolean = false);
Public procedure SaveToFile(const FileName: string);
Public procedure LoadFromFile(const FileName: string; SkipAllChecks: boolean = false);
Public function FindIniRow(const IniKey: string): longint;
Public function SaveToIniFile(const IniFileName: string): string;
Public procedure LoadFromIniFile(const IniFileName: string; const IniFileContent: string = '');
Public procedure LoadValuesFromIniFile(const IniFileName: string; const IniFileContent: string = '');
Public function IsIniGroupRow(ARow: longint): boolean;
Public procedure SetColumnAutoFit(ColIdx: longint);
Public procedure SetColumnsAutoFit;
Public procedure DoEllipsisClick;
Public procedure FinishEditing;
Public procedure ResetChangeLog;
Public function ActiveCellText: string;
Public function IsRowEmpty(ARow: longint; SkipFixedCol: boolean = true; ColumnGroup: integer = 0): boolean;
Public procedure SelectFirstCell;
Public procedure MoveRowEx(FromIndex, ToIndex: longint);
Public procedure InsertRowEx(RowIndex: longint; Activate: boolean = true);
Public procedure DeleteRowEx(RowIndex: longint);
Public procedure MoveColumnEx(FromIndex, ToIndex: longint);
Public procedure InsertColumnEx(ColIndex: longint; Activate: boolean = true);
Public procedure DeleteColumnEx(ColIndex: longint);
Public procedure SortData(ColIndex: integer; Desc: boolean = false; ResetSelection: boolean = false);

Properties

Public property ScaleRatio: double read FScaleRatio;
Public property StringCells[ACol,ARow:longint]: string read GetStringCells write SetStringCells;
Public property NumCells[ACol,ARow:longint]: double read GetNumCells write SetNumCells;
Public property IntCells[ACol,ARow:longint]: integer read GetIntCells write SetIntCells;
Public property BoolCells[ACol,ARow:longint]: boolean read GetBoolCells write SetBoolCells;
Public property SelectedRange: TGridRect read GetSelectedRange write SetSelectedRange;
Public property IniValues[constIniKey:string]: string read GetIniValue write SetIniValue;
Public property ChangedRows: TStrings read FChangedRows;
Public property ChangedCells: TStrings read FChangedCells;
Published property OnMouseWheelUp: TNotifyEvent read FOnMouseWheelUp write FOnMouseWheelUp;
Published property OnMouseWheelDown: TNotifyEvent read FOnMouseWheelDown write FOnMouseWheelDown;
Published property CustomGlyphs: TrCustomGlyphs read FCustomGlyphs write SetCustomGlyphs;
Published property OptionsEx: TOptionsEx read FOptionsEx write SetOptionsEx default[];
Published property ColCount: longint read GetColCount write SetColCount default 5;
Published property Columns: TrStringGridEdColumns read FColumns write FColumns;
Published property IniKeyColumn: integer read FIniKeyColumn write FIniKeyColumn default 0;
Published property IniValueColumn: integer read FIniValueColumn write FIniValueColumn default 1;
Published property InnerMargin: integer read FInnerMargin write SetInnerMargin default 0;
Published property TitleRowHeight: integer read FTitleRowHeight write SetTitleRowHeight default 0;
Published property AutoRowHeight: boolean read FAutoRowHeight write SetAutoRowHeight default false;
Published property AutoAddNewRow: boolean read FAutoAddNewRow write SetAutoAddNewRow default false;
Published property ChangedCellsBkColor: TColor read FChangedCellsBkColor write SetChangedCellsBkColor default clInfoBk;
Published property DateTimePickerCreate: TDateTimePickerCreate read FDateTimePickerCreate write FDateTimePickerCreate;
Published property DateTimePickerEvent: TDateTimePickerEvent read FDateTimePickerEvent write FDateTimePickerEvent;
Published property OnGetHintText: TGetHintText read FGetHintText write FGetHintText;
Published property OnCellClick: TFixedCellClickEvent read FOnCellClick write FOnCellClick;
Published property OnEllipsisClicked: TrStringGridEdCellEvent read FOnEllipsisClicked write FOnEllipsisClicked;
Published property OnPicklistDropdown: TrStringGridEdDropdownEvent read FOnPicklistDropdown write FOnPicklistDropdown;
Published property OnEditorEvent: TrStringGridEdEditorEvent read FOnEditorEvent write FOnEditorEvent;
Published property OnGetCellParams: TGetCellParamsEvent read FOnGetCellParams write FOnGetCellParams;
Published property OnGetCellParamsEx: TGetCellParamsEventEx read FOnGetCellParamsEx write FOnGetCellParamsEx;
Published property OnGetDataType: TGetDataTypeEvent read FOnGetDataType write FOnGetDataType;
Published property OnGetNumFormat: TGetNumFormat read FOnGetNumFormat write FOnGetNumFormat;
Published property OnGetEditStyle: TGetEditStyleEvent read FOnGetEditStyle write FOnGetEditStyle;
Published property OnCanEdit: TCanEditEvent read FOnCanEdit write FOnCanEdit;
Published property OnFinishCellEditing: TrStringGridEdCellEvent read FOnFinishCellEditing write FOnFinishCellEditing;
Published property OnEditorKeyPress: TKeyPressEvent read FOnEditorKeyPress write FOnEditorKeyPress;
Published property OnColumnRestoreDefault: TOnColumnRestoreDefault read FOnColumnRestoreDefault write FOnColumnRestoreDefault;
Published property OnGetEllipsisButtonFormat: TGetEllipsisButtonFormat read FOnGetEllipsisButtonFormat write FOnGetEllipsisButtonFormat;
Published property OnProgress: TOnProgress read FOnProgress write FOnProgress;

Description

Methods

Public procedure BeginUpdate(UseChangeLog: boolean = false);
 
Public procedure EndUpdate;
 
Public function InplaceEditorEx: TrStringGridEdInplaceEdit;

access to internal inplace editor

Public function IsValidData(ACol, ARow: longint): TrStringGridEdDataState;

return state of data in cell - empty, ok, invalid, outoflimit

Public function GetDataType(ACol, ARow: longint): TrStringGridEdDataType;

return type of data in cell - text, int, double, datetime

Public function GetDataAlignment(ACol, ARow: longint): TAlignment;

return alignment of data in cell

Public function GetEditStyleEx(ACol, ARow: longint): TrStringGridEdEditStyle;

return edit style of data in cell

Public function GetNumFormat(ACol, ARow: longint): string;

return numeric format of data in cell

Public procedure GetCellStyle(ACol, ARow: longint; ACanvas: TCanvas);

set Canvas style for data in cell

Public function CellInSelectedRange(ACol, ARow: longint): boolean;

return whether cell is inside of range select

Public procedure ClearSelRange;

clear content of selected range

Public function CopySelRange: string;

copy selected range to clipboard, columns are separated by TABs and prepared to paste in Excel

Public procedure PasteSelRange(CanExpandGrid: boolean; const PasteData: string = '');

paste values from clipboard to cells starting by selected cell (columns separated by TABs)

Public function CopyEntireTable(IncludingFixedRows: boolean = true; IncludingFixedColumns: boolean = true): string;

copy entire table to clipboard, returns clipboard text

Public procedure PasteEntireTable(CanExpandGrid: boolean; const PasteData: string = '');

paste values from clipboard to grid from cell 0,0 (columns separated by TABs)

Public procedure ClearEntireTable(IncludingFixedCells: boolean = false);

clear all cells

Public procedure SaveToFile(const FileName: string);

store entire table to file, columns are separated by TABs and prepared for using in Excel

Public procedure LoadFromFile(const FileName: string; SkipAllChecks: boolean = false);

load entire table from file (columns separated by TABs)

Public function FindIniRow(const IniKey: string): longint;

find row index of the Key

Public function SaveToIniFile(const IniFileName: string): string;

store 2 columns to ini file if defined and/or return inifile text content (Key=Value)

Public procedure LoadFromIniFile(const IniFileName: string; const IniFileContent: string = '');

load 2 columns from ini file or from inifile text content (Key=Value), increase row count if needed

Public procedure LoadValuesFromIniFile(const IniFileName: string; const IniFileContent: string = '');

load ValueColumn from ini file (Key=Value), do not change KeyColumn and row count

Public function IsIniGroupRow(ARow: longint): boolean;

return whether row is defined as Group row for INI grid

Public procedure SetColumnAutoFit(ColIdx: longint);

set column width according data width

Public procedure SetColumnsAutoFit;

set all columns width according data width

Public procedure DoEllipsisClick;

simulate click to ellipsis button

Public procedure FinishEditing;

hide editor and finish editing

Public procedure ResetChangeLog;

reset list of changed Rows and Cells

Public function ActiveCellText: string;

return content of active cell

Public function IsRowEmpty(ARow: longint; SkipFixedCol: boolean = true; ColumnGroup: integer = 0): boolean;

return true if all cells in row is empty

Public procedure SelectFirstCell;

move cursor to first selectable cell

Public procedure MoveRowEx(FromIndex, ToIndex: longint);

move row to new position

Public procedure InsertRowEx(RowIndex: longint; Activate: boolean = true);

insert new empty row to define index position

Public procedure DeleteRowEx(RowIndex: longint);

delete whole row

Public procedure MoveColumnEx(FromIndex, ToIndex: longint);

move column to new position

Public procedure InsertColumnEx(ColIndex: longint; Activate: boolean = true);

insert new empty column to define index position

Public procedure DeleteColumnEx(ColIndex: longint);

delete whole column

Public procedure SortData(ColIndex: integer; Desc: boolean = false; ResetSelection: boolean = false);

sort data/rows according selected column

Properties

Public property ScaleRatio: double read FScaleRatio;

define actual scale ratio relative to original designed size

Public property StringCells[ACol,ARow:longint]: string read GetStringCells write SetStringCells;

read and set cells as string value

Public property NumCells[ACol,ARow:longint]: double read GetNumCells write SetNumCells;

read and set cells as double value

Public property IntCells[ACol,ARow:longint]: integer read GetIntCells write SetIntCells;

read and set cells as integer value

Public property BoolCells[ACol,ARow:longint]: boolean read GetBoolCells write SetBoolCells;

read and set cells as boolean value

Public property SelectedRange: TGridRect read GetSelectedRange write SetSelectedRange;

return or set selection range coordinates

Public property IniValues[constIniKey:string]: string read GetIniValue write SetIniValue;

load or set Value for the Key

Public property ChangedRows: TStrings read FChangedRows;

store list of Row index which was modified

Public property ChangedCells: TStrings read FChangedCells;

store list of cells coordinates which was modified; format: ColIdx;RowIdx

Published property OnMouseWheelUp: TNotifyEvent read FOnMouseWheelUp write FOnMouseWheelUp;
 
Published property OnMouseWheelDown: TNotifyEvent read FOnMouseWheelDown write FOnMouseWheelDown;
 
Published property CustomGlyphs: TrCustomGlyphs read FCustomGlyphs write SetCustomGlyphs;

define link to rCustomGlyphs component which can define all glyphs

Published property OptionsEx: TOptionsEx read FOptionsEx write SetOptionsEx default[];

list of new options

Published property ColCount: longint read GetColCount write SetColCount default 5;

define number of columns, columns collection is updated automatically

Published property Columns: TrStringGridEdColumns read FColumns write FColumns;

columns collection, for detail see TrStringGridEdColumns

Published property IniKeyColumn: integer read FIniKeyColumn write FIniKeyColumn default 0;

define index of Key column for INI function

Published property IniValueColumn: integer read FIniValueColumn write FIniValueColumn default 1;

define index of Value column for INI function

Published property InnerMargin: integer read FInnerMargin write SetInnerMargin default 0;

define inner space between cell border and text in cell

Published property TitleRowHeight: integer read FTitleRowHeight write SetTitleRowHeight default 0;

Defines number of lines in title row

Published property AutoRowHeight: boolean read FAutoRowHeight write SetAutoRowHeight default false;

define whether row of column is set automatically, can be used with textwrap property of some column

Published property AutoAddNewRow: boolean read FAutoAddNewRow write SetAutoAddNewRow default false;

define whether new row is automatically added if last row is edited

Published property ChangedCellsBkColor: TColor read FChangedCellsBkColor write SetChangedCellsBkColor default clInfoBk;

define background color of changed cells (used if dgColorChangedCells is set to true)

Published property DateTimePickerCreate: TDateTimePickerCreate read FDateTimePickerCreate write FDateTimePickerCreate;

event type for creating of DateTimePicker

Published property DateTimePickerEvent: TDateTimePickerEvent read FDateTimePickerEvent write FDateTimePickerEvent;

event type for DateTimePicker action

Published property OnGetHintText: TGetHintText read FGetHintText write FGetHintText;

event for user defined setting of hint string

Published property OnCellClick: TFixedCellClickEvent read FOnCellClick write FOnCellClick;

event for user defined action after user click to any non fixed cell

Published property OnEllipsisClicked: TrStringGridEdCellEvent read FOnEllipsisClicked write FOnEllipsisClicked;

event for user defined action after click to ellipsis button

Published property OnPicklistDropdown: TrStringGridEdDropdownEvent read FOnPicklistDropdown write FOnPicklistDropdown;

event for user defined setting of values after click on drop down button

Published property OnEditorEvent: TrStringGridEdEditorEvent read FOnEditorEvent write FOnEditorEvent;

universal event called in different events of inplace editor

Published property OnGetCellParams: TGetCellParamsEvent read FOnGetCellParams write FOnGetCellParams;

event for user defined setting of individual cell params - font, color

Published property OnGetCellParamsEx: TGetCellParamsEventEx read FOnGetCellParamsEx write FOnGetCellParamsEx;

event for user defined setting of individual cell extended params - font, color, image

Published property OnGetDataType: TGetDataTypeEvent read FOnGetDataType write FOnGetDataType;

event for user defined setting of datatype for individual cell

Published property OnGetNumFormat: TGetNumFormat read FOnGetNumFormat write FOnGetNumFormat;

event for user defined setting of numformat for individual cell

Published property OnGetEditStyle: TGetEditStyleEvent read FOnGetEditStyle write FOnGetEditStyle;

event for user defined setting of editstyle for individual cell

Published property OnCanEdit: TCanEditEvent read FOnCanEdit write FOnCanEdit;

event for user defined setting whether individual cell can be edited

Published property OnFinishCellEditing: TrStringGridEdCellEvent read FOnFinishCellEditing write FOnFinishCellEditing;

event for user defined action after editing of cell is finished

Published property OnEditorKeyPress: TKeyPressEvent read FOnEditorKeyPress write FOnEditorKeyPress;

event for user defined action after press of key in editor

Published property OnColumnRestoreDefault: TOnColumnRestoreDefault read FOnColumnRestoreDefault write FOnColumnRestoreDefault;

event for user defined action for setting of default values

Published property OnGetEllipsisButtonFormat: TGetEllipsisButtonFormat read FOnGetEllipsisButtonFormat write FOnGetEllipsisButtonFormat;

event is called to define format of Ellipsis button in the cell

Published property OnProgress: TOnProgress read FOnProgress write FOnProgress;
 

Generated by PasDoc 0.15.0.