cxGridTableView.pas
上传用户:jackyxiao
上传日期:2020-12-19
资源大小:40962k
文件大小:442k
源码类别:
Delphi控件源码
开发平台:
Delphi
- {********************************************************************}
- { }
- { Developer Express Visual Component Library }
- { ExpressQuantumGrid }
- { }
- { Copyright (c) 1998-2009 Developer Express Inc. }
- { ALL RIGHTS RESERVED }
- { }
- { The entire contents of this file is protected by U.S. and }
- { International Copyright Laws. Unauthorized reproduction, }
- { reverse-engineering, and distribution of all or any portion of }
- { the code contained in this file is strictly prohibited and may }
- { result in severe civil and criminal penalties and will be }
- { prosecuted to the maximum extent possible under the law. }
- { }
- { RESTRICTIONS }
- { }
- { THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES }
- { (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE }
- { SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS }
- { LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL }
- { ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. }
- { }
- { THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED }
- { FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE }
- { COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE }
- { AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT }
- { AND PERMISSION FROM DEVELOPER EXPRESS INC. }
- { }
- { CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON }
- { ADDITIONAL RESTRICTIONS. }
- { }
- {********************************************************************}
- unit cxGridTableView;
- {$I cxVer.inc}
- interface
- uses
- {$IFDEF DELPHI6}
- Variants,
- {$ENDIF}
- Windows, Messages,
- Classes, Graphics, Controls, ImgList, Forms, Buttons, StdCtrls, ExtCtrls, ComCtrls,
- cxClasses, cxControls, cxGraphics, cxLookAndFeels, cxLookAndFeelPainters, cxStyles,
- cxStorage, cxPC, cxListBox,
- cxContainer, cxEdit, cxTextEdit,
- cxGrid, cxGridCommon, cxGridLevel, cxGridCustomView, cxGridCustomTableView, cxGridDetailsSite,
- cxCustomData, cxData, cxDataStorage, cxFilter;
- const
- htGridBase = 200;
- htGroupByBox = htGridBase + 1;
- htColumnHeader = htGridBase + 2;
- htColumnHeaderHorzSizingEdge = htGridBase + 3;
- htColumnHeaderFilterButton = htGridBase + 4;
- htFooter = htGridBase + 5;
- htFooterCell = htGridBase + 6;
- htGroupFooter = htGridBase + 7;
- htGroupFooterCell = htGridBase + 8;
- htRowIndicator = htGridBase + 9;
- htRowSizingEdge = htGridBase + 10;
- htIndicator = htGridBase + 11;
- htIndicatorHeader = htGridBase + 12;
- htRowLevelIndent = htGridBase + 13;
- htHeader = htGridBase + 14;
- htGroupSummary = htGridBase + 15;
- ckHeader = 2;
- ckGroupByBox = 3;
- ckFooter = 4;
- cxGridDefaultIndicatorWidth = 12;
- cxGridCustomRowSeparatorDefaultWidth = 6;
- cxGridCustomRowSeparatorMinWidth = 2;
- cxGridPreviewDefaultLeftIndent = 20;
- cxGridPreviewDefaultMaxLineCount = 3;
- cxGridPreviewDefaultRightIndent = 5;
- cxGridHeaderSizingEdgeSize = 8;
- cxGridRowSizingEdgeSize = 8;
- cxGridOffice11GroupRowSeparatorWidth: Integer = 2;
- // record kind
- rkFiltering = 2;
- isColumnFirst = isCustomItemLast + 1;
- isFooter = isColumnFirst;
- isGroupSummary = isColumnFirst + 1;
- isHeader = isColumnFirst + 2;
- isColumnLast = isHeader;
- bbTableFirst = bbCustomTableLast + 1;
- bbFooter = bbTableFirst;
- bbHeader = bbTableFirst + 1;
- bbGroup = bbTableFirst + 2;
- bbGroupByBox = bbTableFirst + 3;
- bbIndicator = bbTableFirst + 4;
- bbPreview = bbTableFirst + 5;
- bbTableLast = bbPreview;
- vsTableFirst = vsCustomTableLast + 1;
- vsFilterRowInfoText = vsTableFirst;
- vsFooter = vsTableFirst + 1;
- vsGroup = vsTableFirst + 2;
- vsGroupByBox = vsTableFirst + 3;
- vsGroupFooterSortedSummary = vsTableFirst + 4;
- vsGroupSortedSummary = vsTableFirst + 5;
- vsGroupSummary = vsTableFirst + 6;
- vsHeader = vsTableFirst + 7;
- vsNewItemRowInfoText = vsTableFirst + 8;
- vsIndicator = vsTableFirst + 9;
- vsPreview = vsTableFirst + 10;
- vsTableLast = vsPreview;
- {$IFDEF BCB}
- siFooter = 0;
- siGroupFooter = 1;
- siGroup = 2;
- {$ENDIF}
- type
- TcxGridTableCustomizationForm = class;
- TcxGridTableController = class;
- TcxCustomGridRow = class;
- TcxGridMasterDataRow = class;
- TcxGridGroupRow = class;
- TcxGridViewData = class;
- TcxGridColumnHeaderAreaPainterClass = class of TcxGridColumnHeaderAreaPainter;
- TcxGridColumnContainerViewInfo = class;
- TcxGridColumnHeaderAreaViewInfoClass = class of TcxGridColumnHeaderAreaViewInfo;
- TcxGridColumnHeaderAreaViewInfo = class;
- TcxGridColumnHeaderFilterButtonViewInfo = class;
- TcxGridColumnHeaderGlyphViewInfo = class;
- TcxGridColumnHeaderViewInfoClass = class of TcxGridColumnHeaderViewInfo;
- TcxGridColumnHeaderViewInfo = class;
- TcxGridHeaderViewInfo = class;
- TcxGridGroupByBoxViewInfo = class;
- TcxGridFooterViewInfo = class;
- TcxCustomGridIndicatorItemViewInfo = class;
- TcxGridIndicatorHeaderItemViewInfo = class;
- TcxGridIndicatorRowItemViewInfo = class;
- TcxGridIndicatorFooterItemViewInfo = class;
- TcxGridIndicatorViewInfo = class;
- TcxGridRowFooterViewInfo = class;
- TcxGridRowFootersViewInfo = class;
- TcxCustomGridRowViewInfo = class;
- TcxGridRowsViewInfo = class;
- TcxGridTableViewInfo = class;
- TcxGridTableViewInfoCacheItem = class;
- TcxGridColumn = class;
- TcxGridTableView = class;
- TcxGridColumnContainerKind = Integer;
- { hit tests }
- // custom column
- TcxCustomGridColumnHitTest = class(TcxCustomGridViewHitTest)
- public
- Column: TcxGridColumn;
- ColumnContainerKind: TcxGridColumnContainerKind;
- end;
- // group by box
- TcxGridGroupByBoxHitTest = class(TcxCustomGridViewHitTest)
- protected
- class function GetHitTestCode: Integer; override;
- end;
- // column header
- TcxGridColumnHeaderHitTest = class(TcxCustomGridColumnHitTest)
- protected
- class function GetHitTestCode: Integer; override;
- public
- function DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; override;
- end;
- TcxGridColumnHeaderHorzSizingEdgeHitTest = class(TcxCustomGridColumnHitTest)
- protected
- class function GetHitTestCode: Integer; override;
- public
- function Cursor: TCursor; override;
- function DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; override;
- end;
- TcxGridColumnHeaderFilterButtonHitTest = class(TcxCustomGridColumnHitTest)
- protected
- class function GetHitTestCode: Integer; override;
- end;
- // header
- TcxGridHeaderHitTest = class(TcxCustomGridViewHitTest)
- protected
- class function GetHitTestCode: Integer; override;
- end;
- // footer
- TcxGridFooterHitTest = class(TcxCustomGridViewHitTest)
- protected
- class function GetHitTestCode: Integer; override;
- end;
- TcxGridFooterCellHitTest = class(TcxCustomGridColumnHitTest)
- protected
- class function GetHitTestCode: Integer; override;
- public
- SummaryItem: TcxDataSummaryItem;
- end;
- TcxGridGroupFooterHitTest = class(TcxGridFooterHitTest)
- protected
- class function GetHitTestCode: Integer; override;
- end;
- TcxGridGroupFooterCellHitTest = class(TcxGridFooterCellHitTest)
- protected
- class function GetHitTestCode: Integer; override;
- end;
- // indicator
- TcxGridRowIndicatorHitTest = class(TcxGridRecordHitTest)
- protected
- class function GetHitTestCode: Integer; override;
- public
- MultiSelect: Boolean;
- function Cursor: TCursor; override;
- end;
- TcxGridRowSizingEdgeHitTest = class(TcxGridRecordHitTest)
- protected
- class function GetHitTestCode: Integer; override;
- public
- function Cursor: TCursor; override;
- function DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; override;
- end;
- TcxGridIndicatorHitTest = class(TcxCustomGridViewHitTest)
- protected
- class function GetHitTestCode: Integer; override;
- end;
- TcxGridIndicatorHeaderHitTest = class(TcxGridIndicatorHitTest)
- protected
- class function GetHitTestCode: Integer; override;
- end;
- // row
- TcxGridRowLevelIndentHitTest = class(TcxGridRecordHitTest)
- protected
- class function GetHitTestCode: Integer; override;
- public
- class function CanClick: Boolean; override;
- end;
- TcxGridGroupSummaryHitTest = class(TcxGridRecordHitTest)
- private
- function GetColumn: TcxGridColumn;
- protected
- class function GetHitTestCode: Integer; override;
- public
- SummaryItem: TcxDataSummaryItem;
- property Column: TcxGridColumn read GetColumn;
- end;
- { view data }
- TcxCustomGridRowClass = class of TcxCustomGridRow;
- TcxCustomGridRow = class(TcxCustomGridRecord)
- private
- function GetAsGroupRow: TcxGridGroupRow;
- function GetAsMasterDataRow: TcxGridMasterDataRow;
- function GetGridView: TcxGridTableView;
- function GetGridViewLevel: TcxGridLevel;
- function GetIsFilterRow: Boolean;
- function GetIsNewItemRow: Boolean;
- function GetViewData: TcxGridViewData;
- protected
- procedure KeyDown(var Key: Word; Shift: TShiftState); override;
- public
- function ExpandOnDblClick: Boolean; virtual;
- function SupportsCellMultiSelect: Boolean; virtual;
- property AsGroupRow: TcxGridGroupRow read GetAsGroupRow;
- property AsMasterDataRow: TcxGridMasterDataRow read GetAsMasterDataRow;
- property GridView: TcxGridTableView read GetGridView;
- property GridViewLevel: TcxGridLevel read GetGridViewLevel;
- property IsFilterRow: Boolean read GetIsFilterRow;
- property IsNewItemRow: Boolean read GetIsNewItemRow;
- property ViewData: TcxGridViewData read GetViewData;
- end;
- TcxGridDataRow = class(TcxCustomGridRow)
- protected
- function GetHasCells: Boolean; override;
- function GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass; override;
- function GetViewInfoClass: TcxCustomGridRecordViewInfoClass; override;
- public
- function SupportsCellMultiSelect: Boolean; override;
- end;
- TcxGridNewItemRowClass = class of TcxGridNewItemRow;
- TcxGridNewItemRow = class(TcxGridDataRow)
- public
- function SupportsCellMultiSelect: Boolean; override;
- end;
- TcxGridFilterRowClass = class of TcxGridFilterRow;
- TcxGridFilterRow = class(TcxGridNewItemRow)
- private
- FSelected: Boolean;
- function GetFilterCriteriaItem(Index: Integer): TcxFilterCriteriaItem;
- protected
- procedure RefreshRecordInfo; override;
- function GetSelected: Boolean; override;
- function GetVisible: Boolean; override;
- procedure SetSelected(Value: Boolean); override;
- function GetDisplayText(Index: Integer): string; override;
- function GetValue(Index: Integer): Variant; override;
- procedure SetDisplayText(Index: Integer; const Value: string); override;
- procedure SetValue(Index: Integer; const Value: Variant); override;
- function GetDisplayTextForValue(AIndex: Integer; const AValue: Variant): string; virtual;
- function GetFilterOperatorKind(const AValue: Variant; ACheckMask: Boolean): TcxFilterOperatorKind; virtual;
- function IsFilterOperatorSupported(AKind: TcxFilterOperatorKind; const AValue: Variant): Boolean; virtual;
- procedure KeyDown(var Key: Word; Shift: TShiftState); override;
- property FilterCriteriaItems[Index: Integer]: TcxFilterCriteriaItem read GetFilterCriteriaItem;
- property InternalSelected: Boolean read FSelected write FSelected;
- public
- destructor Destroy; override;
- function CanFocusCells: Boolean; override;
- function IsEmpty: Boolean;
- end;
- TcxGridMasterDataRow = class(TcxGridDataRow)
- private
- function GetActiveDetailGridView: TcxCustomGridView;
- function GetActiveDetailGridViewExists: Boolean;
- function GetActiveDetailIndex: Integer;
- function GetActiveDetailLevel: TcxGridLevel;
- function GetDetailGridView(Index: Integer): TcxCustomGridView;
- function GetDetailGridViewCount: Integer;
- function GetDetailGridViewExists(Index: Integer): Boolean;
- function GetDetailGridViewHasData(Index: Integer): Boolean;
- function GetInternalActiveDetailGridView: TcxCustomGridView;
- function GetInternalActiveDetailGridViewExists: Boolean;
- function GetInternalActiveDetailIndex: Integer;
- procedure SetActiveDetailIndex(Value: Integer);
- procedure SetActiveDetailLevel(Value: TcxGridLevel);
- protected
- procedure DoCollapse(ARecurse: Boolean); override;
- procedure DoExpand(ARecurse: Boolean); override;
- function GetExpandable: Boolean; override;
- function GetExpanded: Boolean; override;
- function GetHasChildren: Boolean; virtual;
- function GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass; override;
- function GetViewInfoClass: TcxCustomGridRecordViewInfoClass; override;
- procedure KeyDown(var Key: Word; Shift: TShiftState); override;
- procedure ToggleExpanded; override;
- property InternalActiveDetailGridView: TcxCustomGridView read GetInternalActiveDetailGridView;
- property InternalActiveDetailGridViewExists: Boolean read GetInternalActiveDetailGridViewExists;
- property InternalActiveDetailIndex: Integer read GetInternalActiveDetailIndex;
- public
- function ExpandOnDblClick: Boolean; override;
- function GetFirstFocusableChild: TcxCustomGridRecord; override;
- function GetLastFocusableChild(ARecursive: Boolean): TcxCustomGridRecord; override;
- property ActiveDetailGridView: TcxCustomGridView read GetActiveDetailGridView;
- property ActiveDetailGridViewExists: Boolean read GetActiveDetailGridViewExists;
- property ActiveDetailIndex: Integer read GetActiveDetailIndex write SetActiveDetailIndex;
- property ActiveDetailLevel: TcxGridLevel read GetActiveDetailLevel write SetActiveDetailLevel;
- property DetailGridViewCount: Integer read GetDetailGridViewCount;
- property DetailGridViewExists[Index: Integer]: Boolean read GetDetailGridViewExists;
- property DetailGridViewHasData[Index: Integer]: Boolean read GetDetailGridViewHasData;
- property DetailGridViews[Index: Integer]: TcxCustomGridView read GetDetailGridView;
- property HasChildren: Boolean read GetHasChildren;
- end;
- TcxGridGroupRow = class(TcxCustomGridRow)
- private
- function GetGroupedColumn: TcxGridColumn;
- function GetGroupSummaryItems: TcxDataGroupSummaryItems;
- protected
- procedure DoCollapse(ARecurse: Boolean); override;
- procedure DoExpand(ARecurse: Boolean); override;
- //function GetDestroyingOnExpanding: Boolean; override;
- function GetExpandable: Boolean; override;
- function GetExpanded: Boolean; override;
- function GetDisplayCaption: string; virtual;
- function GetDisplayText(Index: Integer): string; override;
- function GetDisplayTextValue: string; virtual;
- function GetIsData: Boolean; override;
- function GetIsParent: Boolean; override;
- function GetValue: Variant; reintroduce; virtual;
- function GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass; override;
- function GetViewInfoClass: TcxCustomGridRecordViewInfoClass; override;
- procedure SetDisplayText(Index: Integer; const Value: string); override;
- procedure SetValue(Index: Integer; const Value: Variant); override;
- public
- function GetGroupSummaryInfo(var ASummaryItems: TcxDataSummaryItems;
- var ASummaryValues: PVariant): Boolean;
- property DisplayCaption: string read GetDisplayCaption;
- property DisplayText: string read GetDisplayTextValue;
- property GroupedColumn: TcxGridColumn read GetGroupedColumn;
- property GroupSummaryItems: TcxDataGroupSummaryItems read GetGroupSummaryItems;
- property Value: Variant read GetValue;
- end;
- TcxGridViewData = class(TcxCustomGridTableViewData)
- private
- FFilterRow: TcxGridFilterRow;
- function GetNewItemRow: TcxGridNewItemRow;
- function GetRow(Index: Integer): TcxCustomGridRow;
- function GetRowCount: Integer;
- protected
- function GetFirstVisibleExpandedMasterRow: TcxGridMasterDataRow; virtual;
- function GetNewItemRecordClass: TcxCustomGridRecordClass; override;
- function GetRecordByKind(AKind, AIndex: Integer): TcxCustomGridRecord; override;
- function GetRecordClass(ARecordInfo: TcxRowInfo): TcxCustomGridRecordClass; override;
- function GetRecordKind(ARecord: TcxCustomGridRecord): Integer; override;
- procedure CreateFilterRow;
- procedure DestroyFilterRow;
- procedure CheckFilterRow;
- //procedure RecreateFilterRow;
- function GetFilterRowClass: TcxGridFilterRowClass; virtual;
- public
- destructor Destroy; override;
- procedure Collapse(ARecurse: Boolean); override;
- procedure Expand(ARecurse: Boolean); override;
- function HasFilterRow: Boolean; virtual;
- function HasNewItemRecord: Boolean; override;
- function MakeDetailVisible(ADetailLevel: TComponent{TcxGridLevel}): TcxCustomGridView; override;
- //procedure Refresh(ARecordCount: Integer); override;
- property FilterRow: TcxGridFilterRow read FFilterRow;
- property NewItemRow: TcxGridNewItemRow read GetNewItemRow;
- property RowCount: Integer read GetRowCount;
- property Rows[Index: Integer]: TcxCustomGridRow read GetRow;
- end;
- { controller }
- // drag&drop objects
- TcxGridColumnHeaderMovingObjectClass = class of TcxGridColumnHeaderMovingObject;
- TcxGridColumnHeaderMovingObject = class(TcxCustomGridTableItemMovingObject)
- private
- FOriginalDestColumnContainerKind: TcxGridColumnContainerKind;
- function GetGridView: TcxGridTableView;
- function GetSourceItem: TcxGridColumn;
- function GetViewInfo: TcxGridTableViewInfo;
- procedure SetSourceItem(Value: TcxGridColumn);
- protected
- procedure CalculateDestParams(AHitTest: TcxCustomGridHitTest;
- out AContainerKind: TcxGridItemContainerKind; out AZone: TcxGridItemContainerZone); override;
- function CanRemove: Boolean; override;
- procedure CheckDestItemContainerKind(var AValue: TcxGridItemContainerKind); override;
- procedure DoColumnMoving; virtual;
- function GetArrowAreaBounds(APlace: TcxGridArrowPlace): TRect; override;
- function GetArrowAreaBoundsForHeader(APlace: TcxGridArrowPlace): TRect; virtual;
- function GetArrowsClientRect: TRect; override;
- function GetSourceItemViewInfo: TcxCustomGridCellViewInfo; override;
- function IsValidDestination: Boolean; override;
- function IsValidDestinationForVisibleSource: Boolean; virtual;
- procedure EndDragAndDrop(Accepted: Boolean); override;
- property GridView: TcxGridTableView read GetGridView;
- property OriginalDestColumnContainerKind: TcxGridColumnContainerKind
- read FOriginalDestColumnContainerKind write FOriginalDestColumnContainerKind;
- property SourceItem: TcxGridColumn read GetSourceItem write SetSourceItem;
- property ViewInfo: TcxGridTableViewInfo read GetViewInfo;
- public
- procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); override;
- end;
- TcxCustomGridSizingObject = class(TcxCustomGridDragAndDropObject)
- private
- FDestPointX: Integer;
- FDestPointY: Integer;
- FOriginalSize: Integer;
- function GetController: TcxGridTableController;
- function GetGridView: TcxGridTableView;
- function GetViewInfo: TcxGridTableViewInfo;
- procedure SetDestPointX(Value: Integer);
- procedure SetDestPointY(Value: Integer);
- protected
- procedure DirtyChanged; override;
- function GetCurrentSize: Integer; virtual;
- function GetDeltaSize: Integer; virtual;
- function GetDragAndDropCursor(Accepted: Boolean): TCursor; override;
- function GetHorzSizingMarkBounds: TRect; virtual;
- function GetImmediateStart: Boolean; override;
- function GetIsHorizontalSizing: Boolean; virtual;
- function GetSizingItemBounds: TRect; virtual; abstract;
- function GetSizingMarkBounds: TRect; virtual;
- function GetSizingMarkWidth: Integer; virtual; abstract;
- function GetVertSizingMarkBounds: TRect; virtual;
- procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override;
- property Controller: TcxGridTableController read GetController;
- property CurrentSize: Integer read GetCurrentSize;
- property DeltaSize: Integer read GetDeltaSize;
- property DestPointX: Integer read FDestPointX write SetDestPointX;
- property DestPointY: Integer read FDestPointY write SetDestPointY;
- property GridView: TcxGridTableView read GetGridView;
- property IsHorizontalSizing: Boolean read GetIsHorizontalSizing;
- property OriginalSize: Integer read FOriginalSize write FOriginalSize;
- property SizingItemBounds: TRect read GetSizingItemBounds;
- property SizingMarkBounds: TRect read GetSizingMarkBounds;
- property SizingMarkWidth: Integer read GetSizingMarkWidth;
- property ViewInfo: TcxGridTableViewInfo read GetViewInfo;
- public
- procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); override;
- end;
- TcxCustomGridColumnSizingObject = class(TcxCustomGridSizingObject)
- private
- FColumn: TcxGridColumn;
- function GetColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo;
- protected
- function GetSizingItemBounds: TRect; override;
- function GetSizingMarkWidth: Integer; override;
- property Column: TcxGridColumn read FColumn write FColumn;
- property ColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo read GetColumnHeaderViewInfo;
- public
- procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); override;
- end;
- TcxGridColumnHorzSizingObject = class(TcxCustomGridColumnSizingObject)
- protected
- procedure BeginDragAndDrop; override;
- procedure EndDragAndDrop(Accepted: Boolean); override;
- function GetCurrentSize: Integer; override;
- end;
- TcxGridRowSizingObject = class(TcxCustomGridSizingObject)
- private
- FRow: TcxCustomGridRow;
- function GetRowViewInfo: TcxCustomGridRowViewInfo;
- protected
- procedure BeginDragAndDrop; override;
- procedure EndDragAndDrop(Accepted: Boolean); override;
- function GetCurrentSize: Integer; override;
- function GetIsHorizontalSizing: Boolean; override;
- function GetSizingItemBounds: TRect; override;
- function GetSizingMarkWidth: Integer; override;
- property Row: TcxCustomGridRow read FRow;
- property RowViewInfo: TcxCustomGridRowViewInfo read GetRowViewInfo;
- public
- procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); override;
- end;
- // customization form
- TcxGridTableItemsListBox = class(TcxCustomGridTableItemsListBox)
- private
- function GetGridView: TcxGridTableView;
- function GetTextColor: TColor;
- protected
- function CalculateItemHeight: Integer; override;
- function DrawItemDrawBackgroundHandler(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; virtual; abstract;
- function GetItemEndEllipsis: Boolean; virtual; abstract;
- procedure LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); override;
- procedure UpdateBackgroundColor;
- //
- property GridView: TcxGridTableView read GetGridView;
- property TextColor: TColor read GetTextColor;
- public
- constructor Create(AOwner: TComponent); override;
- procedure PaintItem(ACanvas: TcxCanvas; R: TRect; AIndex: Integer; AFocused: Boolean); override;
- end;
- TcxGridTableColumnsListBox = class(TcxGridTableItemsListBox)
- protected
- procedure DoRefreshItems; override;
- function DrawItemDrawBackgroundHandler(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; override;
- function GetDragAndDropParams: TcxCustomGridHitTest; override;
- function GetItemEndEllipsis: Boolean; override;
- end;
- TcxGridTableCustomizationForm = class(TcxCustomGridTableCustomizationForm)
- private
- function GetColumnsListBox: TcxGridTableColumnsListBox;
- function GetColumnsPage: TcxTabSheet;
- function GetController: TcxGridTableController;
- function GetGridView: TcxGridTableView;
- function GetViewInfo: TcxGridTableViewInfo;
- protected
- function GetItemsListBoxClass: TcxCustomGridTableItemsListBoxClass; override;
- function GetItemsPageCaption: string; override;
- property ColumnsListBox: TcxGridTableColumnsListBox read GetColumnsListBox;
- property GridView: TcxGridTableView read GetGridView;
- property ViewInfo: TcxGridTableViewInfo read GetViewInfo;
- public
- property Controller: TcxGridTableController read GetController;
- property ColumnsPage: TcxTabSheet read GetColumnsPage;
- end;
- // drag open info
- TcxGridDragOpenInfoMasterDataRowTab = class(TcxGridDragOpenInfoTab)
- public
- GridRow: TcxGridMasterDataRow;
- constructor Create(ALevel: TcxGridLevel; AGridRow: TcxGridMasterDataRow); reintroduce; virtual;
- function Equals(AInfo: TcxCustomGridDragOpenInfo): Boolean; override;
- procedure Run; override;
- end;
- // popup
- TcxGridColumnsCustomizationPopup = class(TcxCustomGridItemsCustomizationPopup)
- private
- function GetGridView: TcxGridTableView;
- protected
- procedure ItemClicked(AItem: TObject; AChecked: Boolean); override;
- procedure SetItemIndex(AItem: TObject; AIndex: Integer); override;
- public
- property GridView: TcxGridTableView read GetGridView;
- end;
- // controllers
- TcxGridTableEditingController = class(TcxGridEditingController)
- private
- FApplyingImmediateFiltering: Boolean;
- function GetController: TcxGridTableController;
- function GetGridView: TcxGridTableView;
- protected
- function CanInitEditing: Boolean; override;
- function CanUpdateEditValue: Boolean; override;
- procedure DoEditChanged; override;
- procedure DoEditKeyDown(var Key: Word; Shift: TShiftState); override;
- function GetHideEditOnFocusedRecordChange: Boolean; override;
- procedure InitEdit; override;
- procedure PostEditingData; override;
- property ApplyingImmediateFiltering: Boolean read FApplyingImmediateFiltering write FApplyingImmediateFiltering;
- public
- property Controller: TcxGridTableController read GetController;
- property GridView: TcxGridTableView read GetGridView;
- end;
- TcxGridTableController = class(TcxCustomGridTableController)
- private
- FCellSelectionAnchor: TcxGridColumn;
- FHorzSizingColumn: TcxGridColumn;
- FIsFilterPopupOpenedFromHeader: Boolean;
- FKeepFilterRowFocusing: Boolean;
- FLeftPos: Integer;
- FPressedColumn: TcxGridColumn;
- FSelectedColumns: TList;
- function GetColumnsCustomizationPopup: TcxGridColumnsCustomizationPopup;
- function GetCustomizationForm: TcxGridTableCustomizationForm;
- function GetEditingController: TcxGridTableEditingController;
- function GetFocusedColumn: TcxGridColumn;
- function GetFocusedColumnIndex: Integer;
- function GetFocusedRow: TcxCustomGridRow;
- function GetFocusedRowIndex: Integer;
- function GetGridView: TcxGridTableView;
- function GetIsColumnHorzSizing: Boolean;
- function GetSelectedColumn(Index: Integer): TcxGridColumn;
- function GetSelectedColumnCount: Integer;
- function GetSelectedRow(Index: Integer): TcxCustomGridRow;
- function GetSelectedRowCount: Integer;
- function GetTopRowIndex: Integer;
- function GetViewData: TcxGridViewData;
- function GetViewInfo: TcxGridTableViewInfo;
- procedure SetFocusedColumn(Value: TcxGridColumn);
- procedure SetFocusedColumnIndex(Value: Integer);
- procedure SetFocusedRow(Value: TcxCustomGridRow);
- procedure SetFocusedRowIndex(Value: Integer);
- procedure SetLeftPos(Value: Integer);
- procedure SetPressedColumn(Value: TcxGridColumn);
- procedure SetTopRowIndex(Value: Integer);
- procedure AddSelectedColumn(AColumn: TcxGridColumn);
- procedure RemoveSelectedColumn(AColumn: TcxGridColumn);
- protected
- function CanAppend(ACheckOptions: Boolean): Boolean; override;
- function CanDelete(ACheckOptions: Boolean): Boolean; override;
- function CanEdit: Boolean; override;
- function CanInsert(ACheckOptions: Boolean): Boolean; override;
- procedure CheckCoordinates; override;
- procedure CheckLeftPos(var Value: Integer);
- procedure FocusedItemChanged(APrevFocusedItem: TcxCustomGridTableItem); override;
- procedure FocusedRecordChanged(APrevFocusedRecordIndex, AFocusedRecordIndex: Integer;
- ANewItemRecordFocusingChanged: Boolean); override;
- function GetDesignHitTest(AHitTest: TcxCustomGridHitTest): Boolean; override;
- function GetFocusedRecord: TcxCustomGridRecord; override;
- function GetIsRecordsScrollHorizontal: Boolean; override;
- function GetItemsCustomizationPopupClass: TcxCustomGridItemsCustomizationPopupClass; override;
- function GetMaxTopRecordIndexValue: Integer; override;
- function GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; override;
- function GetScrollBarRecordCount: Integer; override;
- function IsColumnFixedDuringHorzSizing(AColumn: TcxGridColumn): Boolean; virtual;
- function IsKeyForMultiSelect(AKey: Word; AShift: TShiftState;
- AFocusedRecordChanged: Boolean): Boolean; override;
- function IsPixelScrollBar(AKind: TScrollBarKind): Boolean; override;
- procedure LeftPosChanged; virtual;
- function NeedsAdditionalRowsScrolling(AIsCallFromMaster: Boolean = False): Boolean; virtual;
- procedure RemoveFocus; override;
- procedure ScrollData(ADirection: TcxDirection); override;
- procedure SetFocusedRecord(Value: TcxCustomGridRecord); override;
- procedure ShowNextPage; override;
- procedure ShowPrevPage; override;
- // internal draganddrop data scrolling
- function CanScrollData(ADirection: TcxDirection): Boolean; override;
- // selection
- function CanPostponeRecordSelection(AShift: TShiftState): Boolean; override;
- function CanProcessMultiSelect(AHitTest: TcxCustomGridHitTest;
- AShift: TShiftState): Boolean; override;
- procedure DoMouseNormalSelection(AHitTest: TcxCustomGridHitTest); override;
- procedure DoMouseRangeSelection(AClearSelection: Boolean = True; AData: TObject = nil); override;
- procedure DoNormalSelection; override;
- procedure MultiSelectKeyDown(var Key: Word; Shift: TShiftState); override;
- function SupportsAdditiveSelection: Boolean; override;
- function SupportsRecordSelectionToggling: Boolean; override;
- // special row focusing
- function DefocusSpecialRow: Boolean; virtual;
- function FocusSpecialRow: Boolean; virtual;
- procedure FilterRowFocusChanged; virtual;
- procedure FilterRowFocusChanging(AValue: Boolean); virtual;
- // pull focusing
- procedure DoPullFocusingScrolling(ADirection: TcxDirection); override;
- function GetPullFocusingScrollingDirection(X, Y: Integer; out ADirection: TcxDirection): Boolean; override;
- function SupportsPullFocusing: Boolean; override;
- // delphi drag and drop
- function GetDragOpenInfo(AHitTest: TcxCustomGridHitTest): TcxCustomGridDragOpenInfo; override;
- function GetDragScrollDirection(X, Y: Integer): TcxDirection; override;
- // customization
- procedure CheckCustomizationFormBounds(var R: TRect); override;
- function GetColumnHeaderDragAndDropObjectClass: TcxGridColumnHeaderMovingObjectClass; virtual;
- function GetCustomizationFormClass: TcxCustomGridCustomizationFormClass; override;
- // cells selection
- function CanProcessCellMultiSelect(APrevFocusedColumn: TcxGridColumn): Boolean; virtual;
- procedure CellMultiSelectKeyDown(var Key: Word; Shift: TShiftState); virtual;
- procedure DoNormalCellSelection;
- procedure DoRangeCellSelection;
- function GetCellMultiSelect: Boolean; virtual;
- property CellMultiSelect: Boolean read GetCellMultiSelect;
- // BeginsWith mask
- procedure AddBeginsWithMask(var AValue: Variant);
- procedure RemoveBeginsWithMask(var AValue: Variant);
- function GetBeginsWithMaskPos(const AValue: string): Integer;
- function GetEditingControllerClass: TcxGridEditingControllerClass; override;
- property IsFilterPopupOpenedFromHeader: Boolean read FIsFilterPopupOpenedFromHeader
- write FIsFilterPopupOpenedFromHeader;
- property KeepFilterRowFocusing: Boolean read FKeepFilterRowFocusing write FKeepFilterRowFocusing;
- property ViewData: TcxGridViewData read GetViewData;
- property ViewInfo: TcxGridTableViewInfo read GetViewInfo;
- public
- constructor Create(AGridView: TcxCustomGridView); override;
- destructor Destroy; override;
- procedure CheckScrolling(const P: TPoint); override;
- procedure ClearGrouping;
- procedure ClearSelection; override;
- procedure DoCancelMode; override;
- function IsFilterRowFocused: Boolean;
- function IsNewItemRowFocused: Boolean;
- function IsSpecialRowFocused: Boolean; virtual;
- procedure MakeItemVisible(AItem: TcxCustomGridTableItem); override;
- procedure SelectAll; override;
- procedure InitScrollBarsParameters; override;
- function IsDataFullyVisible(AIsCallFromMaster: Boolean = False): Boolean; override;
- procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode;
- var AScrollPos: Integer); override;
- procedure EndDragAndDrop(Accepted: Boolean); override;
- procedure DoKeyDown(var Key: Word; Shift: TShiftState); override;
- procedure KeyDown(var Key: Word; Shift: TShiftState); override;
- procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
- // cells selection
- procedure ClearCellSelection;
- procedure SelectAllColumns;
- procedure SelectCells(AFromColumn, AToColumn: TcxGridColumn;
- AFromRowIndex, AToRowIndex: Integer);
- procedure SelectColumns(AFromColumn, AToColumn: TcxGridColumn);
- property CellSelectionAnchor: TcxGridColumn read FCellSelectionAnchor write FCellSelectionAnchor;
- property ColumnsCustomizationPopup: TcxGridColumnsCustomizationPopup read GetColumnsCustomizationPopup;
- property CustomizationForm: TcxGridTableCustomizationForm read GetCustomizationForm;
- property EditingController: TcxGridTableEditingController read GetEditingController;
- property FocusedColumn: TcxGridColumn read GetFocusedColumn write SetFocusedColumn;
- property FocusedColumnIndex: Integer read GetFocusedColumnIndex write SetFocusedColumnIndex;
- property FocusedRow: TcxCustomGridRow read GetFocusedRow write SetFocusedRow;
- property FocusedRowIndex: Integer read GetFocusedRowIndex write SetFocusedRowIndex;
- property GridView: TcxGridTableView read GetGridView;
- property HorzSizingColumn: TcxGridColumn read FHorzSizingColumn;
- property IsColumnHorzSizing: Boolean read GetIsColumnHorzSizing;
- property LeftPos: Integer read FLeftPos write SetLeftPos;
- property PressedColumn: TcxGridColumn read FPressedColumn write SetPressedColumn;
- property SelectedColumnCount: Integer read GetSelectedColumnCount;
- property SelectedColumns[Index: Integer]: TcxGridColumn read GetSelectedColumn;
- property SelectedRowCount: Integer read GetSelectedRowCount;
- property SelectedRows[Index: Integer]: TcxCustomGridRow read GetSelectedRow;
- property TopRowIndex: Integer read GetTopRowIndex write SetTopRowIndex;
- end;
- { painters }
- // column container
- TcxGridColumnContainerPainter = class(TcxCustomGridPartPainter)
- private
- function GetViewInfo: TcxGridColumnContainerViewInfo;
- protected
- procedure DrawContent; override;
- procedure DrawItems; virtual;
- function DrawItemsFirst: Boolean; virtual;
- function ExcludeFromClipRect: Boolean; override;
- property ViewInfo: TcxGridColumnContainerViewInfo read GetViewInfo;
- end;
- // header
- TcxGridColumnHeaderAreaPainter = class(TcxCustomGridCellPainter)
- private
- function GetViewInfo: TcxGridColumnHeaderAreaViewInfo;
- protected
- function ExcludeFromClipRect: Boolean; override;
- property ViewInfo: TcxGridColumnHeaderAreaViewInfo read GetViewInfo;
- end;
- TcxGridColumnHeaderSortingMarkPainter = class(TcxGridColumnHeaderAreaPainter)
- protected
- procedure Paint; override;
- end;
- TcxGridColumnHeaderFilterButtonPainter = class(TcxGridColumnHeaderAreaPainter)
- private
- function GetViewInfo: TcxGridColumnHeaderFilterButtonViewInfo;
- protected
- procedure Paint; override;
- property ViewInfo: TcxGridColumnHeaderFilterButtonViewInfo read GetViewInfo;
- end;
- TcxGridColumnHeaderGlyphPainter = class(TcxGridColumnHeaderAreaPainter)
- private
- function GetViewInfo: TcxGridColumnHeaderGlyphViewInfo;
- protected
- procedure Paint; override;
- property ViewInfo: TcxGridColumnHeaderGlyphViewInfo read GetViewInfo;
- end;
- TcxGridColumnHeaderPainter = class(TcxCustomGridCellPainter)
- private
- function GetViewInfo: TcxGridColumnHeaderViewInfo;
- protected
- procedure DrawAreas; virtual;
- procedure DrawBorders; override;
- procedure DrawContent; override;
- procedure DrawPressed; virtual;
- function ExcludeFromClipRect: Boolean; override;
- procedure Paint; override;
- property ViewInfo: TcxGridColumnHeaderViewInfo read GetViewInfo;
- end;
- TcxGridHeaderPainter = class(TcxGridColumnContainerPainter)
- protected
- function DrawItemsFirst: Boolean; override;
- end;
- // group by box
- TcxGridGroupByBoxPainter = class(TcxGridColumnContainerPainter)
- protected
- procedure DrawBackground(const R: TRect); override;
- procedure DrawContent; override;
- function DrawItemsFirst: Boolean; override;
- end;
- // footer
- TcxGridFooterCellPainter = class(TcxGridColumnHeaderPainter)
- protected
- procedure DrawBorders; override;
- procedure DrawContent; override;
- end;
- TcxGridFooterPainterClass = class of TcxGridFooterPainter;
- TcxGridFooterPainter = class(TcxGridColumnContainerPainter)
- private
- function GetViewInfo: TcxGridFooterViewInfo;
- protected
- procedure DrawBackground(const R: TRect); override;
- procedure DrawBorders; override;
- function DrawItemsFirst: Boolean; override;
- procedure DrawSeparator; virtual;
- property ViewInfo: TcxGridFooterViewInfo read GetViewInfo;
- end;
- // indicator
- TcxCustomGridIndicatorItemPainter = class(TcxCustomGridCellPainter)
- private
- function GetViewInfo: TcxCustomGridIndicatorItemViewInfo;
- protected
- function ExcludeFromClipRect: Boolean; override;
- property ViewInfo: TcxCustomGridIndicatorItemViewInfo read GetViewInfo;
- end;
- TcxGridIndicatorHeaderItemPainter = class(TcxCustomGridIndicatorItemPainter)
- private
- function GetViewInfo: TcxGridIndicatorHeaderItemViewInfo;
- protected
- function DrawBackgroundHandler(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; override;
- procedure DrawContent; override;
- procedure DrawQuickCustomizationMark; virtual;
- property ViewInfo: TcxGridIndicatorHeaderItemViewInfo read GetViewInfo;
- end;
- TcxGridIndicatorRowItemPainter = class(TcxCustomGridIndicatorItemPainter)
- private
- function GetViewInfo: TcxGridIndicatorRowItemViewInfo;
- protected
- procedure DrawContent; override;
- property ViewInfo: TcxGridIndicatorRowItemViewInfo read GetViewInfo;
- end;
- TcxGridIndicatorFooterItemPainter = class(TcxCustomGridIndicatorItemPainter)
- private
- function GetViewInfo: TcxGridIndicatorFooterItemViewInfo;
- protected
- procedure DrawContent; override;
- procedure DrawBorders; override;
- property ViewInfo: TcxGridIndicatorFooterItemViewInfo read GetViewInfo;
- end;
- TcxGridIndicatorPainter = class(TcxCustomGridCellPainter)
- private
- function GetViewInfo: TcxGridIndicatorViewInfo;
- protected
- procedure DrawContent; override;
- procedure DrawItems; virtual;
- function DrawItemsFirst: Boolean; virtual;
- function ExcludeFromClipRect: Boolean; override;
- property ViewInfo: TcxGridIndicatorViewInfo read GetViewInfo;
- end;
- // custom row
- TcxCustomGridRowPainter = class(TcxCustomGridRecordPainter)
- private
- function GetViewInfo: TcxCustomGridRowViewInfo;
- protected
- procedure DrawFooters; virtual;
- procedure DrawIndent; virtual;
- procedure DrawIndentPart(ALevel: Integer; const ABounds: TRect); virtual;
- procedure DrawLastHorzGridLine; virtual;
- procedure DrawSeparator; virtual;
- procedure Paint; override;
- property ViewInfo: TcxCustomGridRowViewInfo read GetViewInfo;
- end;
- // rows
- TcxGridRowsPainterClass = class of TcxGridRowsPainter;
- TcxGridRowsPainter = class(TcxCustomGridRecordsPainter)
- private
- function GetViewInfo: TcxGridRowsViewInfo;
- protected
- procedure Paint; override;
- property ViewInfo: TcxGridRowsViewInfo read GetViewInfo;
- public
- class procedure DrawDataRowCells(ARowViewInfo: TcxCustomGridRowViewInfo); virtual;
- end;
- // table
- TcxGridTablePainter = class(TcxCustomGridTablePainter)
- private
- FGridLines: TList;
- function GetController: TcxGridTableController;
- function GetGridView: TcxGridTableView;
- function GetViewInfo: TcxGridTableViewInfo;
- protected
- function CanOffset(AItemsOffset, DX, DY: Integer): Boolean; override;
- procedure DrawFooter; virtual;
- procedure DrawGroupByBox; virtual;
- procedure DrawHeader; virtual;
- procedure DrawIndicator; virtual;
- procedure DrawRecords; override;
- procedure Offset(AItemsOffset: Integer); override;
- procedure Offset(DX, DY: Integer); override;
- procedure PaintContent; override;
- public
- procedure AddGridLine(const R: TRect);
- property Controller: TcxGridTableController read GetController;
- property GridView: TcxGridTableView read GetGridView;
- property ViewInfo: TcxGridTableViewInfo read GetViewInfo;
- end;
- { view infos }
- // column container
- TcxGridColumnContainerViewInfo = class(TcxCustomGridPartViewInfo)
- private
- FItemHeight: Integer;
- FItems: TList;
- function GetController: TcxGridTableController;
- function GetCount: Integer;
- function GetGridView: TcxGridTableView;
- function GetGridViewInfo: TcxGridTableViewInfo;
- function GetInternalItem(Index: Integer): TcxGridColumnHeaderViewInfo;
- function GetItem(Index: Integer): TcxGridColumnHeaderViewInfo;
- function GetItemHeight: Integer;
- protected
- function CreateItem(AIndex: Integer): TcxGridColumnHeaderViewInfo; virtual;
- procedure CreateItems; virtual;
- procedure DestroyItems; virtual;
- function GetColumn(Index: Integer): TcxGridColumn; virtual; abstract;
- function GetColumnCount: Integer; virtual; abstract;
- function GetItemClass: TcxGridColumnHeaderViewInfoClass; virtual;
- function CalculateItemHeight: Integer; virtual;
- function GetAutoHeight: Boolean; virtual;
- function GetColumnAdditionalWidth(AColumn: TcxGridColumn): Integer;
- function GetColumnMinWidth(AColumn: TcxGridColumn): Integer; virtual;
- function GetColumnNeighbors(AColumn: TcxGridColumn): TcxNeighbors; virtual;
- function GetColumnWidth(AColumn: TcxGridColumn): Integer; virtual;
- function GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; virtual;
- function GetItemMultiLinePainting(AItem: TcxGridColumnHeaderViewInfo): Boolean; virtual;
- function GetItemsAreaBounds: TRect; virtual;
- function GetItemsHitTest(const P: TPoint): TcxCustomGridHitTest; virtual;
- function GetKind: TcxGridColumnContainerKind; virtual; abstract;
- function GetPainterClass: TcxCustomGridCellPainterClass; override;
- function GetZonesAreaBounds: TRect; virtual;
- procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override;
- procedure Offset(DX, DY: Integer); override;
- property AutoHeight: Boolean read GetAutoHeight;
- property ColumnCount: Integer read GetColumnCount;
- property Columns[Index: Integer]: TcxGridColumn read GetColumn;
- property Controller: TcxGridTableController read GetController;
- property ZonesAreaBounds: TRect read GetZonesAreaBounds;
- public
- constructor Create(AGridViewInfo: TcxCustomGridTableViewInfo); override;
- destructor Destroy; override;
- procedure BeforeRecalculation; override;
- function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
- function GetZone(const P: TPoint): TcxGridItemContainerZone; virtual;
- property Count: Integer read GetCount;
- property GridView: TcxGridTableView read GetGridView;
- property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
- property InternalItems[Index: Integer]: TcxGridColumnHeaderViewInfo read GetInternalItem;
- property ItemHeight: Integer read GetItemHeight;
- property Items[Index: Integer]: TcxGridColumnHeaderViewInfo read GetItem; default;
- property ItemsAreaBounds: TRect read GetItemsAreaBounds;
- property Kind: TcxGridColumnContainerKind read GetKind;
- end;
- // column header areas
- TcxGridColumnHeaderAreaViewInfo = class(TcxCustomGridViewCellViewInfo)
- private
- FColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo;
- function GetColumn: TcxGridColumn;
- function GetGridView: TcxGridTableView;
- function GetGridViewInfo: TcxGridTableViewInfo;
- protected
- function GetAlignmentVert: TcxAlignmentVert; override;
- function GetCanvas: TcxCanvas; override;
- function GetHeight: Integer; override;
- function GetWidth: Integer; override;
- function HasMouse(AHitTest: TcxCustomGridHitTest): Boolean; override;
- procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override;
- //procedure Invalidate; virtual;
- function NeedsContainerHotTrack: Boolean; virtual;
- function OccupiesSpace: Boolean; virtual;
- function ResidesInContent: Boolean; virtual;
- property Column: TcxGridColumn read GetColumn;
- property GridView: TcxGridTableView read GetGridView;
- property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
- public
- constructor Create(AColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo); reintroduce; virtual;
- procedure Calculate(const ABounds: TRect; var ATextAreaBounds: TRect); reintroduce; virtual;
- property AlignmentHorz: TAlignment read GetAlignmentHorz;
- property AlignmentVert: TcxAlignmentVert read GetAlignmentVert;
- property ColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo read FColumnHeaderViewInfo;
- property Height: Integer read GetHeight;
- property Width: Integer read GetWidth;
- end;
- TcxGridColumnHeaderSortingMarkViewInfo = class(TcxGridColumnHeaderAreaViewInfo)
- private
- function GetSortOrder: TcxGridSortOrder;
- protected
- function CalculateHeight: Integer; override;
- function CalculateWidth: Integer; override;
- function GetAlignmentHorz: TAlignment; override;
- function GetHitTestClass: TcxCustomGridHitTestClass; override;
- function GetPainterClass: TcxCustomGridCellPainterClass; override;
- property SortOrder: TcxGridSortOrder read GetSortOrder;
- end;
- TcxGridColumnHeaderHorzSizingEdgeViewInfo = class(TcxGridColumnHeaderAreaViewInfo)
- protected
- function CalculateHeight: Integer; override;
- function CalculateWidth: Integer; override;
- function GetAlignmentHorz: TAlignment; override;
- function GetHitTestClass: TcxCustomGridHitTestClass; override;
- function GetPainterClass: TcxCustomGridCellPainterClass; override;
- function OccupiesSpace: Boolean; override;
- function ResidesInContent: Boolean; override;
- public
- procedure Calculate(const ABounds: TRect; var ATextAreaBounds: TRect); override;
- function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton;
- AShift: TShiftState): Boolean; override;
- end;
- TcxGridColumnHeaderFilterButtonViewInfo = class(TcxGridColumnHeaderAreaViewInfo,
- IcxGridFilterPopupOwner)
- private
- function GetActive: Boolean;
- function GetDropDownWindowValue: TcxGridFilterPopup;
- protected
- { IcxGridFilterPopupOwner }
- function GetItem: TcxCustomGridTableItem;
- function CalculateHeight: Integer; override;
- function CalculateWidth: Integer; override;
- procedure DropDown; override;
- function EmulateMouseMoveAfterCalculate: Boolean; override;
- function GetAlignmentHorz: TAlignment; override;
- function GetAlwaysVisible: Boolean; virtual;
- function GetHitTestClass: TcxCustomGridHitTestClass; override;
- function GetPainterClass: TcxCustomGridCellPainterClass; override;
- function GetVisible: Boolean; override;
- function NeedsContainerHotTrack: Boolean; override;
- function OccupiesSpace: Boolean; override;
- procedure StateChanged(APrevState: TcxGridCellState); override;
- function CloseDropDownWindowOnDestruction: Boolean; override;
- function DropDownWindowExists: Boolean; override;
- function GetDropDownWindow: TcxCustomGridPopup; override;
- function GetDropDownWindowOwnerBounds: TRect; override;
- function IsDropDownWindowOwner: Boolean; override;
- property DropDownWindow: TcxGridFilterPopup read GetDropDownWindowValue;
- property AlwaysVisible: Boolean read GetAlwaysVisible;
- public
- function MouseMove(AHitTest: TcxCustomGridHitTest; AShift: TShiftState): Boolean; override;
- property Active: Boolean read GetActive;
- end;
- TcxGridColumnHeaderGlyphViewInfo = class(TcxGridColumnHeaderAreaViewInfo)
- private
- function GetGlyph: TBitmap;
- protected
- function CalculateHeight: Integer; override;
- function CalculateWidth: Integer; override;
- function GetAlignmentHorz: TAlignment; override;
- function GetAlignmentVert: TcxAlignmentVert; override;
- function GetHitTestClass: TcxCustomGridHitTestClass; override;
- function GetPainterClass: TcxCustomGridCellPainterClass; override;
- public
- property Glyph: TBitmap read GetGlyph;
- end;
- // column header
- TcxGridColumnHeaderViewInfo = class(TcxCustomGridViewCellViewInfo)
- private
- FAdditionalHeightAtTop: Integer;
- FAdditionalWidthAtLeft: Integer;
- FAreaViewInfos: TList;
- FColumn: TcxGridColumn;
- FContainer: TcxGridColumnContainerViewInfo;
- FNeighbors: TcxNeighbors;
- FRealWidth: Integer;
- FTextAreaBounds: TRect;
- FWidth: Integer;
- function GetAreaViewInfoCount: Integer;
- function GetAreaViewInfo(Index: Integer): TcxGridColumnHeaderAreaViewInfo;
- function GetGridView: TcxGridTableView;
- function GetGridViewInfo: TcxGridTableViewInfo;
- function GetHasTextOffsetLeft: Boolean;
- function GetHasTextOffsetRight: Boolean;
- function GetIndex: Integer;
- function GetIsFixed: Boolean;
- function GetRealWidth: Integer;
- procedure EnumAreaViewInfoClasses(AClass: TClass);
- procedure CreateAreaViewInfos;
- procedure DestroyAreaViewInfos;
- protected
- function AreasNeedHotTrack: Boolean;
- function CalculateHasTextOffset(ASide: TAlignment): Boolean; virtual;
- function CalculateHeight: Integer; override;
- function CalculateRealWidth(Value: Integer): Integer;
- procedure CalculateTextAreaBounds; virtual;
- procedure CalculateVisible(ALeftBound, AWidth: Integer); virtual;
- function CalculateWidth: Integer; override;
- function CanFilter: Boolean; virtual;
- function CanHorzSize: Boolean; virtual;
- function CanPress: Boolean; virtual;
- function CanShowHint: Boolean; override;
- function CanSort: Boolean; virtual;
- procedure CheckWidth(var Value: Integer); virtual;
- function CustomDraw(ACanvas: TcxCanvas): Boolean; override;
- procedure DoCalculateParams; override;
- function GetAlignmentHorz: TAlignment; override;
- function GetAlignmentVert: TcxAlignmentVert; override;
- function GetAreaBounds: TRect; override;
- procedure GetAreaViewInfoClasses(AProc: TcxGridClassEnumeratorProc); virtual;
- function GetBackgroundBitmap: TBitmap; override;
- function GetBorders: TcxBorders; override;
- function GetBorderWidth(AIndex: TcxBorder): Integer; override;
- function GetCanvas: TcxCanvas; override;
- function GetCaption: string; virtual;
- class function GetCellBorderWidth(ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; virtual;
- class function GetCellHeight(ATextHeight: Integer;
- ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; override;
- function GetDataOffset: Integer; virtual;
- function GetHeight: Integer; override;
- function GetHitTestClass: TcxCustomGridHitTestClass; override;
- function GetHotTrack: Boolean; override;
- function GetIsDesignSelected: Boolean; override;
- function GetIsPressed: Boolean; virtual;
- function GetMaxWidth: Integer; virtual;
- function GetMinWidth: Integer; virtual;
- function GetMultiLine: Boolean; override;
- function GetMultiLinePainting: Boolean; override;
- function GetPainterClass: TcxCustomGridCellPainterClass; override;
- function GetRealBounds: TRect; override;
- function GetShowEndEllipsis: Boolean; override;
- function GetText: string; override;
- function GetTextAreaBounds: TRect; override;
- procedure GetViewParams(var AParams: TcxViewParams); override;
- function GetWidth: Integer; override;
- function HasCustomDraw: Boolean; override;
- function HasFixedContentSpace: Boolean; virtual;
- function HasGlyph: Boolean; virtual;
- function HasHeaderAsContainer: Boolean;
- procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override;
- procedure Offset(DX, DY: Integer); override;
- procedure SetWidth(Value: Integer); override;
- procedure StateChanged(APrevState: TcxGridCellState); override;
- property Caption: string read GetCaption;
- property GridView: TcxGridTableView read GetGridView;
- property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
- property HasTextOffsetLeft: Boolean read GetHasTextOffsetLeft;
- property HasTextOffsetRight: Boolean read GetHasTextOffsetRight;
- public
- constructor Create(AContainer: TcxGridColumnContainerViewInfo;
- AColumn: TcxGridColumn); reintroduce; virtual;
- destructor Destroy; override;
- procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1;
- AHeight: Integer = -1); override;
- function GetBestFitWidth: Integer; override;
- function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
- procedure InitAutoWidthItem(AAutoWidthItem: TcxAutoWidthItem);
- function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton;
- AShift: TShiftState): Boolean; override;
- property AreaViewInfoCount: Integer read GetAreaViewInfoCount;
- property AreaViewInfos[Index: Integer]: TcxGridColumnHeaderAreaViewInfo read GetAreaViewInfo;
- property Column: TcxGridColumn read FColumn;
- property Container: TcxGridColumnContainerViewInfo read FContainer;
- property DataOffset: Integer read GetDataOffset;
- property Index: Integer read GetIndex;
- property IsFixed: Boolean read GetIsFixed;
- property IsPressed: Boolean read GetIsPressed;
- property MaxWidth: Integer read GetMaxWidth;
- property MinWidth: Integer read GetMinWidth;
- property Neighbors: TcxNeighbors read FNeighbors write FNeighbors;
- property RealWidth: Integer read GetRealWidth;
- end;
- // header
- TcxGridHeaderViewInfoSpecificClass = class of TcxGridHeaderViewInfoSpecific;
- TcxGridHeaderViewInfoSpecific = class
- private
- FContainerViewInfo: TcxGridHeaderViewInfo;
- function GetGridViewInfo: TcxGridTableViewInfo;
- function GetItemHeight: Integer;
- protected
- function CalculateHeight: Integer; virtual;
- function GetHeight: Integer; virtual;
- public
- constructor Create(AContainerViewInfo: TcxGridHeaderViewInfo); virtual;
- property ContainerViewInfo: TcxGridHeaderViewInfo read FContainerViewInfo;
- property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
- property Height: Integer read GetHeight;
- property ItemHeight: Integer read GetItemHeight;
- end;
- TcxGridHeaderViewInfoClass = class of TcxGridHeaderViewInfo;
- TcxGridHeaderViewInfo = class(TcxGridColumnContainerViewInfo)
- private
- FSpecific: TcxGridHeaderViewInfoSpecific;
- protected
- function GetColumn(Index: Integer): TcxGridColumn; override;
- function GetColumnCount: Integer; override;
- procedure AddIndicatorItems(AIndicatorViewInfo: TcxGridIndicatorViewInfo; ATopBound: Integer); virtual;
- procedure CalculateColumnAutoWidths; virtual;
- procedure CalculateColumnWidths; virtual;
- function CalculateHeight: Integer; override;
- procedure CalculateInvisible; override;
- function CalculateItemHeight: Integer; override;
- procedure CalculateItems; virtual;
- procedure CalculateVisible; override;
- function CalculateWidth: Integer; override;
- function CanCalculateAutoWidths: Boolean; virtual;
- function DrawColumnBackgroundHandler(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; virtual;
- function GetAlignment: TcxGridPartAlignment; override;
- function GetAutoHeight: Boolean; override;
- function GetColumnBackgroundBitmap: TBitmap; virtual;
- function GetColumnNeighbors(AColumn: TcxGridColumn): TcxNeighbors; override;
- function GetHitTestClass: TcxCustomGridHitTestClass; override;
- function GetIsAutoWidth: Boolean; override;
- function GetIsScrollable: Boolean; override;
- function GetItemMultiLinePainting(AItem: TcxGridColumnHeaderViewInfo): Boolean; override;
- function GetKind: TcxGridColumnContainerKind; override;
- function GetPainterClass: TcxCustomGridCellPainterClass; override;
- procedure GetViewParams(var AParams: TcxViewParams); override;
- function GetVisible: Boolean; override;
- function GetWidth: Integer; override;
- function GetZonesAreaBounds: TRect; override;
- function IsAlwaysVisibleForCalculation: Boolean; virtual;
- function IsHeightAssigned: Boolean; virtual;
- procedure Offset(DX, DY: Integer); override;
- procedure RecalculateItemVisibles;
- property ColumnBackgroundBitmap: TBitmap read GetColumnBackgroundBitmap;
- public
- constructor Create(AGridViewInfo: TcxCustomGridTableViewInfo); override;
- destructor Destroy; override;
- procedure AssignColumnWidths;
- procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1;
- AHeight: Integer = -1); override;
- property Specific: TcxGridHeaderViewInfoSpecific read FSpecific;
- end;
- // group by box
- TcxGridGroupByBoxColumnHeaderViewInfo = class(TcxGridColumnHeaderViewInfo)
- private
- function GetContainer: TcxGridGroupByBoxViewInfo;
- protected
- function CalculateHeight: Integer; override;
- function GetCaption: string; override;
- function HasFixedContentSpace: Boolean; override;
- function InheritedCalculateHeight: Integer;
- public
- property Container: TcxGridGroupByBoxViewInfo read GetContainer;
- end;
- TcxGridGroupByBoxViewInfoClass = class of TcxGridGroupByBoxViewInfo;
- TcxGridGroupByBoxViewInfo = class(TcxGridColumnContainerViewInfo)
- private
- FCalculatingColumnWidth: Boolean;
- function GetGroupByBoxVerOffset: Integer;
- function GetLinkLineBounds(Index: Integer; Horizontal: Boolean): TRect;
- protected
- function GetColumn(Index: Integer): TcxGridColumn; override;
- function GetColumnCount: Integer; override;
- function GetItemClass: TcxGridColumnHeaderViewInfoClass; override;
- function CalculateHeight: Integer; override;
- function CalculateItemHeight: Integer; override;
- function CalculateWidth: Integer; override;
- function GetAlignment: TcxGridPartAlignment; override;
- function GetAlignmentVert: TcxAlignmentVert; override;
- function GetBackgroundBitmap: TBitmap; override;
- function GetColumnWidth(AColumn: TcxGridColumn): Integer; override;
- function GetHitTestClass: TcxCustomGridHitTestClass; override;
- function GetIsAutoWidth: Boolean; override;
- function GetIsScrollable: Boolean; override;
- function GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; override;
- function GetKind: TcxGridColumnContainerKind; override;
- function GetPainterClass: TcxCustomGridCellPainterClass; override;
- function GetText: string; override;
- function GetTextAreaBounds: TRect; override;
- procedure GetViewParams(var AParams: TcxViewParams); override;
- function GetVisible: Boolean; override;
- property CalculatingColumnWidth: Boolean read FCalculatingColumnWidth;
- property GroupByBoxVerOffset: Integer read GetGroupByBoxVerOffset;
- public
- procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1;
- AHeight: Integer = -1); override;
- property LinkLineBounds[Index: Integer; Horizontal: Boolean]: TRect read GetLinkLineBounds;
- end;
- // footer
- TcxGridFooterCellViewInfoClass = class of TcxGridFooterCellViewInfo;
- TcxGridFooterCellViewInfo = class(TcxGridColumnHeaderViewInfo)
- private
- FSummaryItem: TcxDataSummaryItem;
- function GetContainer: TcxGridFooterViewInfo;
- function GetSummary: TcxDataSummary;
- protected
- procedure AfterCalculateBounds(var ABounds: TRect); override;
- function CanPress: Boolean; override;
- function CustomDraw(ACanvas: TcxCanvas): Boolean; override;
- function GetAlignmentHorz: TAlignment; override;
- function GetBackgroundBitmap: TBitmap; override;
- procedure GetAreaViewInfoClasses(AProc: TcxGridClassEnumeratorProc); override;
- function GetBorders: TcxBorders; override;
- class function GetCellBorderWidth(ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; override;
- function GetHitTestClass: TcxCustomGridHitTestClass; override;
- function GetIsDesignSelected: Boolean; override;
- function GetIsPressed: Boolean; override;
- function GetPainterClass: TcxCustomGridCellPainterClass; override;
- function GetText: string; override;
- procedure GetViewParams(var AParams: TcxViewParams); override;
- function HasCustomDraw: Boolean; override;
- procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override;
- property Summary: TcxDataSummary read GetSummary;
- public
- constructor Create(AContainer: TcxGridColumnContainerViewInfo;
- ASummaryItem: TcxDataSummaryItem); reintroduce; virtual;
- function GetBestFitWidth: Integer; override;
- function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton;
- AShift: TShiftState): Boolean; override;
- property Container: TcxGridFooterViewInfo read GetContainer;
- property SummaryItem: TcxDataSummaryItem read FSummaryItem;
- end;
- TcxGridFooterViewInfoClass = class of TcxGridFooterViewInfo;
- TcxGridFooterViewInfo = class(TcxGridHeaderViewInfo)
- private
- FRowCount: Integer;
- FSummaryItems: TList;
- function GetMultipleSummaries: Boolean;
- function GetRowCount: Integer;
- function GetRowHeight: Integer;
- protected
- function CreateItem(AIndex: Integer): TcxGridColumnHeaderViewInfo; override;
- procedure CreateItems; override;
- procedure DestroyItems; override;
- function GetColumn(Index: Integer): TcxGridColumn; override;
- function GetColumnCount: Integer; override;
- function GetItemClass: TcxGridColumnHeaderViewInfoClass; override;
- procedure PrepareSummaryItems(ASummaryItems: TList); virtual;
- function CalculateBounds: TRect; override;
- function CalculateHeight: Integer; override;
- function CalculateItemHeight: Integer; override;
- procedure CalculateItem(AIndex: Integer); virtual;
- procedure CalculateItems; override;
- function CalculateRowCount: Integer; virtual;
- function CanCalculateAutoWidths: Boolean; override;
- function GetAlignment: TcxGridPartAlignment; override;
- function GetAutoHeight: Boolean; override;
- function GetBackgroundBitmap: TBitmap; override;
- function GetBordersBounds: TRect; virtual;
- function GetBorders: TcxBorders; override;
- function GetBorderWidth(AIndex: TcxBorder): Integer; override;
- function GetColumnWidth(AColumn: TcxGridColumn): Integer; override;
- function GetHitTestClass: TcxCustomGridHitTestClass; override;
- function GetIsAutoWidth: Boolean; override;
- function GetIsScrollable: Boolean; override;
- function GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; override;
- function GetItemHeight(AColumn: TcxGridColumn): Integer; overload; virtual;
- function GetItemHeight(AIndex: Integer): Integer; overload;
- function GetItemHitTestClass: TcxCustomGridHitTestClass; virtual;
- function GetItemLeftBound(AColumn: TcxGridColumn): Integer; overload; virtual;
- function GetItemLeftBound(AIndex: Integer): Integer; overload;
- function GetItemRowIndex(AIndex: Integer): Integer; virtual;
- function GetItemsAreaBounds: TRect; override;
- function GetItemTopBound(AColumn: TcxGridColumn): Integer; overload; virtual;
- function GetItemTopBound(AIndex: Integer): Integer; overload; virtual;
- function GetKind: TcxGridColumnContainerKind; override;
- function GetPainterClass: TcxCustomGridCellPainterClass; override;
- function GetSeparatorBounds: TRect; virtual;
- function GetSeparatorWidth: Integer; virtual;
- function GetSummaryItems: TcxDataSummaryItems; virtual;
- procedure GetViewParams(var AParams: TcxViewParams); override;
- function GetVisible: Boolean; override;
- function HasSeparator: Boolean; virtual;
- function IsAlwaysVisibleForCalculation: Boolean; override;
- function IsColumnOnFirstLayer(AColumnIndex: Integer): Boolean; virtual;
- function IsHeightAssigned: Boolean; override;
- function IsItemVisible(AIndex: Integer): Boolean; virtual;
- function IsMultilayerLayout: Boolean; virtual;
- procedure Offset(DX, DY: Integer); override;
- property SummaryItemsList: TList read FSummaryItems;
- public
- function CanShowMultipleSummaries: Boolean; virtual;
- function GetCellBestFitWidth(AColumn: TcxGridColumn): Integer; virtual;
- function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
- property BordersBounds: TRect read GetBordersBounds;
- property MultipleSummaries: Boolean read GetMultipleSummaries;
- property RowCount: Integer read GetRowCount;
- property RowHeight: Integer read GetRowHeight;
- property SeparatorBounds: TRect read GetSeparatorBounds;
- property SeparatorWidth: Integer read GetSeparatorWidth;
- property SummaryItems: TcxDataSummaryItems read GetSummaryItems;
- end;
- // indicator
- TcxCustomGridIndicatorItemViewInfoClass = class of TcxCustomGridIndicatorItemViewInfo;
- TcxCustomGridIndicatorItemViewInfo = class(TcxCustomGridViewCellViewInfo)
- private
- FContainer: TcxGridIndicatorViewInfo;
- function GetGridView: TcxGridTableView;
- function GetGridViewInfo: TcxGridTableViewInfo;
- protected
- function CalculateWidth: Integer; override;
- function CustomDraw(ACanvas: TcxCanvas): Boolean; override;
- function GetHitTestClass: TcxCustomGridHitTestClass; override;
- function GetPainterClass: TcxCustomGridCellPainterClass; override;
- procedure GetViewParams(var AParams: TcxViewParams); override;
- function HasCustomDraw: Boolean; override;
- public
- constructor Create(AContainer: TcxGridIndicatorViewInfo); reintroduce; virtual;
- destructor Destroy; override;
- property Container: TcxGridIndicatorViewInfo read FContainer;
- property GridView: TcxGridTableView read GetGridView;
- property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
- end;
- TcxGridIndicatorHeaderItemViewInfo = class(TcxCustomGridIndicatorItemViewInfo)
- private
- function GetDropDownWindowValue: TcxCustomGridCustomizationPopup;
- protected
- function CalculateHeight: Integer; override;
- function CanShowHint: Boolean; override;
- function GetCellBoundsForHint: TRect; override;
- function GetHintTextRect(const AMousePos: TPoint): TRect; override;
- function GetHitTestClass: TcxCustomGridHitTestClass; override;
- function GetHotTrack: Boolean; override;
- function GetPainterClass: TcxCustomGridCellPainterClass; override;
- function GetText: string; override;
- procedure GetViewParams(var AParams: TcxViewParams); override;
- function IsHintForText: Boolean; override;
- function IsHintMultiLine: Boolean; override;
- function SupportsQuickCustomization: Boolean; virtual;
- function CloseDropDownWindowOnDestruction: Boolean; override;
- function DropDownWindowExists: Boolean; override;
- function GetDropDownWindow: TcxCustomGridPopup; override;
- property DropDownWindow: TcxCustomGridCustomizationPopup read GetDropDownWindowValue;
- end;
- TcxGridIndicatorRowItemViewInfoClass = class of TcxGridIndicatorRowItemViewInfo;
- TcxGridIndicatorRowItemViewInfo = class(TcxCustomGridIndicatorItemViewInfo)
- private
- FRowViewInfo: TcxCustomGridRowViewInfo;
- function GetGridRecord: TcxCustomGridRow;
- function GetGridView: TcxGridTableView;
- protected
- function CalculateHeight: Integer; override;
- function GetBackgroundBitmap: TBitmap; override;
- function GetIndicatorKind: TcxIndicatorKind; virtual;
- function GetHitTestClass: TcxCustomGridHitTestClass; override;
- function GetPainterClass: TcxCustomGridCellPainterClass; override;
- function GetRowSizingEdgeBounds: TRect; virtual;
- procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override;
- property RowSizingEdgeBounds: TRect read GetRowSizingEdgeBounds;
- public
- destructor Destroy; override;
- function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
- function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton;
- AShift: TShiftState): Boolean; override;
- property GridRecord: TcxCustomGridRow read GetGridRecord;
- property GridView: TcxGridTableView read GetGridView;
- property IndicatorKind: TcxIndicatorKind read GetIndicatorKind;
- property RowViewInfo: TcxCustomGridRowViewInfo read FRowViewInfo write FRowViewInfo;
- end;
- TcxGridIndicatorFooterItemViewInfo = class(TcxCustomGridIndicatorItemViewInfo)
- private
- function GetSeparatorWidth: Integer;
- protected
- function CalculateHeight: Integer; override;
- function GetBackgroundBitmap: TBitmap; override;
- function GetBorders: TcxBorders; override;
- function GetBordersBounds: TRect; virtual;
- function GetBorderWidth(AIndex: TcxBorder): Integer; override;
- function GetPainterClass: TcxCustomGridCellPainterClass; override;
- function GetSeparatorBounds: TRect; virtual;
- function HasSeparator: Boolean;
- public
- property BordersBounds: TRect read GetBordersBounds;
- property SeparatorBounds: TRect read GetSeparatorBounds;
- property SeparatorWidth: Integer read GetSeparatorWidth;
- end;
- TcxGridIndicatorViewInfoClass = class of TcxGridIndicatorViewInfo;
- TcxGridIndicatorViewInfo = class(TcxCustomGridViewCellViewInfo)
- private
- FItems: TList;
- function GetCount: Integer;
- function GetGridView: TcxGridTableView;
- function GetGridViewInfo: TcxGridTableViewInfo;
- function GetItem(Index: Integer): TcxCustomGridIndicatorItemViewInfo;
- procedure DestroyItems;
- protected
- function CalculateHeight: Integer; override;
- function CalculateWidth: Integer; override;
- function GetAlwaysVisible: Boolean; virtual;
- function GetBackgroundBitmap: TBitmap; override;
- function GetHitTestClass: TcxCustomGridHitTestClass; override;
- function GetPainterClass: TcxCustomGridCellPainterClass; override;
- function GetRowItemClass(ARowViewInfo: TcxCustomGridRowViewInfo): TcxGridIndicatorRowItemViewInfoClass; virtual;
- procedure GetViewParams(var AParams: TcxViewParams); override;
- function GetVisible: Boolean; override;
- function GetWidth: Integer; override;
- public
- constructor Create(AGridViewInfo: TcxGridTableViewInfo); reintroduce; virtual;
- destructor Destroy; override;
- function AddItem(AItemClass: TcxCustomGridIndicatorItemViewInfoClass): TcxCustomGridIndicatorItemViewInfo; overload;
- function AddItem(ATopBound, AHeight: Integer;
- AItemClass: TcxCustomGridIndicatorItemViewInfoClass): TcxCustomGridIndicatorItemViewInfo; overload;
- function AddRowItem(ARowViewInfo: TcxCustomGridRowViewInfo): TcxCustomGridIndicatorItemViewInfo;
- procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1;
- AHeight: Integer = -1); override;
- procedure CalculateRowItem(ARowViewInfo: TcxCustomGridRowViewInfo;
- AItem: TcxCustomGridIndicatorItemViewInfo);
- function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
- function GetRowItemBounds(AGridRecord: TcxCustomGridRow): TRect;
- property AlwaysVisible: Boolean read GetAlwaysVisible;
- property Count: Integer read GetCount;
- property GridView: TcxGridTableView read GetGridView;
- property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
- property Items[Index: Integer]: TcxCustomGridIndicatorItemViewInfo read GetItem;
- end;
- // custom row
- TcxGridRowFooterCellViewInfo = class(TcxGridFooterCellViewInfo)
- private
- function GetContainer: TcxGridRowFooterViewInfo;
- function GetGridRecord: TcxCustomGridRow;
- protected
- function GetText: string; override;
- procedure GetViewParams(var AParams: TcxViewParams); override;
- public
- property Container: TcxGridRowFooterViewInfo read GetContainer;
- property GridRecord: TcxCustomGridRow read GetGridRecord;
- end;
- TcxGridRowFooterViewInfoClass = class of TcxGridRowFooterViewInfo;
- TcxGridRowFooterViewInfo = class(TcxGridFooterViewInfo)
- private
- FContainer: TcxGridRowFootersViewInfo;
- FLevel: Integer;
- function GetIndent: Integer;
- function GetGridRecord: TcxCustomGridRow;
- function GetGroupLevel: Integer;
- function GetRowViewInfo: TcxCustomGridRowViewInfo;
- protected
- function CalculateHeight: Integer; override;
- function CalculateWidth: Integer; override;
- function GetColumnWidth(AColumn: TcxGridColumn): Integer; override;
- function GetHitTestClass: TcxCustomGridHitTestClass; override;
- function GetIsPart: Boolean; override;
- function GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; override;
- function GetItemClass: TcxGridColumnHeaderViewInfoClass; override;
- function GetItemHitTestClass: TcxCustomGridHitTestClass; override;
- function GetItemMultiLinePainting(AItem: TcxGridColumnHeaderViewInfo): Boolean; override;
- function GetSummaryItems: TcxDataSummaryItems; override;
- procedure GetViewParams(var AParams: TcxViewParams); override;
- function GetVisible: Boolean; override;
- function GetVisualLevel: Integer; virtual;
- function HasSeparator: Boolean; override;
- procedure PrepareSummaryItems(ASummaryItems: TList); override;
- property Indent: Integer read GetIndent;
- public
- constructor Create(AContainer: TcxGridRowFootersViewInfo; ALevel: Integer); reintroduce; virtual;
- function CanShowMultipleSummaries: Boolean; override;
- property Container: TcxGridRowFootersViewInfo read FContainer;
- property GridRecord: TcxCustomGridRow read GetGridRecord;
- property GroupLevel: Integer read GetGroupLevel;
- property Level: Integer read FLevel;
- property RowViewInfo: TcxCustomGridRowViewInfo read GetRowViewInfo;
- property VisualLevel: Integer read GetVisualLevel;
- end;
- TcxGridRowFootersViewInfoClass = class of TcxGridRowFootersViewInfo;
- TcxGridRowFootersViewInfo = class
- private
- FHeight: Integer;
- FItems: TList;
- FRowViewInfo: TcxCustomGridRowViewInfo;
- function GetCount: Integer;
- function GetGridViewInfo: TcxGridTableViewInfo;
- function GetHeight: Integer;
- function GetItem(Index: Integer): TcxGridRowFooterViewInfo;
- function GetVisibleItem(ALevel: Integer): TcxGridRowFooterViewInfo;
- procedure CreateItems;
- procedure DestroyItems;
- protected
- procedure BeforeRecalculation; virtual;
- procedure Calculate(ALeftBound, ATopBound: Integer); virtual;
- function CalculateHeight: Integer; virtual;
- function GetItemClass: TcxGridRowFooterViewInfoClass; virtual;
- public
- constructor Create(ARowViewInfo: TcxCustomGridRowViewInfo); virtual;
- destructor Destroy; override;
- function GetCellBestFitWidth(AColumn: TcxGridColumn): Integer;
- function GetHitTest(const P: TPoint): TcxCustomGridHitTest; virtual;
- function GetTopBound(ALevel: Integer; var ATopBound: Integer): Boolean;
- procedure Offset(DX, DY: Integer); virtual;
- procedure Paint;
- property Count: Integer read GetCount;
- property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
- property Items[Index: Integer]: TcxGridRowFooterViewInfo read GetItem; default;
- property Height: Integer read GetHeight;
- property RowViewInfo: TcxCustomGridRowViewInfo read FRowViewInfo;
- property VisibleItems[ALevel: Integer]: TcxGridRowFooterViewInfo read GetVisibleItem;
- end;
- TcxCustomGridRowViewInfoClass = class of TcxCustomGridRowViewInfo;
- TcxCustomGridRowViewInfo = class(TcxCustomGridRecordViewInfo)
- private
- FFootersViewInfo: TcxGridRowFootersViewInfo;
- FIndicatorItem: TcxCustomGridIndicatorItemViewInfo;
- function GetCacheItem: TcxGridTableViewInfoCacheItem;
- function GetGridView: TcxGridTableView;
- function GetGridLines: TcxGridLines;
- function GetGridRecord: TcxCustomGridRow;
- function GetGridViewInfo: TcxGridTableViewInfo;
- function GetLevel: Integer;
- function GetLevelIndent: Integer;
- function GetLevelIndentBounds(Index: Integer): TRect;
- function GetLevelIndentHorzLineBounds(Index: Integer): TRect;
- function GetLevelIndentSpaceBounds(Index: Integer): TRect;
- function GetLevelIndentVertLineBounds(Index: Integer): TRect;
- function GetRecordsViewInfo: TcxGridRowsViewInfo;
- function GetVisualLevel: Integer;
- procedure CreateFootersViewInfo;
- procedure DestroyFootersViewInfo;
- procedure RecreateFootersViewInfo;
- protected
- procedure AfterRowsViewInfoCalculate; virtual;
- procedure AfterRowsViewInfoOffset; virtual;
- procedure CalculateExpandButtonBounds(var ABounds: TRect); override;
- function CalculateHeight: Integer; override;
- function CalculateLevelIndentHorzLineBounds(ALevel: Integer; const ABounds: TRect): TRect;
- function CalculateLevelIndentSpaceBounds(ALevel: Integer; const ABounds: TRect): TRect;
- function CalculateLevelIndentVertLineBounds(ALevel: Integer; const ABounds: TRect): TRect;
- function CalculateWidth: Integer; override;
- function CanSize: Boolean; virtual;
- procedure CheckRowHeight(var AValue: Integer); virtual;
- function GetAutoHeight: Boolean; override;
- function GetBaseHeight: Integer; virtual;
- function GetBottomPartHeight: Integer; virtual;
- function GetCellTransparent(ACell: TcxGridTableCellViewInfo): Boolean; override;
- function GetContentBounds: TRect; override;
- function GetContentIndent: Integer; virtual;
- function GetContentWidth: Integer; override;
- function GetDataHeight: Integer; virtual;
- function GetDataIndent: Integer; virtual;
- function GetDataWidth: Integer; virtual;
- function GetFocusRectBounds: TRect; override;
- function GetFootersViewInfoClass: TcxGridRowFootersViewInfoClass; virtual;
- function GetLastHorzGridLineBounds: TRect; virtual;
- function GetMaxHeight: Integer; virtual;
- function GetNonBaseHeight: Integer; virtual;
- function GetRowHeight: Integer; virtual;
- function GetSeparatorBounds: TRect; virtual;
- function GetSeparatorColor: TColor; virtual;
- function GetSeparatorWidth: Integer; virtual;
- function GetShowSeparator: Boolean; virtual;
- function GetVisible: Boolean; override;
- function GetWidth: Integer; override;
- function HasAnyFooter(ALevel: Integer): Boolean;
- function HasFooter(ALevel: Integer): Boolean; virtual;
- function HasFooters: Boolean; virtual;
- function HasLastHorzGridLine: Boolean; virtual;
- function IsFullyVisible: Boolean; virtual;
- procedure Offset(DX, DY: Integer); override;
- procedure SetRowHeight(Value: Integer); virtual; abstract;
- property BaseHeight: Integer read GetBaseHeight;
- property BottomPartHeight: Integer read GetBottomPartHeight;
- property CacheItem: TcxGridTableViewInfoCacheItem read GetCacheItem;
- property IndicatorItem: TcxCustomGridIndicatorItemViewInfo read FIndicatorItem;
- property LastHorzGridLineBounds: TRect read GetLastHorzGridLineBounds;
- property Level: Integer read GetLevel;
- property LevelIndent: Integer read GetLevelIndent;
- property NonBaseHeight: Integer read GetNonBaseHeight;
- property RowHeight: Integer read GetRowHeight write SetRowHeight;
- property ShowSeparator: Boolean read GetShowSeparator;
- public
- constructor Create(ARecordsViewInfo: TcxCustomGridRecordsViewInfo;
- ARecord: TcxCustomGridRecord); override;
- destructor Destroy; override;
- procedure BeforeRecalculation; override;
- procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1;
- AHeight: Integer = -1); override;
- function Click(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton;
- AShift: TShiftState): Boolean; override;
- function GetBoundsForInvalidate(AItem: TcxCustomGridTableItem): TRect; override;
- function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
- function HasSeparator: Boolean;
- property ContentIndent: Integer read GetContentIndent;
- property DataHeight: Integer read GetDataHeight;
- property DataIndent: Integer read GetDataIndent;
- property DataWidth: Integer read GetDataWidth;
- property FootersViewInfo: TcxGridRowFootersViewInfo read FFootersViewInfo;
- property GridView: TcxGridTableView read GetGridView;
- property GridLines: TcxGridLines read GetGridLines;
- property GridRecord: TcxCustomGridRow read GetGridRecord;
- property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
- property LevelIndentBounds[Index: Integer]: TRect read GetLevelIndentBounds;
- property LevelIndentHorzLineBounds[Index: Integer]: TRect read GetLevelIndentHorzLineBounds;
- property LevelIndentSpaceBounds[Index: Integer]: TRect read GetLevelIndentSpaceBounds;
- property LevelIndentVertLineBounds[Index: Integer]: TRect read GetLevelIndentVertLineBounds;
- property MaxHeight: Integer read GetMaxHeight;
- property RecordsViewInfo: TcxGridRowsViewInfo read GetRecordsViewInfo;
- property SeparatorBounds: TRect read GetSeparatorBounds;
- property SeparatorColor: TColor read GetSeparatorColor;
- property SeparatorWidth: Integer read GetSeparatorWidth;
- property VisualLevel: Integer read GetVisualLevel;
- end;
- // rows
- TcxGridRowsViewInfoClass = class of TcxGridRowsViewInfo;
- TcxGridRowsViewInfo = class(TcxCustomGridRecordsViewInfo)
- private
- FDataRowHeight: Integer;
- FFilterRowViewInfo: TcxCustomGridRowViewInfo;
- FGroupRowHeight: Integer;
- FNewItemRowViewInfo: TcxCustomGridRowViewInfo;
- FRestHeight: Integer;
- FRowHeight: Integer;
- function GetFilterRowViewInfo: TcxCustomGridRowViewInfo;
- function GetGridView: TcxGridTableView;
- function GetGridLines: TcxGridLines;
- function GetGridViewInfo: TcxGridTableViewInfo;
- function GetHeaderViewInfo: TcxGridHeaderViewInfo;
- function GetItem(Index: Integer): TcxCustomGridRowViewInfo;
- function GetNewItemRowViewInfo: TcxCustomGridRowViewInfo;
- function GetPainterClassValue: TcxGridRowsPainterClass;
- function GetViewData: TcxGridViewData;
- protected
- FIsFirstRowFullyVisible: Boolean;
- FPartVisibleCount: Integer;
- procedure AfterCalculate; override;
- procedure AfterOffset; override;
- procedure Calculate; override;
- function CalculateBounds: TRect; override;
- procedure CalculateConsts; virtual;
- function CalculateContentBounds: TRect; override;
- function CalculateDataRowHeight: Integer; virtual;
- function CalculateGroupRowDefaultHeight(AMinHeight: Boolean): Integer; virtual;
- function CalculateGroupRowHeight: Integer; virtual;
- function CalculateRestHeight(ATopBound: Integer): Integer; virtual;
- function CalculateRowDefaultHeight: Integer; virtual;
- function CalculateRowHeight: Integer; virtual;
- procedure CalculateVisibleCount; override;
- function GetAutoDataCellHeight: Boolean; override;
- function GetCommonDataRowHeight: Integer; virtual;
- function GetFilterRowViewInfoClass: TcxCustomGridRowViewInfoClass; virtual;
- function GetGroupBackgroundBitmap: TBitmap; virtual;
- function GetGroupRowSeparatorWidth: Integer; virtual;
- function GetItemLeftBound(AIndex: Integer): Integer; override;
- function GetItemsOffset(AItemCountDelta: Integer): Integer; override;
- function GetItemTopBound(AIndex: Integer): Integer; override;
- function GetIsScrollable: Boolean; virtual;
- function GetNewItemRowViewInfoClass: TcxCustomGridRowViewInfoClass; virtual;
- function GetPainterClass: TcxCustomGridRecordsPainterClass; override;
- function GetRowWidth: Integer; virtual;
- function GetSeparatorWidth: Integer; virtual;
- function HasFilterRow: Boolean;
- function HasLastHorzGridLine(ARowViewInfo: TcxCustomGridRowViewInfo): Boolean; virtual;
- function HasNewItemRow: Boolean;
- function IsFilterRowVisible: Boolean; virtual;
- function IsNewItemRowVisible: Boolean; virtual;
- procedure NotifyItemsCalculationFinished;
- procedure OffsetItem(AIndex, AOffset: Integer); override;
- property GridView: TcxGridTableView read GetGridView;
- property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
- property HeaderViewInfo: TcxGridHeaderViewInfo read GetHeaderViewInfo;
- property IsScrollable: Boolean read GetIsScrollable;
- property ViewData: TcxGridViewData read GetViewData;
- public
- destructor Destroy; override;
- procedure AfterConstruction; override;
- function CalculateCustomGroupRowHeight(AMinHeight: Boolean; AParams: TcxViewParams): Integer; virtual;
- function CanDataRowSize: Boolean; virtual;
- function GetCellHeight(ACellContentHeight: Integer): Integer; override;
- function GetDataRowCellsAreaViewInfoClass: TClass; virtual;
- function GetFooterCellBestFitWidth(AColumn: TcxGridColumn): Integer;
- function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
- function GetRealItem(ARecord: TcxCustomGridRecord): TcxCustomGridRecordViewInfo; override;
- function GetRestHeight(ATopBound: Integer): Integer; virtual;
- function IsCellMultiLine(AItem: TcxCustomGridTableItem): Boolean; override;
- function IsDataRowHeightAssigned: Boolean; virtual;
- procedure Offset(DX, DY: Integer); override;
- property CommonDataRowHeight: Integer read GetCommonDataRowHeight;
- property DataRowHeight: Integer read FDataRowHeight;
- property FilterRowViewInfo: TcxCustomGridRowViewInfo read GetFilterRowViewInfo;
- property GridLines: TcxGridLines read GetGridLines;
- property GroupBackgroundBitmap: TBitmap read GetGroupBackgroundBitmap;
- property GroupRowHeight: Integer read FGroupRowHeight write FGroupRowHeight;
- property GroupRowSeparatorWidth: Integer read GetGroupRowSeparatorWidth;
- property IsFirstRowFullyVisible: Boolean read FIsFirstRowFullyVisible;
- property Items[Index: Integer]: TcxCustomGridRowViewInfo read GetItem; default;
- property NewItemRowViewInfo: TcxCustomGridRowViewInfo read GetNewItemRowViewInfo;
- property PainterClass: TcxGridRowsPainterClass read GetPainterClassValue;
- property PartVisibleCount: Integer read FPartVisibleCount;
- property RowHeight: Integer read FRowHeight write FRowHeight;
- property RowWidth: Integer read GetRowWidth;
- property SeparatorWidth: Integer read GetSeparatorWidth;
- end;
- // table
- TcxGridTableViewInfo = class(TcxCustomGridTableViewInfo)
- private
- FDataWidth: Integer;
- FExpandButtonIndent: Integer;
- FFooterViewInfo: TcxGridFooterViewInfo;
- FGroupByBoxViewInfo: TcxGridGroupByBoxViewInfo;
- FHeaderViewInfo: TcxGridHeaderViewInfo;
- FIndicatorViewInfo: TcxGridIndicatorViewInfo;
- FLevelIndent: Integer;
- FPrevDataRowHeight: Integer;
- function GetController: TcxGridTableController;
- function GetDataWidth: Integer;
- function GetGridView: TcxGridTableView;
- function GetGridLineColor: TColor;
- function GetGridLines: TcxGridLines;
- function GetLeftPos: Integer;
- function GetLevelIndentBackgroundBitmap: TBitmap;
- function GetLevelIndentColor(Index: Integer): TColor;
- function GetRecordsViewInfo: TcxGridRowsViewInfo;
- function GetViewData: TcxGridViewData;
- protected
- procedure AfterCalculating; override;
- procedure BeforeCalculating; override;
- procedure CreateViewInfos; override;
- procedure DestroyViewInfos(AIsRecreating: Boolean); override;
- procedure Calculate; override;
- function CalculateClientBounds: TRect; override;
- function CalculateDataWidth: Integer; virtual;
- procedure CalculateExpandButtonParams; virtual;
- procedure CalculateHeight(const AMaxSize: TPoint; var AHeight: Integer;
- var AFullyVisible: Boolean); override;
- function CalculatePartBounds(APart: TcxCustomGridPartViewInfo): TRect; override;
- procedure CalculateParts; virtual;
- function CalculateVisibleEqualHeightRecordCount: Integer; override;
- procedure CalculateWidth(const AMaxSize: TPoint; var AWidth: Integer); override;
- function DoGetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
- function GetDefaultGridModeBufferCount: Integer; override;
- function GetFirstItemAdditionalWidth: Integer; virtual;
- function GetGridLineWidth: Integer; virtual;
- function GetLevelSeparatorColor: TColor; virtual;
- function GetNonRecordsAreaHeight(ACheckScrollBar: Boolean): Integer; override;
- function GetScrollableAreaBoundsHorz: TRect; override;
- function GetScrollableAreaBoundsVert: TRect; override;
- function GetVisualLevelCount: Integer; virtual;
- procedure Offset(DX, DY: Integer); override;
- procedure RecreateViewInfos; override;
- function SupportsAutoHeight: Boolean; virtual;
- function SupportsGroupSummariesAlignedWithColumns: Boolean; virtual;
- function SupportsMultipleFooterSummaries: Boolean; virtual;
- function GetFooterPainterClass: TcxGridFooterPainterClass; virtual;
- function GetFooterViewInfoClass: TcxGridFooterViewInfoClass; virtual;
- function GetGroupByBoxViewInfoClass: TcxGridGroupByBoxViewInfoClass; virtual;
- function GetHeaderViewInfoClass: TcxGridHeaderViewInfoClass; virtual;
- function GetIndicatorViewInfoClass: TcxGridIndicatorViewInfoClass; virtual;
- function GetHeaderViewInfoSpecificClass: TcxGridHeaderViewInfoSpecificClass; virtual;
- function GetRecordsViewInfoClass: TcxCustomGridRecordsViewInfoClass; override;
- property Controller: TcxGridTableController read GetController;
- property ViewData: TcxGridViewData read GetViewData;
- public
- function GetCellBorders(AIsRight, AIsBottom: Boolean): TcxBorders; virtual;
- function GetCellHeight(AIndex, ACellHeight: Integer): Integer; virtual;
- function GetCellTopOffset(AIndex, ACellHeight: Integer): Integer; virtual;
- function GetOffsetBounds(AItemsOffset: Integer; out AUpdateBounds: TRect): TRect; overload; virtual;
- function GetOffsetBounds(DX, DY: Integer; out AUpdateBounds: TRect): TRect; overload; virtual;
- function GetVisualLevel(ALevel: Integer): Integer; virtual;
- // for extended lookup edit
- function GetNearestPopupHeight(AHeight: Integer; AAdditionalRecord: Boolean = False): Integer; override;
- function GetPopupHeight(ADropDownRowCount: Integer): Integer; override;
- property DataWidth: Integer read GetDataWidth;
- property ExpandButtonIndent: Integer read FExpandButtonIndent write FExpandButtonIndent;
- property FirstItemAdditionalWidth: Integer read GetFirstItemAdditionalWidth;
- property FooterViewInfo: TcxGridFooterViewInfo read FFooterViewInfo;
- property GridLineColor: TColor read GetGridLineColor;
- property GridLines: TcxGridLines read GetGridLines;
- property GridLineWidth: Integer read GetGridLineWidth;
- property GridView: TcxGridTableView read GetGridView;
- property GroupByBoxViewInfo: TcxGridGroupByBoxViewInfo read FGroupByBoxViewInfo;
- property HeaderViewInfo: TcxGridHeaderViewInfo read FHeaderViewInfo;
- property IndicatorViewInfo: TcxGridIndicatorViewInfo read FIndicatorViewInfo;
- property LeftPos: Integer read GetLeftPos;
- property LevelIndent: Integer read FLevelIndent write FLevelIndent;
- property LevelIndentBackgroundBitmap: TBitmap read GetLevelIndentBackgroundBitmap;
- property LevelIndentColors[Index: Integer]: TColor read GetLevelIndentColor;
- property LevelSeparatorColor: TColor read GetLevelSeparatorColor;
- property RecordsViewInfo: TcxGridRowsViewInfo read GetRecordsViewInfo;
- property VisualLevelCount: Integer read GetVisualLevelCount;
- end;
- // cache
- TcxGridTableViewInfoCacheItem = class(TcxCustomGridTableViewInfoCacheItem)
- private
- FIsPreviewHeightAssigned: Boolean;
- FPreviewHeight: Integer;
- procedure SetPreviewHeight(Value: Integer);
- public
- procedure UnassignValues(AKeepMaster: Boolean); override;
- property IsPreviewHeightAssigned: Boolean read FIsPreviewHeightAssigned
- write FIsPreviewHeightAssigned;
- property PreviewHeight: Integer read FPreviewHeight write SetPreviewHeight;
- end;
- TcxGridMasterTableViewInfoCacheItem = class(TcxGridTableViewInfoCacheItem)
- private
- FIsDetailsSiteFullyVisibleAssigned: Boolean;
- FIsDetailsSiteHeightAssigned: Boolean;
- FIsDetailsSiteNormalHeightAssigned: Boolean;
- FIsDetailsSiteWidthAssigned: Boolean;
- FDetailsSiteFullyVisible: Boolean;
- FDetailsSiteHeight: Integer;
- FDetailsSiteNormalHeight: Integer;
- FDetailsSiteWidth: Integer;
- FUnassigningValues: Boolean;
- function GetGridRecord: TcxGridMasterDataRow;
- function GetIsDetailsSiteCachedInfoAssigned: Boolean;
- procedure SetDetailsSiteFullyVisible(Value: Boolean);
- procedure SetDetailsSiteHeight(Value: Integer);
- procedure SetDetailsSiteNormalHeight(Value: Integer);
- procedure SetDetailsSiteWidth(Value: Integer);
- protected
- property GridRecord: TcxGridMasterDataRow read GetGridRecord;
- public
- DetailsSiteCachedInfo: TcxCustomGridDetailsSiteViewInfoCachedInfo;
- destructor Destroy; override;
- procedure UnassignValues(AKeepMaster: Boolean); override;
- property IsDetailsSiteCachedInfoAssigned: Boolean read GetIsDetailsSiteCachedInfoAssigned;
- property IsDetailsSiteFullyVisibleAssigned: Boolean read FIsDetailsSiteFullyVisibleAssigned write FIsDetailsSiteFullyVisibleAssigned;
- property IsDetailsSiteHeightAssigned: Boolean read FIsDetailsSiteHeightAssigned write FIsDetailsSiteHeightAssigned;
- property IsDetailsSiteNormalHeightAssigned: Boolean read FIsDetailsSiteNormalHeightAssigned write FIsDetailsSiteNormalHeightAssigned;
- property IsDetailsSiteWidthAssigned: Boolean read FIsDetailsSiteWidthAssigned write FIsDetailsSiteWidthAssigned;
- property DetailsSiteFullyVisible: Boolean read FDetailsSiteFullyVisible write SetDetailsSiteFullyVisible;
- property DetailsSiteHeight: Integer read FDetailsSiteHeight write SetDetailsSiteHeight;
- property DetailsSiteNormalHeight: Integer read FDetailsSiteNormalHeight write SetDetailsSiteNormalHeight;
- property DetailsSiteWidth: Integer read FDetailsSiteWidth write SetDetailsSiteWidth;
- end;
- { view }
- // column
- TcxGridColumnOptions = class(TcxCustomGridTableItemOptions)
- private
- FCellMerging: Boolean;
- FGroupFooters: Boolean;
- FHorzSizing: Boolean;
- function GetGridView: TcxGridTableView;
- procedure SetCellMerging(Value: Boolean);
- procedure SetGroupFooters(Value: Boolean);
- procedure SetHorzSizing(Value: Boolean);
- protected
- property GridView: TcxGridTableView read GetGridView;
- public
- constructor Create(AItem: TcxCustomGridTableItem); override;
- procedure Assign(Source: TPersistent); override;
- published
- property CellMerging: Boolean read FCellMerging write SetCellMerging default False;
- property GroupFooters: Boolean read FGroupFooters write SetGroupFooters default True;
- property Grouping;
- property HorzSizing: Boolean read FHorzSizing write SetHorzSizing default True;
- property Moving;
- property ShowCaption;
- property SortByDisplayText;
- property Sorting;
- end;
- TcxGridGetFooterStyleExEvent = procedure(Sender: TcxGridTableView; ARow: TcxCustomGridRow;
- AColumn: TcxGridColumn; AFooterGroupLevel: Integer; var AStyle: TcxStyle) of object;
- TcxGridGetFooterSummaryStyleEvent = procedure(AView: TcxGridTableView; ARow: TcxCustomGridRow;
- AColumn: TcxGridColumn; AFooterGroupLevel: Integer; ASummaryItem: TcxDataSummaryItem; var AStyle: TcxStyle) of object;
- TcxGridGetGroupSummaryStyleEvent = procedure(Sender: TcxGridTableView; ARow: TcxGridGroupRow;
- AColumn: TcxGridColumn; ASummaryItem: TcxDataSummaryItem; var AStyle: TcxStyle) of object;
- TcxGridGetHeaderStyleEvent = procedure(Sender: TcxGridTableView;
- AColumn: TcxGridColumn; {$IFDEF BCB}var{$ELSE}out{$ENDIF} AStyle: TcxStyle) of object;
- TcxGridColumnStyles = class(TcxCustomGridTableItemStyles)
- private
- FOnGetFooterStyle: TcxGridGetCellStyleEvent;
- FOnGetFooterStyleEx: TcxGridGetFooterStyleExEvent;
- FOnGetFooterSummaryStyle: TcxGridGetFooterSummaryStyleEvent;
- FOnGetGroupSummaryStyle: TcxGridGetGroupSummaryStyleEvent;
- FOnGetHeaderStyle: TcxGridGetHeaderStyleEvent;
- function GetGridViewValue: TcxGridTableView;
- function GetItem: TcxGridColumn;
- procedure SetOnGetFooterStyle(Value: TcxGridGetCellStyleEvent);
- procedure SetOnGetFooterStyleEx(Value: TcxGridGetFooterStyleExEvent);
- procedure SetOnGetFooterSummaryStyle(Value: TcxGridGetFooterSummaryStyleEvent);
- procedure SetOnGetGroupSummaryStyle(Value: TcxGridGetGroupSummaryStyleEvent);
- procedure SetOnGetHeaderStyle(Value: TcxGridGetHeaderStyleEvent);
- protected
- procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override;
- public
- procedure Assign(Source: TPersistent); override;
- procedure GetFooterParams(ARow: TcxCustomGridRow; AFooterGroupLevel: Integer;
- ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); virtual;
- procedure GetGroupSummaryParams(ARow: TcxGridGroupRow; ASummaryItem: TcxDataSummaryItem;
- out AParams: TcxViewParams); virtual;
- procedure GetHeaderParams(out AParams: TcxViewParams); virtual;
- property GridView: TcxGridTableView read GetGridViewValue;
- property Item: TcxGridColumn read GetItem;
- published
- property Footer: TcxStyle index isFooter read GetValue write SetValue;
- property GroupSummary: TcxStyle index isGroupSummary read GetValue write SetValue;
- property Header: TcxStyle index isHeader read GetValue write SetValue;
- property OnGetFooterStyle: TcxGridGetCellStyleEvent read FOnGetFooterStyle write SetOnGetFooterStyle;
- property OnGetFooterStyleEx: TcxGridGetFooterStyleExEvent read FOnGetFooterStyleEx write SetOnGetFooterStyleEx;
- property OnGetFooterSummaryStyle: TcxGridGetFooterSummaryStyleEvent read FOnGetFooterSummaryStyle write SetOnGetFooterSummaryStyle;
- property OnGetGroupSummaryStyle: TcxGridGetGroupSummaryStyleEvent read FOnGetGroupSummaryStyle write SetOnGetGroupSummaryStyle;
- property OnGetHeaderStyle: TcxGridGetHeaderStyleEvent read FOnGetHeaderStyle write SetOnGetHeaderStyle;
- end;
- {$IFNDEF BCB}
- TcxGridSummariesIndex = (siFooter, siGroupFooter, siGroup);
- {$ELSE}
- TcxGridSummariesIndex = Integer;
- {$ENDIF}
- TcxGridColumnSummaryClass = class of TcxGridColumnSummary;
- TcxGridColumnSummary = class(TcxCustomGridTableItemCustomOptions)
- private
- function GetDataController: TcxCustomDataController;
- function GetFormat(Index: TcxGridSummariesIndex): string;
- function GetKind(Index: TcxGridSummariesIndex): TcxSummaryKind;
- function GetSortByGroupFooterSummary: Boolean;
- function GetSortByGroupSummary: Boolean;
- procedure SetFormat(Index: TcxGridSummariesIndex; const Value: string);
- procedure SetKind(Index: TcxGridSummariesIndex; Value: TcxSummaryKind);
- procedure SetSortByGroupFooterSummary(Value: Boolean);
- procedure SetSortByGroupSummary(Value: Boolean);
- protected
- function GetSummaryItems(AIndex: TcxGridSummariesIndex): TcxDataSummaryItems;
- function GetSummaryItemsPosition(AIndex: TcxGridSummariesIndex): TcxSummaryPosition;
- property DataController: TcxCustomDataController read GetDataController;
- public
- procedure Assign(Source: TPersistent); override;
- published
- property FooterKind: TcxSummaryKind index siFooter read GetKind write SetKind stored False;
- property FooterFormat: string index siFooter read GetFormat write SetFormat stored False;
- property GroupFooterKind: TcxSummaryKind index siGroupFooter read GetKind write SetKind stored False;
- property GroupFooterFormat: string index siGroupFooter read GetFormat write SetFormat stored False;
- property GroupKind: TcxSummaryKind index siGroup read GetKind write SetKind stored False;
- property GroupFormat: string index siGroup read GetFormat write SetFormat stored False;
- property SortByGroupFooterSummary: Boolean read GetSortByGroupFooterSummary write SetSortByGroupFooterSummary stored False;
- property SortByGroupSummary: Boolean read GetSortByGroupSummary write SetSortByGroupSummary stored False;
- end;
- TcxGridColumnCompareRowValuesEvent = procedure(Sender: TcxGridColumn;
- ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: TcxEditValue;
- ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: TcxEditValue;
- var AAreEqual: Boolean) of object;
- TcxGridColumnCompareValuesEvent = procedure(Sender: TcxGridColumn;
- AProperties1: TcxCustomEditProperties; const AValue1: TcxEditValue;
- AProperties2: TcxCustomEditProperties; const AValue2: TcxEditValue; var AAreEqual: Boolean) of object;
- TcxGridColumnCustomDrawHeaderEvent = procedure(Sender: TcxGridTableView; ACanvas: TcxCanvas;
- AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean) of object;
- TcxGridGroupSummaryCellCustomDrawEvent = procedure(Sender: TObject; ACanvas: TcxCanvas;
- ARow: TcxGridGroupRow; AColumn: TcxGridColumn; ASummaryItem: TcxDataSummaryItem;
- AViewInfo: TcxCustomGridViewCellViewInfo; var ADone: Boolean) of object;
- TcxGridColumn = class(TcxCustomGridTableItem)
- private
- FFooterAlignmentHorz: TAlignment;
- FGroupSummaryAlignment: TAlignment;
- FHeaderGlyph: TBitmap;
- FHeaderGlyphAlignmentHorz: TAlignment;
- FHeaderGlyphAlignmentVert: TcxAlignmentVert;
- FIsFooterAlignmentHorzAssigned: Boolean;
- FIsGroupSummaryAlignmentAssigned: Boolean;
- FSelected: Boolean;
- FSummary: TcxGridColumnSummary;
- FOnCompareRowValuesForCellMerging: TcxGridColumnCompareRowValuesEvent;
- FOnCompareValuesForCellMerging: TcxGridColumnCompareValuesEvent;
- FOnCustomDrawFooterCell: TcxGridColumnCustomDrawHeaderEvent;
- FOnCustomDrawGroupSummaryCell: TcxGridGroupSummaryCellCustomDrawEvent;
- FOnCustomDrawHeader: TcxGridColumnCustomDrawHeaderEvent;
- FOnHeaderClick: TNotifyEvent;
- function GetController: TcxGridTableController;
- function GetFooterAlignmentHorz: TAlignment;
- function GetGridView: TcxGridTableView;
- function GetGroupSummaryAlignment: TAlignment;
- function GetIsPreview: Boolean;
- function GetOptions: TcxGridColumnOptions;
- function GetStyles: TcxGridColumnStyles;
- function GetViewData: TcxGridViewData;
- procedure SetFooterAlignmentHorz(Value: TAlignment);
- procedure SetGroupSummaryAlignment(Value: TAlignment);
- procedure SetHeaderGlyph(Value: TBitmap);
- procedure SetHeaderGlyphAlignmentHorz(Value: TAlignment);
- procedure SetHeaderGlyphAlignmentVert(Value: TcxAlignmentVert);
- procedure SetIsPreview(Value: Boolean);
- procedure SetOnCompareRowValuesForCellMerging(Value: TcxGridColumnCompareRowValuesEvent);
- procedure SetOnCompareValuesForCellMerging(Value: TcxGridColumnCompareValuesEvent);
- procedure SetOnCustomDrawFooterCell(Value: TcxGridColumnCustomDrawHeaderEvent);
- procedure SetOnCustomDrawGroupSummaryCell(Value: TcxGridGroupSummaryCellCustomDrawEvent);
- procedure SetOnCustomDrawHeader(Value: TcxGridColumnCustomDrawHeaderEvent);
- procedure SetOnHeaderClick(Value: TNotifyEvent);
- procedure SetOptions(Value: TcxGridColumnOptions);
- procedure SetSelected(Value: Boolean);
- procedure SetStyles(Value: TcxGridColumnStyles);
- procedure SetSummary(Value: TcxGridColumnSummary);
- function IsFooterAlignmentHorzStored: Boolean;
- function IsGroupSummaryAlignmentStored: Boolean;
- procedure HeaderGlyphChanged(Sender: TObject);
- protected
- // IcxStoredObject
- function GetStoredProperties(AProperties: TStrings): Boolean; override;
- procedure GetPropertyValue(const AName: string; var AValue: Variant); override;
- procedure SetPropertyValue(const AName: string; const AValue: Variant); override;
- procedure CreateSubClasses; override;
- procedure DestroySubClasses; override;
- function GetOptionsClass: TcxCustomGridTableItemOptionsClass; override;
- function GetStylesClass: TcxCustomGridTableItemStylesClass; override;
- function GetSummaryClass: TcxGridColumnSummaryClass; virtual;
- procedure AssignColumnWidths; virtual;
- procedure BestFitApplied(AFireEvents: Boolean); override;
- function CalculateBestFitWidth: Integer; override;
- function CanCellMerging: Boolean; virtual;
- function CanEdit: Boolean; override;
- function CanFocus(ARecord: TcxCustomGridRecord): Boolean; override;
- function CanHorzSize: Boolean; override;
- function CanShowGroupFooters: Boolean; virtual;
- procedure ForceWidth(Value: Integer); override;
- function GetEditValue: Variant; override;
- procedure SetEditValue(const Value: Variant); override;
- function GetFixed: Boolean; override;
- function GetIsBottom: Boolean; virtual;
- function GetIsLeft: Boolean; virtual;
- function GetIsMostBottom: Boolean; virtual;
- function GetIsMostLeft: Boolean; virtual;
- function GetIsMostRight: Boolean; virtual;
- function GetIsRight: Boolean; virtual;
- function GetIsTop: Boolean; virtual;
- function GetVisible: Boolean; override;
- function GetVisibleForCustomization: Boolean; override;
- function HasFixedWidth: Boolean; override;
- function HideOnGrouping: Boolean; virtual;
- function IsVisibleStored: Boolean; override;
- function IsVisibleForCustomizationStored: Boolean; override;
- function SupportsBeginsWithFilterOperator(ARow: TcxCustomGridRow): Boolean;
- //procedure VisibleChanged; dynamic;
- function GetHeaderViewInfoClass: TcxGridColumnHeaderViewInfoClass;
- procedure DoCustomDrawFooterCell(ACanvas: TcxCanvas; AViewInfo: TcxGridColumnHeaderViewInfo;
- var ADone: Boolean); virtual;
- procedure DoCustomDrawGroupSummaryCell(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridViewCellViewInfo;
- var ADone: Boolean); virtual;
- procedure DoCustomDrawHeader(ACanvas: TcxCanvas; AViewInfo: TcxGridColumnHeaderViewInfo;
- var ADone: Boolean); virtual;
- procedure DoHeaderClick; virtual;
- function HasCustomDrawFooterCell: Boolean;
- function HasCustomDrawGroupSummaryCell: Boolean;
- function HasCustomDrawHeader: Boolean;
- property Controller: TcxGridTableController read GetController;
- property ViewData: TcxGridViewData read GetViewData;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure Assign(Source: TPersistent); override;
- function DoCompareValuesForCellMerging(
- ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: TcxEditValue;
- ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: TcxEditValue): Boolean;
- procedure FocusWithSelection; override;
- function GroupBy(AGroupIndex: Integer; ACanShow: Boolean = True): Boolean;
- property GridView: TcxGridTableView read GetGridView;
- property GroupingDateRanges;
- property Hidden; // obsolete, use VisibleForCustomization
- property IsBottom: Boolean read GetIsBottom;
- property IsLeft: Boolean read GetIsLeft;
- property IsMostBottom: Boolean read GetIsMostBottom;
- property IsMostLeft: Boolean read GetIsMostLeft;
- property IsMostRight: Boolean read GetIsMostRight;
- property IsPreview: Boolean read GetIsPreview write SetIsPreview;
- property IsRight: Boolean read GetIsRight;
- property IsTop: Boolean read GetIsTop;
- property Selected: Boolean read FSelected write SetSelected;
- published
- property BestFitMaxWidth;
- property DateTimeGrouping;
- property FooterAlignmentHorz: TAlignment read GetFooterAlignmentHorz write SetFooterAlignmentHorz stored IsFooterAlignmentHorzStored;
- property GroupIndex;
- property GroupSummaryAlignment: TAlignment read GetGroupSummaryAlignment write SetGroupSummaryAlignment stored IsGroupSummaryAlignmentStored;
- property HeaderAlignmentHorz;
- property HeaderAlignmentVert;
- property HeaderGlyph: TBitmap read FHeaderGlyph write SetHeaderGlyph;
- property HeaderGlyphAlignmentHorz: TAlignment read FHeaderGlyphAlignmentHorz write SetHeaderGlyphAlignmentHorz default taLeftJustify;
- property HeaderGlyphAlignmentVert: TcxAlignmentVert read FHeaderGlyphAlignmentVert write SetHeaderGlyphAlignmentVert default vaCenter;
- property MinWidth;
- property Options: TcxGridColumnOptions read GetOptions write SetOptions;
- property SortIndex;
- property SortOrder;
- property Styles: TcxGridColumnStyles read GetStyles write SetStyles;
- property Summary: TcxGridColumnSummary read FSummary write SetSummary;
- property VisibleForCustomization;
- property Width;
- property OnCompareRowValuesForCellMerging: TcxGridColumnCompareRowValuesEvent read FOnCompareRowValuesForCellMerging write SetOnCompareRowValuesForCellMerging;
- property OnCompareValuesForCellMerging: TcxGridColumnCompareValuesEvent read FOnCompareValuesForCellMerging write SetOnCompareValuesForCellMerging;
- property OnCustomDrawFooterCell: TcxGridColumnCustomDrawHeaderEvent read FOnCustomDrawFooterCell write SetOnCustomDrawFooterCell;
- property OnCustomDrawGroupSummaryCell: TcxGridGroupSummaryCellCustomDrawEvent read FOnCustomDrawGroupSummaryCell write SetOnCustomDrawGroupSummaryCell;
- property OnCustomDrawHeader: TcxGridColumnCustomDrawHeaderEvent read FOnCustomDrawHeader write SetOnCustomDrawHeader;
- property OnHeaderClick: TNotifyEvent read FOnHeaderClick write SetOnHeaderClick;
- property OnInitGroupingDateRanges;
- end;
- // options
- TcxGridTableBackgroundBitmaps = class(TcxCustomGridTableBackgroundBitmaps)
- protected
- function GetBitmapStyleIndex(Index: Integer): Integer; override;
- public
- procedure Assign(Source: TPersistent); override;
- published
- property Footer: TBitmap index bbFooter read GetValue write SetValue;
- property Header: TBitmap index bbHeader read GetValue write SetValue;
- property Group: TBitmap index bbGroup read GetValue write SetValue;
- property GroupByBox: TBitmap index bbGroupByBox read GetValue write SetValue;
- property Indicator: TBitmap index bbIndicator read GetValue write SetValue;
- property Preview: TBitmap index bbPreview read GetValue write SetValue;
- end;
- TcxGridTableDateTimeHandling = class(TcxCustomGridTableDateTimeHandling)
- published
- property DateFormat;
- property Grouping;
- property HourFormat;
- property UseLongDateFormat;
- property UseShortTimeFormat;
- end;
- // behavior
- TcxGridTableOptionsBehavior = class(TcxCustomGridTableOptionsBehavior)
- private
- FColumnHeaderHints: Boolean;
- FCopyPreviewToClipboard: Boolean;
- FExpandMasterRowOnDblClick: Boolean;
- procedure SetColumnHeaderHints(Value: Boolean);
- procedure SetCopyPreviewToClipboard(Value: Boolean);
- procedure SetExpandMasterRowOnDblClick(Value: Boolean);
- public
- constructor Create(AGridView: TcxCustomGridView); override;
- procedure Assign(Source: TPersistent); override;
- published
- property BestFitMaxRecordCount;
- property ColumnHeaderHints: Boolean read FColumnHeaderHints write SetColumnHeaderHints default True;
- property CopyPreviewToClipboard: Boolean read FCopyPreviewToClipboard write SetCopyPreviewToClipboard default True;
- property ExpandMasterRowOnDblClick: Boolean read FExpandMasterRowOnDblClick write SetExpandMasterRowOnDblClick default True;
- property FocusCellOnCycle;
- property PullFocusing;
- end;
- // filter
- TcxGridTableFiltering = class(TcxCustomGridTableFiltering)
- private
- function GetColumnFilteredItemsList: Boolean;
- function GetColumnMRUItemsList: Boolean;
- function GetColumnMRUItemsListCount: Integer;
- function GetColumnPopup: TcxGridItemFilterPopupOptions;
- procedure SetColumnFilteredItemsList(Value: Boolean);
- procedure SetColumnMRUItemsList(Value: Boolean);
- procedure SetColumnMRUItemsListCount(Value: Integer);
- procedure SetColumnPopup(Value: TcxGridItemFilterPopupOptions);
- protected
- procedure DefineProperties(Filer: TFiler); override;
- public
- // obsolete - use ColumnPopup.DropDownWidth
- property ColumnPopupDropDownWidth: Integer read GetItemPopupDropDownWidth write SetItemPopupDropDownWidth;
- property DropDownWidth;
- // obsolete - use ColumnPopup.MaxDropDownItemCount
- property ColumnPopupMaxDropDownItemCount: Integer read GetItemPopupMaxDropDownItemCount write SetItemPopupMaxDropDownItemCount;
- property MaxDropDownCount;
- published
- property ColumnFilteredItemsList: Boolean read GetColumnFilteredItemsList
- write SetColumnFilteredItemsList default False;
- property ColumnMRUItemsList: Boolean read GetColumnMRUItemsList write SetColumnMRUItemsList default True;
- property ColumnMRUItemsListCount: Integer read GetColumnMRUItemsListCount
- write SetColumnMRUItemsListCount default cxGridFilterDefaultItemMRUItemsListCount;
- property ColumnPopup: TcxGridItemFilterPopupOptions read GetColumnPopup write SetColumnPopup;
- end;
- // customize
- TcxGridTableOptionsCustomize = class(TcxCustomGridTableOptionsCustomize)
- private
- FColumnHidingOnGrouping: Boolean;
- FColumnHorzSizing: Boolean;
- FDataRowSizing: Boolean;
- FGroupBySorting: Boolean;
- FGroupRowSizing: Boolean;
- function GetColumnFiltering: Boolean;
- function GetColumnGrouping: Boolean;
- function GetColumnHiding: Boolean;
- function GetColumnMoving: Boolean;
- function GetColumnSorting: Boolean;
- function GetColumnsQuickCustomization: Boolean;
- function GetColumnsQuickCustomizationMaxDropDownCount: Integer;
- function GetColumnsQuickCustomizationReordering: TcxGridQuickCustomizationReordering;
- function GetGridView: TcxGridTableView;
- procedure SetColumnFiltering(Value: Boolean);
- procedure SetColumnGrouping(Value: Boolean);
- procedure SetColumnHiding(Value: Boolean);
- procedure SetColumnHidingOnGrouping(Value: Boolean);
- procedure SetColumnHorzSizing(Value: Boolean);
- procedure SetColumnMoving(Value: Boolean);
- procedure SetColumnSorting(Value: Boolean);
- procedure SetColumnsQuickCustomization(Value: Boolean);
- procedure SetColumnsQuickCustomizationMaxDropDownCount(Value: Integer);
- procedure SetColumnsQuickCustomizationReordering(Value: TcxGridQuickCustomizationReordering);
- procedure SetDataRowSizing(Value: Boolean);
- procedure SetGroupBySorting(Value: Boolean);
- procedure SetGroupRowSizing(Value: Boolean);
- public
- constructor Create(AGridView: TcxCustomGridView); override;
- procedure Assign(Source: TPersistent); override;
- property GridView: TcxGridTableView read GetGridView;
- published
- property ColumnFiltering: Boolean read GetColumnFiltering write SetColumnFiltering default True;
- property ColumnGrouping: Boolean read GetColumnGrouping write SetColumnGrouping default True;
- property ColumnHiding: Boolean read GetColumnHiding write SetColumnHiding default False;
- property ColumnHidingOnGrouping: Boolean read FColumnHidingOnGrouping write SetColumnHidingOnGrouping default True;
- property ColumnHorzSizing: Boolean read FColumnHorzSizing write SetColumnHorzSizing default True;
- property ColumnMoving: Boolean read GetColumnMoving write SetColumnMoving default True;
- property ColumnSorting: Boolean read GetColumnSorting write SetColumnSorting default True;
- property ColumnsQuickCustomization: Boolean read GetColumnsQuickCustomization
- write SetColumnsQuickCustomization default False;
- property ColumnsQuickCustomizationMaxDropDownCount: Integer read GetColumnsQuickCustomizationMaxDropDownCount
- write SetColumnsQuickCustomizationMaxDropDownCount default 0;
- property ColumnsQuickCustomizationReordering: TcxGridQuickCustomizationReordering
- read GetColumnsQuickCustomizationReordering write SetColumnsQuickCustomizationReordering default qcrDefault;
- property DataRowSizing: Boolean read FDataRowSizing write SetDataRowSizing default False;
- property GroupBySorting: Boolean read FGroupBySorting write SetGroupBySorting default False;
- property GroupRowSizing: Boolean read FGroupRowSizing write SetGroupRowSizing default False;
- end;
- // data
- TcxGridTableOptionsData = class(TcxCustomGridTableOptionsData);
- // selection
- TcxGridTableOptionsSelection = class(TcxCustomGridTableOptionsSelection)
- private
- FCellMultiSelect: Boolean;
- procedure SetCellMultiSelect(Value: Boolean);
- function IsCellSelectStored: Boolean;
- protected
- function IsInvertSelectStored: Boolean; override;
- function IsMultiSelectStored: Boolean; override;
- procedure SetCellSelect(Value: Boolean); override;
- procedure SetInvertSelect(Value: Boolean); override;
- procedure SetMultiSelect(Value: Boolean); override;
- public
- procedure Assign(Source: TPersistent); override;
- published
- property CellMultiSelect: Boolean read FCellMultiSelect write SetCellMultiSelect default False;
- property CellSelect stored IsCellSelectStored;
- end;
- // view
- TcxGridSpecialRowOptions = class(TcxCustomGridOptions)
- private
- FInfoText: string;
- FIsInfoTextAssigned: Boolean;
- FSeparatorColor: TColor;
- FSeparatorWidth: Integer;
- FVisible: Boolean;
- function GetGridView: TcxGridTableView;
- function GetInfoText: string;
- procedure SetInfoText(const Value: string);
- procedure SetSeparatorColor(Value: TColor);
- procedure SetSeparatorWidth(Value: Integer);
- procedure SetVisible(Value: Boolean);
- function IsInfoTextStored: Boolean;
- protected
- function DefaultInfoText: string; virtual; abstract;
- function DefaultSeparatorColor: TColor; virtual;
- procedure VisibleChanged; virtual; abstract;
- public
- constructor Create(AGridView: TcxCustomGridView); override;
- procedure Assign(Source: TPersistent); override;
- function GetSeparatorColor: TColor;
- property GridView: TcxGridTableView read GetGridView;
- published
- property InfoText: string read GetInfoText write SetInfoText stored IsInfoTextStored;
- property SeparatorColor: TColor read FSeparatorColor write SetSeparatorColor default clDefault;
- property SeparatorWidth: Integer read FSeparatorWidth write SetSeparatorWidth default cxGridCustomRowSeparatorDefaultWidth;
- property Visible: Boolean read FVisible write SetVisible default False;
- end;
- TcxGridFilterRowApplyChangesMode = (fracOnCellExit, fracImmediately);
- TcxGridFilterRowOptionsClass = class of TcxGridFilterRowOptions;
- TcxGridFilterRowOptions = class(TcxGridSpecialRowOptions)
- private
- FApplyChanges: TcxGridFilterRowApplyChangesMode;
- procedure SetApplyChanges(Value: TcxGridFilterRowApplyChangesMode);
- protected
- function DefaultInfoText: string; override;
- procedure VisibleChanged; override;
- public
- procedure Assign(Source: TPersistent); override;
- published
- property ApplyChanges: TcxGridFilterRowApplyChangesMode read FApplyChanges
- write SetApplyChanges default fracOnCellExit;
- end;
- TcxGridNewItemRowOptionsClass = class of TcxGridNewItemRowOptions;
- TcxGridNewItemRowOptions = class(TcxGridSpecialRowOptions)
- protected
- function DefaultInfoText: string; override;
- procedure VisibleChanged; override;
- end;
- TcxGridGroupFootersMode = (gfInvisible, gfVisibleWhenExpanded, gfAlwaysVisible);
- TcxGridGroupRowStyle = (grsStandard, grsOffice11);
- TcxGridGroupSummaryLayout = (gslStandard, gslAlignWithColumns,
- gslAlignWithColumnsAndDistribute);
- TcxGridTableOptionsView = class(TcxCustomGridTableOptionsView)
- private
- FColumnAutoWidth: Boolean;
- FDataRowHeight: Integer;
- FExpandButtonsForEmptyDetails: Boolean;
- FFooter: Boolean;
- FFooterAutoHeight: Boolean;
- FFooterMultiSummaries: Boolean;
- FGridLineColor: TColor;
- FGridLines: TcxGridLines;
- FGroupByBox: Boolean;
- FGroupFooterMultiSummaries: Boolean;
- FGroupFooters: TcxGridGroupFootersMode;
- FGroupRowHeight: Integer;
- FGroupRowStyle: TcxGridGroupRowStyle;
- FGroupSummaryLayout: TcxGridGroupSummaryLayout;
- FHeader: Boolean;
- FHeaderHeight: Integer;
- FIndicator: Boolean;
- FIndicatorWidth: Integer;
- FPrevGroupFooters: TcxGridGroupFootersMode;
- FRowSeparatorColor: TColor;
- FRowSeparatorWidth: Integer;
- function GetExpandButtonsForEmptyDetails: Boolean;
- function GetGridView: TcxGridTableView;
- function GetHeaderAutoHeight: Boolean;
- function GetHeaderEndEllipsis: Boolean;
- function GetNewItemRow: Boolean;
- function GetNewItemRowInfoText: string;
- function GetNewItemRowSeparatorColor: TColor;
- function GetNewItemRowSeparatorWidth: Integer;
- function GetShowColumnFilterButtons: TcxGridShowItemFilterButtons;
- procedure SetColumnAutoWidth(Value: Boolean);
- procedure SetDataRowHeight(Value: Integer);
- procedure SetExpandButtonsForEmptyDetails(Value: Boolean);
- procedure SetFooter(Value: Boolean);
- procedure SetFooterAutoHeight(Value: Boolean);
- procedure SetFooterMultiSummaries(Value: Boolean);
- procedure SetGridLineColor(Value: TColor);
- procedure SetGridLines(Value: TcxGridLines);
- procedure SetGroupByBox(Value: Boolean);
- procedure SetGroupFooterMultiSummaries(Value: Boolean);
- procedure SetGroupFooters(Value: TcxGridGroupFootersMode);
- procedure SetGroupRowHeight(Value: Integer);
- procedure SetGroupRowStyle(Value: TcxGridGroupRowStyle);
- procedure SetGroupSummaryLayout(Value: TcxGridGroupSummaryLayout);
- procedure SetHeader(Value: Boolean);
- procedure SetHeaderAutoHeight(Value: Boolean);
- procedure SetHeaderEndEllipsis(Value: Boolean);
- procedure SetHeaderHeight(Value: Integer);
- procedure SetIndicator(Value: Boolean);
- procedure SetIndicatorWidth(Value: Integer);
- procedure SetNewItemRow(Value: Boolean);
- procedure SetNewItemRowInfoText(const Value: string);
- procedure SetNewItemRowSeparatorColor(Value: TColor);
- procedure SetNewItemRowSeparatorWidth(Value: Integer);
- procedure SetRowSeparatorColor(Value: TColor);
- procedure SetRowSeparatorWidth(Value: Integer);
- procedure SetShowColumnFilterButtons(Value: TcxGridShowItemFilterButtons);
- procedure ReadNewItemRow(Reader: TReader);
- procedure ReadNewItemRowInfoText(Reader: TReader);
- procedure ReadNewItemRowSeparatorColor(Reader: TReader);
- procedure ReadNewItemRowSeparatorWidth(Reader: TReader);
- protected
- procedure DefineProperties(Filer: TFiler); override;
- procedure ItemCaptionAutoHeightChanged; override;
- public
- constructor Create(AGridView: TcxCustomGridView); override;
- procedure Assign(Source: TPersistent); override;
- function CanShowFooterMultiSummaries: Boolean;
- function CanShowGroupFooterMultiSummaries: Boolean;
- procedure CheckDataRowHeight(var AValue: Integer); virtual;
- procedure CheckGroupRowHeight(var AValue: Integer); virtual;
- function GetGridLineColor: TColor;
- function GetGroupSummaryLayout: TcxGridGroupSummaryLayout;
- function GetRowSeparatorColor: TColor;
- property GridView: TcxGridTableView read GetGridView;
- // obsolete - use GridView.NewItemRow
- property NewItemRow: Boolean read GetNewItemRow write SetNewItemRow;
- property NewItemRowInfoText: string read GetNewItemRowInfoText write SetNewItemRowInfoText;
- property NewItemRowSeparatorColor: TColor read GetNewItemRowSeparatorColor write SetNewItemRowSeparatorColor;
- property NewItemRowSeparatorWidth: Integer read GetNewItemRowSeparatorWidth write SetNewItemRowSeparatorWidth;
- property PrevGroupFooters: TcxGridGroupFootersMode read FPrevGroupFooters;
- published
- property CellAutoHeight;
- property CellTextMaxLineCount;
- property ColumnAutoWidth: Boolean read FColumnAutoWidth write SetColumnAutoWidth default False;
- property DataRowHeight: Integer read FDataRowHeight write SetDataRowHeight default 0;
- property ExpandButtonsForEmptyDetails: Boolean read GetExpandButtonsForEmptyDetails
- write SetExpandButtonsForEmptyDetails default True;
- property Footer: Boolean read FFooter write SetFooter default False;
- property FooterAutoHeight: Boolean read FFooterAutoHeight write SetFooterAutoHeight default False;
- property FooterMultiSummaries: Boolean read FFooterMultiSummaries write SetFooterMultiSummaries default False;
- property GridLineColor: TColor read FGridLineColor write SetGridLineColor default clDefault;
- property GridLines: TcxGridLines read FGridLines write SetGridLines default glBoth;
- property GroupByBox: Boolean read FGroupByBox write SetGroupByBox default True;
- property GroupFooterMultiSummaries: Boolean read FGroupFooterMultiSummaries write SetGroupFooterMultiSummaries default False;
- property GroupFooters: TcxGridGroupFootersMode read FGroupFooters write SetGroupFooters default gfInvisible;
- property GroupRowHeight: Integer read FGroupRowHeight write SetGroupRowHeight default 0;
- property GroupRowStyle: TcxGridGroupRowStyle read FGroupRowStyle write SetGroupRowStyle default grsStandard;
- property GroupSummaryLayout: TcxGridGroupSummaryLayout read FGroupSummaryLayout
- write SetGroupSummaryLayout default gslStandard;
- property Header: Boolean read FHeader write SetHeader default True;
- property HeaderAutoHeight: Boolean read GetHeaderAutoHeight write SetHeaderAutoHeight default False;
- property HeaderEndEllipsis: Boolean read GetHeaderEndEllipsis write SetHeaderEndEllipsis default False;
- property HeaderHeight: Integer read FHeaderHeight write SetHeaderHeight default 0;
- property Indicator: Boolean read FIndicator write SetIndicator default False;
- property IndicatorWidth: Integer read FIndicatorWidth write SetIndicatorWidth default cxGridDefaultIndicatorWidth;
- property RowSeparatorColor: TColor read FRowSeparatorColor write SetRowSeparatorColor default clDefault;
- property RowSeparatorWidth: Integer read FRowSeparatorWidth write SetRowSeparatorWidth default 0;
- property ShowColumnFilterButtons: TcxGridShowItemFilterButtons read GetShowColumnFilterButtons
- write SetShowColumnFilterButtons default sfbWhenSelected;
- end;
- // preview
- TcxGridPreviewPlace = (ppBottom, ppTop);
- TcxGridPreviewClass = class of TcxGridPreview;
- TcxGridPreview = class(TcxCustomGridOptions)
- private
- FAutoHeight: Boolean;
- FColumn: TcxGridColumn;
- FLeftIndent: Integer;
- FMaxLineCount: Integer;
- FPlace: TcxGridPreviewPlace;
- FRightIndent: Integer;
- FVisible: Boolean;
- function GetActive: Boolean;
- function GetGridView: TcxGridTableView;
- procedure SetAutoHeight(Value: Boolean);
- procedure SetColumn(Value: TcxGridColumn);
- procedure SetLeftIndent(Value: Integer);
- procedure SetMaxLineCount(Value: Integer);
- procedure SetPlace(Value: TcxGridPreviewPlace);
- procedure SetRightIndent(Value: Integer);
- procedure SetVisible(Value: Boolean);
- protected
- procedure Notification(AComponent: TComponent; AOperation: TOperation); override;
- procedure PropertyChanged;
- public
- constructor Create(AGridView: TcxCustomGridView); override;
- procedure Assign(Source: TPersistent); override;
- property Active: Boolean read GetActive;
- property GridView: TcxGridTableView read GetGridView;
- published
- property AutoHeight: Boolean read FAutoHeight write SetAutoHeight default True;
- property Column: TcxGridColumn read FColumn write SetColumn;
- property LeftIndent: Integer read FLeftIndent write SetLeftIndent
- default cxGridPreviewDefaultLeftIndent;
- property MaxLineCount: Integer read FMaxLineCount write SetMaxLineCount
- default cxGridPreviewDefaultMaxLineCount;
- property Place: TcxGridPreviewPlace read FPlace write SetPlace default ppBottom;
- property RightIndent: Integer read FRightIndent write SetRightIndent
- default cxGridPreviewDefaultRightIndent;
- property Visible: Boolean read FVisible write SetVisible default False;
- end;
- // styles
- TcxGridGetGroupStyleEvent = procedure(Sender: TcxGridTableView; ARecord: TcxCustomGridRecord;
- ALevel: Integer; {$IFDEF BCB}var{$ELSE}out{$ENDIF} AStyle: TcxStyle) of object;
- TcxGridTableViewStyles = class(TcxCustomGridTableViewStyles)
- private
- FProcessingGroupSortedSummary: Boolean;
- FOnGetFooterStyle: TcxGridGetCellStyleEvent;
- FOnGetFooterStyleEx: TcxGridGetFooterStyleExEvent;
- FOnGetFooterSummaryStyle: TcxGridGetFooterSummaryStyleEvent;
- FOnGetGroupStyle: TcxGridGetGroupStyleEvent;
- FOnGetGroupSummaryStyle: TcxGridGetGroupSummaryStyleEvent;
- FOnGetHeaderStyle: TcxGridGetHeaderStyleEvent;
- FOnGetPreviewStyle: TcxGridGetCellStyleEvent;
- function GetGridViewValue: TcxGridTableView;
- procedure SetOnGetFooterStyle(Value: TcxGridGetCellStyleEvent);
- procedure SetOnGetFooterStyleEx(Value: TcxGridGetFooterStyleExEvent);
- procedure SetOnGetFooterSummaryStyle(Value: TcxGridGetFooterSummaryStyleEvent);
- procedure SetOnGetGroupStyle(Value: TcxGridGetGroupStyleEvent);
- procedure SetOnGetGroupSummaryStyle(Value: TcxGridGetGroupSummaryStyleEvent);
- procedure SetOnGetHeaderStyle(Value: TcxGridGetHeaderStyleEvent);
- procedure SetOnGetPreviewStyle(Value: TcxGridGetCellStyleEvent);
- protected
- procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override;
- public
- procedure Assign(Source: TPersistent); override;
- procedure GetCellContentParams(ARecord: TcxCustomGridRecord; AItem: TObject;
- out AParams: TcxViewParams); override;
- procedure GetContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
- out AParams: TcxViewParams); override;
- procedure GetFooterCellParams(ARow: TcxCustomGridRow; AColumn: TcxGridColumn;
- AFooterGroupLevel: Integer; ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); virtual;
- procedure GetFooterParams(ARow: TcxCustomGridRow; AColumn: TcxGridColumn;
- AFooterGroupLevel: Integer; ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); virtual;
- procedure GetGroupParams(ARecord: TcxCustomGridRecord; ALevel: Integer;
- out AParams: TcxViewParams); virtual;
- procedure GetGroupSummaryCellContentParams(ARow: TcxGridGroupRow;
- ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); virtual;
- procedure GetGroupSummaryCellParams(ARow: TcxGridGroupRow;
- ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); virtual;
- procedure GetGroupSummaryParams(ARow: TcxGridGroupRow; ASummaryItem: TcxDataSummaryItem;
- out AParams: TcxViewParams); virtual;
- procedure GetHeaderParams(AItem: TcxGridColumn; out AParams: TcxViewParams); virtual;
- procedure GetPreviewParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
- out AParams: TcxViewParams); virtual;
- procedure GetRecordContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
- out AParams: TcxViewParams); override;
- property GridView: TcxGridTableView read GetGridViewValue;
- published
- property FilterRowInfoText: TcxStyle index vsFilterRowInfoText read GetValue write SetValue;
- property Footer: TcxStyle index vsFooter read GetValue write SetValue;
- property Group: TcxStyle index vsGroup read GetValue write SetValue;
- property GroupByBox: TcxStyle index vsGroupByBox read GetValue write SetValue;
- property GroupFooterSortedSummary: TcxStyle index vsGroupFooterSortedSummary read GetValue write SetValue;
- property GroupSortedSummary: TcxStyle index vsGroupSortedSummary read GetValue write SetValue;
- property GroupSummary: TcxStyle index vsGroupSummary read GetValue write SetValue;
- property Header: TcxStyle index vsHeader read GetValue write SetValue;
- property Indicator: TcxStyle index vsIndicator read GetValue write SetValue;
- property NewItemRowInfoText: TcxStyle index vsNewItemRowInfoText read GetValue write SetValue;
- property Preview: TcxStyle index vsPreview read GetValue write SetValue;
- property StyleSheet;
- property OnGetFooterStyle: TcxGridGetCellStyleEvent read FOnGetFooterStyle write SetOnGetFooterStyle;
- property OnGetFooterStyleEx: TcxGridGetFooterStyleExEvent read FOnGetFooterStyleEx write SetOnGetFooterStyleEx;
- property OnGetFooterSummaryStyle: TcxGridGetFooterSummaryStyleEvent read FOnGetFooterSummaryStyle write SetOnGetFooterSummaryStyle;
- property OnGetGroupStyle: TcxGridGetGroupStyleEvent read FOnGetGroupStyle write SetOnGetGroupStyle;
- property OnGetGroupSummaryStyle: TcxGridGetGroupSummaryStyleEvent read FOnGetGroupSummaryStyle write SetOnGetGroupSummaryStyle;
- property OnGetHeaderStyle: TcxGridGetHeaderStyleEvent read FOnGetHeaderStyle write SetOnGetHeaderStyle;
- property OnGetPreviewStyle: TcxGridGetCellStyleEvent read FOnGetPreviewStyle write SetOnGetPreviewStyle;
- end;
- TcxGridTableViewStyleSheet = class(TcxCustomStyleSheet)
- private
- function GetStylesValue: TcxGridTableViewStyles;
- procedure SetStylesValue(Value: TcxGridTableViewStyles);
- public
- class function GetStylesClass: TcxCustomStylesClass; override;
- published
- property Styles: TcxGridTableViewStyles read GetStylesValue write SetStylesValue;
- end;
- // grid view
- TcxGridTableSummaryGroupItemLink = class(TcxDataSummaryGroupItemLink,
- {$IFNDEF DELPHI6}IUnknown,{$ENDIF} IcxStoredObject)
- private
- function GetColumn: TcxGridColumn;
- procedure SetColumn(Value: TcxGridColumn);
- function GetGridView: TcxGridTableView;
- protected
- // IInterface
- function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
- function _AddRef: Integer; stdcall;
- function _Release: Integer; stdcall;
- // IcxStoredObject
- function GetObjectName: string;
- function GetProperties(AProperties: TStrings): Boolean;
- procedure GetPropertyValue(const AName: string; var AValue: Variant);
- procedure SetPropertyValue(const AName: string; const AValue: Variant);
- property GridView: TcxGridTableView read GetGridView;
- published
- property Column: TcxGridColumn read GetColumn write SetColumn;
- end;
- IcxGridSummaryItem = interface
- ['{6F9A0C3E-E33F-4E77-9357-82F1D19CDB67}']
- function GetDisplayText: string;
- function GetVisibleForCustomization: Boolean;
- property DisplayText: string read GetDisplayText;
- property VisibleForCustomization: Boolean read GetVisibleForCustomization;
- end;
- TcxGridTableSummaryItem = class(TcxDataSummaryItem,
- {$IFNDEF DELPHI6}IUnknown,{$ENDIF} IcxStoredObject, IcxGridSummaryItem)
- private
- FDisplayText: string;
- FVisibleForCustomization: Boolean;
- function GetColumn: TcxGridColumn;
- function GetGridView: TcxGridTableView;
- procedure SetColumn(Value: TcxGridColumn);
- procedure SetDisplayText(const Value: string);
- procedure SetVisibleForCustomization(Value: Boolean);
- protected
- // IInterface
- function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
- function _AddRef: Integer; stdcall;
- function _Release: Integer; stdcall;
- // IcxStoredObject
- function GetObjectName: string;
- function GetProperties(AProperties: TStrings): Boolean;
- procedure GetPropertyValue(const AName: string; var AValue: Variant);
- procedure SetPropertyValue(const AName: string; const AValue: Variant);
- // IcxGridSummaryItem
- function GetDisplayText: string;
- function GetVisibleForCustomization: Boolean;
- property GridView: TcxGridTableView read GetGridView;
- public
- constructor Create(Collection: TCollection); override;
- procedure Assign(Source: TPersistent); override;
- published
- property Column: TcxGridColumn read GetColumn write SetColumn;
- property DisplayText: string read FDisplayText write SetDisplayText;
- property Sorted;
- property VisibleForCustomization: Boolean read FVisibleForCustomization
- write SetVisibleForCustomization default True;
- end;
- TcxGridColumnEvent = procedure(Sender: TcxGridTableView; AColumn: TcxGridColumn) of object;
- TcxGridIndicatorCellCustomDrawEvent = procedure(Sender: TcxGridTableView;
- ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean) of object;
- TcxGridTableView = class(TcxCustomGridTableView)
- private
- FAllowCellMerging: Boolean;
- FFilterRow: TcxGridFilterRowOptions;
- FNewItemRow: TcxGridNewItemRowOptions;
- FPreview: TcxGridPreview;
- FOnColumnHeaderClick: TcxGridColumnEvent;
- FOnColumnPosChanged: TcxGridColumnEvent;
- FOnColumnSizeChanged: TcxGridColumnEvent;
- FOnCustomDrawColumnHeader: TcxGridColumnCustomDrawHeaderEvent;
- FOnCustomDrawFooterCell: TcxGridColumnCustomDrawHeaderEvent;
- FOnCustomDrawGroupCell: TcxGridTableCellCustomDrawEvent;
- FOnCustomDrawGroupSummaryCell: TcxGridGroupSummaryCellCustomDrawEvent;
- FOnCustomDrawIndicatorCell: TcxGridIndicatorCellCustomDrawEvent;
- FOnLeftPosChanged: TNotifyEvent;
- function GetBackgroundBitmaps: TcxGridTableBackgroundBitmaps;
- function GetColumn(Index: Integer): TcxGridColumn;
- function GetColumnCount: Integer;
- function GetController: TcxGridTableController;
- function GetDataController: TcxGridDataController;
- function GetDateTimeHandling: TcxGridTableDateTimeHandling;
- function GetFiltering: TcxGridTableFiltering;
- function GetGroupedColumn(Index: Integer): TcxGridColumn;
- function GetGroupedColumnCount: Integer;
- function GetOptionsBehavior: TcxGridTableOptionsBehavior;
- function GetOptionsCustomize: TcxGridTableOptionsCustomize;
- function GetOptionsData: TcxGridTableOptionsData;
- function GetOptionsSelection: TcxGridTableOptionsSelection;
- function GetOptionsView: TcxGridTableOptionsView;
- function GetPainter: TcxGridTablePainter;
- function GetStyles: TcxGridTableViewStyles;
- function GetViewData: TcxGridViewData;
- function GetViewInfo: TcxGridTableViewInfo;
- function GetVisibleColumn(Index: Integer): TcxGridColumn;
- function GetVisibleColumnCount: Integer;
- procedure SetBackgroundBitmaps(Value: TcxGridTableBackgroundBitmaps);
- procedure SetColumn(Index: Integer; Value: TcxGridColumn);
- procedure SetDataController(Value: TcxGridDataController);
- procedure SetDateTimeHandling(Value: TcxGridTableDateTimeHandling);
- procedure SetFiltering(Value: TcxGridTableFiltering);
- procedure SetFilterRow(Value: TcxGridFilterRowOptions);
- procedure SetNewItemRow(Value: TcxGridNewItemRowOptions);
- procedure SetOnColumnHeaderClick(Value: TcxGridColumnEvent);
- procedure SetOnColumnPosChanged(Value: TcxGridColumnEvent);
- procedure SetOnColumnSizeChanged(Value: TcxGridColumnEvent);
- procedure SetOnCustomDrawColumnHeader(Value: TcxGridColumnCustomDrawHeaderEvent);
- procedure SetOnCustomDrawFooterCell(Value: TcxGridColumnCustomDrawHeaderEvent);
- procedure SetOnCustomDrawGroupCell(Value: TcxGridTableCellCustomDrawEvent);
- procedure SetOnCustomDrawGroupSummaryCell(Value: TcxGridGroupSummaryCellCustomDrawEvent);
- procedure SetOnCustomDrawIndicatorCell(Value: TcxGridIndicatorCellCustomDrawEvent);
- procedure SetOnLeftPosChanged(Value: TNotifyEvent);
- procedure SetOptionsBehavior(Value: TcxGridTableOptionsBehavior);
- procedure SetOptionsCustomize(Value: TcxGridTableOptionsCustomize);
- procedure SetOptionsData(Value: TcxGridTableOptionsData);
- procedure SetOptionsSelection(Value: TcxGridTableOptionsSelection);
- procedure SetOptionsView(Value: TcxGridTableOptionsView);
- procedure SetPreview(Value: TcxGridPreview);
- procedure SetStyles(Value: TcxGridTableViewStyles);
- protected
- // IcxStoredObject
- function GetProperties(AProperties: TStrings): Boolean; override;
- procedure GetPropertyValue(const AName: string; var AValue: Variant); override;
- procedure SetPropertyValue(const AName: string; const AValue: Variant); override;
- // IcxGridViewLayoutEditorSupport - for design-time layout editor
- procedure AssignLayout(ALayoutView: TcxCustomGridView); override;
- procedure BeforeEditLayout(ALayoutView: TcxCustomGridView); override;
- function GetLayoutCustomizationFormButtonCaption: string; override;
- procedure CreateOptions; override;
- procedure DestroyOptions; override;
- function CanCellMerging: Boolean; virtual;
- function CanOffset(ARecordCountDelta: Integer): Boolean; override;
- function CanOffsetHorz: Boolean; virtual;
- procedure DetailDataChanged(ADetail: TcxCustomGridView); override;
- procedure DoAssign(ASource: TcxCustomGridView); override;
- procedure GetItemsListForClipboard(AItems: TList; ACopyAll: Boolean); override;
- function GetResizeOnBoundsChange: Boolean; override;
- function HasCellMerging: Boolean;
- function IsEqualHeightRecords: Boolean; override;
- function IsRecordHeightDependsOnData: Boolean; override;
- function UpdateOnDetailDataChange(ADetail: TcxCustomGridView): Boolean; virtual;
- function GetControllerClass: TcxCustomGridControllerClass; override;
- function GetDataControllerClass: TcxCustomDataControllerClass; override;
- function GetPainterClass: TcxCustomGridPainterClass; override;
- function GetViewDataClass: TcxCustomGridViewDataClass; override;
- function GetViewInfoClass: TcxCustomGridViewInfoClass; override;
- function GetBackgroundBitmapsClass: TcxCustomGridBackgroundBitmapsClass; override;
- function GetDateTimeHandlingClass: TcxCustomGridTableDateTimeHandlingClass; override;
- function GetFilteringClass: TcxCustomGridTableFilteringClass; override;
- function GetFilterRowOptionsClass: TcxGridFilterRowOptionsClass; virtual;
- function GetNewItemRowOptionsClass: TcxGridNewItemRowOptionsClass; virtual;
- function GetOptionsBehaviorClass: TcxCustomGridOptionsBehaviorClass; override;
- function GetOptionsCustomizeClass: TcxCustomGridTableOptionsCustomizeClass; override;
- function GetOptionsDataClass: TcxCustomGridOptionsDataClass; override;
- function GetOptionsSelectionClass: TcxCustomGridOptionsSelectionClass; override;
- function GetOptionsViewClass: TcxCustomGridOptionsViewClass; override;
- function GetPreviewClass: TcxGridPreviewClass; virtual;
- function GetStylesClass: TcxCustomGridViewStylesClass; override;
- function GetSummaryGroupItemLinkClass: TcxDataSummaryGroupItemLinkClass; override;
- function GetSummaryItemClass: TcxDataSummaryItemClass; override;
- function GetItemClass: TcxCustomGridTableItemClass; override;
- procedure ItemVisibilityChanged(AItem: TcxCustomGridTableItem; Value: Boolean); override;
- function CalculateDataCellSelected(ARecord: TcxCustomGridRecord;
- AItem: TcxCustomGridTableItem; AUseViewInfo: Boolean;
- ACellViewInfo: TcxGridTableCellViewInfo): Boolean; override;
- procedure DoColumnHeaderClick(AColumn: TcxGridColumn); virtual;
- procedure DoColumnPosChanged(AColumn: TcxGridColumn); virtual;
- procedure DoColumnSizeChanged(AColumn: TcxGridColumn); virtual;
- procedure DoCustomDrawColumnHeader(ACanvas: TcxCanvas; AViewInfo: TcxGridColumnHeaderViewInfo;
- var ADone: Boolean); virtual;
- procedure DoCustomDrawFooterCell(ACanvas: TcxCanvas; AViewInfo: TcxGridColumnHeaderViewInfo;
- var ADone: Boolean); virtual;
- procedure DoCustomDrawGroupCell(ACanvas: TcxCanvas; AViewInfo: TcxGridTableCellViewInfo;
- var ADone: Boolean); virtual;
- procedure DoCustomDrawGroupSummaryCell(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridViewCellViewInfo;
- var ADone: Boolean); virtual;
- procedure DoCustomDrawIndicatorCell(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo;
- var ADone: Boolean); virtual;
- procedure DoLeftPosChanged; virtual;
- function HasCustomDrawColumnHeader: Boolean;
- function HasCustomDrawFooterCell: Boolean;
- function HasCustomDrawGroupCell: Boolean;
- function HasCustomDrawGroupSummaryCell: Boolean;
- function HasCustomDrawIndicatorCell: Boolean;
- property AllowCellMerging: Boolean read FAllowCellMerging write FAllowCellMerging;
- public
- constructor Create(AOwner: TComponent); override;
- function CreateColumn: TcxGridColumn;
- // for extended lookup edit
- class function CanBeLookupList: Boolean; override;
- property ColumnCount: Integer read GetColumnCount;
- property Columns[Index: Integer]: TcxGridColumn read GetColumn write SetColumn;
- property Controller: TcxGridTableController read GetController;
- property GroupedColumnCount: Integer read GetGroupedColumnCount;
- property GroupedColumns[Index: Integer]: TcxGridColumn read GetGroupedColumn;
- property Painter: TcxGridTablePainter read GetPainter;
- property ViewData: TcxGridViewData read GetViewData;
- property ViewInfo: TcxGridTableViewInfo read GetViewInfo;
- property VisibleColumnCount: Integer read GetVisibleColumnCount;
- property VisibleColumns[Index: Integer]: TcxGridColumn read GetVisibleColumn;
- published
- property BackgroundBitmaps: TcxGridTableBackgroundBitmaps read GetBackgroundBitmaps write SetBackgroundBitmaps;
- property DataController: TcxGridDataController read GetDataController write SetDataController;
- property DateTimeHandling: TcxGridTableDateTimeHandling read GetDateTimeHandling write SetDateTimeHandling;
- property Filtering: TcxGridTableFiltering read GetFiltering write SetFiltering;
- property FilterRow: TcxGridFilterRowOptions read FFilterRow write SetFilterRow;
- property NewItemRow: TcxGridNewItemRowOptions read FNewItemRow write SetNewItemRow;
- property OptionsBehavior: TcxGridTableOptionsBehavior read GetOptionsBehavior write SetOptionsBehavior;
- property OptionsCustomize: TcxGridTableOptionsCustomize read GetOptionsCustomize write SetOptionsCustomize;
- property OptionsData: TcxGridTableOptionsData read GetOptionsData write SetOptionsData;
- property OptionsSelection: TcxGridTableOptionsSelection read GetOptionsSelection write SetOptionsSelection;
- property OptionsView: TcxGridTableOptionsView read GetOptionsView write SetOptionsView;
- property Preview: TcxGridPreview read FPreview write SetPreview;
- property Styles: TcxGridTableViewStyles read GetStyles write SetStyles ;
- property OnColumnHeaderClick: TcxGridColumnEvent read FOnColumnHeaderClick write SetOnColumnHeaderClick;
- property OnColumnPosChanged: TcxGridColumnEvent read FOnColumnPosChanged write SetOnColumnPosChanged;
- property OnColumnSizeChanged: TcxGridColumnEvent read FOnColumnSizeChanged write SetOnColumnSizeChanged;
- property OnCustomDrawColumnHeader: TcxGridColumnCustomDrawHeaderEvent read FOnCustomDrawColumnHeader write SetOnCustomDrawColumnHeader;
- property OnCustomDrawFooterCell: TcxGridColumnCustomDrawHeaderEvent read FOnCustomDrawFooterCell write SetOnCustomDrawFooterCell;
- property OnCustomDrawGroupCell: TcxGridTableCellCustomDrawEvent read FOnCustomDrawGroupCell write SetOnCustomDrawGroupCell;
- property OnCustomDrawGroupSummaryCell: TcxGridGroupSummaryCellCustomDrawEvent read FOnCustomDrawGroupSummaryCell write SetOnCustomDrawGroupSummaryCell;
- property OnCustomDrawIndicatorCell: TcxGridIndicatorCellCustomDrawEvent read FOnCustomDrawIndicatorCell write SetOnCustomDrawIndicatorCell;
- property OnCustomization;
- property OnInitGroupingDateRanges;
- property OnLeftPosChanged: TNotifyEvent read FOnLeftPosChanged write SetOnLeftPosChanged;
- end;
- { TcxGridColumnAccess }
- TcxGridColumnAccess = class
- public
- class function CanCellMerging(AInstance: TcxGridColumn): Boolean;
- class function CanShowGroupFooters(AInstance: TcxGridColumn): Boolean;
- class procedure DoCustomDrawGroupSummaryCell(AInstance: TcxGridColumn;
- ACanvas: TcxCanvas; AViewInfo: TcxCustomGridViewCellViewInfo; var ADone: Boolean); virtual;
- class function HasCustomDrawGroupSummaryCell(AInstance: TcxGridColumn): Boolean;
- end;
- { TcxGridTableViewAccess }
- TcxGridTableViewAccess = class
- public
- class procedure DoColumnPosChanged(AInstance: TcxGridTableView;
- AColumn: TcxGridColumn);
- class procedure DoCustomDrawGroupCell(AInstance: TcxGridTableView;
- ACanvas: TcxCanvas; AViewInfo: TcxGridTableCellViewInfo; var ADone: Boolean);
- class procedure DoCustomDrawGroupSummaryCell(AInstance: TcxGridTableView;
- ACanvas: TcxCanvas; AViewInfo: TcxCustomGridViewCellViewInfo; var ADone: Boolean); virtual;
- class function HasCustomDrawGroupCell(AInstance: TcxGridTableView): Boolean;
- class function HasCustomDrawGroupSummaryCell(AInstance: TcxGridTableView): Boolean;
- end;
- implementation
- uses
- SysUtils, Math, dxOffice11, cxVariants, cxDataUtils, cxFilterControlUtils,
- cxLibraryConsts, cxGridRows, cxGridStrs;
- const
- GroupByBoxLeftOffset = 6;
- GroupByBoxTopOffset = 8;
- GroupByBoxHorOffset = 4;
- GroupByBoxLineVerOffset = 4;
- GroupByBoxColumnWidth = 100;
- GroupByBoxLineWidth = 1;
- GroupByBoxLineColor = clBtnText;
- HScrollDelta = 10;
- FooterSeparatorWidth = 1;
- TopIndexNone = -2;
- RowIndexNone = -1;
- ColumnHeaderHitTestCodes = [htColumnHeader];
- ColumnHeaderMovingZoneSize = 15;
- ColumnSizingMarkWidth = 1;
- RowSizingMarkWidth = 1;
- ScrollHotZoneWidth = 15;
- type
- TcxCustomGridAccess = class(TcxCustomGrid);
- { TcxGridGroupByBoxHitTest }
- class function TcxGridGroupByBoxHitTest.GetHitTestCode: Integer;
- begin
- Result := htGroupByBox;
- end;
- { TcxGridColumnHeaderHitTest }
- class function TcxGridColumnHeaderHitTest.GetHitTestCode: Integer;
- begin
- Result := htColumnHeader;
- end;
- function TcxGridColumnHeaderHitTest.DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass;
- begin
- if Column.CanMove then
- Result := TcxGridTableView(GridView).Controller.GetColumnHeaderDragAndDropObjectClass
- else
- Result := nil;
- end;
- { TcxGridColumnHeaderHorzSizingEdgeHitTest }
- class function TcxGridColumnHeaderHorzSizingEdgeHitTest.GetHitTestCode: Integer;
- begin
- Result := htColumnHeaderHorzSizingEdge;
- end;
- function TcxGridColumnHeaderHorzSizingEdgeHitTest.Cursor: TCursor;
- begin
- Result := crcxGridHorzSize;
- end;
- function TcxGridColumnHeaderHorzSizingEdgeHitTest.DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass;
- begin
- Result := TcxGridColumnHorzSizingObject;
- end;
- { TcxGridColumnHeaderFilterButtonHitTest }
- class function TcxGridColumnHeaderFilterButtonHitTest.GetHitTestCode: Integer;
- begin
- Result := htColumnHeaderFilterButton;
- end;
- { TcxGridHeaderHitTest }
- class function TcxGridHeaderHitTest.GetHitTestCode: Integer;
- begin
- Result := htHeader;
- end;
- { TcxGridFooterHitTest }
- class function TcxGridFooterHitTest.GetHitTestCode: Integer;
- begin
- Result := htFooter;
- end;
- { TcxGridFooterCellHitTest }
- class function TcxGridFooterCellHitTest.GetHitTestCode: Integer;
- begin
- Result := htFooterCell;
- end;
- { TcxGridGroupFooterHitTest }
- class function TcxGridGroupFooterHitTest.GetHitTestCode: Integer;
- begin
- Result := htGroupFooter;
- end;
- { TcxGridGroupFooterCellHitTest }
- class function TcxGridGroupFooterCellHitTest.GetHitTestCode: Integer;
- begin
- Result := htGroupFooterCell;
- end;
- { TcxGridRowIndicatorHitTest }
- class function TcxGridRowIndicatorHitTest.GetHitTestCode: Integer;
- begin
- Result := htRowIndicator;
- end;
- function TcxGridRowIndicatorHitTest.Cursor: TCursor;
- begin
- if MultiSelect then
- Result := crcxGridSelectRow
- else
- Result := inherited Cursor;
- end;
- { TcxGridRowSizingEdgeHitTest }
- class function TcxGridRowSizingEdgeHitTest.GetHitTestCode: Integer;
- begin
- Result := htRowSizingEdge;
- end;
- function TcxGridRowSizingEdgeHitTest.Cursor: TCursor;
- begin
- Result := crcxGridVertSize;
- end;
- function TcxGridRowSizingEdgeHitTest.DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass;
- begin
- Result := TcxGridRowSizingObject;
- end;
- { TcxGridIndicatorHitTest }
- class function TcxGridIndicatorHitTest.GetHitTestCode: Integer;
- begin
- Result := htIndicator;
- end;
- { TcxGridIndicatorHeaderHitTest }
- class function TcxGridIndicatorHeaderHitTest.GetHitTestCode: Integer;
- begin
- Result := htIndicatorHeader;
- end;
- { TcxGridRowLevelIndentHitTest }
- class function TcxGridRowLevelIndentHitTest.GetHitTestCode: Integer;
- begin
- Result := htRowLevelIndent;
- end;
- class function TcxGridRowLevelIndentHitTest.CanClick: Boolean;
- begin
- Result := False;
- end;
- { TcxGridGroupSummaryHitTest }
- function TcxGridGroupSummaryHitTest.GetColumn: TcxGridColumn;
- begin
- if SummaryItem = nil then
- Result := nil
- else
- Result := SummaryItem.ItemLink as TcxGridColumn;
- end;
- class function TcxGridGroupSummaryHitTest.GetHitTestCode: Integer;
- begin
- Result := htGroupSummary;
- end;
- { TcxCustomGridRow }
- function TcxCustomGridRow.GetAsGroupRow: TcxGridGroupRow;
- begin
- Result := Self as TcxGridGroupRow;
- end;
- function TcxCustomGridRow.GetAsMasterDataRow: TcxGridMasterDataRow;
- begin
- Result := Self as TcxGridMasterDataRow;
- end;
- function TcxCustomGridRow.GetGridView: TcxGridTableView;
- begin
- Result := TcxGridTableView(inherited GridView);
- end;
- function TcxCustomGridRow.GetGridViewLevel: TcxGridLevel;
- begin
- Result := TcxGridLevel(GridView.Level);
- end;
- function TcxCustomGridRow.GetIsFilterRow: Boolean;
- begin
- Result := ViewData.FilterRow = Self;
- end;
- function TcxCustomGridRow.GetIsNewItemRow: Boolean;
- begin
- Result := IsNewItemRecord;
- end;
- function TcxCustomGridRow.GetViewData: TcxGridViewData;
- begin
- Result := TcxGridViewData(inherited ViewData);
- end;
- procedure TcxCustomGridRow.KeyDown(var Key: Word; Shift: TShiftState);
- begin
- inherited;
- case Key of
- VK_LEFT:
- if Expandable and Expanded then
- begin
- Expanded := False;
- Key := 0;
- end;
- VK_RIGHT:
- if Expandable and not Expanded then
- begin
- Expanded := True;
- Key := 0;
- end;
- VK_MULTIPLY:
- if Expandable then
- begin
- GridView.Controller.EatKeyPress := True;
- Expand(True);
- Key := 0;
- end;
- end;
- end;
- function TcxCustomGridRow.ExpandOnDblClick: Boolean;
- begin
- Result := Expandable;
- end;
- function TcxCustomGridRow.SupportsCellMultiSelect: Boolean;
- begin
- Result := False;
- end;
- { TcxGridDataRow }
- function TcxGridDataRow.GetHasCells: Boolean;
- begin
- Result := True;
- end;
- function TcxGridDataRow.GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass;
- begin
- Result := TcxGridTableViewInfoCacheItem;
- end;
- function TcxGridDataRow.GetViewInfoClass: TcxCustomGridRecordViewInfoClass;
- begin
- Result := TcxGridDataRowViewInfo;
- end;
- function TcxGridDataRow.SupportsCellMultiSelect: Boolean;
- begin
- Result := True;
- end;
- { TcxGridNewItemRow }
- function TcxGridNewItemRow.SupportsCellMultiSelect: Boolean;
- begin
- Result := False;
- end;
- { TcxGridFilterRow }
- destructor TcxGridFilterRow.Destroy;
- begin
- Selected := False;
- inherited;
- end;
- function TcxGridFilterRow.GetFilterCriteriaItem(Index: Integer): TcxFilterCriteriaItem;
- begin
- Result := GridView.Columns[Index].DataBinding.FilterCriteriaItem;
- if (Result <> nil) and not IsFilterOperatorSupported(Result.OperatorKind, Result.Value) then
- Result := nil;
- end;
- procedure TcxGridFilterRow.RefreshRecordInfo;
- begin
- with RecordInfo do
- begin
- Expanded := False;
- Level := 0;
- RecordIndex := -1;
- end
- end;
- function TcxGridFilterRow.GetSelected: Boolean;
- begin
- Result := FSelected;
- end;
- function TcxGridFilterRow.GetVisible: Boolean;
- begin
- Result := True;
- end;
- procedure TcxGridFilterRow.SetSelected(Value: Boolean);
- begin
- if FSelected <> Value then
- begin
- GridView.Controller.FilterRowFocusChanging(Value);
- FSelected := Value;
- Invalidate;
- GridView.Controller.FilterRowFocusChanged;
- end;
- end;
- function TcxGridFilterRow.GetDisplayText(Index: Integer): string;
- var
- AFilterCriteriaItem: TcxFilterCriteriaItem;
- begin
- AFilterCriteriaItem := FilterCriteriaItems[Index];
- if AFilterCriteriaItem = nil then
- Result := ''
- else
- Result := AFilterCriteriaItem.DisplayValue;
- end;
- function TcxGridFilterRow.GetValue(Index: Integer): Variant;
- var
- AFilterCriteriaItem: TcxFilterCriteriaItem;
- begin
- AFilterCriteriaItem := FilterCriteriaItems[Index];
- if AFilterCriteriaItem = nil then
- Result := Null
- else
- Result := AFilterCriteriaItem.Value;
- end;
- procedure TcxGridFilterRow.SetDisplayText(Index: Integer; const Value: string);
- var
- AFilterCriteriaItem: TcxFilterCriteriaItem;
- begin
- AFilterCriteriaItem := FilterCriteriaItems[Index];
- if AFilterCriteriaItem <> nil then
- AFilterCriteriaItem.DisplayValue := Value;
- end;
- procedure TcxGridFilterRow.SetValue(Index: Integer; const Value: Variant);
- var
- AGridView: TcxGridTableView;
- begin
- AGridView := GridView;
- AGridView.Controller.KeepFilterRowFocusing := True;
- try
- if VarIsSoftNull(Value) then
- AGridView.Columns[Index].DataBinding.Filtered := False
- else
- begin
- DataController.Filter.BeginUpdate;
- try
- DataController.Filter.Active := True;
- AGridView.Columns[Index].DataBinding.AddToFilter(nil,
- GetFilterOperatorKind(Value, True), Value,
- GetDisplayTextForValue(Index, Value), True);
- finally
- DataController.Filter.EndUpdate;
- end;
- end;
- finally
- AGridView.Controller.KeepFilterRowFocusing := False;
- end;
- end;
- function TcxGridFilterRow.GetDisplayTextForValue(AIndex: Integer; const AValue: Variant): string;
- var
- AValueList: TcxGridFilterValueList;
- AValueIndex: Integer;
- begin
- AValueList := ViewData.CreateFilterValueList;
- try
- GridView.Columns[AIndex].DataBinding.GetFilterValues(AValueList);
- AValueIndex := AValueList.FindItemByValue(AValue);
- if AValueIndex = -1 then
- Result := GridView.Columns[AIndex].GetProperties(Self).GetDisplayText(AValue)
- else
- Result := AValueList[AValueIndex].DisplayText;
- finally
- AValueList.Free;
- end;
- end;
- function TcxGridFilterRow.GetFilterOperatorKind(const AValue: Variant; ACheckMask: Boolean): TcxFilterOperatorKind;
- function HasMask(const AValue: string): Boolean;
- begin
- Result :=
- (Pos(DataController.Filter.PercentWildcard, AValue) <> 0) or
- (Pos(DataController.Filter.UnderscoreWildcard, AValue) <> 0);
- end;
- begin
English
