Unit rDBGrid

DescriptionUsesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

rDBGrid is enhanced DBGrid component which provides many new functions (show checkboxes, graphics and memo fields, build-in editors, pictures in title row or in data cells, multiple line titles and rows, sorting functions, fiter buttons, grouping fields etc).

Updated version compatible with Delphi2010+ and 64bit platform. Splash screen in demo version.

Overview

Classes, Interfaces, Objects and Records

Name Description
record TColumnStoredProp record definition for storing of default column width and actual filter
record TSummaryResults define record for calculated summary
Class TrDBGridInplaceEditEx define inplace editor
Class TTitleLineText define object for setting of text in title of grid
Class TFixedColText define object for setting of text in fixed column
Class TFooterRow define object for setting of text in fixed column
Class TCellParamsCond define object for storing of one condition for cell highlighting
Class TCellParamsCondList define list of conditions for cell highlighting
record TGroupInfo define record for grouped field
Class TrDBGrid enhanced DBGrid component which provides many new functions (show checkboxes, glyph for graphics and memo fields, build-in editors, pictures in title row or in data cells, multiple line titles, sorting functions etc)
Class TrDBGridCustomSorter define base Sorter component for dataset sorting; must be used as based class for any other dataset sorter

Functions and Procedures

procedure ResortAllGrids(F: TForm; ToFirst: boolean); overload;

Types

TOptionEx = (...);
TOptionsEx = set of TOptionEx;
TLookupCondition = (...);
TColumnWidth = (...);
TColumnStoredProps = array of TColumnStoredProp;
TSortFieldNames = array of string;
TSortDirections = array of boolean;
TChangeSortEvent = procedure(Sender: TObject; DataSet: TDataSet; SortFieldName: string; SortDesc: boolean; var Accept: boolean) of object;
TChangeSortEventEx = procedure(Sender: TObject; DataSet: TDataSet; SortFieldNames: TSortFieldNames; SortDirections: TSortDirections; var Accept: boolean) of object;
TLoadPickListEvent = procedure(Sender: TObject; DS: TDataSet; FieldName: string; PickList: TStrings) of object;
TGetHintStringEventEx = procedure(Sender: TObject; UnderMouseColumn: TColumn; TitleRow, FooterRow: boolean; FieldValues: TStrings; CellText: string; var HintString: string) of object;
TDrawTitleLineEvent = procedure(Sender: TObject; const Rect: TRect; var Text: string) of object;
TGetFixedColStateEvent = procedure(Sender: TObject; ActiveRow: boolean; AFont: TFont; var Text: string; var CheckBoxChecked: boolean) of object;
TGetFixedRowStateEvent = procedure(Sender: TObject; DataCol: integer; Column: TColumn; AFont: TFont; var Text: string; var RotateText: boolean) of object;
TGetCellParamsEvent = procedure(Sender: TObject; Field: TField; AFont: TFont; var Background: TColor; ActiveRow, Highlight: boolean) of object;
TGetSummaryResultEvent = procedure(Sender: TObject; F: TField; SummaryResults: TSummaryResults; TagStr: string; ForFooter: boolean; var DisplayText: string) of object;
TDrawFooterRowEvent = procedure(Sender: TObject; FooterRect: TRect; var FooterSimpleText: string; var DefaultDrawing: boolean) of object;
TDrawFooterCellEvent = procedure(Sender: TObject; FooterCellRect: TRect; ColIndex: integer; Field: TField; var FooterCellText: string; var DefaultDrawing: boolean) of object;
TFooterCellClick = procedure(Sender: TObject; ACol: integer; Column: TColumn) of object;
TSetColumnFilterEvent = procedure(Sender: TObject; DataSet: TDataSet; Field: TField; FilterString: string; FilterForm: TForm) of object;
TScanDatasetEvent = procedure(Sender: TObject; DataSet: TDataSet; Reason: integer) of object;
TColWidthChangedEvent = procedure(Sender: TObject; Column: TColumn; ManualSizing: boolean) of object;
TGetEllipsisButtonFormat = procedure(Sender: TObject; ColIndex: Longint; Field: TField; var ButtonWidth: integer; var Glyph: TBitmap) of object;
TCanEditEvent = procedure(Sender: TObject; Field: TField; Column: TColumn; var CanEdit: boolean) of object;
TCellParamsCondOperators = (...);
TCellParamsCondActions = (...);

Constants

GroupHeaderSep = '::';
FieldListSep = ';';
DataImagesFieldCfg = 'Cfg_Align';
grrColumnWidth = 1;
grrSummaryCalc = 2;
grrQuickLookup = 3;
grrLoadPickList = 4;
grrCopyData = 5;
grrLoadFilterList = 6;
cSummaryTag_Sum = '%SUM';
cSummaryTag_Min = '%MIN';
cSummaryTag_Max = '%MAX';
cSummaryTag_AVG = '%AVG';
cSummaryTag_CountVal = '%COUNTVAL';
cSummaryTag_CountNull = '%COUNTNULL';
cSummaryTag_CountAll = '%COUNTALL';
cSummaryTag_SelSum = '%SELSUM';
cSummaryTag_SelMin = '%SELMIN';
cSummaryTag_SelMax = '%SELMAX';
cSummaryTag_SelAVG = '%SELAVG';
cSummaryTag_SelCountVal = '%SELCOUNTVAL';
cSummaryTag_SelCountNull = '%SELCOUNTNULL';
cSummaryTag_SelCountAll = '%SELCOUNTALL';

Description

Functions and Procedures

procedure ResortAllGrids(F: TForm; ToFirst: boolean); overload;

find all rDBGrids on the form and call Resort procedure for each of them

Types

TOptionEx = (...);

list of OptionEx properties

Values
  • dgTitleExBtn:  
  • dgTitleBtn:  
  • dgFixColBtn:  
  • dgBool:  
  • dgMemo:  
  • dgMemoShowText:  
  • dgGraphic:  
  • dgGraphicShowImg:  
  • dgDateTimePicker:  
  • dgDrawRowFocus:  
  • dgDrawColoredRow:  
  • dgOneClickCheckbox:  
  • dgAutoSaveCheckBox:  
  • dgHideHScrollBar:  
  • dgNotProcDblClick:  
  • dgNotProcMemoDblClick:  
  • dgNotProcGraphicDblClick:  
  • dgOnlyPickListValues:  
  • dgAllowReadOnlyButton:  
  • dgNotHighlightMultiselect:  
  • dgStandardTabKey:  
  • dgDragCell:  
  • dgUseTitlePopup:  
  • dgAutoPickListWidth:  
  • dgUseCellParamsConditions:  
  • dgFilterButtons:  
  • dgMultiFieldFilter:  
  • dgFieldGroups:  
  • dgAlwaysUseFieldGroupColors:  
  • dgAllowPasteMultipleCells:  
  • dgRotateTitleText:  
  • dgBlockInsertByKey:  
TOptionsEx = set of TOptionEx;

set of OptionEx properties

TLookupCondition = (...);

list of possible AutoLookup conditions

Values
  • lcNever:  
  • lcBrowse:  
  • lcNotEdit:  
TColumnWidth = (...);

list of possible column width types

Values
  • cwNone:  
  • cwDefaultWidth:  
  • cwSameWidth:  
  • cwAutoWidth:  
  • cwDataWidth:  
  • cwLabelWidth:  
  • cwDataLabelWidth:  
TColumnStoredProps = array of TColumnStoredProp;

array type for storing of TColumnStoredProp for all columns

TSortFieldNames = array of string;

array of field names used for sorting

TSortDirections = array of boolean;

array of directions used for sorting

TChangeSortEvent = procedure(Sender: TObject; DataSet: TDataSet; SortFieldName: string; SortDesc: boolean; var Accept: boolean) of object;

event is called after click on title row to provide sorting if Sorter component is not used; if "Accept" remains true, "SortFieldName" and "SortDesc" is changed and sort marker is shown, in other case nothing is changed; obsolete, use ChangeSortEventEx for multifield sorting

TChangeSortEventEx = procedure(Sender: TObject; DataSet: TDataSet; SortFieldNames: TSortFieldNames; SortDirections: TSortDirections; var Accept: boolean) of object;

Enhanced event with MultiField sorting supprt; event is called after click on title row to provide sorting if Sorter component is not used; if "Accept" remains true, "SortFieldName" and "SortDirections" is changed and sort marker is shown, in other case nothing is changed

TLoadPickListEvent = procedure(Sender: TObject; DS: TDataSet; FieldName: string; PickList: TStrings) of object;

event is called to load picklist for particular field - usually by aggregated query

TGetHintStringEventEx = procedure(Sender: TObject; UnderMouseColumn: TColumn; TitleRow, FooterRow: boolean; FieldValues: TStrings; CellText: string; var HintString: string) of object;

event is called before showing of hint window to get user defined hint string HintFieldValue contain value of field defined by HintFieldName from record under mouse

TDrawTitleLineEvent = procedure(Sender: TObject; const Rect: TRect; var Text: string) of object;

event is called to get title line text or draw title line directly

TGetFixedColStateEvent = procedure(Sender: TObject; ActiveRow: boolean; AFont: TFont; var Text: string; var CheckBoxChecked: boolean) of object;

event is called to get font and text of fixed column cell

TGetFixedRowStateEvent = procedure(Sender: TObject; DataCol: integer; Column: TColumn; AFont: TFont; var Text: string; var RotateText: boolean) of object;

event is called to get font and text of fixed row cell (title cell)

TGetCellParamsEvent = procedure(Sender: TObject; Field: TField; AFont: TFont; var Background: TColor; ActiveRow, Highlight: boolean) of object;

event is called to get params of data cell

TGetSummaryResultEvent = procedure(Sender: TObject; F: TField; SummaryResults: TSummaryResults; TagStr: string; ForFooter: boolean; var DisplayText: string) of object;

event is called to get calculated value of field (sum, min, max, avg ...)

TDrawFooterRowEvent = procedure(Sender: TObject; FooterRect: TRect; var FooterSimpleText: string; var DefaultDrawing: boolean) of object;

event is called to get footer simpletext or draw footer rect directly

TDrawFooterCellEvent = procedure(Sender: TObject; FooterCellRect: TRect; ColIndex: integer; Field: TField; var FooterCellText: string; var DefaultDrawing: boolean) of object;

event is called to get footer cell text or draw footer cell directly

TFooterCellClick = procedure(Sender: TObject; ACol: integer; Column: TColumn) of object;

event is called after click to footer cell

TSetColumnFilterEvent = procedure(Sender: TObject; DataSet: TDataSet; Field: TField; FilterString: string; FilterForm: TForm) of object;

event is called after setting filter for any column

TScanDatasetEvent = procedure(Sender: TObject; DataSet: TDataSet; Reason: integer) of object;

event is called before and after dataset scan

TColWidthChangedEvent = procedure(Sender: TObject; Column: TColumn; ManualSizing: boolean) of object;

event is called after changing of column width

TGetEllipsisButtonFormat = procedure(Sender: TObject; ColIndex: Longint; Field: TField; var ButtonWidth: integer; var Glyph: TBitmap) of object;

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

TCanEditEvent = procedure(Sender: TObject; Field: TField; Column: TColumn; var CanEdit: boolean) of object;

event is called before editing of cell, CanEdit define possibility to editation

TCellParamsCondOperators = (...);

list of operators for cell highlighting conditions

Values
  • cpoEqual:  
  • cpoLess:  
  • cpoLessOrEq:  
  • cpoGreater:  
  • cpoGreaterOrEq:  
  • cpoNotEqual:  
  • cpoStart:  
  • cpoNotStart:  
  • cpoContain:  
  • cpoNotContain:  
  • cpoAllways:  
TCellParamsCondActions = (...);

list of logical operators for cell highlighting conditions

Values
  • cpaSet:  
  • cpaAND:  
  • cpaOR:  

Constants

GroupHeaderSep = '::';
 
FieldListSep = ';';
 
DataImagesFieldCfg = 'Cfg_Align';
 
grrColumnWidth = 1;

constants used by BeforeScanDataset and AfterScanDataset events to indicate reason of dataset scan

grrSummaryCalc = 2;
 
grrQuickLookup = 3;
 
grrLoadPickList = 4;
 
grrCopyData = 5;
 
grrLoadFilterList = 6;
 
cSummaryTag_Sum = '%SUM';

constans used as TAG for summary text in title content popup and for footer row

cSummaryTag_Min = '%MIN';
 
cSummaryTag_Max = '%MAX';
 
cSummaryTag_AVG = '%AVG';
 
cSummaryTag_CountVal = '%COUNTVAL';
 
cSummaryTag_CountNull = '%COUNTNULL';
 
cSummaryTag_CountAll = '%COUNTALL';
 
cSummaryTag_SelSum = '%SELSUM';
 
cSummaryTag_SelMin = '%SELMIN';
 
cSummaryTag_SelMax = '%SELMAX';
 
cSummaryTag_SelAVG = '%SELAVG';
 
cSummaryTag_SelCountVal = '%SELCOUNTVAL';
 
cSummaryTag_SelCountNull = '%SELCOUNTNULL';
 
cSummaryTag_SelCountAll = '%SELCOUNTALL';
 

Author

Created

Oct 2006

Last Modified

May 2017


Generated by PasDoc 0.13.0 on 2017-06-17 14:57:06