cxGridTableView.pas
上传用户:jackyxiao
上传日期:2020-12-19
资源大小:40962k
文件大小:442k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. {********************************************************************}
  2. {                                                                    }
  3. {       Developer Express Visual Component Library                   }
  4. {       ExpressQuantumGrid                                           }
  5. {                                                                    }
  6. {       Copyright (c) 1998-2009 Developer Express Inc.               }
  7. {       ALL RIGHTS RESERVED                                          }
  8. {                                                                    }
  9. {   The entire contents of this file is protected by U.S. and        }
  10. {   International Copyright Laws. Unauthorized reproduction,         }
  11. {   reverse-engineering, and distribution of all or any portion of   }
  12. {   the code contained in this file is strictly prohibited and may   }
  13. {   result in severe civil and criminal penalties and will be        }
  14. {   prosecuted to the maximum extent possible under the law.         }
  15. {                                                                    }
  16. {   RESTRICTIONS                                                     }
  17. {                                                                    }
  18. {   THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES            }
  19. {   (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE     }
  20. {   SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS    }
  21. {   LICENSED TO DISTRIBUTE THE EXPRESSQUANTUMGRID AND ALL            }
  22. {   ACCOMPANYING VCL CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY. }
  23. {                                                                    }
  24. {   THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED       }
  25. {   FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE         }
  26. {   COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE        }
  27. {   AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT   }
  28. {   AND PERMISSION FROM DEVELOPER EXPRESS INC.                       }
  29. {                                                                    }
  30. {   CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON        }
  31. {   ADDITIONAL RESTRICTIONS.                                         }
  32. {                                                                    }
  33. {********************************************************************}
  34. unit cxGridTableView;
  35. {$I cxVer.inc}
  36. interface
  37. uses
  38. {$IFDEF DELPHI6}
  39.   Variants,
  40. {$ENDIF}
  41.   Windows, Messages,
  42.   Classes, Graphics, Controls, ImgList, Forms, Buttons, StdCtrls, ExtCtrls, ComCtrls,
  43.   cxClasses, cxControls, cxGraphics, cxLookAndFeels, cxLookAndFeelPainters, cxStyles,
  44.   cxStorage, cxPC, cxListBox,
  45.   cxContainer, cxEdit, cxTextEdit, 
  46.   cxGrid, cxGridCommon, cxGridLevel, cxGridCustomView, cxGridCustomTableView, cxGridDetailsSite,
  47.   cxCustomData, cxData, cxDataStorage, cxFilter;
  48. const
  49.   htGridBase = 200;
  50.   htGroupByBox = htGridBase + 1;
  51.   htColumnHeader = htGridBase + 2;
  52.   htColumnHeaderHorzSizingEdge = htGridBase + 3;
  53.   htColumnHeaderFilterButton = htGridBase + 4;
  54.   htFooter = htGridBase + 5;
  55.   htFooterCell = htGridBase + 6;
  56.   htGroupFooter = htGridBase + 7;
  57.   htGroupFooterCell = htGridBase + 8;
  58.   htRowIndicator = htGridBase + 9;
  59.   htRowSizingEdge = htGridBase + 10;
  60.   htIndicator = htGridBase + 11;
  61.   htIndicatorHeader = htGridBase + 12;
  62.   htRowLevelIndent = htGridBase + 13;
  63.   htHeader = htGridBase + 14;
  64.   htGroupSummary = htGridBase + 15;
  65.   ckHeader = 2;
  66.   ckGroupByBox = 3;
  67.   ckFooter = 4;
  68.   cxGridDefaultIndicatorWidth = 12;
  69.   cxGridCustomRowSeparatorDefaultWidth = 6;
  70.   cxGridCustomRowSeparatorMinWidth = 2;
  71.   cxGridPreviewDefaultLeftIndent = 20;
  72.   cxGridPreviewDefaultMaxLineCount = 3;
  73.   cxGridPreviewDefaultRightIndent = 5;
  74.   cxGridHeaderSizingEdgeSize = 8;
  75.   cxGridRowSizingEdgeSize = 8;
  76.   cxGridOffice11GroupRowSeparatorWidth: Integer = 2;
  77.   // record kind
  78.   rkFiltering = 2;
  79.   isColumnFirst = isCustomItemLast + 1;
  80.   isFooter = isColumnFirst;
  81.   isGroupSummary = isColumnFirst + 1;
  82.   isHeader = isColumnFirst + 2;
  83.   isColumnLast = isHeader;
  84.   bbTableFirst = bbCustomTableLast + 1;
  85.   bbFooter = bbTableFirst;
  86.   bbHeader = bbTableFirst + 1;
  87.   bbGroup = bbTableFirst + 2;
  88.   bbGroupByBox = bbTableFirst + 3;
  89.   bbIndicator = bbTableFirst + 4;
  90.   bbPreview = bbTableFirst + 5;
  91.   bbTableLast = bbPreview;
  92.   vsTableFirst = vsCustomTableLast + 1;
  93.   vsFilterRowInfoText = vsTableFirst;
  94.   vsFooter = vsTableFirst + 1;
  95.   vsGroup = vsTableFirst + 2;
  96.   vsGroupByBox = vsTableFirst + 3;
  97.   vsGroupFooterSortedSummary = vsTableFirst + 4;
  98.   vsGroupSortedSummary = vsTableFirst + 5;
  99.   vsGroupSummary = vsTableFirst + 6;
  100.   vsHeader = vsTableFirst + 7;
  101.   vsNewItemRowInfoText = vsTableFirst + 8;
  102.   vsIndicator = vsTableFirst + 9;
  103.   vsPreview = vsTableFirst + 10;
  104.   vsTableLast = vsPreview;
  105. {$IFDEF BCB}
  106.   siFooter = 0;
  107.   siGroupFooter = 1;
  108.   siGroup = 2;
  109. {$ENDIF}
  110. type
  111.   TcxGridTableCustomizationForm = class;
  112.   TcxGridTableController = class;
  113.   TcxCustomGridRow = class;
  114.   TcxGridMasterDataRow = class;
  115.   TcxGridGroupRow = class;
  116.   TcxGridViewData = class;
  117.   TcxGridColumnHeaderAreaPainterClass = class of TcxGridColumnHeaderAreaPainter;
  118.   TcxGridColumnContainerViewInfo = class;
  119.   TcxGridColumnHeaderAreaViewInfoClass = class of TcxGridColumnHeaderAreaViewInfo;
  120.   TcxGridColumnHeaderAreaViewInfo = class;
  121.   TcxGridColumnHeaderFilterButtonViewInfo = class;
  122.   TcxGridColumnHeaderGlyphViewInfo = class;
  123.   TcxGridColumnHeaderViewInfoClass = class of TcxGridColumnHeaderViewInfo;
  124.   TcxGridColumnHeaderViewInfo = class;
  125.   TcxGridHeaderViewInfo = class;
  126.   TcxGridGroupByBoxViewInfo = class;
  127.   TcxGridFooterViewInfo = class;
  128.   TcxCustomGridIndicatorItemViewInfo = class;
  129.   TcxGridIndicatorHeaderItemViewInfo = class;
  130.   TcxGridIndicatorRowItemViewInfo = class;
  131.   TcxGridIndicatorFooterItemViewInfo = class;
  132.   TcxGridIndicatorViewInfo = class;
  133.   TcxGridRowFooterViewInfo = class;
  134.   TcxGridRowFootersViewInfo = class;
  135.   TcxCustomGridRowViewInfo = class;
  136.   TcxGridRowsViewInfo = class;
  137.   TcxGridTableViewInfo = class;
  138.   TcxGridTableViewInfoCacheItem = class;
  139.   TcxGridColumn = class;
  140.   TcxGridTableView = class;
  141.   TcxGridColumnContainerKind = Integer;
  142.   { hit tests }
  143.   // custom column
  144.   TcxCustomGridColumnHitTest = class(TcxCustomGridViewHitTest)
  145.   public
  146.     Column: TcxGridColumn;
  147.     ColumnContainerKind: TcxGridColumnContainerKind;
  148.   end;
  149.   // group by box
  150.   TcxGridGroupByBoxHitTest = class(TcxCustomGridViewHitTest)
  151.   protected
  152.     class function GetHitTestCode: Integer; override;
  153.   end;
  154.   // column header
  155.   TcxGridColumnHeaderHitTest = class(TcxCustomGridColumnHitTest)
  156.   protected
  157.     class function GetHitTestCode: Integer; override;
  158.   public
  159.     function DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; override;
  160.   end;
  161.   TcxGridColumnHeaderHorzSizingEdgeHitTest = class(TcxCustomGridColumnHitTest)
  162.   protected
  163.     class function GetHitTestCode: Integer; override;
  164.   public
  165.     function Cursor: TCursor; override;
  166.     function DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; override;
  167.   end;
  168.   TcxGridColumnHeaderFilterButtonHitTest = class(TcxCustomGridColumnHitTest)
  169.   protected
  170.     class function GetHitTestCode: Integer; override;
  171.   end;
  172.   // header
  173.   TcxGridHeaderHitTest = class(TcxCustomGridViewHitTest)
  174.   protected
  175.     class function GetHitTestCode: Integer; override;
  176.   end;
  177.   // footer
  178.   TcxGridFooterHitTest = class(TcxCustomGridViewHitTest)
  179.   protected
  180.     class function GetHitTestCode: Integer; override;
  181.   end;
  182.   TcxGridFooterCellHitTest = class(TcxCustomGridColumnHitTest)
  183.   protected
  184.     class function GetHitTestCode: Integer; override;
  185.   public
  186.     SummaryItem: TcxDataSummaryItem;
  187.   end;
  188.   TcxGridGroupFooterHitTest = class(TcxGridFooterHitTest)
  189.   protected
  190.     class function GetHitTestCode: Integer; override;
  191.   end;
  192.   TcxGridGroupFooterCellHitTest = class(TcxGridFooterCellHitTest)
  193.   protected
  194.     class function GetHitTestCode: Integer; override;
  195.   end;
  196.   // indicator
  197.   TcxGridRowIndicatorHitTest = class(TcxGridRecordHitTest)
  198.   protected
  199.     class function GetHitTestCode: Integer; override;
  200.   public
  201.     MultiSelect: Boolean;
  202.     function Cursor: TCursor; override;
  203.   end;
  204.   TcxGridRowSizingEdgeHitTest = class(TcxGridRecordHitTest)
  205.   protected
  206.     class function GetHitTestCode: Integer; override;
  207.   public
  208.     function Cursor: TCursor; override;
  209.     function DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass; override;
  210.   end;
  211.   TcxGridIndicatorHitTest = class(TcxCustomGridViewHitTest)
  212.   protected
  213.     class function GetHitTestCode: Integer; override;
  214.   end;
  215.   TcxGridIndicatorHeaderHitTest = class(TcxGridIndicatorHitTest)
  216.   protected
  217.     class function GetHitTestCode: Integer; override;
  218.   end;
  219.   // row
  220.   TcxGridRowLevelIndentHitTest = class(TcxGridRecordHitTest)
  221.   protected
  222.     class function GetHitTestCode: Integer; override;
  223.   public
  224.     class function CanClick: Boolean; override;
  225.   end;
  226.   TcxGridGroupSummaryHitTest = class(TcxGridRecordHitTest)
  227.   private
  228.     function GetColumn: TcxGridColumn;
  229.   protected
  230.     class function GetHitTestCode: Integer; override;
  231.   public
  232.     SummaryItem: TcxDataSummaryItem;
  233.     property Column: TcxGridColumn read GetColumn;
  234.   end;
  235.   { view data }
  236.   TcxCustomGridRowClass = class of TcxCustomGridRow;
  237.   TcxCustomGridRow = class(TcxCustomGridRecord)
  238.   private
  239.     function GetAsGroupRow: TcxGridGroupRow;
  240.     function GetAsMasterDataRow: TcxGridMasterDataRow;
  241.     function GetGridView: TcxGridTableView;
  242.     function GetGridViewLevel: TcxGridLevel;
  243.     function GetIsFilterRow: Boolean;
  244.     function GetIsNewItemRow: Boolean;
  245.     function GetViewData: TcxGridViewData;
  246.   protected
  247.     procedure KeyDown(var Key: Word; Shift: TShiftState); override;
  248.   public
  249.     function ExpandOnDblClick: Boolean; virtual;
  250.     function SupportsCellMultiSelect: Boolean; virtual;
  251.     property AsGroupRow: TcxGridGroupRow read GetAsGroupRow;
  252.     property AsMasterDataRow: TcxGridMasterDataRow read GetAsMasterDataRow;
  253.     property GridView: TcxGridTableView read GetGridView;
  254.     property GridViewLevel: TcxGridLevel read GetGridViewLevel;
  255.     property IsFilterRow: Boolean read GetIsFilterRow;
  256.     property IsNewItemRow: Boolean read GetIsNewItemRow;
  257.     property ViewData: TcxGridViewData read GetViewData;
  258.   end;
  259.   TcxGridDataRow = class(TcxCustomGridRow)
  260.   protected
  261.     function GetHasCells: Boolean; override;
  262.     function GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass; override;
  263.     function GetViewInfoClass: TcxCustomGridRecordViewInfoClass; override;
  264.   public
  265.     function SupportsCellMultiSelect: Boolean; override;
  266.   end;
  267.   TcxGridNewItemRowClass = class of TcxGridNewItemRow;
  268.   TcxGridNewItemRow = class(TcxGridDataRow)
  269.   public
  270.     function SupportsCellMultiSelect: Boolean; override;
  271.   end;
  272.   TcxGridFilterRowClass = class of TcxGridFilterRow;
  273.   TcxGridFilterRow = class(TcxGridNewItemRow)
  274.   private
  275.     FSelected: Boolean;
  276.     function GetFilterCriteriaItem(Index: Integer): TcxFilterCriteriaItem;
  277.   protected
  278.     procedure RefreshRecordInfo; override;
  279.     function GetSelected: Boolean; override;
  280.     function GetVisible: Boolean; override;
  281.     procedure SetSelected(Value: Boolean); override;
  282.     function GetDisplayText(Index: Integer): string; override;
  283.     function GetValue(Index: Integer): Variant; override;
  284.     procedure SetDisplayText(Index: Integer; const Value: string); override;
  285.     procedure SetValue(Index: Integer; const Value: Variant); override;
  286.     function GetDisplayTextForValue(AIndex: Integer; const AValue: Variant): string; virtual;
  287.     function GetFilterOperatorKind(const AValue: Variant; ACheckMask: Boolean): TcxFilterOperatorKind; virtual;
  288.     function IsFilterOperatorSupported(AKind: TcxFilterOperatorKind; const AValue: Variant): Boolean; virtual;
  289.     procedure KeyDown(var Key: Word; Shift: TShiftState); override;
  290.     property FilterCriteriaItems[Index: Integer]: TcxFilterCriteriaItem read GetFilterCriteriaItem;
  291.     property InternalSelected: Boolean read FSelected write FSelected;
  292.   public
  293.     destructor Destroy; override;
  294.     function CanFocusCells: Boolean; override;
  295.     function IsEmpty: Boolean;
  296.   end;
  297.   TcxGridMasterDataRow = class(TcxGridDataRow)
  298.   private
  299.     function GetActiveDetailGridView: TcxCustomGridView;
  300.     function GetActiveDetailGridViewExists: Boolean;
  301.     function GetActiveDetailIndex: Integer;
  302.     function GetActiveDetailLevel: TcxGridLevel;
  303.     function GetDetailGridView(Index: Integer): TcxCustomGridView;
  304.     function GetDetailGridViewCount: Integer;
  305.     function GetDetailGridViewExists(Index: Integer): Boolean;
  306.     function GetDetailGridViewHasData(Index: Integer): Boolean;
  307.     function GetInternalActiveDetailGridView: TcxCustomGridView;
  308.     function GetInternalActiveDetailGridViewExists: Boolean;
  309.     function GetInternalActiveDetailIndex: Integer;
  310.     procedure SetActiveDetailIndex(Value: Integer);
  311.     procedure SetActiveDetailLevel(Value: TcxGridLevel);
  312.   protected
  313.     procedure DoCollapse(ARecurse: Boolean); override;
  314.     procedure DoExpand(ARecurse: Boolean); override;
  315.     function GetExpandable: Boolean; override;
  316.     function GetExpanded: Boolean; override;
  317.     function GetHasChildren: Boolean; virtual;
  318.     function GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass; override;
  319.     function GetViewInfoClass: TcxCustomGridRecordViewInfoClass; override;
  320.     procedure KeyDown(var Key: Word; Shift: TShiftState); override;
  321.     procedure ToggleExpanded; override;
  322.     property InternalActiveDetailGridView: TcxCustomGridView read GetInternalActiveDetailGridView;
  323.     property InternalActiveDetailGridViewExists: Boolean read GetInternalActiveDetailGridViewExists;
  324.     property InternalActiveDetailIndex: Integer read GetInternalActiveDetailIndex;
  325.   public
  326.     function ExpandOnDblClick: Boolean; override;
  327.     function GetFirstFocusableChild: TcxCustomGridRecord; override;
  328.     function GetLastFocusableChild(ARecursive: Boolean): TcxCustomGridRecord; override;
  329.     property ActiveDetailGridView: TcxCustomGridView read GetActiveDetailGridView;
  330.     property ActiveDetailGridViewExists: Boolean read GetActiveDetailGridViewExists;
  331.     property ActiveDetailIndex: Integer read GetActiveDetailIndex write SetActiveDetailIndex;
  332.     property ActiveDetailLevel: TcxGridLevel read GetActiveDetailLevel write SetActiveDetailLevel;
  333.     property DetailGridViewCount: Integer read GetDetailGridViewCount;
  334.     property DetailGridViewExists[Index: Integer]: Boolean read GetDetailGridViewExists;
  335.     property DetailGridViewHasData[Index: Integer]: Boolean read GetDetailGridViewHasData;
  336.     property DetailGridViews[Index: Integer]: TcxCustomGridView read GetDetailGridView;
  337.     property HasChildren: Boolean read GetHasChildren;
  338.   end;
  339.   TcxGridGroupRow = class(TcxCustomGridRow)
  340.   private
  341.     function GetGroupedColumn: TcxGridColumn;
  342.     function GetGroupSummaryItems: TcxDataGroupSummaryItems;
  343.   protected
  344.     procedure DoCollapse(ARecurse: Boolean); override;
  345.     procedure DoExpand(ARecurse: Boolean); override;
  346.     //function GetDestroyingOnExpanding: Boolean; override;
  347.     function GetExpandable: Boolean; override;
  348.     function GetExpanded: Boolean; override;
  349.     function GetDisplayCaption: string; virtual;
  350.     function GetDisplayText(Index: Integer): string; override;
  351.     function GetDisplayTextValue: string; virtual;
  352.     function GetIsData: Boolean; override;
  353.     function GetIsParent: Boolean; override;
  354.     function GetValue: Variant; reintroduce; virtual;
  355.     function GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass; override;
  356.     function GetViewInfoClass: TcxCustomGridRecordViewInfoClass; override;
  357.     procedure SetDisplayText(Index: Integer; const Value: string); override;
  358.     procedure SetValue(Index: Integer; const Value: Variant); override;
  359.   public
  360.     function GetGroupSummaryInfo(var ASummaryItems: TcxDataSummaryItems;
  361.       var ASummaryValues: PVariant): Boolean;
  362.     property DisplayCaption: string read GetDisplayCaption;
  363.     property DisplayText: string read GetDisplayTextValue;
  364.     property GroupedColumn: TcxGridColumn read GetGroupedColumn;
  365.     property GroupSummaryItems: TcxDataGroupSummaryItems read GetGroupSummaryItems;
  366.     property Value: Variant read GetValue;
  367.   end;
  368.   TcxGridViewData = class(TcxCustomGridTableViewData)
  369.   private
  370.     FFilterRow: TcxGridFilterRow;
  371.     function GetNewItemRow: TcxGridNewItemRow;
  372.     function GetRow(Index: Integer): TcxCustomGridRow;
  373.     function GetRowCount: Integer;
  374.   protected
  375.     function GetFirstVisibleExpandedMasterRow: TcxGridMasterDataRow; virtual;
  376.     function GetNewItemRecordClass: TcxCustomGridRecordClass; override;
  377.     function GetRecordByKind(AKind, AIndex: Integer): TcxCustomGridRecord; override;
  378.     function GetRecordClass(ARecordInfo: TcxRowInfo): TcxCustomGridRecordClass; override;
  379.     function GetRecordKind(ARecord: TcxCustomGridRecord): Integer; override;
  380.     procedure CreateFilterRow;
  381.     procedure DestroyFilterRow;
  382.     procedure CheckFilterRow;
  383.     //procedure RecreateFilterRow;
  384.     function GetFilterRowClass: TcxGridFilterRowClass; virtual;
  385.   public
  386.     destructor Destroy; override;
  387.     procedure Collapse(ARecurse: Boolean); override;
  388.     procedure Expand(ARecurse: Boolean); override;
  389.     function HasFilterRow: Boolean; virtual;
  390.     function HasNewItemRecord: Boolean; override;
  391.     function MakeDetailVisible(ADetailLevel: TComponent{TcxGridLevel}): TcxCustomGridView; override;
  392.     //procedure Refresh(ARecordCount: Integer); override;
  393.     property FilterRow: TcxGridFilterRow read FFilterRow;
  394.     property NewItemRow: TcxGridNewItemRow read GetNewItemRow;
  395.     property RowCount: Integer read GetRowCount;
  396.     property Rows[Index: Integer]: TcxCustomGridRow read GetRow;
  397.   end;
  398.   { controller }
  399.   // drag&drop objects
  400.   TcxGridColumnHeaderMovingObjectClass = class of TcxGridColumnHeaderMovingObject;
  401.   TcxGridColumnHeaderMovingObject = class(TcxCustomGridTableItemMovingObject)
  402.   private
  403.     FOriginalDestColumnContainerKind: TcxGridColumnContainerKind;
  404.     function GetGridView: TcxGridTableView;
  405.     function GetSourceItem: TcxGridColumn;
  406.     function GetViewInfo: TcxGridTableViewInfo;
  407.     procedure SetSourceItem(Value: TcxGridColumn);
  408.   protected
  409.     procedure CalculateDestParams(AHitTest: TcxCustomGridHitTest;
  410.       out AContainerKind: TcxGridItemContainerKind; out AZone: TcxGridItemContainerZone); override;
  411.     function CanRemove: Boolean; override;
  412.     procedure CheckDestItemContainerKind(var AValue: TcxGridItemContainerKind); override;
  413.     procedure DoColumnMoving; virtual;
  414.     function GetArrowAreaBounds(APlace: TcxGridArrowPlace): TRect; override;
  415.     function GetArrowAreaBoundsForHeader(APlace: TcxGridArrowPlace): TRect; virtual;
  416.     function GetArrowsClientRect: TRect; override;
  417.     function GetSourceItemViewInfo: TcxCustomGridCellViewInfo; override;
  418.     function IsValidDestination: Boolean; override;
  419.     function IsValidDestinationForVisibleSource: Boolean; virtual;
  420.     procedure EndDragAndDrop(Accepted: Boolean); override;
  421.     property GridView: TcxGridTableView read GetGridView;
  422.     property OriginalDestColumnContainerKind: TcxGridColumnContainerKind
  423.       read FOriginalDestColumnContainerKind write FOriginalDestColumnContainerKind;
  424.     property SourceItem: TcxGridColumn read GetSourceItem write SetSourceItem;
  425.     property ViewInfo: TcxGridTableViewInfo read GetViewInfo;
  426.   public
  427.     procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); override;
  428.   end;
  429.   TcxCustomGridSizingObject = class(TcxCustomGridDragAndDropObject)
  430.   private
  431.     FDestPointX: Integer;
  432.     FDestPointY: Integer;
  433.     FOriginalSize: Integer;
  434.     function GetController: TcxGridTableController;
  435.     function GetGridView: TcxGridTableView;
  436.     function GetViewInfo: TcxGridTableViewInfo;
  437.     procedure SetDestPointX(Value: Integer);
  438.     procedure SetDestPointY(Value: Integer);
  439.   protected
  440.     procedure DirtyChanged; override;
  441.     function GetCurrentSize: Integer; virtual;
  442.     function GetDeltaSize: Integer; virtual;
  443.     function GetDragAndDropCursor(Accepted: Boolean): TCursor; override;
  444.     function GetHorzSizingMarkBounds: TRect; virtual;
  445.     function GetImmediateStart: Boolean; override;
  446.     function GetIsHorizontalSizing: Boolean; virtual;
  447.     function GetSizingItemBounds: TRect; virtual; abstract;
  448.     function GetSizingMarkBounds: TRect; virtual;
  449.     function GetSizingMarkWidth: Integer; virtual; abstract;
  450.     function GetVertSizingMarkBounds: TRect; virtual;
  451.     procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override;
  452.     property Controller: TcxGridTableController read GetController;
  453.     property CurrentSize: Integer read GetCurrentSize;
  454.     property DeltaSize: Integer read GetDeltaSize;
  455.     property DestPointX: Integer read FDestPointX write SetDestPointX;
  456.     property DestPointY: Integer read FDestPointY write SetDestPointY;
  457.     property GridView: TcxGridTableView read GetGridView;
  458.     property IsHorizontalSizing: Boolean read GetIsHorizontalSizing;
  459.     property OriginalSize: Integer read FOriginalSize write FOriginalSize;
  460.     property SizingItemBounds: TRect read GetSizingItemBounds;
  461.     property SizingMarkBounds: TRect read GetSizingMarkBounds;
  462.     property SizingMarkWidth: Integer read GetSizingMarkWidth;
  463.     property ViewInfo: TcxGridTableViewInfo read GetViewInfo;
  464.   public
  465.     procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); override;
  466.   end;
  467.   TcxCustomGridColumnSizingObject = class(TcxCustomGridSizingObject)
  468.   private
  469.     FColumn: TcxGridColumn;
  470.     function GetColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo;
  471.   protected  
  472.     function GetSizingItemBounds: TRect; override;
  473.     function GetSizingMarkWidth: Integer; override;
  474.     property Column: TcxGridColumn read FColumn write FColumn;
  475.     property ColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo read GetColumnHeaderViewInfo;
  476.   public
  477.     procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); override;
  478.   end;
  479.   TcxGridColumnHorzSizingObject = class(TcxCustomGridColumnSizingObject)
  480.   protected
  481.     procedure BeginDragAndDrop; override;
  482.     procedure EndDragAndDrop(Accepted: Boolean); override;
  483.     function GetCurrentSize: Integer; override;
  484.   end;
  485.   TcxGridRowSizingObject = class(TcxCustomGridSizingObject)
  486.   private
  487.     FRow: TcxCustomGridRow;
  488.     function GetRowViewInfo: TcxCustomGridRowViewInfo;
  489.   protected
  490.     procedure BeginDragAndDrop; override;
  491.     procedure EndDragAndDrop(Accepted: Boolean); override;
  492.     function GetCurrentSize: Integer; override;
  493.     function GetIsHorizontalSizing: Boolean; override;
  494.     function GetSizingItemBounds: TRect; override;
  495.     function GetSizingMarkWidth: Integer; override;
  496.     property Row: TcxCustomGridRow read FRow;
  497.     property RowViewInfo: TcxCustomGridRowViewInfo read GetRowViewInfo;
  498.   public
  499.     procedure Init(const P: TPoint; AParams: TcxCustomGridHitTest); override;
  500.   end;
  501.   // customization form
  502.   TcxGridTableItemsListBox = class(TcxCustomGridTableItemsListBox)
  503.   private
  504.     function GetGridView: TcxGridTableView;
  505.     function GetTextColor: TColor;
  506.   protected
  507.     function CalculateItemHeight: Integer; override;
  508.     function DrawItemDrawBackgroundHandler(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; virtual; abstract;
  509.     function GetItemEndEllipsis: Boolean; virtual; abstract;
  510.     procedure LookAndFeelChanged(Sender: TcxLookAndFeel; AChangedValues: TcxLookAndFeelValues); override;
  511.     procedure UpdateBackgroundColor;
  512.     //
  513.     property GridView: TcxGridTableView read GetGridView;
  514.     property TextColor: TColor read GetTextColor;
  515.   public
  516.     constructor Create(AOwner: TComponent); override;
  517.     procedure PaintItem(ACanvas: TcxCanvas; R: TRect; AIndex: Integer; AFocused: Boolean); override;
  518.   end;
  519.   TcxGridTableColumnsListBox = class(TcxGridTableItemsListBox)
  520.   protected
  521.     procedure DoRefreshItems; override;
  522.     function DrawItemDrawBackgroundHandler(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; override;
  523.     function GetDragAndDropParams: TcxCustomGridHitTest; override;
  524.     function GetItemEndEllipsis: Boolean; override;
  525.   end;
  526.   TcxGridTableCustomizationForm = class(TcxCustomGridTableCustomizationForm)
  527.   private
  528.     function GetColumnsListBox: TcxGridTableColumnsListBox;
  529.     function GetColumnsPage: TcxTabSheet;
  530.     function GetController: TcxGridTableController;
  531.     function GetGridView: TcxGridTableView;
  532.     function GetViewInfo: TcxGridTableViewInfo;
  533.   protected
  534.     function GetItemsListBoxClass: TcxCustomGridTableItemsListBoxClass; override;
  535.     function GetItemsPageCaption: string; override;
  536.     property ColumnsListBox: TcxGridTableColumnsListBox read GetColumnsListBox;
  537.     property GridView: TcxGridTableView read GetGridView;
  538.     property ViewInfo: TcxGridTableViewInfo read GetViewInfo;
  539.   public
  540.     property Controller: TcxGridTableController read GetController;
  541.     property ColumnsPage: TcxTabSheet read GetColumnsPage;
  542.   end;
  543.   // drag open info
  544.   TcxGridDragOpenInfoMasterDataRowTab = class(TcxGridDragOpenInfoTab)
  545.   public
  546.     GridRow: TcxGridMasterDataRow;
  547.     constructor Create(ALevel: TcxGridLevel; AGridRow: TcxGridMasterDataRow); reintroduce; virtual;
  548.     function Equals(AInfo: TcxCustomGridDragOpenInfo): Boolean; override;
  549.     procedure Run; override;
  550.   end;
  551.   // popup
  552.   TcxGridColumnsCustomizationPopup = class(TcxCustomGridItemsCustomizationPopup)
  553.   private
  554.     function GetGridView: TcxGridTableView;
  555.   protected
  556.     procedure ItemClicked(AItem: TObject; AChecked: Boolean); override;
  557.     procedure SetItemIndex(AItem: TObject; AIndex: Integer); override;
  558.   public
  559.     property GridView: TcxGridTableView read GetGridView;
  560.   end;
  561.   // controllers
  562.   TcxGridTableEditingController = class(TcxGridEditingController)
  563.   private
  564.     FApplyingImmediateFiltering: Boolean;
  565.     function GetController: TcxGridTableController;
  566.     function GetGridView: TcxGridTableView;
  567.   protected
  568.     function CanInitEditing: Boolean; override;
  569.     function CanUpdateEditValue: Boolean; override;
  570.     procedure DoEditChanged; override;
  571.     procedure DoEditKeyDown(var Key: Word; Shift: TShiftState); override;
  572.     function GetHideEditOnFocusedRecordChange: Boolean; override;
  573.     procedure InitEdit; override;
  574.     procedure PostEditingData; override;
  575.     property ApplyingImmediateFiltering: Boolean read FApplyingImmediateFiltering write FApplyingImmediateFiltering;
  576.   public
  577.     property Controller: TcxGridTableController read GetController;
  578.     property GridView: TcxGridTableView read GetGridView;
  579.   end;
  580.   TcxGridTableController = class(TcxCustomGridTableController)
  581.   private
  582.     FCellSelectionAnchor: TcxGridColumn;
  583.     FHorzSizingColumn: TcxGridColumn;
  584.     FIsFilterPopupOpenedFromHeader: Boolean;
  585.     FKeepFilterRowFocusing: Boolean;
  586.     FLeftPos: Integer;
  587.     FPressedColumn: TcxGridColumn;
  588.     FSelectedColumns: TList;
  589.     function GetColumnsCustomizationPopup: TcxGridColumnsCustomizationPopup;
  590.     function GetCustomizationForm: TcxGridTableCustomizationForm;
  591.     function GetEditingController: TcxGridTableEditingController;
  592.     function GetFocusedColumn: TcxGridColumn;
  593.     function GetFocusedColumnIndex: Integer;
  594.     function GetFocusedRow: TcxCustomGridRow;
  595.     function GetFocusedRowIndex: Integer;
  596.     function GetGridView: TcxGridTableView;
  597.     function GetIsColumnHorzSizing: Boolean;
  598.     function GetSelectedColumn(Index: Integer): TcxGridColumn;
  599.     function GetSelectedColumnCount: Integer;
  600.     function GetSelectedRow(Index: Integer): TcxCustomGridRow;
  601.     function GetSelectedRowCount: Integer;
  602.     function GetTopRowIndex: Integer;
  603.     function GetViewData: TcxGridViewData;
  604.     function GetViewInfo: TcxGridTableViewInfo;
  605.     procedure SetFocusedColumn(Value: TcxGridColumn);
  606.     procedure SetFocusedColumnIndex(Value: Integer);
  607.     procedure SetFocusedRow(Value: TcxCustomGridRow);
  608.     procedure SetFocusedRowIndex(Value: Integer);
  609.     procedure SetLeftPos(Value: Integer);
  610.     procedure SetPressedColumn(Value: TcxGridColumn);
  611.     procedure SetTopRowIndex(Value: Integer);
  612.     procedure AddSelectedColumn(AColumn: TcxGridColumn);
  613.     procedure RemoveSelectedColumn(AColumn: TcxGridColumn);
  614.   protected
  615.     function CanAppend(ACheckOptions: Boolean): Boolean; override;
  616.     function CanDelete(ACheckOptions: Boolean): Boolean; override;
  617.     function CanEdit: Boolean; override;
  618.     function CanInsert(ACheckOptions: Boolean): Boolean; override;
  619.     procedure CheckCoordinates; override;
  620.     procedure CheckLeftPos(var Value: Integer);
  621.     procedure FocusedItemChanged(APrevFocusedItem: TcxCustomGridTableItem); override;
  622.     procedure FocusedRecordChanged(APrevFocusedRecordIndex, AFocusedRecordIndex: Integer;
  623.       ANewItemRecordFocusingChanged: Boolean); override;
  624.     function GetDesignHitTest(AHitTest: TcxCustomGridHitTest): Boolean; override;
  625.     function GetFocusedRecord: TcxCustomGridRecord; override;
  626.     function GetIsRecordsScrollHorizontal: Boolean; override;
  627.     function GetItemsCustomizationPopupClass: TcxCustomGridItemsCustomizationPopupClass; override;
  628.     function GetMaxTopRecordIndexValue: Integer; override;
  629.     function GetMouseWheelScrollingKind: TcxMouseWheelScrollingKind; override;
  630.     function GetScrollBarRecordCount: Integer; override;
  631.     function IsColumnFixedDuringHorzSizing(AColumn: TcxGridColumn): Boolean; virtual;
  632.     function IsKeyForMultiSelect(AKey: Word; AShift: TShiftState;
  633.       AFocusedRecordChanged: Boolean): Boolean; override;
  634.     function IsPixelScrollBar(AKind: TScrollBarKind): Boolean; override;
  635.     procedure LeftPosChanged; virtual;
  636.     function NeedsAdditionalRowsScrolling(AIsCallFromMaster: Boolean = False): Boolean; virtual;
  637.     procedure RemoveFocus; override;
  638.     procedure ScrollData(ADirection: TcxDirection); override;
  639.     procedure SetFocusedRecord(Value: TcxCustomGridRecord); override;
  640.     procedure ShowNextPage; override;
  641.     procedure ShowPrevPage; override;
  642.     // internal draganddrop data scrolling
  643.     function CanScrollData(ADirection: TcxDirection): Boolean; override;
  644.     // selection
  645.     function CanPostponeRecordSelection(AShift: TShiftState): Boolean; override;
  646.     function CanProcessMultiSelect(AHitTest: TcxCustomGridHitTest;
  647.       AShift: TShiftState): Boolean; override;
  648.     procedure DoMouseNormalSelection(AHitTest: TcxCustomGridHitTest); override;
  649.     procedure DoMouseRangeSelection(AClearSelection: Boolean = True; AData: TObject = nil); override;
  650.     procedure DoNormalSelection; override;
  651.     procedure MultiSelectKeyDown(var Key: Word; Shift: TShiftState); override;
  652.     function SupportsAdditiveSelection: Boolean; override;
  653.     function SupportsRecordSelectionToggling: Boolean; override;
  654.     // special row focusing
  655.     function DefocusSpecialRow: Boolean; virtual;
  656.     function FocusSpecialRow: Boolean; virtual;
  657.     procedure FilterRowFocusChanged; virtual;
  658.     procedure FilterRowFocusChanging(AValue: Boolean); virtual;
  659.     // pull focusing
  660.     procedure DoPullFocusingScrolling(ADirection: TcxDirection); override;
  661.     function GetPullFocusingScrollingDirection(X, Y: Integer; out ADirection: TcxDirection): Boolean; override;
  662.     function SupportsPullFocusing: Boolean; override;
  663.     // delphi drag and drop
  664.     function GetDragOpenInfo(AHitTest: TcxCustomGridHitTest): TcxCustomGridDragOpenInfo; override;
  665.     function GetDragScrollDirection(X, Y: Integer): TcxDirection; override;
  666.     // customization
  667.     procedure CheckCustomizationFormBounds(var R: TRect); override;
  668.     function GetColumnHeaderDragAndDropObjectClass: TcxGridColumnHeaderMovingObjectClass; virtual;
  669.     function GetCustomizationFormClass: TcxCustomGridCustomizationFormClass; override;
  670.     // cells selection
  671.     function CanProcessCellMultiSelect(APrevFocusedColumn: TcxGridColumn): Boolean; virtual;
  672.     procedure CellMultiSelectKeyDown(var Key: Word; Shift: TShiftState); virtual;
  673.     procedure DoNormalCellSelection;
  674.     procedure DoRangeCellSelection;
  675.     function GetCellMultiSelect: Boolean; virtual;
  676.     property CellMultiSelect: Boolean read GetCellMultiSelect;
  677.     // BeginsWith mask
  678.     procedure AddBeginsWithMask(var AValue: Variant);
  679.     procedure RemoveBeginsWithMask(var AValue: Variant);
  680.     function GetBeginsWithMaskPos(const AValue: string): Integer;
  681.     function GetEditingControllerClass: TcxGridEditingControllerClass; override;
  682.     property IsFilterPopupOpenedFromHeader: Boolean read FIsFilterPopupOpenedFromHeader
  683.       write FIsFilterPopupOpenedFromHeader;
  684.     property KeepFilterRowFocusing: Boolean read FKeepFilterRowFocusing write FKeepFilterRowFocusing;
  685.     property ViewData: TcxGridViewData read GetViewData;
  686.     property ViewInfo: TcxGridTableViewInfo read GetViewInfo;
  687.   public
  688.     constructor Create(AGridView: TcxCustomGridView); override;
  689.     destructor Destroy; override;
  690.     procedure CheckScrolling(const P: TPoint); override;
  691.     procedure ClearGrouping;
  692.     procedure ClearSelection; override;
  693.     procedure DoCancelMode; override;
  694.     function IsFilterRowFocused: Boolean;
  695.     function IsNewItemRowFocused: Boolean;
  696.     function IsSpecialRowFocused: Boolean; virtual;
  697.     procedure MakeItemVisible(AItem: TcxCustomGridTableItem); override;
  698.     procedure SelectAll; override;
  699.     procedure InitScrollBarsParameters; override;
  700.     function IsDataFullyVisible(AIsCallFromMaster: Boolean = False): Boolean; override;
  701.     procedure Scroll(AScrollBarKind: TScrollBarKind; AScrollCode: TScrollCode;
  702.       var AScrollPos: Integer); override;
  703.     procedure EndDragAndDrop(Accepted: Boolean); override;
  704.     procedure DoKeyDown(var Key: Word; Shift: TShiftState); override;
  705.     procedure KeyDown(var Key: Word; Shift: TShiftState); override;
  706.     procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
  707.     // cells selection
  708.     procedure ClearCellSelection;
  709.     procedure SelectAllColumns;
  710.     procedure SelectCells(AFromColumn, AToColumn: TcxGridColumn;
  711.       AFromRowIndex, AToRowIndex: Integer);
  712.     procedure SelectColumns(AFromColumn, AToColumn: TcxGridColumn);
  713.     property CellSelectionAnchor: TcxGridColumn read FCellSelectionAnchor write FCellSelectionAnchor;
  714.     property ColumnsCustomizationPopup: TcxGridColumnsCustomizationPopup read GetColumnsCustomizationPopup;
  715.     property CustomizationForm: TcxGridTableCustomizationForm read GetCustomizationForm;
  716.     property EditingController: TcxGridTableEditingController read GetEditingController;
  717.     property FocusedColumn: TcxGridColumn read GetFocusedColumn write SetFocusedColumn;
  718.     property FocusedColumnIndex: Integer read GetFocusedColumnIndex write SetFocusedColumnIndex;
  719.     property FocusedRow: TcxCustomGridRow read GetFocusedRow write SetFocusedRow;
  720.     property FocusedRowIndex: Integer read GetFocusedRowIndex write SetFocusedRowIndex;
  721.     property GridView: TcxGridTableView read GetGridView;
  722.     property HorzSizingColumn: TcxGridColumn read FHorzSizingColumn;
  723.     property IsColumnHorzSizing: Boolean read GetIsColumnHorzSizing;
  724.     property LeftPos: Integer read FLeftPos write SetLeftPos;
  725.     property PressedColumn: TcxGridColumn read FPressedColumn write SetPressedColumn;
  726.     property SelectedColumnCount: Integer read GetSelectedColumnCount;
  727.     property SelectedColumns[Index: Integer]: TcxGridColumn read GetSelectedColumn;
  728.     property SelectedRowCount: Integer read GetSelectedRowCount;
  729.     property SelectedRows[Index: Integer]: TcxCustomGridRow read GetSelectedRow;
  730.     property TopRowIndex: Integer read GetTopRowIndex write SetTopRowIndex;
  731.   end;
  732.   { painters }
  733.   // column container
  734.   TcxGridColumnContainerPainter = class(TcxCustomGridPartPainter)
  735.   private
  736.     function GetViewInfo: TcxGridColumnContainerViewInfo;
  737.   protected
  738.     procedure DrawContent; override;
  739.     procedure DrawItems; virtual;
  740.     function DrawItemsFirst: Boolean; virtual;
  741.     function ExcludeFromClipRect: Boolean; override;
  742.     property ViewInfo: TcxGridColumnContainerViewInfo read GetViewInfo;
  743.   end;
  744.   // header
  745.   TcxGridColumnHeaderAreaPainter = class(TcxCustomGridCellPainter)
  746.   private
  747.     function GetViewInfo: TcxGridColumnHeaderAreaViewInfo;
  748.   protected
  749.     function ExcludeFromClipRect: Boolean; override;
  750.     property ViewInfo: TcxGridColumnHeaderAreaViewInfo read GetViewInfo;
  751.   end;
  752.   TcxGridColumnHeaderSortingMarkPainter = class(TcxGridColumnHeaderAreaPainter)
  753.   protected
  754.     procedure Paint; override;
  755.   end;
  756.   TcxGridColumnHeaderFilterButtonPainter = class(TcxGridColumnHeaderAreaPainter)
  757.   private
  758.     function GetViewInfo: TcxGridColumnHeaderFilterButtonViewInfo;
  759.   protected
  760.     procedure Paint; override;
  761.     property ViewInfo: TcxGridColumnHeaderFilterButtonViewInfo read GetViewInfo;
  762.   end;
  763.   TcxGridColumnHeaderGlyphPainter = class(TcxGridColumnHeaderAreaPainter)
  764.   private
  765.     function GetViewInfo: TcxGridColumnHeaderGlyphViewInfo;
  766.   protected
  767.     procedure Paint; override;
  768.     property ViewInfo: TcxGridColumnHeaderGlyphViewInfo read GetViewInfo;
  769.   end;
  770.   TcxGridColumnHeaderPainter = class(TcxCustomGridCellPainter)
  771.   private
  772.     function GetViewInfo: TcxGridColumnHeaderViewInfo;
  773.   protected
  774.     procedure DrawAreas; virtual;
  775.     procedure DrawBorders; override;
  776.     procedure DrawContent; override;
  777.     procedure DrawPressed; virtual;
  778.     function ExcludeFromClipRect: Boolean; override;
  779.     procedure Paint; override;
  780.     property ViewInfo: TcxGridColumnHeaderViewInfo read GetViewInfo;
  781.   end;
  782.   TcxGridHeaderPainter = class(TcxGridColumnContainerPainter)
  783.   protected
  784.     function DrawItemsFirst: Boolean; override;
  785.   end;
  786.   // group by box
  787.   TcxGridGroupByBoxPainter = class(TcxGridColumnContainerPainter)
  788.   protected
  789.     procedure DrawBackground(const R: TRect); override;
  790.     procedure DrawContent; override;
  791.     function DrawItemsFirst: Boolean; override;
  792.   end;
  793.   // footer
  794.   TcxGridFooterCellPainter = class(TcxGridColumnHeaderPainter)
  795.   protected
  796.     procedure DrawBorders; override;
  797.     procedure DrawContent; override;
  798.   end;
  799.   TcxGridFooterPainterClass = class of TcxGridFooterPainter;
  800.   TcxGridFooterPainter = class(TcxGridColumnContainerPainter)
  801.   private
  802.     function GetViewInfo: TcxGridFooterViewInfo;
  803.   protected
  804.     procedure DrawBackground(const R: TRect); override;
  805.     procedure DrawBorders; override;
  806.     function DrawItemsFirst: Boolean; override;
  807.     procedure DrawSeparator; virtual;
  808.     property ViewInfo: TcxGridFooterViewInfo read GetViewInfo;
  809.   end;
  810.   // indicator
  811.   TcxCustomGridIndicatorItemPainter = class(TcxCustomGridCellPainter)
  812.   private
  813.     function GetViewInfo: TcxCustomGridIndicatorItemViewInfo;
  814.   protected
  815.     function ExcludeFromClipRect: Boolean; override;
  816.     property ViewInfo: TcxCustomGridIndicatorItemViewInfo read GetViewInfo;
  817.   end;
  818.   TcxGridIndicatorHeaderItemPainter = class(TcxCustomGridIndicatorItemPainter)
  819.   private
  820.     function GetViewInfo: TcxGridIndicatorHeaderItemViewInfo;
  821.   protected
  822.     function DrawBackgroundHandler(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; override;
  823.     procedure DrawContent; override;
  824.     procedure DrawQuickCustomizationMark; virtual;
  825.     property ViewInfo: TcxGridIndicatorHeaderItemViewInfo read GetViewInfo;
  826.   end;
  827.   TcxGridIndicatorRowItemPainter = class(TcxCustomGridIndicatorItemPainter)
  828.   private
  829.     function GetViewInfo: TcxGridIndicatorRowItemViewInfo;
  830.   protected
  831.     procedure DrawContent; override;
  832.     property ViewInfo: TcxGridIndicatorRowItemViewInfo read GetViewInfo;
  833.   end;
  834.   TcxGridIndicatorFooterItemPainter = class(TcxCustomGridIndicatorItemPainter)
  835.   private
  836.     function GetViewInfo: TcxGridIndicatorFooterItemViewInfo;
  837.   protected
  838.     procedure DrawContent; override; 
  839.     procedure DrawBorders; override;
  840.     property ViewInfo: TcxGridIndicatorFooterItemViewInfo read GetViewInfo;
  841.   end;
  842.   TcxGridIndicatorPainter = class(TcxCustomGridCellPainter)
  843.   private
  844.     function GetViewInfo: TcxGridIndicatorViewInfo;
  845.   protected
  846.     procedure DrawContent; override;
  847.     procedure DrawItems; virtual;
  848.     function DrawItemsFirst: Boolean; virtual;
  849.     function ExcludeFromClipRect: Boolean; override;
  850.     property ViewInfo: TcxGridIndicatorViewInfo read GetViewInfo;
  851.   end;
  852.   // custom row
  853.   TcxCustomGridRowPainter = class(TcxCustomGridRecordPainter)
  854.   private
  855.     function GetViewInfo: TcxCustomGridRowViewInfo;
  856.   protected
  857.     procedure DrawFooters; virtual;
  858.     procedure DrawIndent; virtual;
  859.     procedure DrawIndentPart(ALevel: Integer; const ABounds: TRect); virtual;
  860.     procedure DrawLastHorzGridLine; virtual;
  861.     procedure DrawSeparator; virtual;
  862.     procedure Paint; override;
  863.     property ViewInfo: TcxCustomGridRowViewInfo read GetViewInfo;
  864.   end;
  865.   // rows
  866.   TcxGridRowsPainterClass = class of TcxGridRowsPainter;
  867.   TcxGridRowsPainter = class(TcxCustomGridRecordsPainter)
  868.   private
  869.     function GetViewInfo: TcxGridRowsViewInfo;
  870.   protected
  871.     procedure Paint; override;
  872.     property ViewInfo: TcxGridRowsViewInfo read GetViewInfo;
  873.   public
  874.     class procedure DrawDataRowCells(ARowViewInfo: TcxCustomGridRowViewInfo); virtual;
  875.   end;
  876.   // table
  877.   TcxGridTablePainter = class(TcxCustomGridTablePainter)
  878.   private
  879.     FGridLines: TList;
  880.     function GetController: TcxGridTableController;
  881.     function GetGridView: TcxGridTableView;
  882.     function GetViewInfo: TcxGridTableViewInfo;
  883.   protected
  884.     function CanOffset(AItemsOffset, DX, DY: Integer): Boolean; override;
  885.     procedure DrawFooter; virtual;
  886.     procedure DrawGroupByBox; virtual;
  887.     procedure DrawHeader; virtual;
  888.     procedure DrawIndicator; virtual;
  889.     procedure DrawRecords; override;
  890.     procedure Offset(AItemsOffset: Integer); override;
  891.     procedure Offset(DX, DY: Integer); override;
  892.     procedure PaintContent; override;
  893.   public
  894.     procedure AddGridLine(const R: TRect);
  895.     property Controller: TcxGridTableController read GetController;
  896.     property GridView: TcxGridTableView read GetGridView;
  897.     property ViewInfo: TcxGridTableViewInfo read GetViewInfo;
  898.   end;
  899.   { view infos }
  900.   // column container
  901.   TcxGridColumnContainerViewInfo = class(TcxCustomGridPartViewInfo)
  902.   private
  903.     FItemHeight: Integer;
  904.     FItems: TList;
  905.     function GetController: TcxGridTableController;
  906.     function GetCount: Integer;
  907.     function GetGridView: TcxGridTableView;
  908.     function GetGridViewInfo: TcxGridTableViewInfo;
  909.     function GetInternalItem(Index: Integer): TcxGridColumnHeaderViewInfo;
  910.     function GetItem(Index: Integer): TcxGridColumnHeaderViewInfo;
  911.     function GetItemHeight: Integer;
  912.   protected
  913.     function CreateItem(AIndex: Integer): TcxGridColumnHeaderViewInfo; virtual;
  914.     procedure CreateItems; virtual;
  915.     procedure DestroyItems; virtual;
  916.     function GetColumn(Index: Integer): TcxGridColumn; virtual; abstract;
  917.     function GetColumnCount: Integer; virtual; abstract;
  918.     function GetItemClass: TcxGridColumnHeaderViewInfoClass; virtual;
  919.     function CalculateItemHeight: Integer; virtual;
  920.     function GetAutoHeight: Boolean; virtual;
  921.     function GetColumnAdditionalWidth(AColumn: TcxGridColumn): Integer;
  922.     function GetColumnMinWidth(AColumn: TcxGridColumn): Integer; virtual;
  923.     function GetColumnNeighbors(AColumn: TcxGridColumn): TcxNeighbors; virtual;
  924.     function GetColumnWidth(AColumn: TcxGridColumn): Integer; virtual;
  925.     function GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; virtual;
  926.     function GetItemMultiLinePainting(AItem: TcxGridColumnHeaderViewInfo): Boolean; virtual;
  927.     function GetItemsAreaBounds: TRect; virtual;
  928.     function GetItemsHitTest(const P: TPoint): TcxCustomGridHitTest; virtual;
  929.     function GetKind: TcxGridColumnContainerKind; virtual; abstract;
  930.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  931.     function GetZonesAreaBounds: TRect; virtual;
  932.     procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override;
  933.     procedure Offset(DX, DY: Integer); override;
  934.     property AutoHeight: Boolean read GetAutoHeight;
  935.     property ColumnCount: Integer read GetColumnCount;
  936.     property Columns[Index: Integer]: TcxGridColumn read GetColumn;
  937.     property Controller: TcxGridTableController read GetController;
  938.     property ZonesAreaBounds: TRect read GetZonesAreaBounds;
  939.   public
  940.     constructor Create(AGridViewInfo: TcxCustomGridTableViewInfo); override;
  941.     destructor Destroy; override;
  942.     procedure BeforeRecalculation; override;
  943.     function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
  944.     function GetZone(const P: TPoint): TcxGridItemContainerZone; virtual;
  945.     property Count: Integer read GetCount;
  946.     property GridView: TcxGridTableView read GetGridView;
  947.     property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
  948.     property InternalItems[Index: Integer]: TcxGridColumnHeaderViewInfo read GetInternalItem;
  949.     property ItemHeight: Integer read GetItemHeight;
  950.     property Items[Index: Integer]: TcxGridColumnHeaderViewInfo read GetItem; default;
  951.     property ItemsAreaBounds: TRect read GetItemsAreaBounds;
  952.     property Kind: TcxGridColumnContainerKind read GetKind;
  953.   end;
  954.   // column header areas
  955.   TcxGridColumnHeaderAreaViewInfo = class(TcxCustomGridViewCellViewInfo)
  956.   private
  957.     FColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo;
  958.     function GetColumn: TcxGridColumn;
  959.     function GetGridView: TcxGridTableView;
  960.     function GetGridViewInfo: TcxGridTableViewInfo;
  961.   protected
  962.     function GetAlignmentVert: TcxAlignmentVert; override;
  963.     function GetCanvas: TcxCanvas; override;
  964.     function GetHeight: Integer; override;
  965.     function GetWidth: Integer; override;
  966.     function HasMouse(AHitTest: TcxCustomGridHitTest): Boolean; override;
  967.     procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override;
  968.     //procedure Invalidate; virtual;
  969.     function NeedsContainerHotTrack: Boolean; virtual;
  970.     function OccupiesSpace: Boolean; virtual;
  971.     function ResidesInContent: Boolean; virtual;
  972.     property Column: TcxGridColumn read GetColumn;
  973.     property GridView: TcxGridTableView read GetGridView;
  974.     property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
  975.   public
  976.     constructor Create(AColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo); reintroduce; virtual;
  977.     procedure Calculate(const ABounds: TRect; var ATextAreaBounds: TRect); reintroduce; virtual;
  978.     property AlignmentHorz: TAlignment read GetAlignmentHorz;
  979.     property AlignmentVert: TcxAlignmentVert read GetAlignmentVert;
  980.     property ColumnHeaderViewInfo: TcxGridColumnHeaderViewInfo read FColumnHeaderViewInfo;
  981.     property Height: Integer read GetHeight;
  982.     property Width: Integer read GetWidth;
  983.   end;
  984.   TcxGridColumnHeaderSortingMarkViewInfo = class(TcxGridColumnHeaderAreaViewInfo)
  985.   private
  986.     function GetSortOrder: TcxGridSortOrder;
  987.   protected
  988.     function CalculateHeight: Integer; override;
  989.     function CalculateWidth: Integer; override;
  990.     function GetAlignmentHorz: TAlignment; override;
  991.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  992.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  993.     property SortOrder: TcxGridSortOrder read GetSortOrder;
  994.   end;
  995.   TcxGridColumnHeaderHorzSizingEdgeViewInfo = class(TcxGridColumnHeaderAreaViewInfo)
  996.   protected
  997.     function CalculateHeight: Integer; override;
  998.     function CalculateWidth: Integer; override;
  999.     function GetAlignmentHorz: TAlignment; override;
  1000.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1001.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1002.     function OccupiesSpace: Boolean; override;
  1003.     function ResidesInContent: Boolean; override;
  1004.   public
  1005.     procedure Calculate(const ABounds: TRect; var ATextAreaBounds: TRect); override;
  1006.     function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton;
  1007.       AShift: TShiftState): Boolean; override;
  1008.   end;
  1009.   TcxGridColumnHeaderFilterButtonViewInfo = class(TcxGridColumnHeaderAreaViewInfo,
  1010.     IcxGridFilterPopupOwner)
  1011.   private
  1012.     function GetActive: Boolean;
  1013.     function GetDropDownWindowValue: TcxGridFilterPopup;
  1014.   protected
  1015.     { IcxGridFilterPopupOwner }
  1016.     function GetItem: TcxCustomGridTableItem;
  1017.     function CalculateHeight: Integer; override;
  1018.     function CalculateWidth: Integer; override;
  1019.     procedure DropDown; override;
  1020.     function EmulateMouseMoveAfterCalculate: Boolean; override;
  1021.     function GetAlignmentHorz: TAlignment; override;
  1022.     function GetAlwaysVisible: Boolean; virtual;
  1023.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1024.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1025.     function GetVisible: Boolean; override;
  1026.     function NeedsContainerHotTrack: Boolean; override;
  1027.     function OccupiesSpace: Boolean; override;
  1028.     procedure StateChanged(APrevState: TcxGridCellState); override;
  1029.     function CloseDropDownWindowOnDestruction: Boolean; override;
  1030.     function DropDownWindowExists: Boolean; override;
  1031.     function GetDropDownWindow: TcxCustomGridPopup; override;
  1032.     function GetDropDownWindowOwnerBounds: TRect; override;
  1033.     function IsDropDownWindowOwner: Boolean; override;
  1034.     property DropDownWindow: TcxGridFilterPopup read GetDropDownWindowValue;
  1035.     property AlwaysVisible: Boolean read GetAlwaysVisible;
  1036.   public
  1037.     function MouseMove(AHitTest: TcxCustomGridHitTest; AShift: TShiftState): Boolean; override;
  1038.     property Active: Boolean read GetActive;
  1039.   end;
  1040.   TcxGridColumnHeaderGlyphViewInfo = class(TcxGridColumnHeaderAreaViewInfo)
  1041.   private
  1042.     function GetGlyph: TBitmap;
  1043.   protected
  1044.     function CalculateHeight: Integer; override;
  1045.     function CalculateWidth: Integer; override;
  1046.     function GetAlignmentHorz: TAlignment; override;
  1047.     function GetAlignmentVert: TcxAlignmentVert; override;
  1048.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1049.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1050.   public
  1051.     property Glyph: TBitmap read GetGlyph;
  1052.   end;
  1053.   // column header
  1054.   TcxGridColumnHeaderViewInfo = class(TcxCustomGridViewCellViewInfo)
  1055.   private
  1056.     FAdditionalHeightAtTop: Integer;
  1057.     FAdditionalWidthAtLeft: Integer;
  1058.     FAreaViewInfos: TList;
  1059.     FColumn: TcxGridColumn;
  1060.     FContainer: TcxGridColumnContainerViewInfo;
  1061.     FNeighbors: TcxNeighbors;
  1062.     FRealWidth: Integer;
  1063.     FTextAreaBounds: TRect;
  1064.     FWidth: Integer;
  1065.     function GetAreaViewInfoCount: Integer;
  1066.     function GetAreaViewInfo(Index: Integer): TcxGridColumnHeaderAreaViewInfo;
  1067.     function GetGridView: TcxGridTableView;
  1068.     function GetGridViewInfo: TcxGridTableViewInfo;
  1069.     function GetHasTextOffsetLeft: Boolean;
  1070.     function GetHasTextOffsetRight: Boolean;
  1071.     function GetIndex: Integer;
  1072.     function GetIsFixed: Boolean;
  1073.     function GetRealWidth: Integer;
  1074.     procedure EnumAreaViewInfoClasses(AClass: TClass);
  1075.     procedure CreateAreaViewInfos;
  1076.     procedure DestroyAreaViewInfos;
  1077.   protected
  1078.     function AreasNeedHotTrack: Boolean;
  1079.     function CalculateHasTextOffset(ASide: TAlignment): Boolean; virtual;
  1080.     function CalculateHeight: Integer; override;
  1081.     function CalculateRealWidth(Value: Integer): Integer;
  1082.     procedure CalculateTextAreaBounds; virtual;
  1083.     procedure CalculateVisible(ALeftBound, AWidth: Integer); virtual;
  1084.     function CalculateWidth: Integer; override;
  1085.     function CanFilter: Boolean; virtual;
  1086.     function CanHorzSize: Boolean; virtual;
  1087.     function CanPress: Boolean; virtual;
  1088.     function CanShowHint: Boolean; override;
  1089.     function CanSort: Boolean; virtual;
  1090.     procedure CheckWidth(var Value: Integer); virtual;
  1091.     function CustomDraw(ACanvas: TcxCanvas): Boolean; override;
  1092.     procedure DoCalculateParams; override;
  1093.     function GetAlignmentHorz: TAlignment; override;
  1094.     function GetAlignmentVert: TcxAlignmentVert; override;
  1095.     function GetAreaBounds: TRect; override;
  1096.     procedure GetAreaViewInfoClasses(AProc: TcxGridClassEnumeratorProc); virtual;
  1097.     function GetBackgroundBitmap: TBitmap; override;
  1098.     function GetBorders: TcxBorders; override;
  1099.     function GetBorderWidth(AIndex: TcxBorder): Integer; override;
  1100.     function GetCanvas: TcxCanvas; override;
  1101.     function GetCaption: string; virtual;
  1102.     class function GetCellBorderWidth(ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; virtual;
  1103.     class function GetCellHeight(ATextHeight: Integer;
  1104.       ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; override;
  1105.     function GetDataOffset: Integer; virtual;
  1106.     function GetHeight: Integer; override;
  1107.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1108.     function GetHotTrack: Boolean; override;
  1109.     function GetIsDesignSelected: Boolean; override;
  1110.     function GetIsPressed: Boolean; virtual;
  1111.     function GetMaxWidth: Integer; virtual;
  1112.     function GetMinWidth: Integer; virtual;
  1113.     function GetMultiLine: Boolean; override;
  1114.     function GetMultiLinePainting: Boolean; override;
  1115.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1116.     function GetRealBounds: TRect; override;
  1117.     function GetShowEndEllipsis: Boolean; override;
  1118.     function GetText: string; override;
  1119.     function GetTextAreaBounds: TRect; override;
  1120.     procedure GetViewParams(var AParams: TcxViewParams); override;
  1121.     function GetWidth: Integer; override;
  1122.     function HasCustomDraw: Boolean; override;
  1123.     function HasFixedContentSpace: Boolean; virtual;
  1124.     function HasGlyph: Boolean; virtual;
  1125.     function HasHeaderAsContainer: Boolean;
  1126.     procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override;
  1127.     procedure Offset(DX, DY: Integer); override;
  1128.     procedure SetWidth(Value: Integer); override;
  1129.     procedure StateChanged(APrevState: TcxGridCellState); override;
  1130.     property Caption: string read GetCaption;
  1131.     property GridView: TcxGridTableView read GetGridView;
  1132.     property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
  1133.     property HasTextOffsetLeft: Boolean read GetHasTextOffsetLeft;
  1134.     property HasTextOffsetRight: Boolean read GetHasTextOffsetRight;
  1135.   public
  1136.     constructor Create(AContainer: TcxGridColumnContainerViewInfo;
  1137.       AColumn: TcxGridColumn); reintroduce; virtual;
  1138.     destructor Destroy; override;
  1139.     procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1;
  1140.       AHeight: Integer = -1); override;
  1141.     function GetBestFitWidth: Integer; override;
  1142.     function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
  1143.     procedure InitAutoWidthItem(AAutoWidthItem: TcxAutoWidthItem);
  1144.     function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton;
  1145.       AShift: TShiftState): Boolean; override;
  1146.     property AreaViewInfoCount: Integer read GetAreaViewInfoCount;
  1147.     property AreaViewInfos[Index: Integer]: TcxGridColumnHeaderAreaViewInfo read GetAreaViewInfo;
  1148.     property Column: TcxGridColumn read FColumn;
  1149.     property Container: TcxGridColumnContainerViewInfo read FContainer;
  1150.     property DataOffset: Integer read GetDataOffset;
  1151.     property Index: Integer read GetIndex;
  1152.     property IsFixed: Boolean read GetIsFixed;
  1153.     property IsPressed: Boolean read GetIsPressed;
  1154.     property MaxWidth: Integer read GetMaxWidth;
  1155.     property MinWidth: Integer read GetMinWidth;
  1156.     property Neighbors: TcxNeighbors read FNeighbors write FNeighbors;
  1157.     property RealWidth: Integer read GetRealWidth;
  1158.   end;
  1159.   // header
  1160.   TcxGridHeaderViewInfoSpecificClass = class of TcxGridHeaderViewInfoSpecific;
  1161.   TcxGridHeaderViewInfoSpecific = class
  1162.   private
  1163.     FContainerViewInfo: TcxGridHeaderViewInfo;
  1164.     function GetGridViewInfo: TcxGridTableViewInfo;
  1165.     function GetItemHeight: Integer;
  1166.   protected
  1167.     function CalculateHeight: Integer; virtual;
  1168.     function GetHeight: Integer; virtual;
  1169.   public
  1170.     constructor Create(AContainerViewInfo: TcxGridHeaderViewInfo); virtual;
  1171.     property ContainerViewInfo: TcxGridHeaderViewInfo read FContainerViewInfo;
  1172.     property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
  1173.     property Height: Integer read GetHeight;
  1174.     property ItemHeight: Integer read GetItemHeight;
  1175.   end;
  1176.   TcxGridHeaderViewInfoClass = class of TcxGridHeaderViewInfo;
  1177.   TcxGridHeaderViewInfo = class(TcxGridColumnContainerViewInfo)
  1178.   private
  1179.     FSpecific: TcxGridHeaderViewInfoSpecific;
  1180.   protected
  1181.     function GetColumn(Index: Integer): TcxGridColumn; override;
  1182.     function GetColumnCount: Integer; override;
  1183.     procedure AddIndicatorItems(AIndicatorViewInfo: TcxGridIndicatorViewInfo; ATopBound: Integer); virtual;
  1184.     procedure CalculateColumnAutoWidths; virtual;
  1185.     procedure CalculateColumnWidths; virtual;
  1186.     function CalculateHeight: Integer; override;
  1187.     procedure CalculateInvisible; override;
  1188.     function CalculateItemHeight: Integer; override;
  1189.     procedure CalculateItems; virtual;
  1190.     procedure CalculateVisible; override;
  1191.     function CalculateWidth: Integer; override;
  1192.     function CanCalculateAutoWidths: Boolean; virtual;
  1193.     function DrawColumnBackgroundHandler(ACanvas: TcxCanvas; const ABounds: TRect): Boolean; virtual;
  1194.     function GetAlignment: TcxGridPartAlignment; override;
  1195.     function GetAutoHeight: Boolean; override;
  1196.     function GetColumnBackgroundBitmap: TBitmap; virtual;
  1197.     function GetColumnNeighbors(AColumn: TcxGridColumn): TcxNeighbors; override;
  1198.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1199.     function GetIsAutoWidth: Boolean; override;
  1200.     function GetIsScrollable: Boolean; override;
  1201.     function GetItemMultiLinePainting(AItem: TcxGridColumnHeaderViewInfo): Boolean; override;
  1202.     function GetKind: TcxGridColumnContainerKind; override;
  1203.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1204.     procedure GetViewParams(var AParams: TcxViewParams); override;
  1205.     function GetVisible: Boolean; override;
  1206.     function GetWidth: Integer; override;
  1207.     function GetZonesAreaBounds: TRect; override;
  1208.     function IsAlwaysVisibleForCalculation: Boolean; virtual;
  1209.     function IsHeightAssigned: Boolean; virtual;
  1210.     procedure Offset(DX, DY: Integer); override;
  1211.     procedure RecalculateItemVisibles;
  1212.     property ColumnBackgroundBitmap: TBitmap read GetColumnBackgroundBitmap;
  1213.   public
  1214.     constructor Create(AGridViewInfo: TcxCustomGridTableViewInfo); override;
  1215.     destructor Destroy; override;
  1216.     procedure AssignColumnWidths;
  1217.     procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1;
  1218.       AHeight: Integer = -1); override;
  1219.     property Specific: TcxGridHeaderViewInfoSpecific read FSpecific;
  1220.   end;
  1221.   // group by box
  1222.   TcxGridGroupByBoxColumnHeaderViewInfo = class(TcxGridColumnHeaderViewInfo)
  1223.   private
  1224.     function GetContainer: TcxGridGroupByBoxViewInfo;
  1225.   protected
  1226.     function CalculateHeight: Integer; override;
  1227.     function GetCaption: string; override;
  1228.     function HasFixedContentSpace: Boolean; override;
  1229.     function InheritedCalculateHeight: Integer;
  1230.   public
  1231.     property Container: TcxGridGroupByBoxViewInfo read GetContainer;
  1232.   end;
  1233.   TcxGridGroupByBoxViewInfoClass = class of TcxGridGroupByBoxViewInfo;
  1234.   TcxGridGroupByBoxViewInfo = class(TcxGridColumnContainerViewInfo)
  1235.   private
  1236.     FCalculatingColumnWidth: Boolean;
  1237.     function GetGroupByBoxVerOffset: Integer;
  1238.     function GetLinkLineBounds(Index: Integer; Horizontal: Boolean): TRect;
  1239.   protected
  1240.     function GetColumn(Index: Integer): TcxGridColumn; override;
  1241.     function GetColumnCount: Integer; override;
  1242.     function GetItemClass: TcxGridColumnHeaderViewInfoClass; override;
  1243.     function CalculateHeight: Integer; override;
  1244.     function CalculateItemHeight: Integer; override;
  1245.     function CalculateWidth: Integer; override;
  1246.     function GetAlignment: TcxGridPartAlignment; override;
  1247.     function GetAlignmentVert: TcxAlignmentVert; override;
  1248.     function GetBackgroundBitmap: TBitmap; override;
  1249.     function GetColumnWidth(AColumn: TcxGridColumn): Integer; override;
  1250.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1251.     function GetIsAutoWidth: Boolean; override;
  1252.     function GetIsScrollable: Boolean; override;
  1253.     function GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; override;
  1254.     function GetKind: TcxGridColumnContainerKind; override;
  1255.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1256.     function GetText: string; override;
  1257.     function GetTextAreaBounds: TRect; override;
  1258.     procedure GetViewParams(var AParams: TcxViewParams); override;
  1259.     function GetVisible: Boolean; override;
  1260.     property CalculatingColumnWidth: Boolean read FCalculatingColumnWidth;
  1261.     property GroupByBoxVerOffset: Integer read GetGroupByBoxVerOffset;
  1262.   public
  1263.     procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1;
  1264.       AHeight: Integer = -1); override;
  1265.     property LinkLineBounds[Index: Integer; Horizontal: Boolean]: TRect read GetLinkLineBounds;
  1266.   end;
  1267.   // footer
  1268.   TcxGridFooterCellViewInfoClass = class of TcxGridFooterCellViewInfo;
  1269.   TcxGridFooterCellViewInfo = class(TcxGridColumnHeaderViewInfo)
  1270.   private
  1271.     FSummaryItem: TcxDataSummaryItem;
  1272.     function GetContainer: TcxGridFooterViewInfo;
  1273.     function GetSummary: TcxDataSummary;
  1274.   protected
  1275.     procedure AfterCalculateBounds(var ABounds: TRect); override;
  1276.     function CanPress: Boolean; override;
  1277.     function CustomDraw(ACanvas: TcxCanvas): Boolean; override;
  1278.     function GetAlignmentHorz: TAlignment; override;
  1279.     function GetBackgroundBitmap: TBitmap; override;
  1280.     procedure GetAreaViewInfoClasses(AProc: TcxGridClassEnumeratorProc); override;
  1281.     function GetBorders: TcxBorders; override;
  1282.     class function GetCellBorderWidth(ALookAndFeelPainter: TcxCustomLookAndFeelPainterClass): Integer; override;
  1283.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1284.     function GetIsDesignSelected: Boolean; override;
  1285.     function GetIsPressed: Boolean; override;
  1286.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1287.     function GetText: string; override;
  1288.     procedure GetViewParams(var AParams: TcxViewParams); override;
  1289.     function HasCustomDraw: Boolean; override;
  1290.     procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override;
  1291.     property Summary: TcxDataSummary read GetSummary;
  1292.   public
  1293.     constructor Create(AContainer: TcxGridColumnContainerViewInfo;
  1294.       ASummaryItem: TcxDataSummaryItem); reintroduce; virtual;
  1295.     function GetBestFitWidth: Integer; override;
  1296.     function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton;
  1297.       AShift: TShiftState): Boolean; override;
  1298.     property Container: TcxGridFooterViewInfo read GetContainer;
  1299.     property SummaryItem: TcxDataSummaryItem read FSummaryItem;
  1300.   end;
  1301.   TcxGridFooterViewInfoClass = class of TcxGridFooterViewInfo;
  1302.   TcxGridFooterViewInfo = class(TcxGridHeaderViewInfo)
  1303.   private
  1304.     FRowCount: Integer;
  1305.     FSummaryItems: TList;
  1306.     function GetMultipleSummaries: Boolean;
  1307.     function GetRowCount: Integer;
  1308.     function GetRowHeight: Integer;
  1309.   protected
  1310.     function CreateItem(AIndex: Integer): TcxGridColumnHeaderViewInfo; override;
  1311.     procedure CreateItems; override;
  1312.     procedure DestroyItems; override;
  1313.     function GetColumn(Index: Integer): TcxGridColumn; override;
  1314.     function GetColumnCount: Integer; override;
  1315.     function GetItemClass: TcxGridColumnHeaderViewInfoClass; override;
  1316.     procedure PrepareSummaryItems(ASummaryItems: TList); virtual;
  1317.     function CalculateBounds: TRect; override;
  1318.     function CalculateHeight: Integer; override;
  1319.     function CalculateItemHeight: Integer; override;
  1320.     procedure CalculateItem(AIndex: Integer); virtual;
  1321.     procedure CalculateItems; override;
  1322.     function CalculateRowCount: Integer; virtual;
  1323.     function CanCalculateAutoWidths: Boolean; override;
  1324.     function GetAlignment: TcxGridPartAlignment; override;
  1325.     function GetAutoHeight: Boolean; override;
  1326.     function GetBackgroundBitmap: TBitmap; override;
  1327.     function GetBordersBounds: TRect; virtual;
  1328.     function GetBorders: TcxBorders; override;
  1329.     function GetBorderWidth(AIndex: TcxBorder): Integer; override;
  1330.     function GetColumnWidth(AColumn: TcxGridColumn): Integer; override;
  1331.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1332.     function GetIsAutoWidth: Boolean; override;
  1333.     function GetIsScrollable: Boolean; override;
  1334.     function GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; override;
  1335.     function GetItemHeight(AColumn: TcxGridColumn): Integer; overload; virtual;
  1336.     function GetItemHeight(AIndex: Integer): Integer; overload;
  1337.     function GetItemHitTestClass: TcxCustomGridHitTestClass; virtual;
  1338.     function GetItemLeftBound(AColumn: TcxGridColumn): Integer; overload; virtual;
  1339.     function GetItemLeftBound(AIndex: Integer): Integer; overload;
  1340.     function GetItemRowIndex(AIndex: Integer): Integer; virtual;
  1341.     function GetItemsAreaBounds: TRect; override;
  1342.     function GetItemTopBound(AColumn: TcxGridColumn): Integer; overload; virtual;
  1343.     function GetItemTopBound(AIndex: Integer): Integer; overload; virtual;
  1344.     function GetKind: TcxGridColumnContainerKind; override;
  1345.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1346.     function GetSeparatorBounds: TRect; virtual;
  1347.     function GetSeparatorWidth: Integer; virtual;
  1348.     function GetSummaryItems: TcxDataSummaryItems; virtual;
  1349.     procedure GetViewParams(var AParams: TcxViewParams); override;
  1350.     function GetVisible: Boolean; override;
  1351.     function HasSeparator: Boolean; virtual;
  1352.     function IsAlwaysVisibleForCalculation: Boolean; override;
  1353.     function IsColumnOnFirstLayer(AColumnIndex: Integer): Boolean; virtual;
  1354.     function IsHeightAssigned: Boolean; override;
  1355.     function IsItemVisible(AIndex: Integer): Boolean; virtual;
  1356.     function IsMultilayerLayout: Boolean; virtual;
  1357.     procedure Offset(DX, DY: Integer); override;
  1358.     property SummaryItemsList: TList read FSummaryItems;
  1359.   public
  1360.     function CanShowMultipleSummaries: Boolean; virtual;
  1361.     function GetCellBestFitWidth(AColumn: TcxGridColumn): Integer; virtual;
  1362.     function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
  1363.     property BordersBounds: TRect read GetBordersBounds;
  1364.     property MultipleSummaries: Boolean read GetMultipleSummaries;
  1365.     property RowCount: Integer read GetRowCount;
  1366.     property RowHeight: Integer read GetRowHeight;
  1367.     property SeparatorBounds: TRect read GetSeparatorBounds;
  1368.     property SeparatorWidth: Integer read GetSeparatorWidth;
  1369.     property SummaryItems: TcxDataSummaryItems read GetSummaryItems;
  1370.   end;
  1371.   // indicator
  1372.   TcxCustomGridIndicatorItemViewInfoClass = class of TcxCustomGridIndicatorItemViewInfo;
  1373.   TcxCustomGridIndicatorItemViewInfo = class(TcxCustomGridViewCellViewInfo)
  1374.   private
  1375.     FContainer: TcxGridIndicatorViewInfo;
  1376.     function GetGridView: TcxGridTableView;
  1377.     function GetGridViewInfo: TcxGridTableViewInfo;
  1378.   protected
  1379.     function CalculateWidth: Integer; override;
  1380.     function CustomDraw(ACanvas: TcxCanvas): Boolean; override;
  1381.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1382.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1383.     procedure GetViewParams(var AParams: TcxViewParams); override;
  1384.     function HasCustomDraw: Boolean; override;
  1385.   public
  1386.     constructor Create(AContainer: TcxGridIndicatorViewInfo); reintroduce; virtual;
  1387.     destructor Destroy; override;
  1388.     property Container: TcxGridIndicatorViewInfo read FContainer;
  1389.     property GridView: TcxGridTableView read GetGridView;
  1390.     property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
  1391.   end;
  1392.   TcxGridIndicatorHeaderItemViewInfo = class(TcxCustomGridIndicatorItemViewInfo)
  1393.   private
  1394.     function GetDropDownWindowValue: TcxCustomGridCustomizationPopup;
  1395.   protected
  1396.     function CalculateHeight: Integer; override;
  1397.     function CanShowHint: Boolean; override;
  1398.     function GetCellBoundsForHint: TRect; override;
  1399.     function GetHintTextRect(const AMousePos: TPoint): TRect; override;
  1400.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1401.     function GetHotTrack: Boolean; override;
  1402.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1403.     function GetText: string; override;
  1404.     procedure GetViewParams(var AParams: TcxViewParams); override;
  1405.     function IsHintForText: Boolean; override;
  1406.     function IsHintMultiLine: Boolean; override;
  1407.     function SupportsQuickCustomization: Boolean; virtual;
  1408.     function CloseDropDownWindowOnDestruction: Boolean; override;
  1409.     function DropDownWindowExists: Boolean; override;
  1410.     function GetDropDownWindow: TcxCustomGridPopup; override;
  1411.     property DropDownWindow: TcxCustomGridCustomizationPopup read GetDropDownWindowValue;
  1412.   end;
  1413.   TcxGridIndicatorRowItemViewInfoClass = class of TcxGridIndicatorRowItemViewInfo;
  1414.   TcxGridIndicatorRowItemViewInfo = class(TcxCustomGridIndicatorItemViewInfo)
  1415.   private
  1416.     FRowViewInfo: TcxCustomGridRowViewInfo;
  1417.     function GetGridRecord: TcxCustomGridRow;
  1418.     function GetGridView: TcxGridTableView;
  1419.   protected
  1420.     function CalculateHeight: Integer; override;
  1421.     function GetBackgroundBitmap: TBitmap; override;
  1422.     function GetIndicatorKind: TcxIndicatorKind; virtual;
  1423.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1424.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1425.     function GetRowSizingEdgeBounds: TRect; virtual;
  1426.     procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override;
  1427.     property RowSizingEdgeBounds: TRect read GetRowSizingEdgeBounds;
  1428.   public
  1429.     destructor Destroy; override;
  1430.     function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
  1431.     function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton;
  1432.       AShift: TShiftState): Boolean; override;
  1433.     property GridRecord: TcxCustomGridRow read GetGridRecord;
  1434.     property GridView: TcxGridTableView read GetGridView;
  1435.     property IndicatorKind: TcxIndicatorKind read GetIndicatorKind;
  1436.     property RowViewInfo: TcxCustomGridRowViewInfo read FRowViewInfo write FRowViewInfo;
  1437.   end;
  1438.   TcxGridIndicatorFooterItemViewInfo = class(TcxCustomGridIndicatorItemViewInfo)
  1439.   private
  1440.     function GetSeparatorWidth: Integer;
  1441.   protected
  1442.     function CalculateHeight: Integer; override;
  1443.     function GetBackgroundBitmap: TBitmap; override;
  1444.     function GetBorders: TcxBorders; override;
  1445.     function GetBordersBounds: TRect; virtual;
  1446.     function GetBorderWidth(AIndex: TcxBorder): Integer; override;
  1447.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1448.     function GetSeparatorBounds: TRect; virtual;
  1449.     function HasSeparator: Boolean;
  1450.   public
  1451.     property BordersBounds: TRect read GetBordersBounds;
  1452.     property SeparatorBounds: TRect read GetSeparatorBounds;
  1453.     property SeparatorWidth: Integer read GetSeparatorWidth;
  1454.   end;
  1455.   TcxGridIndicatorViewInfoClass = class of TcxGridIndicatorViewInfo;
  1456.   TcxGridIndicatorViewInfo = class(TcxCustomGridViewCellViewInfo)
  1457.   private
  1458.     FItems: TList;
  1459.     function GetCount: Integer;
  1460.     function GetGridView: TcxGridTableView;
  1461.     function GetGridViewInfo: TcxGridTableViewInfo;
  1462.     function GetItem(Index: Integer): TcxCustomGridIndicatorItemViewInfo;
  1463.     procedure DestroyItems;
  1464.   protected
  1465.     function CalculateHeight: Integer; override;
  1466.     function CalculateWidth: Integer; override;
  1467.     function GetAlwaysVisible: Boolean; virtual;
  1468.     function GetBackgroundBitmap: TBitmap; override;
  1469.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1470.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1471.     function GetRowItemClass(ARowViewInfo: TcxCustomGridRowViewInfo): TcxGridIndicatorRowItemViewInfoClass; virtual;
  1472.     procedure GetViewParams(var AParams: TcxViewParams); override;
  1473.     function GetVisible: Boolean; override;
  1474.     function GetWidth: Integer; override;
  1475.   public
  1476.     constructor Create(AGridViewInfo: TcxGridTableViewInfo); reintroduce; virtual;
  1477.     destructor Destroy; override;
  1478.     function AddItem(AItemClass: TcxCustomGridIndicatorItemViewInfoClass): TcxCustomGridIndicatorItemViewInfo; overload;
  1479.     function AddItem(ATopBound, AHeight: Integer;
  1480.       AItemClass: TcxCustomGridIndicatorItemViewInfoClass): TcxCustomGridIndicatorItemViewInfo; overload;
  1481.     function AddRowItem(ARowViewInfo: TcxCustomGridRowViewInfo): TcxCustomGridIndicatorItemViewInfo;
  1482.     procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1;
  1483.       AHeight: Integer = -1); override;
  1484.     procedure CalculateRowItem(ARowViewInfo: TcxCustomGridRowViewInfo;
  1485.       AItem: TcxCustomGridIndicatorItemViewInfo);
  1486.     function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
  1487.     function GetRowItemBounds(AGridRecord: TcxCustomGridRow): TRect;
  1488.     property AlwaysVisible: Boolean read GetAlwaysVisible;
  1489.     property Count: Integer read GetCount;
  1490.     property GridView: TcxGridTableView read GetGridView;
  1491.     property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
  1492.     property Items[Index: Integer]: TcxCustomGridIndicatorItemViewInfo read GetItem;
  1493.   end;
  1494.   // custom row
  1495.   TcxGridRowFooterCellViewInfo = class(TcxGridFooterCellViewInfo)
  1496.   private
  1497.     function GetContainer: TcxGridRowFooterViewInfo;
  1498.     function GetGridRecord: TcxCustomGridRow;
  1499.   protected
  1500.     function GetText: string; override;
  1501.     procedure GetViewParams(var AParams: TcxViewParams); override;
  1502.   public
  1503.     property Container: TcxGridRowFooterViewInfo read GetContainer;
  1504.     property GridRecord: TcxCustomGridRow read GetGridRecord;
  1505.   end;
  1506.   TcxGridRowFooterViewInfoClass = class of TcxGridRowFooterViewInfo;
  1507.   TcxGridRowFooterViewInfo = class(TcxGridFooterViewInfo)
  1508.   private
  1509.     FContainer: TcxGridRowFootersViewInfo;
  1510.     FLevel: Integer;
  1511.     function GetIndent: Integer;
  1512.     function GetGridRecord: TcxCustomGridRow;
  1513.     function GetGroupLevel: Integer;
  1514.     function GetRowViewInfo: TcxCustomGridRowViewInfo;
  1515.   protected
  1516.     function CalculateHeight: Integer; override;
  1517.     function CalculateWidth: Integer; override;
  1518.     function GetColumnWidth(AColumn: TcxGridColumn): Integer; override;
  1519.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1520.     function GetIsPart: Boolean; override;
  1521.     function GetItemAreaBounds(AItem: TcxGridColumnHeaderViewInfo): TRect; override;
  1522.     function GetItemClass: TcxGridColumnHeaderViewInfoClass; override;
  1523.     function GetItemHitTestClass: TcxCustomGridHitTestClass; override;
  1524.     function GetItemMultiLinePainting(AItem: TcxGridColumnHeaderViewInfo): Boolean; override;
  1525.     function GetSummaryItems: TcxDataSummaryItems; override;
  1526.     procedure GetViewParams(var AParams: TcxViewParams); override;
  1527.     function GetVisible: Boolean; override;
  1528.     function GetVisualLevel: Integer; virtual;
  1529.     function HasSeparator: Boolean; override;
  1530.     procedure PrepareSummaryItems(ASummaryItems: TList); override;
  1531.     property Indent: Integer read GetIndent;
  1532.   public
  1533.     constructor Create(AContainer: TcxGridRowFootersViewInfo; ALevel: Integer); reintroduce; virtual;
  1534.     function CanShowMultipleSummaries: Boolean; override;
  1535.     property Container: TcxGridRowFootersViewInfo read FContainer;
  1536.     property GridRecord: TcxCustomGridRow read GetGridRecord;
  1537.     property GroupLevel: Integer read GetGroupLevel;
  1538.     property Level: Integer read FLevel;
  1539.     property RowViewInfo: TcxCustomGridRowViewInfo read GetRowViewInfo;
  1540.     property VisualLevel: Integer read GetVisualLevel;
  1541.   end;
  1542.   TcxGridRowFootersViewInfoClass = class of TcxGridRowFootersViewInfo;
  1543.   TcxGridRowFootersViewInfo = class
  1544.   private
  1545.     FHeight: Integer;
  1546.     FItems: TList;
  1547.     FRowViewInfo: TcxCustomGridRowViewInfo;
  1548.     function GetCount: Integer;
  1549.     function GetGridViewInfo: TcxGridTableViewInfo;
  1550.     function GetHeight: Integer;
  1551.     function GetItem(Index: Integer): TcxGridRowFooterViewInfo;
  1552.     function GetVisibleItem(ALevel: Integer): TcxGridRowFooterViewInfo;
  1553.     procedure CreateItems;
  1554.     procedure DestroyItems;
  1555.   protected
  1556.     procedure BeforeRecalculation; virtual;
  1557.     procedure Calculate(ALeftBound, ATopBound: Integer); virtual;
  1558.     function CalculateHeight: Integer; virtual;
  1559.     function GetItemClass: TcxGridRowFooterViewInfoClass; virtual;
  1560.   public
  1561.     constructor Create(ARowViewInfo: TcxCustomGridRowViewInfo); virtual;
  1562.     destructor Destroy; override;
  1563.     function GetCellBestFitWidth(AColumn: TcxGridColumn): Integer;
  1564.     function GetHitTest(const P: TPoint): TcxCustomGridHitTest; virtual;
  1565.     function GetTopBound(ALevel: Integer; var ATopBound: Integer): Boolean;
  1566.     procedure Offset(DX, DY: Integer); virtual;
  1567.     procedure Paint;
  1568.     property Count: Integer read GetCount;
  1569.     property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
  1570.     property Items[Index: Integer]: TcxGridRowFooterViewInfo read GetItem; default;
  1571.     property Height: Integer read GetHeight;
  1572.     property RowViewInfo: TcxCustomGridRowViewInfo read FRowViewInfo;
  1573.     property VisibleItems[ALevel: Integer]: TcxGridRowFooterViewInfo read GetVisibleItem;
  1574.   end;
  1575.   TcxCustomGridRowViewInfoClass = class of TcxCustomGridRowViewInfo;
  1576.   TcxCustomGridRowViewInfo = class(TcxCustomGridRecordViewInfo)
  1577.   private
  1578.     FFootersViewInfo: TcxGridRowFootersViewInfo;
  1579.     FIndicatorItem: TcxCustomGridIndicatorItemViewInfo;
  1580.     function GetCacheItem: TcxGridTableViewInfoCacheItem;
  1581.     function GetGridView: TcxGridTableView;
  1582.     function GetGridLines: TcxGridLines;
  1583.     function GetGridRecord: TcxCustomGridRow;
  1584.     function GetGridViewInfo: TcxGridTableViewInfo;
  1585.     function GetLevel: Integer;
  1586.     function GetLevelIndent: Integer;
  1587.     function GetLevelIndentBounds(Index: Integer): TRect;
  1588.     function GetLevelIndentHorzLineBounds(Index: Integer): TRect;
  1589.     function GetLevelIndentSpaceBounds(Index: Integer): TRect;
  1590.     function GetLevelIndentVertLineBounds(Index: Integer): TRect;
  1591.     function GetRecordsViewInfo: TcxGridRowsViewInfo;
  1592.     function GetVisualLevel: Integer;
  1593.     procedure CreateFootersViewInfo;
  1594.     procedure DestroyFootersViewInfo;
  1595.     procedure RecreateFootersViewInfo;
  1596.   protected
  1597.     procedure AfterRowsViewInfoCalculate; virtual;
  1598.     procedure AfterRowsViewInfoOffset; virtual;
  1599.     procedure CalculateExpandButtonBounds(var ABounds: TRect); override;
  1600.     function CalculateHeight: Integer; override;
  1601.     function CalculateLevelIndentHorzLineBounds(ALevel: Integer; const ABounds: TRect): TRect;
  1602.     function CalculateLevelIndentSpaceBounds(ALevel: Integer; const ABounds: TRect): TRect;
  1603.     function CalculateLevelIndentVertLineBounds(ALevel: Integer; const ABounds: TRect): TRect;
  1604.     function CalculateWidth: Integer; override;
  1605.     function CanSize: Boolean; virtual;
  1606.     procedure CheckRowHeight(var AValue: Integer); virtual;
  1607.     function GetAutoHeight: Boolean; override;
  1608.     function GetBaseHeight: Integer; virtual;
  1609.     function GetBottomPartHeight: Integer; virtual;
  1610.     function GetCellTransparent(ACell: TcxGridTableCellViewInfo): Boolean; override;
  1611.     function GetContentBounds: TRect; override;
  1612.     function GetContentIndent: Integer; virtual;
  1613.     function GetContentWidth: Integer; override;
  1614.     function GetDataHeight: Integer; virtual;
  1615.     function GetDataIndent: Integer; virtual;
  1616.     function GetDataWidth: Integer; virtual;
  1617.     function GetFocusRectBounds: TRect; override;
  1618.     function GetFootersViewInfoClass: TcxGridRowFootersViewInfoClass; virtual;
  1619.     function GetLastHorzGridLineBounds: TRect; virtual;
  1620.     function GetMaxHeight: Integer; virtual;
  1621.     function GetNonBaseHeight: Integer; virtual;
  1622.     function GetRowHeight: Integer; virtual;
  1623.     function GetSeparatorBounds: TRect; virtual;
  1624.     function GetSeparatorColor: TColor; virtual;
  1625.     function GetSeparatorWidth: Integer; virtual;
  1626.     function GetShowSeparator: Boolean; virtual;
  1627.     function GetVisible: Boolean; override;
  1628.     function GetWidth: Integer; override;
  1629.     function HasAnyFooter(ALevel: Integer): Boolean;
  1630.     function HasFooter(ALevel: Integer): Boolean; virtual;
  1631.     function HasFooters: Boolean; virtual;
  1632.     function HasLastHorzGridLine: Boolean; virtual;
  1633.     function IsFullyVisible: Boolean; virtual;
  1634.     procedure Offset(DX, DY: Integer); override;
  1635.     procedure SetRowHeight(Value: Integer); virtual; abstract;
  1636.     property BaseHeight: Integer read GetBaseHeight;
  1637.     property BottomPartHeight: Integer read GetBottomPartHeight;
  1638.     property CacheItem: TcxGridTableViewInfoCacheItem read GetCacheItem;
  1639.     property IndicatorItem: TcxCustomGridIndicatorItemViewInfo read FIndicatorItem;
  1640.     property LastHorzGridLineBounds: TRect read GetLastHorzGridLineBounds;
  1641.     property Level: Integer read GetLevel;
  1642.     property LevelIndent: Integer read GetLevelIndent;
  1643.     property NonBaseHeight: Integer read GetNonBaseHeight;
  1644.     property RowHeight: Integer read GetRowHeight write SetRowHeight;
  1645.     property ShowSeparator: Boolean read GetShowSeparator;
  1646.   public
  1647.     constructor Create(ARecordsViewInfo: TcxCustomGridRecordsViewInfo;
  1648.       ARecord: TcxCustomGridRecord); override;
  1649.     destructor Destroy; override;
  1650.     procedure BeforeRecalculation; override;
  1651.     procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1;
  1652.       AHeight: Integer = -1); override;
  1653.     function Click(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton;
  1654.       AShift: TShiftState): Boolean; override;
  1655.     function GetBoundsForInvalidate(AItem: TcxCustomGridTableItem): TRect; override;
  1656.     function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
  1657.     function HasSeparator: Boolean;
  1658.     property ContentIndent: Integer read GetContentIndent;
  1659.     property DataHeight: Integer read GetDataHeight;
  1660.     property DataIndent: Integer read GetDataIndent;
  1661.     property DataWidth: Integer read GetDataWidth;
  1662.     property FootersViewInfo: TcxGridRowFootersViewInfo read FFootersViewInfo;
  1663.     property GridView: TcxGridTableView read GetGridView;
  1664.     property GridLines: TcxGridLines read GetGridLines;
  1665.     property GridRecord: TcxCustomGridRow read GetGridRecord;
  1666.     property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
  1667.     property LevelIndentBounds[Index: Integer]: TRect read GetLevelIndentBounds;
  1668.     property LevelIndentHorzLineBounds[Index: Integer]: TRect read GetLevelIndentHorzLineBounds;
  1669.     property LevelIndentSpaceBounds[Index: Integer]: TRect read GetLevelIndentSpaceBounds;
  1670.     property LevelIndentVertLineBounds[Index: Integer]: TRect read GetLevelIndentVertLineBounds;
  1671.     property MaxHeight: Integer read GetMaxHeight;
  1672.     property RecordsViewInfo: TcxGridRowsViewInfo read GetRecordsViewInfo;
  1673.     property SeparatorBounds: TRect read GetSeparatorBounds;
  1674.     property SeparatorColor: TColor read GetSeparatorColor;
  1675.     property SeparatorWidth: Integer read GetSeparatorWidth;
  1676.     property VisualLevel: Integer read GetVisualLevel;
  1677.   end;
  1678.   // rows
  1679.   TcxGridRowsViewInfoClass = class of TcxGridRowsViewInfo;
  1680.   TcxGridRowsViewInfo = class(TcxCustomGridRecordsViewInfo)
  1681.   private
  1682.     FDataRowHeight: Integer;
  1683.     FFilterRowViewInfo: TcxCustomGridRowViewInfo;
  1684.     FGroupRowHeight: Integer;
  1685.     FNewItemRowViewInfo: TcxCustomGridRowViewInfo;
  1686.     FRestHeight: Integer;
  1687.     FRowHeight: Integer;
  1688.     function GetFilterRowViewInfo: TcxCustomGridRowViewInfo;
  1689.     function GetGridView: TcxGridTableView;
  1690.     function GetGridLines: TcxGridLines;
  1691.     function GetGridViewInfo: TcxGridTableViewInfo;
  1692.     function GetHeaderViewInfo: TcxGridHeaderViewInfo;
  1693.     function GetItem(Index: Integer): TcxCustomGridRowViewInfo;
  1694.     function GetNewItemRowViewInfo: TcxCustomGridRowViewInfo;
  1695.     function GetPainterClassValue: TcxGridRowsPainterClass;
  1696.     function GetViewData: TcxGridViewData;
  1697.   protected
  1698.     FIsFirstRowFullyVisible: Boolean;
  1699.     FPartVisibleCount: Integer;
  1700.     procedure AfterCalculate; override;
  1701.     procedure AfterOffset; override;
  1702.     procedure Calculate; override;
  1703.     function CalculateBounds: TRect; override;
  1704.     procedure CalculateConsts; virtual;
  1705.     function CalculateContentBounds: TRect; override;
  1706.     function CalculateDataRowHeight: Integer; virtual;
  1707.     function CalculateGroupRowDefaultHeight(AMinHeight: Boolean): Integer; virtual;
  1708.     function CalculateGroupRowHeight: Integer; virtual;
  1709.     function CalculateRestHeight(ATopBound: Integer): Integer; virtual;
  1710.     function CalculateRowDefaultHeight: Integer; virtual;
  1711.     function CalculateRowHeight: Integer; virtual;
  1712.     procedure CalculateVisibleCount; override;
  1713.     function GetAutoDataCellHeight: Boolean; override;
  1714.     function GetCommonDataRowHeight: Integer; virtual;
  1715.     function GetFilterRowViewInfoClass: TcxCustomGridRowViewInfoClass; virtual;
  1716.     function GetGroupBackgroundBitmap: TBitmap; virtual;
  1717.     function GetGroupRowSeparatorWidth: Integer; virtual;
  1718.     function GetItemLeftBound(AIndex: Integer): Integer; override;
  1719.     function GetItemsOffset(AItemCountDelta: Integer): Integer; override;
  1720.     function GetItemTopBound(AIndex: Integer): Integer; override;
  1721.     function GetIsScrollable: Boolean; virtual;
  1722.     function GetNewItemRowViewInfoClass: TcxCustomGridRowViewInfoClass; virtual;
  1723.     function GetPainterClass: TcxCustomGridRecordsPainterClass; override;
  1724.     function GetRowWidth: Integer; virtual;
  1725.     function GetSeparatorWidth: Integer; virtual;
  1726.     function HasFilterRow: Boolean;
  1727.     function HasLastHorzGridLine(ARowViewInfo: TcxCustomGridRowViewInfo): Boolean; virtual;
  1728.     function HasNewItemRow: Boolean;
  1729.     function IsFilterRowVisible: Boolean; virtual;
  1730.     function IsNewItemRowVisible: Boolean; virtual;
  1731.     procedure NotifyItemsCalculationFinished;
  1732.     procedure OffsetItem(AIndex, AOffset: Integer); override;
  1733.     property GridView: TcxGridTableView read GetGridView;
  1734.     property GridViewInfo: TcxGridTableViewInfo read GetGridViewInfo;
  1735.     property HeaderViewInfo: TcxGridHeaderViewInfo read GetHeaderViewInfo;
  1736.     property IsScrollable: Boolean read GetIsScrollable;
  1737.     property ViewData: TcxGridViewData read GetViewData;
  1738.   public
  1739.     destructor Destroy; override;
  1740.     procedure AfterConstruction; override;
  1741.     function CalculateCustomGroupRowHeight(AMinHeight: Boolean; AParams: TcxViewParams): Integer; virtual;
  1742.     function CanDataRowSize: Boolean; virtual;
  1743.     function GetCellHeight(ACellContentHeight: Integer): Integer; override;
  1744.     function GetDataRowCellsAreaViewInfoClass: TClass; virtual;
  1745.     function GetFooterCellBestFitWidth(AColumn: TcxGridColumn): Integer;
  1746.     function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
  1747.     function GetRealItem(ARecord: TcxCustomGridRecord): TcxCustomGridRecordViewInfo; override;
  1748.     function GetRestHeight(ATopBound: Integer): Integer; virtual;
  1749.     function IsCellMultiLine(AItem: TcxCustomGridTableItem): Boolean; override;
  1750.     function IsDataRowHeightAssigned: Boolean; virtual;
  1751.     procedure Offset(DX, DY: Integer); override;
  1752.     property CommonDataRowHeight: Integer read GetCommonDataRowHeight;
  1753.     property DataRowHeight: Integer read FDataRowHeight;
  1754.     property FilterRowViewInfo: TcxCustomGridRowViewInfo read GetFilterRowViewInfo;
  1755.     property GridLines: TcxGridLines read GetGridLines;
  1756.     property GroupBackgroundBitmap: TBitmap read GetGroupBackgroundBitmap;
  1757.     property GroupRowHeight: Integer read FGroupRowHeight write FGroupRowHeight;
  1758.     property GroupRowSeparatorWidth: Integer read GetGroupRowSeparatorWidth;
  1759.     property IsFirstRowFullyVisible: Boolean read FIsFirstRowFullyVisible;
  1760.     property Items[Index: Integer]: TcxCustomGridRowViewInfo read GetItem; default;
  1761.     property NewItemRowViewInfo: TcxCustomGridRowViewInfo read GetNewItemRowViewInfo;
  1762.     property PainterClass: TcxGridRowsPainterClass read GetPainterClassValue;
  1763.     property PartVisibleCount: Integer read FPartVisibleCount;
  1764.     property RowHeight: Integer read FRowHeight write FRowHeight;
  1765.     property RowWidth: Integer read GetRowWidth;
  1766.     property SeparatorWidth: Integer read GetSeparatorWidth;
  1767.   end;
  1768.   // table
  1769.   TcxGridTableViewInfo = class(TcxCustomGridTableViewInfo)
  1770.   private
  1771.     FDataWidth: Integer;
  1772.     FExpandButtonIndent: Integer;
  1773.     FFooterViewInfo: TcxGridFooterViewInfo;
  1774.     FGroupByBoxViewInfo: TcxGridGroupByBoxViewInfo;
  1775.     FHeaderViewInfo: TcxGridHeaderViewInfo;
  1776.     FIndicatorViewInfo: TcxGridIndicatorViewInfo;
  1777.     FLevelIndent: Integer;
  1778.     FPrevDataRowHeight: Integer;
  1779.     function GetController: TcxGridTableController;
  1780.     function GetDataWidth: Integer;
  1781.     function GetGridView: TcxGridTableView;
  1782.     function GetGridLineColor: TColor;
  1783.     function GetGridLines: TcxGridLines;
  1784.     function GetLeftPos: Integer;
  1785.     function GetLevelIndentBackgroundBitmap: TBitmap;
  1786.     function GetLevelIndentColor(Index: Integer): TColor;
  1787.     function GetRecordsViewInfo: TcxGridRowsViewInfo;
  1788.     function GetViewData: TcxGridViewData;
  1789.   protected
  1790.     procedure AfterCalculating; override;
  1791.     procedure BeforeCalculating; override;
  1792.     procedure CreateViewInfos; override;
  1793.     procedure DestroyViewInfos(AIsRecreating: Boolean); override;
  1794.     procedure Calculate; override;
  1795.     function CalculateClientBounds: TRect; override;
  1796.     function CalculateDataWidth: Integer; virtual;
  1797.     procedure CalculateExpandButtonParams; virtual;
  1798.     procedure CalculateHeight(const AMaxSize: TPoint; var AHeight: Integer;
  1799.       var AFullyVisible: Boolean); override;
  1800.     function CalculatePartBounds(APart: TcxCustomGridPartViewInfo): TRect; override;
  1801.     procedure CalculateParts; virtual;
  1802.     function CalculateVisibleEqualHeightRecordCount: Integer; override;
  1803.     procedure CalculateWidth(const AMaxSize: TPoint; var AWidth: Integer); override;
  1804.     function DoGetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
  1805.     function GetDefaultGridModeBufferCount: Integer; override;
  1806.     function GetFirstItemAdditionalWidth: Integer; virtual;
  1807.     function GetGridLineWidth: Integer; virtual;
  1808.     function GetLevelSeparatorColor: TColor; virtual;
  1809.     function GetNonRecordsAreaHeight(ACheckScrollBar: Boolean): Integer; override;
  1810.     function GetScrollableAreaBoundsHorz: TRect; override;
  1811.     function GetScrollableAreaBoundsVert: TRect; override;
  1812.     function GetVisualLevelCount: Integer; virtual;
  1813.     procedure Offset(DX, DY: Integer); override;
  1814.     procedure RecreateViewInfos; override;
  1815.     function SupportsAutoHeight: Boolean; virtual;
  1816.     function SupportsGroupSummariesAlignedWithColumns: Boolean; virtual;
  1817.     function SupportsMultipleFooterSummaries: Boolean; virtual;
  1818.     function GetFooterPainterClass: TcxGridFooterPainterClass; virtual;
  1819.     function GetFooterViewInfoClass: TcxGridFooterViewInfoClass; virtual;
  1820.     function GetGroupByBoxViewInfoClass: TcxGridGroupByBoxViewInfoClass; virtual;
  1821.     function GetHeaderViewInfoClass: TcxGridHeaderViewInfoClass; virtual;
  1822.     function GetIndicatorViewInfoClass: TcxGridIndicatorViewInfoClass; virtual;
  1823.     function GetHeaderViewInfoSpecificClass: TcxGridHeaderViewInfoSpecificClass; virtual;
  1824.     function GetRecordsViewInfoClass: TcxCustomGridRecordsViewInfoClass; override;
  1825.     property Controller: TcxGridTableController read GetController;
  1826.     property ViewData: TcxGridViewData read GetViewData;
  1827.   public
  1828.     function GetCellBorders(AIsRight, AIsBottom: Boolean): TcxBorders; virtual;
  1829.     function GetCellHeight(AIndex, ACellHeight: Integer): Integer; virtual;
  1830.     function GetCellTopOffset(AIndex, ACellHeight: Integer): Integer; virtual;
  1831.     function GetOffsetBounds(AItemsOffset: Integer; out AUpdateBounds: TRect): TRect; overload; virtual;
  1832.     function GetOffsetBounds(DX, DY: Integer; out AUpdateBounds: TRect): TRect; overload; virtual;
  1833.     function GetVisualLevel(ALevel: Integer): Integer; virtual;
  1834.     // for extended lookup edit
  1835.     function GetNearestPopupHeight(AHeight: Integer; AAdditionalRecord: Boolean = False): Integer; override;
  1836.     function GetPopupHeight(ADropDownRowCount: Integer): Integer; override;
  1837.     property DataWidth: Integer read GetDataWidth;
  1838.     property ExpandButtonIndent: Integer read FExpandButtonIndent write FExpandButtonIndent;
  1839.     property FirstItemAdditionalWidth: Integer read GetFirstItemAdditionalWidth;
  1840.     property FooterViewInfo: TcxGridFooterViewInfo read FFooterViewInfo;
  1841.     property GridLineColor: TColor read GetGridLineColor;
  1842.     property GridLines: TcxGridLines read GetGridLines;
  1843.     property GridLineWidth: Integer read GetGridLineWidth;
  1844.     property GridView: TcxGridTableView read GetGridView;
  1845.     property GroupByBoxViewInfo: TcxGridGroupByBoxViewInfo read FGroupByBoxViewInfo;
  1846.     property HeaderViewInfo: TcxGridHeaderViewInfo read FHeaderViewInfo;
  1847.     property IndicatorViewInfo: TcxGridIndicatorViewInfo read FIndicatorViewInfo;
  1848.     property LeftPos: Integer read GetLeftPos;
  1849.     property LevelIndent: Integer read FLevelIndent write FLevelIndent;
  1850.     property LevelIndentBackgroundBitmap: TBitmap read GetLevelIndentBackgroundBitmap;
  1851.     property LevelIndentColors[Index: Integer]: TColor read GetLevelIndentColor;
  1852.     property LevelSeparatorColor: TColor read GetLevelSeparatorColor;
  1853.     property RecordsViewInfo: TcxGridRowsViewInfo read GetRecordsViewInfo;
  1854.     property VisualLevelCount: Integer read GetVisualLevelCount;
  1855.   end;
  1856.   // cache
  1857.   TcxGridTableViewInfoCacheItem = class(TcxCustomGridTableViewInfoCacheItem)
  1858.   private
  1859.     FIsPreviewHeightAssigned: Boolean;
  1860.     FPreviewHeight: Integer;
  1861.     procedure SetPreviewHeight(Value: Integer);
  1862.   public
  1863.     procedure UnassignValues(AKeepMaster: Boolean); override;
  1864.     property IsPreviewHeightAssigned: Boolean read FIsPreviewHeightAssigned
  1865.       write FIsPreviewHeightAssigned;
  1866.     property PreviewHeight: Integer read FPreviewHeight write SetPreviewHeight;
  1867.   end;
  1868.   TcxGridMasterTableViewInfoCacheItem = class(TcxGridTableViewInfoCacheItem)
  1869.   private
  1870.     FIsDetailsSiteFullyVisibleAssigned: Boolean;
  1871.     FIsDetailsSiteHeightAssigned: Boolean;
  1872.     FIsDetailsSiteNormalHeightAssigned: Boolean;
  1873.     FIsDetailsSiteWidthAssigned: Boolean;
  1874.     FDetailsSiteFullyVisible: Boolean;
  1875.     FDetailsSiteHeight: Integer;
  1876.     FDetailsSiteNormalHeight: Integer;
  1877.     FDetailsSiteWidth: Integer;
  1878.     FUnassigningValues: Boolean;
  1879.     function GetGridRecord: TcxGridMasterDataRow;
  1880.     function GetIsDetailsSiteCachedInfoAssigned: Boolean;
  1881.     procedure SetDetailsSiteFullyVisible(Value: Boolean);
  1882.     procedure SetDetailsSiteHeight(Value: Integer);
  1883.     procedure SetDetailsSiteNormalHeight(Value: Integer);
  1884.     procedure SetDetailsSiteWidth(Value: Integer);
  1885.   protected
  1886.     property GridRecord: TcxGridMasterDataRow read GetGridRecord;
  1887.   public
  1888.     DetailsSiteCachedInfo: TcxCustomGridDetailsSiteViewInfoCachedInfo;
  1889.     destructor Destroy; override;
  1890.     procedure UnassignValues(AKeepMaster: Boolean); override;
  1891.     property IsDetailsSiteCachedInfoAssigned: Boolean read GetIsDetailsSiteCachedInfoAssigned;
  1892.     property IsDetailsSiteFullyVisibleAssigned: Boolean read FIsDetailsSiteFullyVisibleAssigned write FIsDetailsSiteFullyVisibleAssigned;
  1893.     property IsDetailsSiteHeightAssigned: Boolean read FIsDetailsSiteHeightAssigned write FIsDetailsSiteHeightAssigned;
  1894.     property IsDetailsSiteNormalHeightAssigned: Boolean read FIsDetailsSiteNormalHeightAssigned write FIsDetailsSiteNormalHeightAssigned;
  1895.     property IsDetailsSiteWidthAssigned: Boolean read FIsDetailsSiteWidthAssigned write FIsDetailsSiteWidthAssigned;
  1896.     property DetailsSiteFullyVisible: Boolean read FDetailsSiteFullyVisible write SetDetailsSiteFullyVisible;
  1897.     property DetailsSiteHeight: Integer read FDetailsSiteHeight write SetDetailsSiteHeight;
  1898.     property DetailsSiteNormalHeight: Integer read FDetailsSiteNormalHeight write SetDetailsSiteNormalHeight;
  1899.     property DetailsSiteWidth: Integer read FDetailsSiteWidth write SetDetailsSiteWidth;
  1900.   end;
  1901.   { view }
  1902.   // column
  1903.   TcxGridColumnOptions = class(TcxCustomGridTableItemOptions)
  1904.   private
  1905.     FCellMerging: Boolean;
  1906.     FGroupFooters: Boolean;
  1907.     FHorzSizing: Boolean;
  1908.     function GetGridView: TcxGridTableView;
  1909.     procedure SetCellMerging(Value: Boolean);
  1910.     procedure SetGroupFooters(Value: Boolean);
  1911.     procedure SetHorzSizing(Value: Boolean);
  1912.   protected
  1913.     property GridView: TcxGridTableView read GetGridView;
  1914.   public
  1915.     constructor Create(AItem: TcxCustomGridTableItem); override;
  1916.     procedure Assign(Source: TPersistent); override;
  1917.   published
  1918.     property CellMerging: Boolean read FCellMerging write SetCellMerging default False;
  1919.     property GroupFooters: Boolean read FGroupFooters write SetGroupFooters default True; 
  1920.     property Grouping;
  1921.     property HorzSizing: Boolean read FHorzSizing write SetHorzSizing default True;
  1922.     property Moving;
  1923.     property ShowCaption;
  1924.     property SortByDisplayText;
  1925.     property Sorting;
  1926.   end;
  1927.   TcxGridGetFooterStyleExEvent = procedure(Sender: TcxGridTableView; ARow: TcxCustomGridRow;
  1928.     AColumn: TcxGridColumn; AFooterGroupLevel: Integer; var AStyle: TcxStyle) of object;
  1929.   TcxGridGetFooterSummaryStyleEvent = procedure(AView: TcxGridTableView; ARow: TcxCustomGridRow;
  1930.     AColumn: TcxGridColumn; AFooterGroupLevel: Integer; ASummaryItem: TcxDataSummaryItem; var AStyle: TcxStyle) of object;
  1931.   TcxGridGetGroupSummaryStyleEvent = procedure(Sender: TcxGridTableView; ARow: TcxGridGroupRow;
  1932.     AColumn: TcxGridColumn; ASummaryItem: TcxDataSummaryItem; var AStyle: TcxStyle) of object;
  1933.   TcxGridGetHeaderStyleEvent = procedure(Sender: TcxGridTableView;
  1934.     AColumn: TcxGridColumn; {$IFDEF BCB}var{$ELSE}out{$ENDIF} AStyle: TcxStyle) of object;
  1935.   TcxGridColumnStyles = class(TcxCustomGridTableItemStyles)
  1936.   private
  1937.     FOnGetFooterStyle: TcxGridGetCellStyleEvent;
  1938.     FOnGetFooterStyleEx: TcxGridGetFooterStyleExEvent;
  1939.     FOnGetFooterSummaryStyle: TcxGridGetFooterSummaryStyleEvent;
  1940.     FOnGetGroupSummaryStyle: TcxGridGetGroupSummaryStyleEvent;
  1941.     FOnGetHeaderStyle: TcxGridGetHeaderStyleEvent;
  1942.     function GetGridViewValue: TcxGridTableView;
  1943.     function GetItem: TcxGridColumn;
  1944.     procedure SetOnGetFooterStyle(Value: TcxGridGetCellStyleEvent);
  1945.     procedure SetOnGetFooterStyleEx(Value: TcxGridGetFooterStyleExEvent);
  1946.     procedure SetOnGetFooterSummaryStyle(Value: TcxGridGetFooterSummaryStyleEvent);
  1947.     procedure SetOnGetGroupSummaryStyle(Value: TcxGridGetGroupSummaryStyleEvent);
  1948.     procedure SetOnGetHeaderStyle(Value: TcxGridGetHeaderStyleEvent);
  1949.   protected
  1950.     procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override;
  1951.   public
  1952.     procedure Assign(Source: TPersistent); override;
  1953.     procedure GetFooterParams(ARow: TcxCustomGridRow; AFooterGroupLevel: Integer;
  1954.       ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); virtual;
  1955.     procedure GetGroupSummaryParams(ARow: TcxGridGroupRow; ASummaryItem: TcxDataSummaryItem;
  1956.       out AParams: TcxViewParams); virtual;
  1957.     procedure GetHeaderParams(out AParams: TcxViewParams); virtual;
  1958.     property GridView: TcxGridTableView read GetGridViewValue;
  1959.     property Item: TcxGridColumn read GetItem;
  1960.   published
  1961.     property Footer: TcxStyle index isFooter read GetValue write SetValue;
  1962.     property GroupSummary: TcxStyle index isGroupSummary read GetValue write SetValue;
  1963.     property Header: TcxStyle index isHeader read GetValue write SetValue;
  1964.     property OnGetFooterStyle: TcxGridGetCellStyleEvent read FOnGetFooterStyle write SetOnGetFooterStyle;
  1965.     property OnGetFooterStyleEx: TcxGridGetFooterStyleExEvent read FOnGetFooterStyleEx write SetOnGetFooterStyleEx;
  1966.     property OnGetFooterSummaryStyle: TcxGridGetFooterSummaryStyleEvent read FOnGetFooterSummaryStyle write SetOnGetFooterSummaryStyle;
  1967.     property OnGetGroupSummaryStyle: TcxGridGetGroupSummaryStyleEvent read FOnGetGroupSummaryStyle write SetOnGetGroupSummaryStyle;
  1968.     property OnGetHeaderStyle: TcxGridGetHeaderStyleEvent read FOnGetHeaderStyle write SetOnGetHeaderStyle;
  1969.   end;
  1970. {$IFNDEF BCB}
  1971.   TcxGridSummariesIndex = (siFooter, siGroupFooter, siGroup);
  1972. {$ELSE}
  1973.   TcxGridSummariesIndex = Integer;
  1974. {$ENDIF}
  1975.   TcxGridColumnSummaryClass = class of TcxGridColumnSummary;
  1976.   TcxGridColumnSummary = class(TcxCustomGridTableItemCustomOptions)
  1977.   private
  1978.     function GetDataController: TcxCustomDataController;
  1979.     function GetFormat(Index: TcxGridSummariesIndex): string;
  1980.     function GetKind(Index: TcxGridSummariesIndex): TcxSummaryKind;
  1981.     function GetSortByGroupFooterSummary: Boolean;
  1982.     function GetSortByGroupSummary: Boolean;
  1983.     procedure SetFormat(Index: TcxGridSummariesIndex; const Value: string);
  1984.     procedure SetKind(Index: TcxGridSummariesIndex; Value: TcxSummaryKind);
  1985.     procedure SetSortByGroupFooterSummary(Value: Boolean);
  1986.     procedure SetSortByGroupSummary(Value: Boolean);
  1987.   protected
  1988.     function GetSummaryItems(AIndex: TcxGridSummariesIndex): TcxDataSummaryItems;
  1989.     function GetSummaryItemsPosition(AIndex: TcxGridSummariesIndex): TcxSummaryPosition;
  1990.     property DataController: TcxCustomDataController read GetDataController;
  1991.   public
  1992.     procedure Assign(Source: TPersistent); override;
  1993.   published
  1994.     property FooterKind: TcxSummaryKind index siFooter read GetKind write SetKind stored False;
  1995.     property FooterFormat: string index siFooter read GetFormat write SetFormat stored False;
  1996.     property GroupFooterKind: TcxSummaryKind index siGroupFooter read GetKind write SetKind stored False;
  1997.     property GroupFooterFormat: string index siGroupFooter read GetFormat write SetFormat stored False;
  1998.     property GroupKind: TcxSummaryKind index siGroup read GetKind write SetKind stored False;
  1999.     property GroupFormat: string index siGroup read GetFormat write SetFormat stored False;
  2000.     property SortByGroupFooterSummary: Boolean read GetSortByGroupFooterSummary write SetSortByGroupFooterSummary stored False;
  2001.     property SortByGroupSummary: Boolean read GetSortByGroupSummary write SetSortByGroupSummary stored False;
  2002.   end;
  2003.   TcxGridColumnCompareRowValuesEvent = procedure(Sender: TcxGridColumn;
  2004.     ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: TcxEditValue;
  2005.     ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: TcxEditValue;
  2006.     var AAreEqual: Boolean) of object;
  2007.   TcxGridColumnCompareValuesEvent = procedure(Sender: TcxGridColumn;
  2008.     AProperties1: TcxCustomEditProperties; const AValue1: TcxEditValue;
  2009.     AProperties2: TcxCustomEditProperties; const AValue2: TcxEditValue; var AAreEqual: Boolean) of object;
  2010.   TcxGridColumnCustomDrawHeaderEvent = procedure(Sender: TcxGridTableView; ACanvas: TcxCanvas;
  2011.     AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean) of object;
  2012.   TcxGridGroupSummaryCellCustomDrawEvent = procedure(Sender: TObject; ACanvas: TcxCanvas;
  2013.     ARow: TcxGridGroupRow; AColumn: TcxGridColumn; ASummaryItem: TcxDataSummaryItem;
  2014.     AViewInfo: TcxCustomGridViewCellViewInfo; var ADone: Boolean) of object;
  2015.   TcxGridColumn = class(TcxCustomGridTableItem)
  2016.   private
  2017.     FFooterAlignmentHorz: TAlignment;
  2018.     FGroupSummaryAlignment: TAlignment;
  2019.     FHeaderGlyph: TBitmap;
  2020.     FHeaderGlyphAlignmentHorz: TAlignment;
  2021.     FHeaderGlyphAlignmentVert: TcxAlignmentVert;
  2022.     FIsFooterAlignmentHorzAssigned: Boolean;
  2023.     FIsGroupSummaryAlignmentAssigned: Boolean;
  2024.     FSelected: Boolean;
  2025.     FSummary: TcxGridColumnSummary;
  2026.     FOnCompareRowValuesForCellMerging: TcxGridColumnCompareRowValuesEvent;
  2027.     FOnCompareValuesForCellMerging: TcxGridColumnCompareValuesEvent;
  2028.     FOnCustomDrawFooterCell: TcxGridColumnCustomDrawHeaderEvent;
  2029.     FOnCustomDrawGroupSummaryCell: TcxGridGroupSummaryCellCustomDrawEvent;
  2030.     FOnCustomDrawHeader: TcxGridColumnCustomDrawHeaderEvent;
  2031.     FOnHeaderClick: TNotifyEvent;
  2032.     function GetController: TcxGridTableController;
  2033.     function GetFooterAlignmentHorz: TAlignment;
  2034.     function GetGridView: TcxGridTableView;
  2035.     function GetGroupSummaryAlignment: TAlignment;
  2036.     function GetIsPreview: Boolean;
  2037.     function GetOptions: TcxGridColumnOptions;
  2038.     function GetStyles: TcxGridColumnStyles;
  2039.     function GetViewData: TcxGridViewData;
  2040.     procedure SetFooterAlignmentHorz(Value: TAlignment);
  2041.     procedure SetGroupSummaryAlignment(Value: TAlignment);
  2042.     procedure SetHeaderGlyph(Value: TBitmap);
  2043.     procedure SetHeaderGlyphAlignmentHorz(Value: TAlignment);
  2044.     procedure SetHeaderGlyphAlignmentVert(Value: TcxAlignmentVert);
  2045.     procedure SetIsPreview(Value: Boolean);
  2046.     procedure SetOnCompareRowValuesForCellMerging(Value: TcxGridColumnCompareRowValuesEvent);
  2047.     procedure SetOnCompareValuesForCellMerging(Value: TcxGridColumnCompareValuesEvent);
  2048.     procedure SetOnCustomDrawFooterCell(Value: TcxGridColumnCustomDrawHeaderEvent);
  2049.     procedure SetOnCustomDrawGroupSummaryCell(Value: TcxGridGroupSummaryCellCustomDrawEvent);
  2050.     procedure SetOnCustomDrawHeader(Value: TcxGridColumnCustomDrawHeaderEvent);
  2051.     procedure SetOnHeaderClick(Value: TNotifyEvent);
  2052.     procedure SetOptions(Value: TcxGridColumnOptions);
  2053.     procedure SetSelected(Value: Boolean);
  2054.     procedure SetStyles(Value: TcxGridColumnStyles);
  2055.     procedure SetSummary(Value: TcxGridColumnSummary);
  2056.     function IsFooterAlignmentHorzStored: Boolean;
  2057.     function IsGroupSummaryAlignmentStored: Boolean;
  2058.     procedure HeaderGlyphChanged(Sender: TObject);
  2059.   protected
  2060.     // IcxStoredObject
  2061.     function GetStoredProperties(AProperties: TStrings): Boolean; override;
  2062.     procedure GetPropertyValue(const AName: string; var AValue: Variant); override;
  2063.     procedure SetPropertyValue(const AName: string; const AValue: Variant); override;
  2064.     procedure CreateSubClasses; override;
  2065.     procedure DestroySubClasses; override;
  2066.     function GetOptionsClass: TcxCustomGridTableItemOptionsClass; override;
  2067.     function GetStylesClass: TcxCustomGridTableItemStylesClass; override;
  2068.     function GetSummaryClass: TcxGridColumnSummaryClass; virtual;
  2069.     procedure AssignColumnWidths; virtual;
  2070.     procedure BestFitApplied(AFireEvents: Boolean); override;
  2071.     function CalculateBestFitWidth: Integer; override;
  2072.     function CanCellMerging: Boolean; virtual;
  2073.     function CanEdit: Boolean; override;
  2074.     function CanFocus(ARecord: TcxCustomGridRecord): Boolean; override;
  2075.     function CanHorzSize: Boolean; override;
  2076.     function CanShowGroupFooters: Boolean; virtual;
  2077.     procedure ForceWidth(Value: Integer); override;
  2078.     function GetEditValue: Variant; override;
  2079.     procedure SetEditValue(const Value: Variant); override;
  2080.     function GetFixed: Boolean; override;
  2081.     function GetIsBottom: Boolean; virtual;
  2082.     function GetIsLeft: Boolean; virtual;
  2083.     function GetIsMostBottom: Boolean; virtual;
  2084.     function GetIsMostLeft: Boolean; virtual;
  2085.     function GetIsMostRight: Boolean; virtual;
  2086.     function GetIsRight: Boolean; virtual;
  2087.     function GetIsTop: Boolean; virtual;
  2088.     function GetVisible: Boolean; override;
  2089.     function GetVisibleForCustomization: Boolean; override;
  2090.     function HasFixedWidth: Boolean; override;
  2091.     function HideOnGrouping: Boolean; virtual;
  2092.     function IsVisibleStored: Boolean; override;
  2093.     function IsVisibleForCustomizationStored: Boolean; override;
  2094.     function SupportsBeginsWithFilterOperator(ARow: TcxCustomGridRow): Boolean;
  2095.     //procedure VisibleChanged; dynamic;
  2096.     function GetHeaderViewInfoClass: TcxGridColumnHeaderViewInfoClass;
  2097.     procedure DoCustomDrawFooterCell(ACanvas: TcxCanvas; AViewInfo: TcxGridColumnHeaderViewInfo;
  2098.       var ADone: Boolean); virtual;
  2099.     procedure DoCustomDrawGroupSummaryCell(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridViewCellViewInfo;
  2100.       var ADone: Boolean); virtual;
  2101.     procedure DoCustomDrawHeader(ACanvas: TcxCanvas; AViewInfo: TcxGridColumnHeaderViewInfo;
  2102.       var ADone: Boolean); virtual;
  2103.     procedure DoHeaderClick; virtual;
  2104.     function HasCustomDrawFooterCell: Boolean;
  2105.     function HasCustomDrawGroupSummaryCell: Boolean;
  2106.     function HasCustomDrawHeader: Boolean;
  2107.     property Controller: TcxGridTableController read GetController;
  2108.     property ViewData: TcxGridViewData read GetViewData;
  2109.   public
  2110.     constructor Create(AOwner: TComponent); override;
  2111.     destructor Destroy; override;
  2112.     procedure Assign(Source: TPersistent); override;
  2113.     function DoCompareValuesForCellMerging(
  2114.       ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: TcxEditValue;
  2115.       ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: TcxEditValue): Boolean;
  2116.     procedure FocusWithSelection; override;
  2117.     function GroupBy(AGroupIndex: Integer; ACanShow: Boolean = True): Boolean;
  2118.     property GridView: TcxGridTableView read GetGridView;
  2119.     property GroupingDateRanges;
  2120.     property Hidden;  // obsolete, use VisibleForCustomization
  2121.     property IsBottom: Boolean read GetIsBottom;
  2122.     property IsLeft: Boolean read GetIsLeft;
  2123.     property IsMostBottom: Boolean read GetIsMostBottom;
  2124.     property IsMostLeft: Boolean read GetIsMostLeft;
  2125.     property IsMostRight: Boolean read GetIsMostRight;
  2126.     property IsPreview: Boolean read GetIsPreview write SetIsPreview;
  2127.     property IsRight: Boolean read GetIsRight;
  2128.     property IsTop: Boolean read GetIsTop;
  2129.     property Selected: Boolean read FSelected write SetSelected;
  2130.   published
  2131.     property BestFitMaxWidth;
  2132.     property DateTimeGrouping;
  2133.     property FooterAlignmentHorz: TAlignment read GetFooterAlignmentHorz write SetFooterAlignmentHorz stored IsFooterAlignmentHorzStored;
  2134.     property GroupIndex;
  2135.     property GroupSummaryAlignment: TAlignment read GetGroupSummaryAlignment write SetGroupSummaryAlignment stored IsGroupSummaryAlignmentStored;
  2136.     property HeaderAlignmentHorz;
  2137.     property HeaderAlignmentVert;
  2138.     property HeaderGlyph: TBitmap read FHeaderGlyph write SetHeaderGlyph;
  2139.     property HeaderGlyphAlignmentHorz: TAlignment read FHeaderGlyphAlignmentHorz write SetHeaderGlyphAlignmentHorz default taLeftJustify;
  2140.     property HeaderGlyphAlignmentVert: TcxAlignmentVert read FHeaderGlyphAlignmentVert write SetHeaderGlyphAlignmentVert default vaCenter;
  2141.     property MinWidth;
  2142.     property Options: TcxGridColumnOptions read GetOptions write SetOptions;
  2143.     property SortIndex;
  2144.     property SortOrder;
  2145.     property Styles: TcxGridColumnStyles read GetStyles write SetStyles;
  2146.     property Summary: TcxGridColumnSummary read FSummary write SetSummary;
  2147.     property VisibleForCustomization;
  2148.     property Width;
  2149.     property OnCompareRowValuesForCellMerging: TcxGridColumnCompareRowValuesEvent read FOnCompareRowValuesForCellMerging write SetOnCompareRowValuesForCellMerging;
  2150.     property OnCompareValuesForCellMerging: TcxGridColumnCompareValuesEvent read FOnCompareValuesForCellMerging write SetOnCompareValuesForCellMerging;
  2151.     property OnCustomDrawFooterCell: TcxGridColumnCustomDrawHeaderEvent read FOnCustomDrawFooterCell write SetOnCustomDrawFooterCell;
  2152.     property OnCustomDrawGroupSummaryCell: TcxGridGroupSummaryCellCustomDrawEvent read FOnCustomDrawGroupSummaryCell write SetOnCustomDrawGroupSummaryCell;
  2153.     property OnCustomDrawHeader: TcxGridColumnCustomDrawHeaderEvent read FOnCustomDrawHeader write SetOnCustomDrawHeader;
  2154.     property OnHeaderClick: TNotifyEvent read FOnHeaderClick write SetOnHeaderClick;
  2155.     property OnInitGroupingDateRanges;
  2156.   end;
  2157.   // options
  2158.   TcxGridTableBackgroundBitmaps = class(TcxCustomGridTableBackgroundBitmaps)
  2159.   protected
  2160.     function GetBitmapStyleIndex(Index: Integer): Integer; override;
  2161.   public
  2162.     procedure Assign(Source: TPersistent); override;
  2163.   published
  2164.     property Footer: TBitmap index bbFooter read GetValue write SetValue;
  2165.     property Header: TBitmap index bbHeader read GetValue write SetValue;
  2166.     property Group: TBitmap index bbGroup read GetValue write SetValue;
  2167.     property GroupByBox: TBitmap index bbGroupByBox read GetValue write SetValue;
  2168.     property Indicator: TBitmap index bbIndicator read GetValue write SetValue;
  2169.     property Preview: TBitmap index bbPreview read GetValue write SetValue;
  2170.   end;
  2171.   TcxGridTableDateTimeHandling = class(TcxCustomGridTableDateTimeHandling)
  2172.   published
  2173.     property DateFormat;
  2174.     property Grouping;
  2175.     property HourFormat; 
  2176.     property UseLongDateFormat;
  2177.     property UseShortTimeFormat;
  2178.   end;
  2179.   // behavior
  2180.   TcxGridTableOptionsBehavior = class(TcxCustomGridTableOptionsBehavior)
  2181.   private
  2182.     FColumnHeaderHints: Boolean;
  2183.     FCopyPreviewToClipboard: Boolean;
  2184.     FExpandMasterRowOnDblClick: Boolean;
  2185.     procedure SetColumnHeaderHints(Value: Boolean);
  2186.     procedure SetCopyPreviewToClipboard(Value: Boolean);
  2187.     procedure SetExpandMasterRowOnDblClick(Value: Boolean);
  2188.   public
  2189.     constructor Create(AGridView: TcxCustomGridView); override;
  2190.     procedure Assign(Source: TPersistent); override;
  2191.   published
  2192.     property BestFitMaxRecordCount;
  2193.     property ColumnHeaderHints: Boolean read FColumnHeaderHints write SetColumnHeaderHints default True;
  2194.     property CopyPreviewToClipboard: Boolean read FCopyPreviewToClipboard write SetCopyPreviewToClipboard default True;
  2195.     property ExpandMasterRowOnDblClick: Boolean read FExpandMasterRowOnDblClick write SetExpandMasterRowOnDblClick default True;
  2196.     property FocusCellOnCycle;
  2197.     property PullFocusing;
  2198.   end;
  2199.   // filter
  2200.   TcxGridTableFiltering = class(TcxCustomGridTableFiltering)
  2201.   private
  2202.     function GetColumnFilteredItemsList: Boolean;
  2203.     function GetColumnMRUItemsList: Boolean;
  2204.     function GetColumnMRUItemsListCount: Integer;
  2205.     function GetColumnPopup: TcxGridItemFilterPopupOptions;
  2206.     procedure SetColumnFilteredItemsList(Value: Boolean);
  2207.     procedure SetColumnMRUItemsList(Value: Boolean);
  2208.     procedure SetColumnMRUItemsListCount(Value: Integer);
  2209.     procedure SetColumnPopup(Value: TcxGridItemFilterPopupOptions);
  2210.   protected
  2211.     procedure DefineProperties(Filer: TFiler); override;
  2212.   public
  2213.     // obsolete - use ColumnPopup.DropDownWidth
  2214.     property ColumnPopupDropDownWidth: Integer read GetItemPopupDropDownWidth write SetItemPopupDropDownWidth;
  2215.     property DropDownWidth;
  2216.     // obsolete - use ColumnPopup.MaxDropDownItemCount
  2217.     property ColumnPopupMaxDropDownItemCount: Integer read GetItemPopupMaxDropDownItemCount write SetItemPopupMaxDropDownItemCount;
  2218.     property MaxDropDownCount;
  2219.   published
  2220.     property ColumnFilteredItemsList: Boolean read GetColumnFilteredItemsList
  2221.       write SetColumnFilteredItemsList default False;
  2222.     property ColumnMRUItemsList: Boolean read GetColumnMRUItemsList write SetColumnMRUItemsList default True;
  2223.     property ColumnMRUItemsListCount: Integer read GetColumnMRUItemsListCount
  2224.       write SetColumnMRUItemsListCount default cxGridFilterDefaultItemMRUItemsListCount;
  2225.     property ColumnPopup: TcxGridItemFilterPopupOptions read GetColumnPopup write SetColumnPopup;
  2226.   end;
  2227.   // customize
  2228.   TcxGridTableOptionsCustomize = class(TcxCustomGridTableOptionsCustomize)
  2229.   private
  2230.     FColumnHidingOnGrouping: Boolean;
  2231.     FColumnHorzSizing: Boolean;
  2232.     FDataRowSizing: Boolean;
  2233.     FGroupBySorting: Boolean;
  2234.     FGroupRowSizing: Boolean;
  2235.     function GetColumnFiltering: Boolean;
  2236.     function GetColumnGrouping: Boolean;
  2237.     function GetColumnHiding: Boolean;
  2238.     function GetColumnMoving: Boolean;
  2239.     function GetColumnSorting: Boolean;
  2240.     function GetColumnsQuickCustomization: Boolean;
  2241.     function GetColumnsQuickCustomizationMaxDropDownCount: Integer;
  2242.     function GetColumnsQuickCustomizationReordering: TcxGridQuickCustomizationReordering;
  2243.     function GetGridView: TcxGridTableView;
  2244.     procedure SetColumnFiltering(Value: Boolean);
  2245.     procedure SetColumnGrouping(Value: Boolean);
  2246.     procedure SetColumnHiding(Value: Boolean);
  2247.     procedure SetColumnHidingOnGrouping(Value: Boolean);
  2248.     procedure SetColumnHorzSizing(Value: Boolean);
  2249.     procedure SetColumnMoving(Value: Boolean);
  2250.     procedure SetColumnSorting(Value: Boolean);
  2251.     procedure SetColumnsQuickCustomization(Value: Boolean);
  2252.     procedure SetColumnsQuickCustomizationMaxDropDownCount(Value: Integer);
  2253.     procedure SetColumnsQuickCustomizationReordering(Value: TcxGridQuickCustomizationReordering);
  2254.     procedure SetDataRowSizing(Value: Boolean);
  2255.     procedure SetGroupBySorting(Value: Boolean);
  2256.     procedure SetGroupRowSizing(Value: Boolean);
  2257.   public
  2258.     constructor Create(AGridView: TcxCustomGridView); override;
  2259.     procedure Assign(Source: TPersistent); override;
  2260.     property GridView: TcxGridTableView read GetGridView;
  2261.   published
  2262.     property ColumnFiltering: Boolean read GetColumnFiltering write SetColumnFiltering default True;
  2263.     property ColumnGrouping: Boolean read GetColumnGrouping write SetColumnGrouping default True;
  2264.     property ColumnHiding: Boolean read GetColumnHiding write SetColumnHiding default False;
  2265.     property ColumnHidingOnGrouping: Boolean read FColumnHidingOnGrouping write SetColumnHidingOnGrouping default True;
  2266.     property ColumnHorzSizing: Boolean read FColumnHorzSizing write SetColumnHorzSizing default True;
  2267.     property ColumnMoving: Boolean read GetColumnMoving write SetColumnMoving default True;
  2268.     property ColumnSorting: Boolean read GetColumnSorting write SetColumnSorting default True;
  2269.     property ColumnsQuickCustomization: Boolean read GetColumnsQuickCustomization
  2270.       write SetColumnsQuickCustomization default False;
  2271.     property ColumnsQuickCustomizationMaxDropDownCount: Integer read GetColumnsQuickCustomizationMaxDropDownCount
  2272.       write SetColumnsQuickCustomizationMaxDropDownCount default 0;
  2273.     property ColumnsQuickCustomizationReordering: TcxGridQuickCustomizationReordering
  2274.       read GetColumnsQuickCustomizationReordering write SetColumnsQuickCustomizationReordering default qcrDefault;
  2275.     property DataRowSizing: Boolean read FDataRowSizing write SetDataRowSizing default False;
  2276.     property GroupBySorting: Boolean read FGroupBySorting write SetGroupBySorting default False;
  2277.     property GroupRowSizing: Boolean read FGroupRowSizing write SetGroupRowSizing default False;
  2278.   end;
  2279.   // data
  2280.   TcxGridTableOptionsData = class(TcxCustomGridTableOptionsData);
  2281.   // selection
  2282.   TcxGridTableOptionsSelection = class(TcxCustomGridTableOptionsSelection)
  2283.   private
  2284.     FCellMultiSelect: Boolean;
  2285.     procedure SetCellMultiSelect(Value: Boolean);
  2286.     function IsCellSelectStored: Boolean;
  2287.   protected
  2288.     function IsInvertSelectStored: Boolean; override;
  2289.     function IsMultiSelectStored: Boolean; override;
  2290.     procedure SetCellSelect(Value: Boolean); override;
  2291.     procedure SetInvertSelect(Value: Boolean); override;
  2292.     procedure SetMultiSelect(Value: Boolean); override;
  2293.   public
  2294.     procedure Assign(Source: TPersistent); override;
  2295.   published
  2296.     property CellMultiSelect: Boolean read FCellMultiSelect write SetCellMultiSelect default False;
  2297.     property CellSelect stored IsCellSelectStored;
  2298.   end;
  2299.   // view
  2300.   TcxGridSpecialRowOptions = class(TcxCustomGridOptions)
  2301.   private
  2302.     FInfoText: string;
  2303.     FIsInfoTextAssigned: Boolean;
  2304.     FSeparatorColor: TColor;
  2305.     FSeparatorWidth: Integer;
  2306.     FVisible: Boolean;
  2307.     function GetGridView: TcxGridTableView;
  2308.     function GetInfoText: string;
  2309.     procedure SetInfoText(const Value: string);
  2310.     procedure SetSeparatorColor(Value: TColor);
  2311.     procedure SetSeparatorWidth(Value: Integer);
  2312.     procedure SetVisible(Value: Boolean);
  2313.     function IsInfoTextStored: Boolean;
  2314.   protected
  2315.     function DefaultInfoText: string; virtual; abstract;
  2316.     function DefaultSeparatorColor: TColor; virtual;
  2317.     procedure VisibleChanged; virtual; abstract;
  2318.   public
  2319.     constructor Create(AGridView: TcxCustomGridView); override;
  2320.     procedure Assign(Source: TPersistent); override;
  2321.     function GetSeparatorColor: TColor;
  2322.     property GridView: TcxGridTableView read GetGridView;
  2323.   published
  2324.     property InfoText: string read GetInfoText write SetInfoText stored IsInfoTextStored;
  2325.     property SeparatorColor: TColor read FSeparatorColor write SetSeparatorColor default clDefault;
  2326.     property SeparatorWidth: Integer read FSeparatorWidth write SetSeparatorWidth default cxGridCustomRowSeparatorDefaultWidth;
  2327.     property Visible: Boolean read FVisible write SetVisible default False;
  2328.   end;
  2329.   TcxGridFilterRowApplyChangesMode = (fracOnCellExit, fracImmediately);
  2330.   TcxGridFilterRowOptionsClass = class of TcxGridFilterRowOptions;
  2331.   TcxGridFilterRowOptions = class(TcxGridSpecialRowOptions)
  2332.   private
  2333.     FApplyChanges: TcxGridFilterRowApplyChangesMode;
  2334.     procedure SetApplyChanges(Value: TcxGridFilterRowApplyChangesMode);
  2335.   protected
  2336.     function DefaultInfoText: string; override;
  2337.     procedure VisibleChanged; override;
  2338.   public
  2339.     procedure Assign(Source: TPersistent); override;
  2340.   published
  2341.     property ApplyChanges: TcxGridFilterRowApplyChangesMode read FApplyChanges
  2342.       write SetApplyChanges default fracOnCellExit;
  2343.   end;
  2344.   TcxGridNewItemRowOptionsClass = class of TcxGridNewItemRowOptions;
  2345.   TcxGridNewItemRowOptions = class(TcxGridSpecialRowOptions)
  2346.   protected
  2347.     function DefaultInfoText: string; override;
  2348.     procedure VisibleChanged; override;
  2349.   end;
  2350.   TcxGridGroupFootersMode = (gfInvisible, gfVisibleWhenExpanded, gfAlwaysVisible);
  2351.   TcxGridGroupRowStyle = (grsStandard, grsOffice11);
  2352.   TcxGridGroupSummaryLayout = (gslStandard, gslAlignWithColumns,
  2353.     gslAlignWithColumnsAndDistribute);
  2354.   TcxGridTableOptionsView = class(TcxCustomGridTableOptionsView)
  2355.   private
  2356.     FColumnAutoWidth: Boolean;
  2357.     FDataRowHeight: Integer;
  2358.     FExpandButtonsForEmptyDetails: Boolean;
  2359.     FFooter: Boolean;
  2360.     FFooterAutoHeight: Boolean;
  2361.     FFooterMultiSummaries: Boolean;
  2362.     FGridLineColor: TColor;
  2363.     FGridLines: TcxGridLines;
  2364.     FGroupByBox: Boolean;
  2365.     FGroupFooterMultiSummaries: Boolean;
  2366.     FGroupFooters: TcxGridGroupFootersMode;
  2367.     FGroupRowHeight: Integer;
  2368.     FGroupRowStyle: TcxGridGroupRowStyle;
  2369.     FGroupSummaryLayout: TcxGridGroupSummaryLayout;
  2370.     FHeader: Boolean;
  2371.     FHeaderHeight: Integer;
  2372.     FIndicator: Boolean;
  2373.     FIndicatorWidth: Integer;
  2374.     FPrevGroupFooters: TcxGridGroupFootersMode;
  2375.     FRowSeparatorColor: TColor;
  2376.     FRowSeparatorWidth: Integer;
  2377.     function GetExpandButtonsForEmptyDetails: Boolean;
  2378.     function GetGridView: TcxGridTableView;
  2379.     function GetHeaderAutoHeight: Boolean;
  2380.     function GetHeaderEndEllipsis: Boolean;
  2381.     function GetNewItemRow: Boolean;
  2382.     function GetNewItemRowInfoText: string;
  2383.     function GetNewItemRowSeparatorColor: TColor;
  2384.     function GetNewItemRowSeparatorWidth: Integer;
  2385.     function GetShowColumnFilterButtons: TcxGridShowItemFilterButtons;
  2386.     procedure SetColumnAutoWidth(Value: Boolean);
  2387.     procedure SetDataRowHeight(Value: Integer);
  2388.     procedure SetExpandButtonsForEmptyDetails(Value: Boolean);
  2389.     procedure SetFooter(Value: Boolean);
  2390.     procedure SetFooterAutoHeight(Value: Boolean);
  2391.     procedure SetFooterMultiSummaries(Value: Boolean);
  2392.     procedure SetGridLineColor(Value: TColor);
  2393.     procedure SetGridLines(Value: TcxGridLines);
  2394.     procedure SetGroupByBox(Value: Boolean);
  2395.     procedure SetGroupFooterMultiSummaries(Value: Boolean);
  2396.     procedure SetGroupFooters(Value: TcxGridGroupFootersMode);
  2397.     procedure SetGroupRowHeight(Value: Integer);
  2398.     procedure SetGroupRowStyle(Value: TcxGridGroupRowStyle);
  2399.     procedure SetGroupSummaryLayout(Value: TcxGridGroupSummaryLayout);
  2400.     procedure SetHeader(Value: Boolean);
  2401.     procedure SetHeaderAutoHeight(Value: Boolean);
  2402.     procedure SetHeaderEndEllipsis(Value: Boolean);
  2403.     procedure SetHeaderHeight(Value: Integer);
  2404.     procedure SetIndicator(Value: Boolean);
  2405.     procedure SetIndicatorWidth(Value: Integer);
  2406.     procedure SetNewItemRow(Value: Boolean);
  2407.     procedure SetNewItemRowInfoText(const Value: string);
  2408.     procedure SetNewItemRowSeparatorColor(Value: TColor);
  2409.     procedure SetNewItemRowSeparatorWidth(Value: Integer);
  2410.     procedure SetRowSeparatorColor(Value: TColor);
  2411.     procedure SetRowSeparatorWidth(Value: Integer);
  2412.     procedure SetShowColumnFilterButtons(Value: TcxGridShowItemFilterButtons);
  2413.     procedure ReadNewItemRow(Reader: TReader);
  2414.     procedure ReadNewItemRowInfoText(Reader: TReader);
  2415.     procedure ReadNewItemRowSeparatorColor(Reader: TReader);
  2416.     procedure ReadNewItemRowSeparatorWidth(Reader: TReader);
  2417.   protected
  2418.     procedure DefineProperties(Filer: TFiler); override;
  2419.     procedure ItemCaptionAutoHeightChanged; override;
  2420.   public
  2421.     constructor Create(AGridView: TcxCustomGridView); override;
  2422.     procedure Assign(Source: TPersistent); override;
  2423.     function CanShowFooterMultiSummaries: Boolean; 
  2424.     function CanShowGroupFooterMultiSummaries: Boolean; 
  2425.     procedure CheckDataRowHeight(var AValue: Integer); virtual;
  2426.     procedure CheckGroupRowHeight(var AValue: Integer); virtual;
  2427.     function GetGridLineColor: TColor;
  2428.     function GetGroupSummaryLayout: TcxGridGroupSummaryLayout;
  2429.     function GetRowSeparatorColor: TColor;
  2430.     property GridView: TcxGridTableView read GetGridView;
  2431.     // obsolete - use GridView.NewItemRow
  2432.     property NewItemRow: Boolean read GetNewItemRow write SetNewItemRow;
  2433.     property NewItemRowInfoText: string read GetNewItemRowInfoText write SetNewItemRowInfoText;
  2434.     property NewItemRowSeparatorColor: TColor read GetNewItemRowSeparatorColor write SetNewItemRowSeparatorColor;
  2435.     property NewItemRowSeparatorWidth: Integer read GetNewItemRowSeparatorWidth write SetNewItemRowSeparatorWidth;
  2436.     property PrevGroupFooters: TcxGridGroupFootersMode read FPrevGroupFooters;
  2437.   published
  2438.     property CellAutoHeight;
  2439.     property CellTextMaxLineCount;
  2440.     property ColumnAutoWidth: Boolean read FColumnAutoWidth write SetColumnAutoWidth default False;
  2441.     property DataRowHeight: Integer read FDataRowHeight write SetDataRowHeight default 0;
  2442.     property ExpandButtonsForEmptyDetails: Boolean read GetExpandButtonsForEmptyDetails
  2443.       write SetExpandButtonsForEmptyDetails default True;
  2444.     property Footer: Boolean read FFooter write SetFooter default False;
  2445.     property FooterAutoHeight: Boolean read FFooterAutoHeight write SetFooterAutoHeight default False;
  2446.     property FooterMultiSummaries: Boolean read FFooterMultiSummaries write SetFooterMultiSummaries default False; 
  2447.     property GridLineColor: TColor read FGridLineColor write SetGridLineColor default clDefault;
  2448.     property GridLines: TcxGridLines read FGridLines write SetGridLines default glBoth;
  2449.     property GroupByBox: Boolean read FGroupByBox write SetGroupByBox default True;
  2450.     property GroupFooterMultiSummaries: Boolean read FGroupFooterMultiSummaries write SetGroupFooterMultiSummaries default False; 
  2451.     property GroupFooters: TcxGridGroupFootersMode read FGroupFooters write SetGroupFooters default gfInvisible;
  2452.     property GroupRowHeight: Integer read FGroupRowHeight write SetGroupRowHeight default 0;
  2453.     property GroupRowStyle: TcxGridGroupRowStyle read FGroupRowStyle write SetGroupRowStyle default grsStandard;
  2454.     property GroupSummaryLayout: TcxGridGroupSummaryLayout read FGroupSummaryLayout
  2455.       write SetGroupSummaryLayout default gslStandard;
  2456.     property Header: Boolean read FHeader write SetHeader default True;
  2457.     property HeaderAutoHeight: Boolean read GetHeaderAutoHeight write SetHeaderAutoHeight default False;
  2458.     property HeaderEndEllipsis: Boolean read GetHeaderEndEllipsis write SetHeaderEndEllipsis default False;
  2459.     property HeaderHeight: Integer read FHeaderHeight write SetHeaderHeight default 0;
  2460.     property Indicator: Boolean read FIndicator write SetIndicator default False;
  2461.     property IndicatorWidth: Integer read FIndicatorWidth write SetIndicatorWidth default cxGridDefaultIndicatorWidth;
  2462.     property RowSeparatorColor: TColor read FRowSeparatorColor write SetRowSeparatorColor default clDefault;
  2463.     property RowSeparatorWidth: Integer read FRowSeparatorWidth write SetRowSeparatorWidth default 0;
  2464.     property ShowColumnFilterButtons: TcxGridShowItemFilterButtons read GetShowColumnFilterButtons
  2465.       write SetShowColumnFilterButtons default sfbWhenSelected;
  2466.   end;
  2467.   // preview
  2468.   TcxGridPreviewPlace = (ppBottom, ppTop);
  2469.   TcxGridPreviewClass = class of TcxGridPreview;
  2470.   TcxGridPreview = class(TcxCustomGridOptions)
  2471.   private
  2472.     FAutoHeight: Boolean;
  2473.     FColumn: TcxGridColumn;
  2474.     FLeftIndent: Integer;
  2475.     FMaxLineCount: Integer;
  2476.     FPlace: TcxGridPreviewPlace;
  2477.     FRightIndent: Integer;
  2478.     FVisible: Boolean;
  2479.     function GetActive: Boolean;
  2480.     function GetGridView: TcxGridTableView;
  2481.     procedure SetAutoHeight(Value: Boolean);
  2482.     procedure SetColumn(Value: TcxGridColumn);
  2483.     procedure SetLeftIndent(Value: Integer);
  2484.     procedure SetMaxLineCount(Value: Integer);
  2485.     procedure SetPlace(Value: TcxGridPreviewPlace);
  2486.     procedure SetRightIndent(Value: Integer);
  2487.     procedure SetVisible(Value: Boolean);
  2488.   protected
  2489.     procedure Notification(AComponent: TComponent; AOperation: TOperation); override;
  2490.     procedure PropertyChanged;
  2491.   public
  2492.     constructor Create(AGridView: TcxCustomGridView); override;
  2493.     procedure Assign(Source: TPersistent); override;
  2494.     property Active: Boolean read GetActive;
  2495.     property GridView: TcxGridTableView read GetGridView;
  2496.   published
  2497.     property AutoHeight: Boolean read FAutoHeight write SetAutoHeight default True;
  2498.     property Column: TcxGridColumn read FColumn write SetColumn;
  2499.     property LeftIndent: Integer read FLeftIndent write SetLeftIndent
  2500.       default cxGridPreviewDefaultLeftIndent;
  2501.     property MaxLineCount: Integer read FMaxLineCount write SetMaxLineCount
  2502.       default cxGridPreviewDefaultMaxLineCount;
  2503.     property Place: TcxGridPreviewPlace read FPlace write SetPlace default ppBottom;
  2504.     property RightIndent: Integer read FRightIndent write SetRightIndent
  2505.       default cxGridPreviewDefaultRightIndent;
  2506.     property Visible: Boolean read FVisible write SetVisible default False;
  2507.   end;
  2508.   // styles
  2509.   TcxGridGetGroupStyleEvent = procedure(Sender: TcxGridTableView; ARecord: TcxCustomGridRecord;
  2510.     ALevel: Integer; {$IFDEF BCB}var{$ELSE}out{$ENDIF} AStyle: TcxStyle) of object;
  2511.   TcxGridTableViewStyles = class(TcxCustomGridTableViewStyles)
  2512.   private
  2513.     FProcessingGroupSortedSummary: Boolean;
  2514.     FOnGetFooterStyle: TcxGridGetCellStyleEvent;
  2515.     FOnGetFooterStyleEx: TcxGridGetFooterStyleExEvent;
  2516.     FOnGetFooterSummaryStyle: TcxGridGetFooterSummaryStyleEvent;
  2517.     FOnGetGroupStyle: TcxGridGetGroupStyleEvent;
  2518.     FOnGetGroupSummaryStyle: TcxGridGetGroupSummaryStyleEvent;
  2519.     FOnGetHeaderStyle: TcxGridGetHeaderStyleEvent;
  2520.     FOnGetPreviewStyle: TcxGridGetCellStyleEvent;
  2521.     function GetGridViewValue: TcxGridTableView;
  2522.     procedure SetOnGetFooterStyle(Value: TcxGridGetCellStyleEvent);
  2523.     procedure SetOnGetFooterStyleEx(Value: TcxGridGetFooterStyleExEvent);
  2524.     procedure SetOnGetFooterSummaryStyle(Value: TcxGridGetFooterSummaryStyleEvent);
  2525.     procedure SetOnGetGroupStyle(Value: TcxGridGetGroupStyleEvent);
  2526.     procedure SetOnGetGroupSummaryStyle(Value: TcxGridGetGroupSummaryStyleEvent);
  2527.     procedure SetOnGetHeaderStyle(Value: TcxGridGetHeaderStyleEvent);
  2528.     procedure SetOnGetPreviewStyle(Value: TcxGridGetCellStyleEvent);
  2529.   protected
  2530.     procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override;
  2531.   public
  2532.     procedure Assign(Source: TPersistent); override;
  2533.     procedure GetCellContentParams(ARecord: TcxCustomGridRecord; AItem: TObject;
  2534.       out AParams: TcxViewParams); override;
  2535.     procedure GetContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
  2536.       out AParams: TcxViewParams); override;
  2537.     procedure GetFooterCellParams(ARow: TcxCustomGridRow; AColumn: TcxGridColumn;
  2538.       AFooterGroupLevel: Integer; ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); virtual;
  2539.     procedure GetFooterParams(ARow: TcxCustomGridRow; AColumn: TcxGridColumn;
  2540.       AFooterGroupLevel: Integer; ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); virtual;
  2541.     procedure GetGroupParams(ARecord: TcxCustomGridRecord; ALevel: Integer;
  2542.       out AParams: TcxViewParams); virtual;
  2543.     procedure GetGroupSummaryCellContentParams(ARow: TcxGridGroupRow;
  2544.       ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); virtual;
  2545.     procedure GetGroupSummaryCellParams(ARow: TcxGridGroupRow;
  2546.       ASummaryItem: TcxDataSummaryItem; out AParams: TcxViewParams); virtual;
  2547.     procedure GetGroupSummaryParams(ARow: TcxGridGroupRow; ASummaryItem: TcxDataSummaryItem;
  2548.       out AParams: TcxViewParams); virtual;
  2549.     procedure GetHeaderParams(AItem: TcxGridColumn; out AParams: TcxViewParams); virtual;
  2550.     procedure GetPreviewParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
  2551.       out AParams: TcxViewParams); virtual;
  2552.     procedure GetRecordContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
  2553.       out AParams: TcxViewParams); override;
  2554.     property GridView: TcxGridTableView read GetGridViewValue;
  2555.   published
  2556.     property FilterRowInfoText: TcxStyle index vsFilterRowInfoText read GetValue write SetValue;
  2557.     property Footer: TcxStyle index vsFooter read GetValue write SetValue;
  2558.     property Group: TcxStyle index vsGroup read GetValue write SetValue;
  2559.     property GroupByBox: TcxStyle index vsGroupByBox read GetValue write SetValue;
  2560.     property GroupFooterSortedSummary: TcxStyle index vsGroupFooterSortedSummary read GetValue write SetValue;
  2561.     property GroupSortedSummary: TcxStyle index vsGroupSortedSummary read GetValue write SetValue;
  2562.     property GroupSummary: TcxStyle index vsGroupSummary read GetValue write SetValue;
  2563.     property Header: TcxStyle index vsHeader read GetValue write SetValue;
  2564.     property Indicator: TcxStyle index vsIndicator read GetValue write SetValue;
  2565.     property NewItemRowInfoText: TcxStyle index vsNewItemRowInfoText read GetValue write SetValue;
  2566.     property Preview: TcxStyle index vsPreview read GetValue write SetValue;
  2567.     property StyleSheet;
  2568.     property OnGetFooterStyle: TcxGridGetCellStyleEvent read FOnGetFooterStyle write SetOnGetFooterStyle;
  2569.     property OnGetFooterStyleEx: TcxGridGetFooterStyleExEvent read FOnGetFooterStyleEx write SetOnGetFooterStyleEx;
  2570.     property OnGetFooterSummaryStyle: TcxGridGetFooterSummaryStyleEvent read FOnGetFooterSummaryStyle write SetOnGetFooterSummaryStyle;
  2571.     property OnGetGroupStyle: TcxGridGetGroupStyleEvent read FOnGetGroupStyle write SetOnGetGroupStyle;
  2572.     property OnGetGroupSummaryStyle: TcxGridGetGroupSummaryStyleEvent read FOnGetGroupSummaryStyle write SetOnGetGroupSummaryStyle;
  2573.     property OnGetHeaderStyle: TcxGridGetHeaderStyleEvent read FOnGetHeaderStyle write SetOnGetHeaderStyle;
  2574.     property OnGetPreviewStyle: TcxGridGetCellStyleEvent read FOnGetPreviewStyle write SetOnGetPreviewStyle;
  2575.   end;
  2576.   TcxGridTableViewStyleSheet = class(TcxCustomStyleSheet)
  2577.   private
  2578.     function GetStylesValue: TcxGridTableViewStyles;
  2579.     procedure SetStylesValue(Value: TcxGridTableViewStyles);
  2580.   public
  2581.     class function GetStylesClass: TcxCustomStylesClass; override;
  2582.   published
  2583.     property Styles: TcxGridTableViewStyles read GetStylesValue write SetStylesValue;
  2584.   end;
  2585.   // grid view
  2586.   TcxGridTableSummaryGroupItemLink = class(TcxDataSummaryGroupItemLink,
  2587.     {$IFNDEF DELPHI6}IUnknown,{$ENDIF} IcxStoredObject)
  2588.   private
  2589.     function GetColumn: TcxGridColumn;
  2590.     procedure SetColumn(Value: TcxGridColumn);
  2591.     function GetGridView: TcxGridTableView;
  2592.   protected
  2593.     // IInterface
  2594.     function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
  2595.     function _AddRef: Integer; stdcall;
  2596.     function _Release: Integer; stdcall;
  2597.     // IcxStoredObject
  2598.     function GetObjectName: string;
  2599.     function GetProperties(AProperties: TStrings): Boolean;
  2600.     procedure GetPropertyValue(const AName: string; var AValue: Variant);
  2601.     procedure SetPropertyValue(const AName: string; const AValue: Variant);
  2602.     property GridView: TcxGridTableView read GetGridView;
  2603.   published
  2604.     property Column: TcxGridColumn read GetColumn write SetColumn;
  2605.   end;
  2606.   IcxGridSummaryItem = interface
  2607.     ['{6F9A0C3E-E33F-4E77-9357-82F1D19CDB67}']
  2608.     function GetDisplayText: string;
  2609.     function GetVisibleForCustomization: Boolean;
  2610.     property DisplayText: string read GetDisplayText;
  2611.     property VisibleForCustomization: Boolean read GetVisibleForCustomization;
  2612.   end;
  2613.   TcxGridTableSummaryItem = class(TcxDataSummaryItem,
  2614.     {$IFNDEF DELPHI6}IUnknown,{$ENDIF} IcxStoredObject, IcxGridSummaryItem)
  2615.   private
  2616.     FDisplayText: string;
  2617.     FVisibleForCustomization: Boolean;
  2618.     function GetColumn: TcxGridColumn;
  2619.     function GetGridView: TcxGridTableView;
  2620.     procedure SetColumn(Value: TcxGridColumn);
  2621.     procedure SetDisplayText(const Value: string);
  2622.     procedure SetVisibleForCustomization(Value: Boolean);
  2623.   protected
  2624.     // IInterface
  2625.     function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
  2626.     function _AddRef: Integer; stdcall;
  2627.     function _Release: Integer; stdcall;
  2628.     // IcxStoredObject
  2629.     function GetObjectName: string;
  2630.     function GetProperties(AProperties: TStrings): Boolean;
  2631.     procedure GetPropertyValue(const AName: string; var AValue: Variant);
  2632.     procedure SetPropertyValue(const AName: string; const AValue: Variant);
  2633.     // IcxGridSummaryItem
  2634.     function GetDisplayText: string;
  2635.     function GetVisibleForCustomization: Boolean;
  2636.     property GridView: TcxGridTableView read GetGridView;
  2637.   public
  2638.     constructor Create(Collection: TCollection); override;
  2639.     procedure Assign(Source: TPersistent); override;
  2640.   published
  2641.     property Column: TcxGridColumn read GetColumn write SetColumn;
  2642.     property DisplayText: string read FDisplayText write SetDisplayText;
  2643.     property Sorted;
  2644.     property VisibleForCustomization: Boolean read FVisibleForCustomization
  2645.       write SetVisibleForCustomization default True;
  2646.   end;
  2647.   TcxGridColumnEvent = procedure(Sender: TcxGridTableView; AColumn: TcxGridColumn) of object;
  2648.   TcxGridIndicatorCellCustomDrawEvent = procedure(Sender: TcxGridTableView;
  2649.     ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean) of object;
  2650.   TcxGridTableView = class(TcxCustomGridTableView)
  2651.   private
  2652.     FAllowCellMerging: Boolean;
  2653.     FFilterRow: TcxGridFilterRowOptions;
  2654.     FNewItemRow: TcxGridNewItemRowOptions;
  2655.     FPreview: TcxGridPreview;
  2656.     FOnColumnHeaderClick: TcxGridColumnEvent;
  2657.     FOnColumnPosChanged: TcxGridColumnEvent;
  2658.     FOnColumnSizeChanged: TcxGridColumnEvent;
  2659.     FOnCustomDrawColumnHeader: TcxGridColumnCustomDrawHeaderEvent;
  2660.     FOnCustomDrawFooterCell: TcxGridColumnCustomDrawHeaderEvent;
  2661.     FOnCustomDrawGroupCell: TcxGridTableCellCustomDrawEvent;
  2662.     FOnCustomDrawGroupSummaryCell: TcxGridGroupSummaryCellCustomDrawEvent;
  2663.     FOnCustomDrawIndicatorCell: TcxGridIndicatorCellCustomDrawEvent;
  2664.     FOnLeftPosChanged: TNotifyEvent;
  2665.     function GetBackgroundBitmaps: TcxGridTableBackgroundBitmaps;
  2666.     function GetColumn(Index: Integer): TcxGridColumn;
  2667.     function GetColumnCount: Integer;
  2668.     function GetController: TcxGridTableController;
  2669.     function GetDataController: TcxGridDataController;
  2670.     function GetDateTimeHandling: TcxGridTableDateTimeHandling;
  2671.     function GetFiltering: TcxGridTableFiltering;
  2672.     function GetGroupedColumn(Index: Integer): TcxGridColumn;
  2673.     function GetGroupedColumnCount: Integer;
  2674.     function GetOptionsBehavior: TcxGridTableOptionsBehavior;
  2675.     function GetOptionsCustomize: TcxGridTableOptionsCustomize;
  2676.     function GetOptionsData: TcxGridTableOptionsData;
  2677.     function GetOptionsSelection: TcxGridTableOptionsSelection;
  2678.     function GetOptionsView: TcxGridTableOptionsView;
  2679.     function GetPainter: TcxGridTablePainter;
  2680.     function GetStyles: TcxGridTableViewStyles;
  2681.     function GetViewData: TcxGridViewData;
  2682.     function GetViewInfo: TcxGridTableViewInfo;
  2683.     function GetVisibleColumn(Index: Integer): TcxGridColumn;
  2684.     function GetVisibleColumnCount: Integer;
  2685.     procedure SetBackgroundBitmaps(Value: TcxGridTableBackgroundBitmaps);
  2686.     procedure SetColumn(Index: Integer; Value: TcxGridColumn);
  2687.     procedure SetDataController(Value: TcxGridDataController);
  2688.     procedure SetDateTimeHandling(Value: TcxGridTableDateTimeHandling);
  2689.     procedure SetFiltering(Value: TcxGridTableFiltering);
  2690.     procedure SetFilterRow(Value: TcxGridFilterRowOptions);
  2691.     procedure SetNewItemRow(Value: TcxGridNewItemRowOptions);
  2692.     procedure SetOnColumnHeaderClick(Value: TcxGridColumnEvent);
  2693.     procedure SetOnColumnPosChanged(Value: TcxGridColumnEvent);
  2694.     procedure SetOnColumnSizeChanged(Value: TcxGridColumnEvent);
  2695.     procedure SetOnCustomDrawColumnHeader(Value: TcxGridColumnCustomDrawHeaderEvent);
  2696.     procedure SetOnCustomDrawFooterCell(Value: TcxGridColumnCustomDrawHeaderEvent);
  2697.     procedure SetOnCustomDrawGroupCell(Value: TcxGridTableCellCustomDrawEvent);
  2698.     procedure SetOnCustomDrawGroupSummaryCell(Value: TcxGridGroupSummaryCellCustomDrawEvent);
  2699.     procedure SetOnCustomDrawIndicatorCell(Value: TcxGridIndicatorCellCustomDrawEvent);
  2700.     procedure SetOnLeftPosChanged(Value: TNotifyEvent);
  2701.     procedure SetOptionsBehavior(Value: TcxGridTableOptionsBehavior);
  2702.     procedure SetOptionsCustomize(Value: TcxGridTableOptionsCustomize);
  2703.     procedure SetOptionsData(Value: TcxGridTableOptionsData);
  2704.     procedure SetOptionsSelection(Value: TcxGridTableOptionsSelection);
  2705.     procedure SetOptionsView(Value: TcxGridTableOptionsView);
  2706.     procedure SetPreview(Value: TcxGridPreview);
  2707.     procedure SetStyles(Value: TcxGridTableViewStyles);
  2708.   protected
  2709.     // IcxStoredObject
  2710.     function GetProperties(AProperties: TStrings): Boolean; override;
  2711.     procedure GetPropertyValue(const AName: string; var AValue: Variant); override;
  2712.     procedure SetPropertyValue(const AName: string; const AValue: Variant); override;
  2713.     // IcxGridViewLayoutEditorSupport - for design-time layout editor
  2714.     procedure AssignLayout(ALayoutView: TcxCustomGridView); override;
  2715.     procedure BeforeEditLayout(ALayoutView: TcxCustomGridView); override;
  2716.     function GetLayoutCustomizationFormButtonCaption: string; override;
  2717.     procedure CreateOptions; override;
  2718.     procedure DestroyOptions; override;
  2719.     function CanCellMerging: Boolean; virtual;
  2720.     function CanOffset(ARecordCountDelta: Integer): Boolean; override;
  2721.     function CanOffsetHorz: Boolean; virtual;
  2722.     procedure DetailDataChanged(ADetail: TcxCustomGridView); override;
  2723.     procedure DoAssign(ASource: TcxCustomGridView); override;
  2724.     procedure GetItemsListForClipboard(AItems: TList; ACopyAll: Boolean); override;
  2725.     function GetResizeOnBoundsChange: Boolean; override;
  2726.     function HasCellMerging: Boolean;
  2727.     function IsEqualHeightRecords: Boolean; override;
  2728.     function IsRecordHeightDependsOnData: Boolean; override;
  2729.     function UpdateOnDetailDataChange(ADetail: TcxCustomGridView): Boolean; virtual;
  2730.     function GetControllerClass: TcxCustomGridControllerClass; override;
  2731.     function GetDataControllerClass: TcxCustomDataControllerClass; override;
  2732.     function GetPainterClass: TcxCustomGridPainterClass; override;
  2733.     function GetViewDataClass: TcxCustomGridViewDataClass; override;
  2734.     function GetViewInfoClass: TcxCustomGridViewInfoClass; override;
  2735.     function GetBackgroundBitmapsClass: TcxCustomGridBackgroundBitmapsClass; override;
  2736.     function GetDateTimeHandlingClass: TcxCustomGridTableDateTimeHandlingClass; override;
  2737.     function GetFilteringClass: TcxCustomGridTableFilteringClass; override;
  2738.     function GetFilterRowOptionsClass: TcxGridFilterRowOptionsClass; virtual;
  2739.     function GetNewItemRowOptionsClass: TcxGridNewItemRowOptionsClass; virtual;
  2740.     function GetOptionsBehaviorClass: TcxCustomGridOptionsBehaviorClass; override;
  2741.     function GetOptionsCustomizeClass: TcxCustomGridTableOptionsCustomizeClass; override;
  2742.     function GetOptionsDataClass: TcxCustomGridOptionsDataClass; override;
  2743.     function GetOptionsSelectionClass: TcxCustomGridOptionsSelectionClass; override;
  2744.     function GetOptionsViewClass: TcxCustomGridOptionsViewClass; override;
  2745.     function GetPreviewClass: TcxGridPreviewClass; virtual;
  2746.     function GetStylesClass: TcxCustomGridViewStylesClass; override;
  2747.     function GetSummaryGroupItemLinkClass: TcxDataSummaryGroupItemLinkClass; override;
  2748.     function GetSummaryItemClass: TcxDataSummaryItemClass; override;
  2749.     function GetItemClass: TcxCustomGridTableItemClass; override;
  2750.     procedure ItemVisibilityChanged(AItem: TcxCustomGridTableItem; Value: Boolean); override;
  2751.     function CalculateDataCellSelected(ARecord: TcxCustomGridRecord;
  2752.       AItem: TcxCustomGridTableItem; AUseViewInfo: Boolean;
  2753.       ACellViewInfo: TcxGridTableCellViewInfo): Boolean; override;
  2754.     procedure DoColumnHeaderClick(AColumn: TcxGridColumn); virtual;
  2755.     procedure DoColumnPosChanged(AColumn: TcxGridColumn); virtual;
  2756.     procedure DoColumnSizeChanged(AColumn: TcxGridColumn); virtual;
  2757.     procedure DoCustomDrawColumnHeader(ACanvas: TcxCanvas; AViewInfo: TcxGridColumnHeaderViewInfo;
  2758.       var ADone: Boolean); virtual;
  2759.     procedure DoCustomDrawFooterCell(ACanvas: TcxCanvas; AViewInfo: TcxGridColumnHeaderViewInfo;
  2760.       var ADone: Boolean); virtual;
  2761.     procedure DoCustomDrawGroupCell(ACanvas: TcxCanvas; AViewInfo: TcxGridTableCellViewInfo;
  2762.       var ADone: Boolean); virtual;
  2763.     procedure DoCustomDrawGroupSummaryCell(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridViewCellViewInfo;
  2764.       var ADone: Boolean); virtual;
  2765.     procedure DoCustomDrawIndicatorCell(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo;
  2766.       var ADone: Boolean); virtual;
  2767.     procedure DoLeftPosChanged; virtual;
  2768.     function HasCustomDrawColumnHeader: Boolean;
  2769.     function HasCustomDrawFooterCell: Boolean;
  2770.     function HasCustomDrawGroupCell: Boolean;
  2771.     function HasCustomDrawGroupSummaryCell: Boolean;
  2772.     function HasCustomDrawIndicatorCell: Boolean;
  2773.     property AllowCellMerging: Boolean read FAllowCellMerging write FAllowCellMerging;
  2774.   public
  2775.     constructor Create(AOwner: TComponent); override;
  2776.     function CreateColumn: TcxGridColumn;
  2777.     // for extended lookup edit
  2778.     class function CanBeLookupList: Boolean; override;
  2779.     property ColumnCount: Integer read GetColumnCount;
  2780.     property Columns[Index: Integer]: TcxGridColumn read GetColumn write SetColumn;
  2781.     property Controller: TcxGridTableController read GetController;
  2782.     property GroupedColumnCount: Integer read GetGroupedColumnCount;
  2783.     property GroupedColumns[Index: Integer]: TcxGridColumn read GetGroupedColumn;
  2784.     property Painter: TcxGridTablePainter read GetPainter;
  2785.     property ViewData: TcxGridViewData read GetViewData;
  2786.     property ViewInfo: TcxGridTableViewInfo read GetViewInfo;
  2787.     property VisibleColumnCount: Integer read GetVisibleColumnCount;
  2788.     property VisibleColumns[Index: Integer]: TcxGridColumn read GetVisibleColumn;
  2789.   published
  2790.     property BackgroundBitmaps: TcxGridTableBackgroundBitmaps read GetBackgroundBitmaps write SetBackgroundBitmaps;
  2791.     property DataController: TcxGridDataController read GetDataController write SetDataController;
  2792.     property DateTimeHandling: TcxGridTableDateTimeHandling read GetDateTimeHandling write SetDateTimeHandling;
  2793.     property Filtering: TcxGridTableFiltering read GetFiltering write SetFiltering;
  2794.     property FilterRow: TcxGridFilterRowOptions read FFilterRow write SetFilterRow;
  2795.     property NewItemRow: TcxGridNewItemRowOptions read FNewItemRow write SetNewItemRow;
  2796.     property OptionsBehavior: TcxGridTableOptionsBehavior read GetOptionsBehavior write SetOptionsBehavior;
  2797.     property OptionsCustomize: TcxGridTableOptionsCustomize read GetOptionsCustomize write SetOptionsCustomize;
  2798.     property OptionsData: TcxGridTableOptionsData read GetOptionsData write SetOptionsData;
  2799.     property OptionsSelection: TcxGridTableOptionsSelection read GetOptionsSelection write SetOptionsSelection;
  2800.     property OptionsView: TcxGridTableOptionsView read GetOptionsView write SetOptionsView;
  2801.     property Preview: TcxGridPreview read FPreview write SetPreview;
  2802.     property Styles: TcxGridTableViewStyles read GetStyles write SetStyles ;
  2803.     property OnColumnHeaderClick: TcxGridColumnEvent read FOnColumnHeaderClick write SetOnColumnHeaderClick;
  2804.     property OnColumnPosChanged: TcxGridColumnEvent read FOnColumnPosChanged write SetOnColumnPosChanged;
  2805.     property OnColumnSizeChanged: TcxGridColumnEvent read FOnColumnSizeChanged write SetOnColumnSizeChanged;
  2806.     property OnCustomDrawColumnHeader: TcxGridColumnCustomDrawHeaderEvent read FOnCustomDrawColumnHeader write SetOnCustomDrawColumnHeader;
  2807.     property OnCustomDrawFooterCell: TcxGridColumnCustomDrawHeaderEvent read FOnCustomDrawFooterCell write SetOnCustomDrawFooterCell;
  2808.     property OnCustomDrawGroupCell: TcxGridTableCellCustomDrawEvent read FOnCustomDrawGroupCell write SetOnCustomDrawGroupCell;
  2809.     property OnCustomDrawGroupSummaryCell: TcxGridGroupSummaryCellCustomDrawEvent read FOnCustomDrawGroupSummaryCell write SetOnCustomDrawGroupSummaryCell;
  2810.     property OnCustomDrawIndicatorCell: TcxGridIndicatorCellCustomDrawEvent read FOnCustomDrawIndicatorCell write SetOnCustomDrawIndicatorCell;
  2811.     property OnCustomization;
  2812.     property OnInitGroupingDateRanges;
  2813.     property OnLeftPosChanged: TNotifyEvent read FOnLeftPosChanged write SetOnLeftPosChanged;
  2814.   end;
  2815.   { TcxGridColumnAccess }
  2816.   TcxGridColumnAccess = class
  2817.   public
  2818.     class function CanCellMerging(AInstance: TcxGridColumn): Boolean;
  2819.     class function CanShowGroupFooters(AInstance: TcxGridColumn): Boolean;
  2820.     class procedure DoCustomDrawGroupSummaryCell(AInstance: TcxGridColumn;
  2821.       ACanvas: TcxCanvas; AViewInfo: TcxCustomGridViewCellViewInfo; var ADone: Boolean); virtual;
  2822.     class function HasCustomDrawGroupSummaryCell(AInstance: TcxGridColumn): Boolean;
  2823.   end;
  2824.   { TcxGridTableViewAccess }
  2825.   TcxGridTableViewAccess = class
  2826.   public
  2827.     class procedure DoColumnPosChanged(AInstance: TcxGridTableView;
  2828.       AColumn: TcxGridColumn);
  2829.     class procedure DoCustomDrawGroupCell(AInstance: TcxGridTableView;
  2830.       ACanvas: TcxCanvas; AViewInfo: TcxGridTableCellViewInfo; var ADone: Boolean);
  2831.     class procedure DoCustomDrawGroupSummaryCell(AInstance: TcxGridTableView;
  2832.       ACanvas: TcxCanvas; AViewInfo: TcxCustomGridViewCellViewInfo; var ADone: Boolean); virtual;
  2833.     class function HasCustomDrawGroupCell(AInstance: TcxGridTableView): Boolean;
  2834.     class function HasCustomDrawGroupSummaryCell(AInstance: TcxGridTableView): Boolean;
  2835.   end;
  2836. implementation
  2837. uses
  2838.   SysUtils, Math, dxOffice11, cxVariants, cxDataUtils, cxFilterControlUtils,
  2839.   cxLibraryConsts, cxGridRows, cxGridStrs;
  2840. const
  2841.   GroupByBoxLeftOffset = 6;
  2842.   GroupByBoxTopOffset = 8;
  2843.   GroupByBoxHorOffset = 4;
  2844.   GroupByBoxLineVerOffset = 4;
  2845.   GroupByBoxColumnWidth = 100;
  2846.   GroupByBoxLineWidth = 1;
  2847.   GroupByBoxLineColor = clBtnText;
  2848.   HScrollDelta = 10;
  2849.   FooterSeparatorWidth = 1;
  2850.   TopIndexNone = -2;
  2851.   RowIndexNone = -1;
  2852.   ColumnHeaderHitTestCodes = [htColumnHeader];
  2853.   ColumnHeaderMovingZoneSize = 15;
  2854.   ColumnSizingMarkWidth = 1;
  2855.   RowSizingMarkWidth = 1;
  2856.   ScrollHotZoneWidth = 15;
  2857. type
  2858.   TcxCustomGridAccess = class(TcxCustomGrid);
  2859. { TcxGridGroupByBoxHitTest }
  2860. class function TcxGridGroupByBoxHitTest.GetHitTestCode: Integer;
  2861. begin
  2862.   Result := htGroupByBox;
  2863. end;
  2864. { TcxGridColumnHeaderHitTest }
  2865. class function TcxGridColumnHeaderHitTest.GetHitTestCode: Integer;
  2866. begin
  2867.   Result := htColumnHeader;
  2868. end;
  2869. function TcxGridColumnHeaderHitTest.DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass;
  2870. begin
  2871.   if Column.CanMove then
  2872.     Result := TcxGridTableView(GridView).Controller.GetColumnHeaderDragAndDropObjectClass
  2873.   else
  2874.     Result := nil;
  2875. end;
  2876. { TcxGridColumnHeaderHorzSizingEdgeHitTest }
  2877. class function TcxGridColumnHeaderHorzSizingEdgeHitTest.GetHitTestCode: Integer;
  2878. begin
  2879.   Result := htColumnHeaderHorzSizingEdge;
  2880. end;
  2881. function TcxGridColumnHeaderHorzSizingEdgeHitTest.Cursor: TCursor;
  2882. begin
  2883.   Result := crcxGridHorzSize;
  2884. end;
  2885. function TcxGridColumnHeaderHorzSizingEdgeHitTest.DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass;
  2886. begin
  2887.   Result := TcxGridColumnHorzSizingObject;
  2888. end;
  2889. { TcxGridColumnHeaderFilterButtonHitTest }
  2890. class function TcxGridColumnHeaderFilterButtonHitTest.GetHitTestCode: Integer;
  2891. begin
  2892.   Result := htColumnHeaderFilterButton;
  2893. end;
  2894. { TcxGridHeaderHitTest }
  2895. class function TcxGridHeaderHitTest.GetHitTestCode: Integer;
  2896. begin
  2897.   Result := htHeader;
  2898. end;
  2899. { TcxGridFooterHitTest }
  2900. class function TcxGridFooterHitTest.GetHitTestCode: Integer;
  2901. begin
  2902.   Result := htFooter;
  2903. end;
  2904. { TcxGridFooterCellHitTest }
  2905. class function TcxGridFooterCellHitTest.GetHitTestCode: Integer;
  2906. begin
  2907.   Result := htFooterCell;
  2908. end;
  2909. { TcxGridGroupFooterHitTest }
  2910. class function TcxGridGroupFooterHitTest.GetHitTestCode: Integer;
  2911. begin
  2912.   Result := htGroupFooter;
  2913. end;
  2914. { TcxGridGroupFooterCellHitTest }
  2915. class function TcxGridGroupFooterCellHitTest.GetHitTestCode: Integer;
  2916. begin
  2917.   Result := htGroupFooterCell;
  2918. end;
  2919. { TcxGridRowIndicatorHitTest }
  2920. class function TcxGridRowIndicatorHitTest.GetHitTestCode: Integer;
  2921. begin
  2922.   Result := htRowIndicator;
  2923. end;
  2924. function TcxGridRowIndicatorHitTest.Cursor: TCursor;
  2925. begin
  2926.   if MultiSelect then
  2927.     Result := crcxGridSelectRow
  2928.   else
  2929.     Result := inherited Cursor;
  2930. end;
  2931. { TcxGridRowSizingEdgeHitTest }
  2932. class function TcxGridRowSizingEdgeHitTest.GetHitTestCode: Integer;
  2933. begin
  2934.   Result := htRowSizingEdge;
  2935. end;
  2936. function TcxGridRowSizingEdgeHitTest.Cursor: TCursor;
  2937. begin
  2938.   Result := crcxGridVertSize;
  2939. end;
  2940. function TcxGridRowSizingEdgeHitTest.DragAndDropObjectClass: TcxCustomGridDragAndDropObjectClass;
  2941. begin
  2942.   Result := TcxGridRowSizingObject;
  2943. end;
  2944. { TcxGridIndicatorHitTest }
  2945. class function TcxGridIndicatorHitTest.GetHitTestCode: Integer;
  2946. begin
  2947.   Result := htIndicator;
  2948. end;
  2949. { TcxGridIndicatorHeaderHitTest }
  2950. class function TcxGridIndicatorHeaderHitTest.GetHitTestCode: Integer;
  2951. begin
  2952.   Result := htIndicatorHeader;
  2953. end;
  2954. { TcxGridRowLevelIndentHitTest }
  2955. class function TcxGridRowLevelIndentHitTest.GetHitTestCode: Integer;
  2956. begin
  2957.   Result := htRowLevelIndent;
  2958. end;
  2959. class function TcxGridRowLevelIndentHitTest.CanClick: Boolean;
  2960. begin
  2961.   Result := False;
  2962. end;
  2963. { TcxGridGroupSummaryHitTest }
  2964. function TcxGridGroupSummaryHitTest.GetColumn: TcxGridColumn;
  2965. begin
  2966.   if SummaryItem = nil then
  2967.     Result := nil
  2968.   else
  2969.     Result := SummaryItem.ItemLink as TcxGridColumn;
  2970. end;
  2971. class function TcxGridGroupSummaryHitTest.GetHitTestCode: Integer;
  2972. begin
  2973.   Result := htGroupSummary;
  2974. end;
  2975. { TcxCustomGridRow }
  2976. function TcxCustomGridRow.GetAsGroupRow: TcxGridGroupRow;
  2977. begin
  2978.   Result := Self as TcxGridGroupRow;
  2979. end;
  2980. function TcxCustomGridRow.GetAsMasterDataRow: TcxGridMasterDataRow;
  2981. begin
  2982.   Result := Self as TcxGridMasterDataRow;
  2983. end;
  2984. function TcxCustomGridRow.GetGridView: TcxGridTableView;
  2985. begin
  2986.   Result := TcxGridTableView(inherited GridView);
  2987. end;
  2988. function TcxCustomGridRow.GetGridViewLevel: TcxGridLevel;
  2989. begin
  2990.   Result := TcxGridLevel(GridView.Level);
  2991. end;
  2992. function TcxCustomGridRow.GetIsFilterRow: Boolean;
  2993. begin
  2994.   Result := ViewData.FilterRow = Self;
  2995. end;
  2996. function TcxCustomGridRow.GetIsNewItemRow: Boolean;
  2997. begin
  2998.   Result := IsNewItemRecord;
  2999. end;
  3000. function TcxCustomGridRow.GetViewData: TcxGridViewData;
  3001. begin
  3002.   Result := TcxGridViewData(inherited ViewData);
  3003. end;
  3004. procedure TcxCustomGridRow.KeyDown(var Key: Word; Shift: TShiftState);
  3005. begin
  3006.   inherited;
  3007.   case Key of
  3008.     VK_LEFT:
  3009.       if Expandable and Expanded then
  3010.       begin
  3011.         Expanded := False;
  3012.         Key := 0;
  3013.       end;
  3014.     VK_RIGHT:
  3015.       if Expandable and not Expanded then
  3016.       begin
  3017.         Expanded := True;
  3018.         Key := 0;
  3019.       end;
  3020.     VK_MULTIPLY:
  3021.       if Expandable then
  3022.       begin
  3023.         GridView.Controller.EatKeyPress := True;
  3024.         Expand(True);
  3025.         Key := 0;
  3026.       end;
  3027.   end;
  3028. end;
  3029. function TcxCustomGridRow.ExpandOnDblClick: Boolean;
  3030. begin
  3031.   Result := Expandable;
  3032. end;
  3033. function TcxCustomGridRow.SupportsCellMultiSelect: Boolean;
  3034. begin
  3035.   Result := False;
  3036. end;
  3037. { TcxGridDataRow }
  3038. function TcxGridDataRow.GetHasCells: Boolean;
  3039. begin
  3040.   Result := True;
  3041. end;
  3042. function TcxGridDataRow.GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass;
  3043. begin
  3044.   Result := TcxGridTableViewInfoCacheItem;
  3045. end;
  3046. function TcxGridDataRow.GetViewInfoClass: TcxCustomGridRecordViewInfoClass;
  3047. begin
  3048.   Result := TcxGridDataRowViewInfo;
  3049. end;
  3050. function TcxGridDataRow.SupportsCellMultiSelect: Boolean;
  3051. begin
  3052.   Result := True;
  3053. end;
  3054. { TcxGridNewItemRow }
  3055. function TcxGridNewItemRow.SupportsCellMultiSelect: Boolean;
  3056. begin
  3057.   Result := False;
  3058. end;
  3059. { TcxGridFilterRow }
  3060. destructor TcxGridFilterRow.Destroy;
  3061. begin
  3062.   Selected := False;
  3063.   inherited;
  3064. end;
  3065. function TcxGridFilterRow.GetFilterCriteriaItem(Index: Integer): TcxFilterCriteriaItem;
  3066. begin
  3067.   Result := GridView.Columns[Index].DataBinding.FilterCriteriaItem;
  3068.   if (Result <> nil) and not IsFilterOperatorSupported(Result.OperatorKind, Result.Value) then
  3069.     Result := nil;
  3070. end;
  3071. procedure TcxGridFilterRow.RefreshRecordInfo;
  3072. begin
  3073.   with RecordInfo do
  3074.   begin
  3075.     Expanded := False;
  3076.     Level := 0;
  3077.     RecordIndex := -1;
  3078.   end
  3079. end;
  3080. function TcxGridFilterRow.GetSelected: Boolean;
  3081. begin
  3082.   Result := FSelected;
  3083. end;
  3084. function TcxGridFilterRow.GetVisible: Boolean;
  3085. begin
  3086.   Result := True;
  3087. end;
  3088. procedure TcxGridFilterRow.SetSelected(Value: Boolean);
  3089. begin
  3090.   if FSelected <> Value then
  3091.   begin
  3092.     GridView.Controller.FilterRowFocusChanging(Value);
  3093.     FSelected := Value;
  3094.     Invalidate;
  3095.     GridView.Controller.FilterRowFocusChanged;
  3096.   end;
  3097. end;
  3098. function TcxGridFilterRow.GetDisplayText(Index: Integer): string;
  3099. var
  3100.   AFilterCriteriaItem: TcxFilterCriteriaItem;
  3101. begin
  3102.   AFilterCriteriaItem := FilterCriteriaItems[Index];
  3103.   if AFilterCriteriaItem = nil then
  3104.     Result := ''
  3105.   else
  3106.     Result := AFilterCriteriaItem.DisplayValue;
  3107. end;
  3108. function TcxGridFilterRow.GetValue(Index: Integer): Variant;
  3109. var
  3110.   AFilterCriteriaItem: TcxFilterCriteriaItem;
  3111. begin
  3112.   AFilterCriteriaItem := FilterCriteriaItems[Index];
  3113.   if AFilterCriteriaItem = nil then
  3114.     Result := Null
  3115.   else
  3116.     Result := AFilterCriteriaItem.Value;
  3117. end;
  3118. procedure TcxGridFilterRow.SetDisplayText(Index: Integer; const Value: string);
  3119. var
  3120.   AFilterCriteriaItem: TcxFilterCriteriaItem;
  3121. begin
  3122.   AFilterCriteriaItem := FilterCriteriaItems[Index];
  3123.   if AFilterCriteriaItem <> nil then
  3124.     AFilterCriteriaItem.DisplayValue := Value;
  3125. end;
  3126. procedure TcxGridFilterRow.SetValue(Index: Integer; const Value: Variant);
  3127. var
  3128.   AGridView: TcxGridTableView;
  3129. begin
  3130.   AGridView := GridView;
  3131.   AGridView.Controller.KeepFilterRowFocusing := True;
  3132.   try
  3133.     if VarIsSoftNull(Value) then
  3134.       AGridView.Columns[Index].DataBinding.Filtered := False
  3135.     else
  3136.     begin
  3137.       DataController.Filter.BeginUpdate;
  3138.       try
  3139.         DataController.Filter.Active := True;
  3140.         AGridView.Columns[Index].DataBinding.AddToFilter(nil,
  3141.           GetFilterOperatorKind(Value, True), Value,
  3142.           GetDisplayTextForValue(Index, Value), True);
  3143.       finally
  3144.         DataController.Filter.EndUpdate;
  3145.       end;
  3146.     end;
  3147.   finally
  3148.     AGridView.Controller.KeepFilterRowFocusing := False;
  3149.   end;
  3150. end;
  3151. function TcxGridFilterRow.GetDisplayTextForValue(AIndex: Integer; const AValue: Variant): string;
  3152. var
  3153.   AValueList: TcxGridFilterValueList;
  3154.   AValueIndex: Integer;
  3155. begin
  3156.   AValueList := ViewData.CreateFilterValueList;
  3157.   try
  3158.     GridView.Columns[AIndex].DataBinding.GetFilterValues(AValueList);
  3159.     AValueIndex := AValueList.FindItemByValue(AValue);
  3160.     if AValueIndex = -1 then
  3161.       Result := GridView.Columns[AIndex].GetProperties(Self).GetDisplayText(AValue)
  3162.     else
  3163.       Result := AValueList[AValueIndex].DisplayText;
  3164.   finally
  3165.     AValueList.Free;
  3166.   end;
  3167. end;
  3168. function TcxGridFilterRow.GetFilterOperatorKind(const AValue: Variant; ACheckMask: Boolean): TcxFilterOperatorKind;
  3169.   function HasMask(const AValue: string): Boolean;
  3170.   begin
  3171.     Result :=
  3172.       (Pos(DataController.Filter.PercentWildcard, AValue) <> 0) or
  3173.       (Pos(DataController.Filter.UnderscoreWildcard, AValue) <> 0);
  3174.   end;
  3175. begin