cxGridCustomTableView.pas
Upload User: yyjgift
Upload Date: 2014-01-20
Package Size: 29104k
Code Size: 535k
Category:

Delphi VCL

Development Platform:

Delphi

  1. {********************************************************************}
  2. {                                                                    }
  3. {       Developer Express Visual Component Library                   }
  4. {       ExpressQuantumGrid                                           }
  5. {                                                                    }
  6. {       Copyright (c) 1998-2005 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 cxGridCustomTableView;                           
  35. {$I cxVer.inc}
  36. interface
  37. uses
  38. {$IFDEF DELPHI6}
  39.   Variants,
  40. {$ENDIF}
  41.   Windows, Messages, Classes, Graphics, Controls, Forms, StdCtrls,
  42.   cxClasses, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters,
  43.   cxStorage, cxPC, cxFilterControl, cxNavigator, cxListBox, cxEdit,
  44.   cxDataStorage, cxCustomData, cxData, cxFilter, cxDataUtils, cxContainer,
  45.   cxCheckBox, cxCheckListBox, cxStyles, cxGridCommon, cxGridCustomView;
  46. const
  47.   cxGridFilterDefaultItemMRUItemsListCount = 5;
  48.   cxGridFilterDefaultMaxDropDownCount = 15;
  49.   cxGridFilterDefaultMRUItemsListCount = 10;
  50.   cxGridItemDefaultMinWidth = 20;
  51.   cxGridNavigatorDefaultOffset = 50;
  52.   cxGridCustomizationFormDefaultWidth = 180;
  53.   cxGridCustomizationFormDefaultHeight = 300;
  54.   htCustomGridTableBase = 100;
  55.   htFilter = htCustomGridTableBase + 1;
  56.   htFilterActivateButton = htCustomGridTableBase + 2;
  57.   htFilterCloseButton = htCustomGridTableBase + 3;
  58.   htFilterDropDownButton = htCustomGridTableBase + 4;
  59.   htFilterCustomizeButton = htCustomGridTableBase + 5;
  60.   htRecord = htCustomGridTableBase + 6;
  61.   htCell = htCustomGridTableBase + 7;
  62.   htExpandButton = htCustomGridTableBase + 8;
  63.   htCustomizationForm = htCustomGridTableBase + 9;
  64.   ccNone = 0;
  65.   ccCustomizationForm = 1;
  66.   isCustomItemFirst = 0;
  67.   isContent = isCustomItemFirst;
  68.   isCustomItemLast = isContent;
  69.   bbCustomTableFirst = bbCustomLast + 1;
  70.   bbContent = bbCustomTableFirst;
  71.   bbFilterBox = bbCustomTableFirst + 1;
  72.   bbCustomTableLast = bbFilterBox;
  73.   vsCustomTableFirst = vsCustomLast + 1;
  74.   vsContent = vsCustomTableFirst;
  75.   vsContentEven = vsCustomTableFirst + 1;
  76.   vsContentOdd = vsCustomTableFirst + 2;
  77.   vsFilterBox = vsCustomTableFirst + 3;
  78.   vsInactive = vsCustomTableFirst + 4;
  79.   vsIncSearch = vsCustomTableFirst + 5;
  80.   vsSelection = vsCustomTableFirst + 6;
  81.   vsCustomTableLast = vsSelection;
  82. type
  83.   TcxGridItemDataBindingClass = class of TcxGridItemDataBinding;
  84.   TcxCustomGridTableItemsListBox = class;
  85.   TcxCustomGridTableCustomizationForm = class;
  86.   TcxGridPopupListBox = class;
  87.   TcxGridFilterPopup = class;
  88.   TcxCustomGridTableController = class;
  89.   TcxCustomGridRecord = class;
  90.   TcxCustomGridTableViewData = class;
  91.   TcxCustomGridFilterButtonViewInfo = class;
  92.   TcxGridFilterActivateButtonViewInfo = class;
  93.   TcxGridFilterButtonsViewInfo = class;
  94.   TcxGridFilterViewInfo = class;
  95.   TcxGridTableDataCellViewInfo = class;
  96.   TcxCustomGridRecordViewInfoClass = class of TcxCustomGridRecordViewInfo;
  97.   TcxCustomGridRecordViewInfo = class;
  98.   TcxCustomGridRecordsViewInfo = class;
  99.   TcxCustomGridTableViewInfo = class;
  100.   TcxCustomGridTableViewInfoCacheItem = class;
  101.   TcxCustomGridTableItem = class;
  102.   TcxCustomGridTableFiltering = class;
  103.   TcxCustomGridTableView = class;
  104.   { changes }
  105.   TcxGridDataChange = class(TcxCustomGridViewChange)
  106.   public
  107.     procedure Execute; override;
  108.     function IsLockable: Boolean; override;
  109.   end;
  110.   TcxGridRecordChange = class(TcxCustomGridViewChange)
  111.   private
  112.     FItem: TcxCustomGridTableItem;
  113.     FRecord: TcxCustomGridRecord;
  114.     FRecordIndex: Integer;
  115.     function GetGridView: TcxCustomGridTableView;
  116.     function GetRecordViewInfo: TcxCustomGridRecordViewInfo;
  117.   public
  118.     constructor Create(AGridView: TcxCustomGridView; ARecord: TcxCustomGridRecord;
  119.       ARecordIndex: Integer; AItem: TcxCustomGridTableItem = nil); reintroduce; virtual;
  120.     procedure Execute; override;
  121.     function IsCompatibleWith(AChange: TcxCustomGridChange): Boolean; override;
  122.     function IsEqual(AChange: TcxCustomGridChange): Boolean; override;
  123.     function IsItemVisible: Boolean;
  124.     property GridRecord: TcxCustomGridRecord read FRecord;
  125.     property GridView: TcxCustomGridTableView read GetGridView;
  126.     property Item: TcxCustomGridTableItem read FItem;
  127.     property RecordIndex: Integer read FRecordIndex;
  128.     property RecordViewInfo: TcxCustomGridRecordViewInfo read GetRecordViewInfo;
  129.   end;
  130.   TcxGridFocusedRecordChange = class(TcxCustomGridViewChange)
  131.   private
  132.     FFocusedRecordIndex: Integer;
  133.     FNewItemRecordFocusingChanged: Boolean;
  134.     FPrevFocusedRecordIndex: Integer;
  135.   public
  136.     constructor Create(AGridView: TcxCustomGridView;
  137.       APrevFocusedRecordIndex, AFocusedRecordIndex: Integer;
  138.       ANewItemRecordFocusingChanged: Boolean); reintroduce; virtual;
  139.     procedure Execute; override;
  140.     property FocusedRecordIndex: Integer read FFocusedRecordIndex;
  141.     property NewItemRecordFocusingChanged: Boolean read FNewItemRecordFocusingChanged;
  142.     property PrevFocusedRecordIndex: Integer read FPrevFocusedRecordIndex;
  143.   end;
  144.   { hit tests }
  145.   TcxGridFilterHitTest = class(TcxCustomGridViewHitTest)
  146.   protected
  147.     class function GetHitTestCode: Integer; override;
  148.   end;
  149.   TcxGridFilterCloseButtonHitTest = class(TcxCustomGridViewHitTest)
  150.   protected
  151.     class function GetHitTestCode: Integer; override;
  152.   end;
  153.   TcxGridFilterActivateButtonHitTest = class(TcxCustomGridViewHitTest)
  154.   protected
  155.     class function GetHitTestCode: Integer; override;
  156.   end;
  157.   TcxGridFilterDropDownButtonHitTest = class(TcxCustomGridViewHitTest)
  158.   protected
  159.     class function GetHitTestCode: Integer; override;
  160.   end;
  161.   TcxGridFilterCustomizeButtonHitTest = class(TcxCustomGridViewHitTest)
  162.   protected
  163.     class function GetHitTestCode: Integer; override;
  164.   end;
  165.   TcxGridRecordHitTest = class(TcxCustomGridViewHitTest)
  166.   private
  167.     FGridRecordIndex: Integer;
  168.     FIsNewItemRecord: Boolean;
  169.     FViewData: TcxCustomGridTableViewData;
  170.     function GetGridRecord: TcxCustomGridRecord;
  171.     procedure SetGridRecord(Value: TcxCustomGridRecord);
  172.   protected
  173.     class function GetHitTestCode: Integer; override;
  174.   public
  175.     class function CanClick: Boolean; virtual;
  176.     property GridRecord: TcxCustomGridRecord read GetGridRecord write SetGridRecord;
  177.   end;
  178.   TcxGridRecordCellHitTest = class(TcxGridRecordHitTest)
  179.   protected
  180.     class function GetHitTestCode: Integer; override;
  181.   public
  182.     Item: TcxCustomGridTableItem;
  183.   end;
  184.   TcxGridExpandButtonHitTest = class(TcxGridRecordHitTest)
  185.   protected
  186.     class function GetHitTestCode: Integer; override;
  187.   public
  188.     class function CanClick: Boolean; override;
  189.   end;
  190.   TcxGridCustomizationFormHitTest = class(TcxCustomGridViewHitTest)  {2m}
  191.   protected
  192.     class function GetHitTestCode: Integer; override;
  193.   end;
  194.   { data definitions }
  195.   TcxGridDefaultValuesProvider = class(TcxCustomEditDefaultValuesProvider)
  196.   public
  197.     function IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean; override;
  198.   end;
  199.   IcxGridDataController = interface
  200.   ['{FEEE7E69-BD54-4B5D-BA0B-B6116B69C0CC}']
  201.     procedure CheckGridModeBufferCount;
  202.     function DoScroll(AForward: Boolean): Boolean;
  203.     function DoScrollPage(AForward: Boolean): Boolean;
  204.     function GetItemDataBindingClass: TcxGridItemDataBindingClass;
  205.     function GetItemDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass;
  206.     function GetNavigatorIsBof: Boolean;
  207.     function GetNavigatorIsEof: Boolean;
  208.     //function GetFilterPropertyValue(const AName: string; var AValue: Variant): Boolean;
  209.     function GetScrollBarPos: Integer;
  210.     function GetScrollBarRecordCount: Integer;
  211.     //function SetFilterPropertyValue(const AName: string; const AValue: Variant): Boolean;
  212.     function SetScrollBarPos(Value: Integer): Boolean;
  213.   end;
  214.   TcxGridDataController = class(TcxDataController,
  215.     IcxCustomGridDataController, IcxGridDataController)
  216.   private
  217.     FLoadedData: TMemoryStream;
  218.     function GetGridViewValue: TcxCustomGridTableView;
  219.     procedure ReadData(Stream: TStream);
  220.     procedure WriteData(Stream: TStream);
  221.   protected
  222.     { IcxCustomGridDataController }
  223.     procedure AssignData(ADataController: TcxCustomDataController);
  224.     procedure CreateAllItems;
  225.     procedure DeleteAllItems;
  226.     procedure GetFakeComponentLinks(AList: TList);
  227.     function GetGridView: TcxCustomGridView;
  228.     function IsDataChangeable: Boolean;
  229.     function IsDataLinked: Boolean;
  230.     function SupportsCreateAllItems: Boolean;
  231.     { IcxGridDataController }
  232.     procedure CheckGridModeBufferCount;
  233.     function DoScroll(AForward: Boolean): Boolean;
  234.     function DoScrollPage(AForward: Boolean): Boolean;
  235.     //function GetFilterPropertyValue(const AName: string; var AValue: Variant): Boolean;
  236.     function GetItemDataBindingClass: TcxGridItemDataBindingClass;
  237.     function GetItemDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass;
  238.     function GetNavigatorIsBof: Boolean;
  239.     function GetNavigatorIsEof: Boolean;
  240.     function GetScrollBarPos: Integer;
  241.     function GetScrollBarRecordCount: Integer;
  242.     //function SetFilterPropertyValue(const AName: string; const AValue: Variant): Boolean;
  243.     function SetScrollBarPos(Value: Integer): Boolean;
  244.     function CanSelectRow(ARowIndex: Integer): Boolean; override;
  245.     procedure DefineProperties(Filer: TFiler); override;
  246.     procedure DoValueTypeClassChanged(AItemIndex: Integer); override;
  247.     procedure FilterChanged; override;
  248.     function GetDefaultActiveRelationIndex: Integer; override;
  249.     //function GetIncrementalSearchText(ARecordIndex, AItemIndex: Integer): string; override;
  250.     function GetItemID(AItem: TObject): Integer; override;
  251.     function GetSummaryGroupItemLinkClass: TcxDataSummaryGroupItemLinkClass; override;
  252.     function GetSummaryItemClass: TcxDataSummaryItemClass; override;
  253.   public
  254.     procedure BeginFullUpdate; override;
  255.     procedure EndFullUpdate; override;
  256.     function CreateDetailLinkObject(ARelation: TcxCustomDataRelation;
  257.       ARecordIndex: Integer): TObject; override;
  258.     procedure FocusControl(AItemIndex: Integer; var Done: Boolean); override;
  259.     function GetDetailDataControllerByLinkObject(ALinkObject: TObject): TcxCustomDataController; override;
  260.     function GetDisplayText(ARecordIndex, AItemIndex: Integer): string; override;
  261.     function GetFilterItemFieldCaption(AItem: TObject): string; override;
  262.     function GetItem(Index: Integer): TObject; override;
  263.     function GetItemSortByDisplayText(AItemIndex: Integer; ASortByDisplayText: Boolean): Boolean; override;
  264.     function GetItemValueSource(AItemIndex: Integer): TcxDataEditValueSource; override;
  265.     procedure Loaded; override;
  266.     procedure UpdateData; override;
  267.     //!!! maybe remove? check events
  268.     function AddItemToFilter(AParent: TcxFilterCriteriaItemList; AItem: TcxCustomGridTableItem;
  269.       AOperatorKind: TcxFilterOperatorKind; const AValue: Variant; ADisplayText: string = '';
  270.       AReplaceExistent: Boolean = True): TcxFilterCriteriaItem;
  271.     property GridView: TcxCustomGridTableView read GetGridViewValue;
  272.   published
  273.     property Filter;
  274.     property Options;
  275.     property Summary;
  276.     property OnAfterCancel;
  277.     property OnAfterDelete;
  278.     property OnAfterInsert;
  279.     property OnAfterPost;
  280.     property OnBeforeCancel;
  281.     property OnBeforeDelete;
  282.     property OnBeforeInsert;
  283.     property OnBeforePost;
  284.     property OnNewRecord;
  285.     property OnCompare;
  286.     property OnDataChanged;
  287.     property OnDetailCollapsing;
  288.     property OnDetailCollapsed;
  289.     property OnDetailExpanding;
  290.     property OnDetailExpanded;
  291.     property OnFilterRecord;
  292.     property OnGroupingChanged;
  293.     property OnRecordChanged;
  294.     property OnSortingChanged;
  295.   end;
  296.   TcxGridFilterMRUValueItem = class(TcxMRUItem)
  297.   public
  298.     Value: Variant;
  299.     DisplayText: string;
  300.     constructor Create(const AValue: Variant; const ADisplayText: string);
  301.     function Equals(AItem: TcxMRUItem): Boolean; override;
  302.   end;
  303.   TcxGridFilterMRUValueItemsClass = class of TcxGridFilterMRUValueItems;
  304.   TcxGridFilterMRUValueItems = class(TcxMRUItems)
  305.   private
  306.     function GetItem(Index: Integer): TcxGridFilterMRUValueItem;
  307.   public
  308.     procedure Add(const AValue: Variant; const ADisplayText: string);
  309.     procedure AddItemsTo(AValueList: TcxDataFilterValueList);
  310.     property Items[Index: Integer]: TcxGridFilterMRUValueItem read GetItem; default;
  311.   end;
  312.   TcxGridItemDataBinding = class(TPersistent)
  313.   private
  314.     FData: TObject;
  315.     FDefaultValuesProvider: TcxCustomEditDefaultValuesProvider;
  316.     FItem: TcxCustomGridTableItem;
  317.     FFilterMRUValueItems: TcxGridFilterMRUValueItems;
  318.     function GetDataController: TcxCustomDataController;
  319.     function GetFilter: TcxDataFilterCriteria;
  320.     function GetFilterCriteriaItem: TcxFilterCriteriaItem;
  321.     function GetFiltered: Boolean;
  322.     function GetGridView: TcxCustomGridTableView;
  323.     function GetValueType: string;
  324.     function GetValueTypeClass: TcxValueTypeClass;
  325.     procedure SetData(Value: TObject);
  326.     procedure SetFiltered(Value: Boolean);
  327.     procedure SetValueType(const Value: string);
  328.     procedure SetValueTypeClass(Value: TcxValueTypeClass);
  329.   protected
  330.     function GetDefaultValuesProviderClass: TcxCustomEditDefaultValuesProviderClass;
  331.     function GetDefaultValueTypeClass: TcxValueTypeClass; virtual;
  332.     function GetFilterFieldName: string; virtual;
  333.     function GetFilterMRUValueItemsClass: TcxGridFilterMRUValueItemsClass; virtual;
  334.     procedure Init; virtual;
  335.     function IsValueTypeStored: Boolean; virtual;
  336.     property DefaultValuesProvider: TcxCustomEditDefaultValuesProvider read FDefaultValuesProvider;
  337.   public
  338.     constructor Create(AItem: TcxCustomGridTableItem); virtual;
  339.     destructor Destroy; override;
  340.     procedure Assign(Source: TPersistent); override;
  341.     function DefaultCaption: string; virtual;
  342.     function DefaultRepositoryItem: TcxEditRepositoryItem; virtual;
  343.     function DefaultWidth(ATakeHeaderIntoAccount: Boolean = True): Integer; virtual;
  344.     function GetDefaultValuesProvider(AProperties: TcxCustomEditProperties = nil): IcxEditDefaultValuesProvider;
  345.     function IsDisplayFormatDefined(AIsCurrencyValueAccepted: Boolean): Boolean;
  346.     function AddToFilter(AParent: TcxFilterCriteriaItemList; AOperatorKind: TcxFilterOperatorKind;
  347.       const AValue: Variant; const ADisplayText: string = '';
  348.       AReplaceExistent: Boolean = True): TcxFilterCriteriaItem; virtual;
  349.     procedure GetFilterDisplayText(const AValue: Variant; var ADisplayText: string);
  350.     procedure GetFilterStrings(AStrings: TStrings; AValueList: TcxDataFilterValueList);
  351.     property Data: TObject read FData write SetData;
  352.     property DataController: TcxCustomDataController read GetDataController;
  353.     property Filter: TcxDataFilterCriteria read GetFilter;
  354.     property FilterCriteriaItem: TcxFilterCriteriaItem read GetFilterCriteriaItem;
  355.     property Filtered: Boolean read GetFiltered write SetFiltered;
  356.     property FilterFieldName: string read GetFilterFieldName;
  357.     property FilterMRUValueItems: TcxGridFilterMRUValueItems read FFilterMRUValueItems;
  358.     property GridView: TcxCustomGridTableView read GetGridView;
  359.     property Item: TcxCustomGridTableItem read FItem;
  360.     property ValueTypeClass: TcxValueTypeClass read GetValueTypeClass write SetValueTypeClass;
  361.   published
  362.     property ValueType: string read GetValueType write SetValueType stored IsValueTypeStored;
  363.   end;
  364.   { view data }
  365.   TcxCustomGridRecordClass = class of TcxCustomGridRecord;
  366.   TcxCustomGridRecord = class
  367.   private
  368.     //FData: Pointer;
  369.     FEatKeyPress: Boolean;
  370.     FIndex: Integer;
  371.     FRecordInfo: TcxRowInfo;
  372.     FViewData: TcxCustomGridTableViewData;
  373.     FViewInfo: TcxCustomGridRecordViewInfo;
  374.     function GetController: TcxCustomGridTableController;
  375.     function GetDataController: TcxCustomDataController;
  376.     function GetDragHighlighted: Boolean;
  377.     function GetFocused: Boolean;
  378.     function GetGridView: TcxCustomGridTableView;
  379.     function GetIsEditing: Boolean;
  380.     function GetIsNewItemRecord: Boolean;
  381.     function GetIsValid: Boolean;
  382.     function GetLastParentRecordCount: Integer;
  383.     function GetLevel: Integer;
  384.     function GetPartVisible: Boolean;
  385.     function GetRecordIndex: Integer;
  386.     procedure SetExpanded(Value: Boolean);
  387.     procedure SetFocused(Value: Boolean);
  388.   protected
  389.     procedure RefreshRecordInfo;
  390.     procedure DoCollapse(ARecurse: Boolean); virtual;
  391.     procedure DoExpand(ARecurse: Boolean); virtual; 
  392.     //function GetDestroyingOnExpanding: Boolean; virtual;
  393.     function GetExpandable: Boolean; virtual;
  394.     function GetExpanded: Boolean; virtual;
  395.     function GetDrawFocused: Boolean; virtual;
  396.     function GetDrawSelected: Boolean; virtual;
  397.     function GetHasCells: Boolean; virtual;
  398.     function GetIsData: Boolean; virtual;
  399.     function GetIsFirst: Boolean; virtual;
  400.     function GetIsLast: Boolean; virtual;
  401.     function GetIsParent: Boolean; virtual;
  402.     function GetIsParentRecordLast(AIndex: Integer): Boolean;
  403.     function GetParentRecord: TcxCustomGridRecord; virtual;
  404.     function GetSelected: Boolean; virtual;
  405.     function GetVisible: Boolean; virtual;
  406.     procedure SetSelected(Value: Boolean); virtual;
  407.     function GetDisplayText(Index: Integer): string; virtual;
  408.     function GetValueCount: Integer; virtual;
  409.     function GetValue(Index: Integer): Variant; virtual;
  410.     procedure SetDisplayText(Index: Integer; const Value: string); virtual;
  411.     procedure SetValue(Index: Integer; const Value: Variant); virtual;
  412.     function GetViewInfoCacheItemClass: TcxCustomGridViewInfoCacheItemClass; virtual; abstract;
  413.     function GetViewInfoClass: TcxCustomGridRecordViewInfoClass; virtual; abstract;
  414.     property EatKeyPress: Boolean read FEatKeyPress write FEatKeyPress;
  415.     property IsParent: Boolean read GetIsParent;
  416.     property RecordInfo: TcxRowInfo read FRecordInfo;
  417.     property Controller: TcxCustomGridTableController read GetController;
  418.     property DataController: TcxCustomDataController read GetDataController;
  419.     //property DestroyingOnExpanding: Boolean read GetDestroyingOnExpanding;
  420.   public
  421.     constructor Create(AViewData: TcxCustomGridTableViewData; AIndex: Integer;
  422.       const ARecordInfo: TcxRowInfo); virtual;
  423.     destructor Destroy; override;
  424.     function CanFocus: Boolean; virtual;
  425.     procedure Collapse(ARecurse: Boolean);
  426.     procedure DoKeyPress(var Key: Char);
  427.     procedure Expand(ARecurse: Boolean);
  428.     function GetFirstFocusableChild: TcxCustomGridRecord; virtual;
  429.     function GetLastFocusableChild(ARecursive: Boolean): TcxCustomGridRecord; virtual;
  430.     procedure Invalidate(AItem: TcxCustomGridTableItem = nil); virtual;
  431.     procedure KeyDown(var Key: Word; Shift: TShiftState); virtual;
  432.     procedure KeyPress(var Key: Char); virtual;
  433.     procedure MakeVisible;
  434.     //property Data: Pointer read FData write FData;
  435.     property DragHighlighted: Boolean read GetDragHighlighted;
  436.     property DrawFocused: Boolean read GetDrawFocused;
  437.     property DrawSelected: Boolean read GetDrawSelected;
  438.     property DisplayTexts[Index: Integer]: string read GetDisplayText write SetDisplayText;
  439.     property Expandable: Boolean read GetExpandable;
  440.     property Expanded: Boolean read GetExpanded write SetExpanded;
  441.     property Focused: Boolean read GetFocused write SetFocused;
  442.     property GridView: TcxCustomGridTableView read GetGridView;
  443.     property HasCells: Boolean read GetHasCells;
  444.     property Index: Integer read FIndex;
  445.     property IsData: Boolean read GetIsData;
  446.     property IsEditing: Boolean read GetIsEditing;
  447.     property IsFirst: Boolean read GetIsFirst;
  448.     property IsLast: Boolean read GetIsLast;
  449.     property IsNewItemRecord: Boolean read GetIsNewItemRecord;
  450.     property IsParentRecordLast[AIndex: Integer]: Boolean read GetIsParentRecordLast;
  451.     property IsValid: Boolean read GetIsValid;
  452.     property LastParentRecordCount: Integer read GetLastParentRecordCount;
  453.     property Level: Integer read GetLevel;
  454.     property ParentRecord: TcxCustomGridRecord read GetParentRecord;
  455.     property PartVisible: Boolean read GetPartVisible;
  456.     property RecordIndex: Integer read GetRecordIndex;
  457.     property Selected: Boolean read GetSelected write SetSelected;
  458.     property ValueCount: Integer read GetValueCount;
  459.     property Values[Index: Integer]: Variant read GetValue write SetValue;
  460.     property ViewData: TcxCustomGridTableViewData read FViewData;
  461.     property ViewInfo: TcxCustomGridRecordViewInfo read FViewInfo;
  462.     property Visible: Boolean read GetVisible;
  463.   end;
  464.   TcxCustomGridTableViewData = class(TcxCustomGridViewData)
  465.   private
  466.     FEditingRecord: TcxCustomGridRecord;
  467.     FNewItemRecord: TcxCustomGridRecord;
  468.     FRecords: TList;
  469.     function GetController: TcxCustomGridTableController;
  470.     function GetEditingRecord: TcxCustomGridRecord;
  471.     function GetGridView: TcxCustomGridTableView;
  472.     function GetInternalRecord(Index: Integer): TcxCustomGridRecord;
  473.     function GetRecord(Index: Integer): TcxCustomGridRecord;
  474.     function GetRecordCount: Integer;
  475.     function GetViewInfo: TcxCustomGridTableViewInfo;
  476.     function CreateRecord(AIndex: Integer): TcxCustomGridRecord;
  477.   protected
  478.     function GetRecordClass(ARecordInfo: TcxRowInfo): TcxCustomGridRecordClass; virtual; abstract;
  479.     procedure AssignEditingRecord;
  480.     procedure CreateNewItemRecord;
  481.     procedure DestroyNewItemRecord;
  482.     function GetNewItemRecordClass: TcxCustomGridRecordClass; virtual;
  483.     procedure RecreateNewItemRecord;
  484.     property Controller: TcxCustomGridTableController read GetController;
  485.     property InternalRecords[Index: Integer]: TcxCustomGridRecord read GetInternalRecord;
  486.     property ViewInfo: TcxCustomGridTableViewInfo read GetViewInfo;
  487.   public
  488.     constructor Create(AGridView: TcxCustomGridView); override;
  489.     destructor Destroy; override;
  490.     procedure Collapse(ARecurse: Boolean); virtual;
  491.     procedure DestroyRecords;
  492.     procedure Expand(ARecurse: Boolean); virtual;
  493.     function GetRecordByIndex(AIndex: Integer): TcxCustomGridRecord;
  494.     function GetRecordByRecordIndex(ARecordIndex: Integer): TcxCustomGridRecord;
  495.     function GetRecordIndexByRecord(ARecord: TcxCustomGridRecord): Integer;
  496.     function IsRecordIndexValid(AIndex: Integer): Boolean;
  497.     procedure Refresh(ARecordCount: Integer); virtual;
  498.     procedure RefreshRecords;
  499.     procedure CheckNewItemRecord;
  500.     function HasNewItemRecord: Boolean; virtual;
  501.     property EditingRecord: TcxCustomGridRecord read FEditingRecord;
  502.     property GridView: TcxCustomGridTableView read GetGridView;
  503.     property NewItemRecord: TcxCustomGridRecord read FNewItemRecord;
  504.     property RecordCount: Integer read GetRecordCount;
  505.     property Records[Index: Integer]: TcxCustomGridRecord read GetRecord;
  506.   end;
  507.   { controller }
  508.   // drag&drop objects
  509.   TcxCustomGridTableDragAndDropObject = class(TcxCustomGridDragAndDropObject)
  510.   private
  511.     function GetController: TcxCustomGridTableController;
  512.     function GetGridView: TcxCustomGridTableView;
  513.     function GetViewInfo: TcxCustomGridTableViewInfo;
  514.   protected
  515.     procedure AfterScrolling; virtual;
  516.     procedure BeforeScrolling; virtual;
  517.     property Controller: TcxCustomGridTableController read GetController;
  518.     property GridView: TcxCustomGridTableView read GetGridView;
  519.     property ViewInfo: TcxCustomGridTableViewInfo read GetViewInfo;
  520.   end;
  521.   TcxGridArrowNumber = (anFirst, anLast);
  522.   TcxGridArrowPlace = (apLeft, apTop, apRight, apBottom);
  523.   TcxCustomGridTableMovingObject = class(TcxCustomGridTableDragAndDropObject)
  524.   private
  525.     FArrowsVisible: Boolean;
  526.     FDragImage: TBitmap;
  527.     FDragImageCanvas: TcxCanvas;
  528.     FDragImageOffset: TPoint;
  529.     FDragImagePos: TPoint;
  530.     FDragImageSavingBitmap: TBitmap;
  531.     FDragImageSavingPos: TPoint;
  532.     FDragImageVisible: Boolean;
  533.     FSavingBitmap: TBitmap;
  534.     function GetArrowPlace(AArrowNumber: TcxGridArrowNumber): TcxGridArrowPlace;
  535.     function GetCustomizationForm: TcxCustomGridTableCustomizationForm;
  536.     function GetDragImageSavingCanvas: TCanvas;
  537.     function GetSavingBitmap: TBitmap;
  538.     function GetSavingCanvas: TCanvas;
  539.     procedure CreateDragImage;
  540.     procedure DestroyDragImage;
  541.   protected
  542.     procedure AfterScrolling; override;
  543.     procedure BeforeScrolling; override;
  544.     procedure DirtyChanged; override;
  545.     function GetDragAndDropCursor(Accepted: Boolean): TCursor; override;
  546.     procedure ChangeArrowsVisibility(AVisible: Boolean);
  547.     procedure ChangeDragImagePosition(AVisible: Boolean = True);
  548.     function AreArrowsVertical: Boolean; virtual;
  549.     function CalculateDragImageOffset: TPoint; virtual;
  550.     function CanRemove: Boolean; virtual; abstract;
  551.     function GetArrowAreaBounds(APlace: TcxGridArrowPlace): TRect; virtual; abstract;
  552.     function GetArrowBounds(APlace: TcxGridArrowPlace): TRect; virtual;
  553.     function GetArrowsClientRect: TRect; virtual;
  554.     function GetCustomizationFormListBox: TcxCustomGridTableItemsListBox; virtual; abstract;
  555.     function GetDragImageBounds(AMousePos: TPoint): TRect; virtual;
  556.     function GetSourceItem: TObject; virtual; abstract;
  557.     function GetSourceItemBounds: TRect; virtual;
  558.     function GetSourceItemViewInfo: TcxCustomGridCellViewInfo; virtual;
  559.     procedure InitDragImage; virtual;
  560.     function IsSourceCustomizationForm: Boolean; virtual; abstract;
  561.     function IsValidDestination: Boolean; virtual; abstract;
  562.     procedure BeginDragAndDrop; override;
  563.     procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override;
  564.     procedure EndDragAndDrop(Accepted: Boolean); override;
  565.     property ArrowBounds[APlace: TcxGridArrowPlace]: TRect read GetArrowBounds;
  566.     property ArrowPlaces[AArrowNumber: TcxGridArrowNumber]: TcxGridArrowPlace read GetArrowPlace;
  567.     property ArrowsClientRect: TRect read GetArrowsClientRect;
  568.     property CustomizationForm: TcxCustomGridTableCustomizationForm read GetCustomizationForm;
  569.     property CustomizationFormListBox: TcxCustomGridTableItemsListBox read GetCustomizationFormListBox;
  570.     property DragImage: TBitmap read FDragImage;
  571.     property DragImageCanvas: TcxCanvas read FDragImageCanvas;
  572.     property DragImageOffset: TPoint read FDragImageOffset;
  573.     property DragImagePos: TPoint read FDragImagePos write FDragImagePos;
  574.     property DragImageSavingBitmap: TBitmap read FDragImageSavingBitmap;
  575.     property DragImageSavingCanvas: TCanvas read GetDragImageSavingCanvas;
  576.     property DragImageSavingPos: TPoint read FDragImageSavingPos write FDragImageSavingPos;
  577.     property DragImageVisible: Boolean read FDragImageVisible write FDragImageVisible;
  578.     property SavingBitmap: TBitmap read GetSavingBitmap;
  579.     property SavingCanvas: TCanvas read GetSavingCanvas;
  580.     property SourceItem: TObject read GetSourceItem;
  581.     property SourceItemBounds: TRect read GetSourceItemBounds;
  582.     property SourceItemViewInfo: TcxCustomGridCellViewInfo read GetSourceItemViewInfo;
  583.   public
  584.     constructor Create(AControl: TcxControl); override;
  585.     destructor Destroy; override;
  586.   end;
  587.   TcxGridItemContainerKind = Integer;
  588.   TcxGridItemContainerZone = class
  589.   public
  590.     ItemIndex: Integer;
  591.     constructor Create(AItemIndex: Integer);
  592.     function IsEqual(Value: TcxGridItemContainerZone): Boolean; virtual;
  593.   end;
  594.   TcxCustomGridTableItemMovingObject = class(TcxCustomGridTableMovingObject)
  595.   private
  596.     FDestItemContainerKind: TcxGridItemContainerKind;
  597.     FDestZone: TcxGridItemContainerZone;
  598.     FOriginalDestItemContainerKind: TcxGridItemContainerKind;
  599.     FSourceItem: TcxCustomGridTableItem;
  600.     FSourceItemContainerKind: TcxGridItemContainerKind;
  601.     procedure SetDestItemContainerKind(Value: TcxGridItemContainerKind);
  602.     procedure SetDestZone(Value: TcxGridItemContainerZone);
  603.   protected
  604.     procedure CalculateDestParams(AHitTest: TcxCustomGridHitTest;
  605.       out AContainerKind: TcxGridItemContainerKind; out AZone: TcxGridItemContainerZone); virtual;
  606.     procedure CheckDestParams; virtual;
  607.     function GetCustomizationFormListBox: TcxCustomGridTableItemsListBox; override;
  608.     function GetSourceItem: TObject; override;
  609.     function IsSourceCustomizationForm: Boolean; override;
  610.     procedure BeginDragAndDrop; override;
  611.     procedure DragAndDrop(const P: TPoint; var Accepted: Boolean); override;
  612.     procedure EndDragAndDrop(Accepted: Boolean); override;
  613.     property DestItemContainerKind: TcxGridItemContainerKind read FDestItemContainerKind
  614.       write SetDestItemContainerKind;
  615.     property DestZone: TcxGridItemContainerZone read FDestZone write SetDestZone;
  616.     property OriginalDestItemContainerKind: TcxGridItemContainerKind
  617.       read FOriginalDestItemContainerKind write FOriginalDestItemContainerKind;
  618.     property SourceItem: TcxCustomGridTableItem read FSourceItem write FSourceItem;
  619.     property SourceItemContainerKind: TcxGridItemContainerKind read FSourceItemContainerKind
  620.       write FSourceItemContainerKind;
  621.   public
  622.     constructor Create(AControl: TcxControl); override;
  623.     destructor Destroy; override;
  624.   end;
  625.   // customization form
  626.   TcxCustomGridTableItemsInnerListBox = class(TcxInnerListBox)
  627.   private
  628.     FDragAndDropItemIndex: Integer;
  629.     FMouseDownPos: TPoint;
  630.     function GetContainer: TcxCustomGridTableItemsListBox;
  631.     function GetDragAndDropItem: TObject;
  632.     function GetGridView: TcxCustomGridTableView;
  633.     function GetLookAndFeelPainter: TcxCustomLookAndFeelPainterClass;
  634.   {$IFDEF VCL}
  635.     procedure WMCancelMode(var Message: TWMCancelMode); message WM_CANCELMODE;
  636.     procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE;
  637.     procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT;
  638.   {$ENDIF}
  639.   protected
  640.   {$IFDEF VCL}
  641.     procedure CreateParams(var Params: TCreateParams); override;
  642.     procedure CreateWnd; override;
  643.   {$ELSE}
  644.     function EventFilter(Sender: QObjectH; Event: QEventH): Boolean; override;
  645.     procedure InitWidget; override;
  646.     procedure Resize; override;
  647.   {$ENDIF}
  648.   {$IFDEF VCL}
  649.     procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override;
  650.   {$ELSE}
  651.     function DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState): Boolean; override;
  652.   {$ENDIF}
  653.     procedure KeyDown(var Key: Word; Shift: TShiftState); override;
  654.     procedure LookAndFeelChanged(Sender: TcxLookAndFeel;
  655.       AChangedValues: TcxLookAndFeelValues); override;
  656.     procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
  657.     procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
  658.     procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
  659.     procedure CalculateBorderStyle;
  660.     procedure CalculateItemHeight;
  661.     property Container: TcxCustomGridTableItemsListBox read GetContainer;
  662.     property DragAndDropItem: TObject read GetDragAndDropItem;
  663.     property DragAndDropItemIndex: Integer read FDragAndDropItemIndex;
  664.     property GridView: TcxCustomGridTableView read GetGridView;
  665.     property LookAndFeelPainter: TcxCustomLookAndFeelPainterClass read GetLookAndFeelPainter;
  666.   public
  667.     constructor Create(AOwner: TComponent); override;
  668.   end;
  669.   TcxCustomGridTableItemsListBoxClass = class of TcxCustomGridTableItemsListBox;
  670.   TcxCustomGridTableItemsListBox = class(TcxListBox)
  671.   private
  672.     function GetDragAndDropItem: TObject;
  673.     function GetGridView: TcxCustomGridTableView;
  674.     function GetInnerListBox: TcxCustomGridTableItemsInnerListBox;
  675.   protected
  676.     function CalculateItemHeight: Integer; virtual; abstract;
  677.     function GetInnerListBoxClass: TcxInnerListBoxClass; override;
  678.     function GetDragAndDropParams: TcxCustomGridHitTest; virtual; abstract;
  679.     procedure RefreshItemsAsTableItems;
  680.     property DragAndDropItem: TObject read GetDragAndDropItem;
  681.     property GridView: TcxCustomGridTableView read GetGridView;
  682.   public
  683.     constructor Create(AOwner: TComponent); override;
  684.     function IndexOfItem(AItem: TObject): Integer;
  685.     procedure PaintDragAndDropItem(ACanvas: TcxCanvas; const R: TRect; AItem: TObject);
  686.     procedure PaintItem(ACanvas: TcxCanvas; R: TRect; AIndex: Integer; AFocused: Boolean); virtual; abstract;
  687.     procedure RefreshItems; virtual;
  688.     property InnerListBox: TcxCustomGridTableItemsInnerListBox read GetInnerListBox;
  689.   end;
  690.   TcxCustomGridTableCustomizationFormClass = class of TcxCustomGridTableCustomizationForm;
  691.   TcxCustomGridTableCustomizationForm = class(TForm)
  692.   private
  693.     FItemsListBox: TcxCustomGridTableItemsListBox;
  694.     FItemsPage: TcxTabSheet;
  695.     FController: TcxCustomGridTableController;
  696.     FHookTimer: TcxTimer;
  697.     FOffset: Integer;
  698.     FPageControl: TcxPageControl;
  699.     FStep: Integer;
  700.     function GetGridView: TcxCustomGridTableView;
  701.     function GetViewInfo: TcxCustomGridTableViewInfo;
  702.     procedure HookTimerHandler(Sender: TObject);
  703.   protected
  704.   {$IFDEF VCL}
  705.     procedure CreateParams(var Params: TCreateParams); override;
  706.   {$ELSE}
  707.     function WidgetFlags: Integer; override;
  708.   {$ENDIF}
  709.     procedure DoClose(var Action: TCloseAction); override;
  710.     procedure DoShow; override;
  711.     procedure CalculateConsts; virtual;
  712.     procedure CreateControls; virtual;
  713.     function CreatePage(const ACaption: string; AVisible: Boolean): TcxTabSheet;
  714.     function GetItemsListBoxBounds: TRect; virtual;
  715.     function GetItemsListBoxClass: TcxCustomGridTableItemsListBoxClass; virtual;
  716.     function GetItemsPageCaption: string; virtual; abstract;
  717.     function GetItemsPageVisible: Boolean; virtual;
  718.     function GetContentBounds: TRect; virtual;
  719.     function GetPageControlBounds: TRect; virtual;
  720.     procedure InitPageControl; virtual;
  721.     property ContentBounds: TRect read GetContentBounds;
  722.     property GridView: TcxCustomGridTableView read GetGridView;
  723.     property ItemsListBox: TcxCustomGridTableItemsListBox read FItemsListBox;
  724.     property Offset: Integer read FOffset write FOffset;
  725.     property PageControl: TcxPageControl read FPageControl;
  726.     property Step: Integer read FStep write FStep;
  727.     property ViewInfo: TcxCustomGridTableViewInfo read GetViewInfo;
  728.   public
  729.     constructor Create(AController: TcxCustomGridTableController); reintroduce; virtual;
  730.     destructor Destroy; override;
  731.     property Controller: TcxCustomGridTableController read FController;
  732.     procedure ActivatePage(APage: TcxTabSheet);
  733.     procedure RefreshData; virtual;
  734.     property ItemsPage: TcxTabSheet read FItemsPage;
  735.   end;
  736.   // popups
  737.   IcxCustomGridPopupOwner = interface
  738.     ['{ACF62D23-6871-4735-A4CE-3B0888DB8FC3}']
  739.     function ClosePopupWhenNilOwner: Boolean;
  740.     function GetOwnerBounds: TRect;
  741.     procedure PopupClosed;
  742.   end;
  743.   TcxCustomGridPopup = class(TcxCustomPopupWindow)
  744.   private
  745.     FGridView: TcxCustomGridTableView;
  746.     FOwner: IcxCustomGridPopupOwner;
  747.     procedure SetOwner(Value: IcxCustomGridPopupOwner);
  748.   protected
  749.     function CalculateOwnerBounds: TRect; virtual;
  750.     procedure InitPopup; override;
  751.     procedure Paint; override;
  752.     procedure VisibleChanged; override;
  753.   public
  754.     constructor Create(AGridView: TcxCustomGridTableView); reintroduce; virtual;
  755.     procedure CloseUp(AModalResult: Boolean = False); override;
  756.     procedure Popup; reintroduce; virtual;
  757.     property GridView: TcxCustomGridTableView read FGridView;
  758.     property Owner: IcxCustomGridPopupOwner read FOwner write SetOwner;
  759.   end;
  760.   TcxGridPopupListBoxActionEvent = procedure(Sender: TcxGridPopupListBox;
  761.     AItemIndex: Integer) of object;
  762.   TcxGridPopupListBox = class(TcxListBox)
  763.   private
  764.     FItemTextOffsetHorz: Integer;
  765.     FItemTextOffsetVert: Integer;
  766.     FMinWidth: Integer;
  767.     FPopup: TcxCustomGridPopup;
  768.     FVisibleItemCount: Integer;
  769.     FVisibleWidth: Integer;
  770.     FOnAction: TcxGridPopupListBoxActionEvent;
  771.     function GetGridView: TcxCustomGridTableView;
  772.   protected
  773.     function DrawItem(ACanvas: TcxCanvas; AIndex: Integer; const ARect: TRect;
  774.       AState: TOwnerDrawState): Boolean; override;
  775.     procedure KeyDown(var Key: Word; Shift: TShiftState); override;
  776.     procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
  777.     procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
  778.     function CalculateItemHeight: Integer; virtual;
  779.     procedure DoAction(AItemIndex: Integer); virtual;
  780.     procedure DrawItemContent(ACanvas: TcxCanvas; AIndex: Integer; ARect: TRect;
  781.       AState: TOwnerDrawState); virtual;
  782.     function GetVisibleItemCount(AItems: TStrings): Integer; virtual;
  783.     procedure Init; virtual;
  784.   public
  785.     constructor Create(APopup: TcxCustomGridPopup); reintroduce; virtual;
  786.     procedure AdjustBounds(AItems: TStrings = nil); virtual;
  787.     property GridView: TcxCustomGridTableView read GetGridView;
  788.     property ItemTextOffsetHorz: Integer read FItemTextOffsetHorz write FItemTextOffsetHorz;
  789.     property ItemTextOffsetVert: Integer read FItemTextOffsetVert write FItemTextOffsetVert;
  790.     property MinWidth: Integer read FMinWidth write FMinWidth;
  791.     property Popup: TcxCustomGridPopup read FPopup;
  792.     property VisibleItemCount: Integer read FVisibleItemCount write FVisibleItemCount;
  793.     property VisibleWidth: Integer read FVisibleWidth write FVisibleWidth;
  794.     property OnAction: TcxGridPopupListBoxActionEvent read FOnAction write FOnAction;
  795.   end;
  796.   IcxGridFilterPopupOwner = interface(IcxCustomGridPopupOwner)
  797.     ['{1FC070B2-36E5-4388-B22D-1FF5D240E95F}']
  798.     function GetItem: TcxCustomGridTableItem;
  799.   end;
  800.   TcxGridFilterPopupListBox = class(TcxGridPopupListBox)
  801.   private
  802.     function GetPopup: TcxGridFilterPopup;
  803.   protected
  804.     procedure DrawItemContent(ACanvas: TcxCanvas; AIndex: Integer; ARect: TRect;
  805.       AState: TOwnerDrawState); override;
  806.   public
  807.     property Popup: TcxGridFilterPopup read GetPopup;
  808.   end;
  809.   TcxGridFilterPopupClass = class of TcxGridFilterPopup;
  810.   TcxGridFilterPopup = class(TcxCustomGridPopup)
  811.   private
  812.     FListBox: TcxGridFilterPopupListBox;
  813.     FListBoxItems: TStringList;
  814.     FValueList: TcxDataFilterValueList;
  815.     function GetItem: TcxCustomGridTableItem;
  816.     function GetFilter: TcxDataFilterCriteria;
  817.     function GetOwnerValue: IcxGridFilterPopupOwner;
  818.     procedure SetOwnerValue(Value: IcxGridFilterPopupOwner);
  819.     procedure ListBoxAction(Sender: TcxGridPopupListBox; AItemIndex: Integer);
  820.   protected
  821.     procedure AddListBoxItems; virtual;
  822.     procedure AdjustListBoxSize; virtual;
  823.     procedure ApplyFilter(AItemIndex: Integer); virtual;
  824.     function GetSelectedItemIndex: Integer; virtual;
  825.     procedure InitPopup; override;
  826.     function IsMRUItemsListSeparatorItem(AIndex: Integer): Boolean;
  827.     property Filter: TcxDataFilterCriteria read GetFilter;
  828.     property ListBox: TcxGridFilterPopupListBox read FListBox;
  829.     property ListBoxItems: TStringList read FListBoxItems;
  830.     property SelectedItemIndex: Integer read GetSelectedItemIndex;
  831.     property ValueList: TcxDataFilterValueList read FValueList;
  832.   public
  833.     constructor Create(AGridView: TcxCustomGridTableView); override;
  834.     destructor Destroy; override;
  835.     procedure CloseUp(AModalResult: Boolean = False); override;
  836.     property Item: TcxCustomGridTableItem read GetItem;
  837.     property Owner: IcxGridFilterPopupOwner read GetOwnerValue write SetOwnerValue;
  838.   end;
  839.   TcxGridFilterMRUItemsPopupClass = class of TcxGridFilterMRUItemsPopup;
  840.   TcxGridFilterMRUItemsPopup = class(TcxCustomGridPopup)
  841.   private
  842.     FListBox: TcxGridPopupListBox;
  843.     function GetFiltering: TcxCustomGridTableFiltering;
  844.     procedure ListBoxAction(Sender: TcxGridPopupListBox; AItemIndex: Integer);
  845.   protected
  846.     procedure AddFilterMRUItems(AStrings: TStrings); virtual;
  847.     procedure ApplyFilterMRUItem(AItemIndex: Integer); virtual;
  848.     function GetTextOffsetHorz: Integer; virtual;
  849.     procedure InitPopup; override;
  850.     property Filtering: TcxCustomGridTableFiltering read GetFiltering;
  851.     property ListBox: TcxGridPopupListBox read FListBox;
  852.   public
  853.     constructor Create(AGridView: TcxCustomGridTableView); override;
  854.     property TextOffsetHorz: Integer read GetTextOffsetHorz;
  855.   end;
  856.   TcxCustomGridCustomizationPopup = class(TcxCustomGridPopup)
  857.   private
  858.     FCheckListBox: TcxCheckListBox;
  859.     procedure CheckListBoxCheckClick(Sender: TObject; AIndex: Integer;
  860.       APrevState, ANewState: TcxCheckBoxState);
  861.     procedure CheckListBoxKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
  862.   protected
  863.     procedure AddCheckListBoxItems; virtual; abstract;
  864.     procedure AdjustCheckListBoxSize; virtual;
  865.     procedure CheckClicked(AIndex: Integer; AChecked: Boolean); virtual;
  866.     procedure CreateCheckListBox; virtual;
  867.     function GetDropDownCount: Integer; virtual; abstract;
  868.     procedure InitPopup; override;
  869.     procedure ItemClicked(AItem: TObject; AChecked: Boolean); virtual; abstract;
  870.   public
  871.     constructor Create(AGridView: TcxCustomGridTableView); override;
  872.     procedure CloseUp(AModalResult: Boolean = False); override;
  873.     property CheckListBox: TcxCheckListBox read FCheckListBox;
  874.   end;
  875.   TcxCustomGridItemsCustomizationPopupClass = class of TcxCustomGridItemsCustomizationPopup;
  876.   TcxCustomGridItemsCustomizationPopup = class(TcxCustomGridCustomizationPopup)
  877.   protected
  878.     procedure AddCheckListBoxItems; override;
  879.     function GetDropDownCount: Integer; override;
  880.     procedure ItemClicked(AItem: TObject; AChecked: Boolean); override;
  881.   end;
  882.   // controllers
  883.   TcxGridEditingControllerClass = class of TcxGridEditingController;
  884.   TcxGridEditingController = class
  885.   private
  886.     FController: TcxCustomGridTableController;
  887.     FEdit: TcxCustomEdit;
  888.     FEditHiding: Boolean;
  889.     FEditingItem: TcxCustomGridTableItem;
  890.     FEditingItemSetting: Boolean;
  891.     FEditList: TcxInplaceEditList;
  892.     FEditPreparing: Boolean;
  893.     FEditShowingTimer: TcxTimer;
  894.     FEditShowingTimerItem: TcxCustomGridTableItem;
  895.     FEditUpdateNeeded: Boolean;
  896.     FInitiatingEditing: Boolean;
  897.     FIsEditPlaced: Boolean;
  898.     FIsErrorOnEditExit: Boolean;
  899.     FPrevEditOnChange: TNotifyEvent;
  900.     FPrevEditOnEditValueChanged: TNotifyEvent;
  901.     function GetEditingProperties: TcxCustomEditProperties;
  902.     function GetGridView: TcxCustomGridTableView;
  903.     function GetIsEditing: Boolean;
  904.     procedure SetEditingItem(Value: TcxCustomGridTableItem);
  905.     procedure EditShowingTimerHandler(Sender: TObject);
  906.   protected
  907.     procedure AfterViewInfoCalculate; virtual;
  908.     procedure BeforeViewInfoCalculate; virtual;
  909.     procedure CancelEditUpdatePost;
  910.     function CanRemoveEditFocus: Boolean; virtual;
  911.     procedure CheckEdit;
  912.     procedure CheckEditUpdatePost;
  913.     procedure DoUpdateEdit;
  914.     function GetHideEditOnExit: Boolean; virtual;
  915.     function GetHideEditOnFocusedRecordChange: Boolean; virtual;
  916.     procedure InitEdit; virtual;
  917.     procedure PostEditUpdate;
  918.     function PrepareEdit(AItem: TcxCustomGridTableItem; AOnMouseEvent: Boolean): Boolean; virtual;
  919.     procedure UpdateEditValue;
  920.     procedure UpdateValue;
  921.     procedure AssignEditEvents; virtual;
  922.     procedure UnassignEditEvents; virtual;
  923.     procedure EditAfterKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); virtual;
  924.     procedure EditChanged(Sender: TObject); virtual;
  925.     procedure EditEditing(Sender: TObject; var CanEdit: Boolean); virtual;
  926.     procedure EditExit(Sender: TObject); virtual;
  927.     procedure EditFocusChanged(Sender: TObject); virtual;
  928.     procedure EditKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); virtual;
  929.     procedure EditKeyPress(Sender: TObject; var Key: Char); virtual;
  930.     procedure EditKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); virtual;
  931.     procedure EditPostEditValue(Sender: TObject); virtual;
  932.     procedure EditValueChanged(Sender: TObject); virtual;
  933.     property EditHiding: Boolean read FEditHiding;
  934.     property EditingProperties: TcxCustomEditProperties read GetEditingProperties;
  935.     property EditList: TcxInplaceEditList read FEditList;
  936.     property EditUpdateNeeded: Boolean read FEditUpdateNeeded;
  937.     property HideEditOnExit: Boolean read GetHideEditOnExit;
  938.     property HideEditOnFocusedRecordChange: Boolean read GetHideEditOnFocusedRecordChange;
  939.     property InitiatingEditing: Boolean read FInitiatingEditing;
  940.     property IsEditPlaced: Boolean read FIsEditPlaced;
  941.     property IsErrorOnEditExit: Boolean read FIsErrorOnEditExit;
  942.   public
  943.     constructor Create(AController: TcxCustomGridTableController); virtual;
  944.     destructor Destroy; override;
  945.     procedure HideEdit(Accept: Boolean); virtual;
  946.     procedure RemoveEdit(AProperties: TcxCustomEditProperties); virtual;
  947.     procedure ShowEdit(AItem: TcxCustomGridTableItem = nil); overload;
  948.     procedure ShowEdit(AItem: TcxCustomGridTableItem; Key: Char); overload;
  949.     procedure ShowEdit(AItem: TcxCustomGridTableItem; Shift: TShiftState; X, Y: Integer); overload;
  950.     procedure UpdateEdit;
  951.     procedure StartEditShowingTimer(AItem: TcxCustomGridTableItem);
  952.     procedure StopEditShowingTimer;
  953.     property Controller: TcxCustomGridTableController read FController;
  954.     property Edit: TcxCustomEdit read FEdit;
  955.     property EditingItem: TcxCustomGridTableItem read FEditingItem write SetEditingItem;
  956.     property GridView: TcxCustomGridTableView read GetGridView;
  957.     property IsEditing: Boolean read GetIsEditing;
  958.   end;
  959.   TcxGridDragOpenInfoExpand = class(TcxCustomGridDragOpenInfo)
  960.   public
  961.     GridRecord: TcxCustomGridRecord;
  962.     constructor Create(AGridRecord: TcxCustomGridRecord); virtual;
  963.     function Equals(AInfo: TcxCustomGridDragOpenInfo): Boolean; override;
  964.     procedure Run; override;
  965.   end;
  966.   TcxCustomGridTableCanItemFocus = function(AOwner: TcxCustomGridTableView;
  967.     AItemIndex: Integer; AData: TObject): Boolean;
  968.   TcxCustomGridTableController = class(TcxCustomGridController)
  969.   private
  970.     FAllowCheckEdit: Boolean;
  971.     FBlockRecordKeyboardHandling: Boolean;
  972.     FCheckEditNeeded: Boolean;
  973.     FCheckingCoordinate: Boolean;
  974.     FClickedCellViewInfo: TcxGridTableDataCellViewInfo;
  975.     FCustomization: Boolean;
  976.     FCustomizationForm: TcxCustomGridTableCustomizationForm;
  977.     FCustomizationFormBounds: TRect;
  978.     FDragDropText: string;
  979.     FDragScrollDirection: TcxDirection;
  980.     FDragScrollTimer: TcxTimer;
  981.     FDragHighlightedRecord: TcxCustomGridRecord;
  982.     FEatKeyPress: Boolean;
  983.     FEditingController: TcxGridEditingController;
  984.     FFilterMRUItemsPopup: TcxGridFilterMRUItemsPopup;
  985.     FFilterPopup: TcxGridFilterPopup;
  986.     FFocusedItem: TcxCustomGridTableItem;
  987.     FFocusOnRecordFocusing: Boolean;
  988.     FForcingWidthItem: TcxCustomGridTableItem;
  989.     FGridModeBufferCountUpdateNeeded: Boolean;
  990.     FGridModeBufferCountUpdateTimer: TcxTimer;
  991.     FIsCheckingCoordinates: Boolean;
  992.     FIsPullFocusing: Boolean;
  993.     FIsReadyForImmediateEditing: Boolean;
  994.     FIsRecordUnselecting: Boolean;
  995.     FItemsCustomizationPopup: TcxCustomGridItemsCustomizationPopup;
  996.     FMovingItem: TcxCustomGridTableItem;
  997.     FPullFocusingItem: TcxCustomGridTableItem;
  998.     FPullFocusingMousePos: TPoint;
  999.     FPullFocusingOriginHitTest: TcxCustomGridHitTest;
  1000.     FPullFocusingRecordId: Variant;
  1001.     FPullFocusingScrollingDirection: TcxDirection;
  1002.     FPullFocusingScrollingTimer: TcxTimer;
  1003.     FScrollDirection: TcxDirection;
  1004.     FScrollTimer: TcxTimer;
  1005.     FTopRecordIndex: Integer;
  1006.     FUnselectingRecordIndex: Integer;
  1007.     function GetDragAndDropObject: TcxCustomGridTableDragAndDropObject;
  1008.     function GetEditingItem: TcxCustomGridTableItem;
  1009.     function GetFilterMRUItemsPopup: TcxGridFilterMRUItemsPopup;
  1010.     function GetFilterPopup: TcxGridFilterPopup;
  1011.     function GetFocusedItemIndex: Integer;
  1012.     function GetFocusedRecordIndex: Integer;
  1013.     function GetGridView: TcxCustomGridTableView;
  1014.     function GetIncSearchingItem: TcxCustomGridTableItem;
  1015.     function GetIncSearchingText: string;
  1016.     function GetIsEditing: Boolean;
  1017.     function GetIsIncSearching: Boolean;
  1018.     function GetIsItemMoving: Boolean;
  1019.     function GetItemsCustomizationPopup: TcxCustomGridItemsCustomizationPopup;
  1020.     function GetMasterController: TcxCustomGridTableController;
  1021.     function GetMultiSelect: Boolean;
  1022.     function GetSelectedRecord(Index: Integer): TcxCustomGridRecord;
  1023.     function GetSelectedRecordCount: Integer;
  1024.     function GetViewData: TcxCustomGridTableViewData;
  1025.     function GetViewInfo: TcxCustomGridTableViewInfo;
  1026.     procedure SetCustomization(Value: Boolean);
  1027.     procedure SetDragHighlightedRecord(Value: TcxCustomGridRecord);
  1028.     procedure SetEditingItem(Value: TcxCustomGridTableItem);
  1029.     procedure SetFocusedItem(Value: TcxCustomGridTableItem);
  1030.     procedure SetFocusedItemIndex(Value: Integer);
  1031.     procedure SetFocusedRecordIndex(Value: Integer);
  1032.     procedure SetIncSearchingText(const Value: string);
  1033.     procedure SetInternalTopRecordIndex(Value: Integer);
  1034.     procedure SetScrollDirection(Value: TcxDirection);
  1035.     procedure SetTopRecordIndex(Value: Integer);
  1036.     procedure DragScrollTimerHandler(Sender: TObject);
  1037.     procedure GridModeBufferCountUpdateTimerHandler(Sender: TObject);
  1038.     procedure PullFocusingScrollingTimerHandler(Sender: TObject);
  1039.     procedure CreateScrollTimer;
  1040.     procedure DestroyScrollTimer;
  1041.     procedure ScrollTimerHandler(Sender: TObject);
  1042.   protected
  1043.     procedure AfterPaint; override;
  1044.     procedure BeforePaint; override;
  1045.     procedure DetailFocused(ADetail: TcxCustomGridView); override;
  1046.     procedure DoEnter; override;
  1047.     procedure DoExit; override;
  1048.     function MayFocus: Boolean; override;
  1049.     procedure RemoveFocus; override;
  1050.     procedure SetFocus; override;
  1051.     procedure AfterOffset; virtual;
  1052.     procedure BeforeKillFocus; override;
  1053.     procedure BeforeOffset; virtual;
  1054.     function CanAppend: Boolean; virtual;
  1055.     procedure CancelCheckEditPost;
  1056.     function CanDelete(ACheckOptions: Boolean): Boolean; virtual;
  1057.     function CanEdit: Boolean; virtual;
  1058.     procedure CheckCoordinates; virtual;
  1059.     function CanHScrollBarHide: Boolean; virtual;
  1060.     function CanInsert(ACheckOptions: Boolean): Boolean; virtual;
  1061.     procedure CheckEdit; virtual;
  1062.     procedure CheckTopRecordIndex(var Value: Integer); virtual;
  1063.     function FindNextCustomItem(AFocusedItemIndex, AItemCount: Integer;
  1064.       AGoForward, AGoOnCycle: Boolean; ACanFocus: TcxCustomGridTableCanItemFocus;
  1065.       AData: TObject; var AItemIndex: Integer; out ACycleChanged: Boolean): Boolean;
  1066.     procedure FocusedItemChanged(APrevFocusedItem: TcxCustomGridTableItem); virtual;
  1067.     function GetCancelEditingOnExit: Boolean; virtual;
  1068.     function GetFilterMRUItemsPopupClass: TcxGridFilterMRUItemsPopupClass; virtual;
  1069.     function GetFilterPopupClass: TcxGridFilterPopupClass; virtual;
  1070.     function GetFocusedRecord: TcxCustomGridRecord; virtual;
  1071.     function GetIsRecordsScrollHorizontal: Boolean; virtual; abstract;
  1072.     function GetItemsCustomizationPopupClass: TcxCustomGridItemsCustomizationPopupClass; virtual;
  1073.     function GetMaxTopRecordIndexValue: Integer; virtual;
  1074.     function GetPatternObject(AObject: TPersistent): TPersistent; override;
  1075.     function GetScrollBarOffsetBegin: Integer; virtual;
  1076.     function GetScrollBarOffsetEnd: Integer; virtual;
  1077.     function GetScrollBarPos: Integer; virtual;
  1078.     function GetScrollBarRecordCount: Integer; virtual;
  1079.     function GetVisibleRecordCount(AFirstRecordIndex: Integer;
  1080.       ACalculateDown: Boolean = True): Integer; virtual;
  1081.     procedure PostCheckEdit;
  1082.     procedure ProcessCheckEditPost;
  1083.     procedure ScrollData(ADirection: TcxDirection); virtual;
  1084.     procedure SetFocusedRecord(Value: TcxCustomGridRecord); virtual;
  1085.     procedure SetScrollBarPos(Value: Integer); virtual;
  1086.     procedure CancelGridModeBufferCountUpdate;
  1087.     procedure CheckGridModeBufferCountUpdatePost;
  1088.     procedure PostGridModeBufferCountUpdate;
  1089.     property GridModeBufferCountUpdateNeeded: Boolean read FGridModeBufferCountUpdateNeeded;
  1090.     // internal draganddrop data scrolling
  1091.     function CanScrollData(ADirection: TcxDirection): Boolean; virtual;
  1092.     function GetScrollDataTimeInterval(ADirection: TcxDirection): Integer; virtual;
  1093.     property ScrollDirection: TcxDirection read FScrollDirection write SetScrollDirection;
  1094.     // selection
  1095.     function CanPostponeRecordSelection: Boolean; virtual;
  1096.     function CanProcessMultiSelect(AIsKeyboard: Boolean): Boolean; overload; virtual;
  1097.     function CanProcessMultiSelect(AHitTest: TcxCustomGridHitTest;
  1098.       AShift: TShiftState): Boolean; overload; virtual;
  1099.     function CanProcessMultiSelect(AKey: Word; AShift: TShiftState;
  1100.       AFocusedRecordChanged: Boolean): Boolean; overload; virtual;
  1101.     procedure ChangeRecordSelection(ARecord: TcxCustomGridRecord; Value: Boolean);
  1102.     procedure CheckFocusedRecordSelectionWhenExit(ARecord: TcxCustomGridRecord);
  1103.     procedure DoMouseNormalSelection(AHitTest: TcxCustomGridHitTest); virtual;
  1104.     procedure DoMouseRangeSelection(AClearSelection: Boolean = True; AData: TObject = nil); virtual;
  1105.     procedure DoNormalSelection; virtual;
  1106.     procedure DoNormalSelectionWithAnchor(ASelect: Boolean = True);
  1107.     procedure DoRangeSelection(AClearSelection: Boolean = True);
  1108.     procedure DoToggleRecordSelection;
  1109.     procedure FinishSelection; virtual;
  1110.     procedure InvalidateFocusedRecord; virtual;
  1111.     procedure InvalidateSelection; virtual;
  1112.     function IsKeyForMultiSelect(AKey: Word; AShift: TShiftState;
  1113.       AFocusedRecordChanged: Boolean): Boolean; virtual;
  1114.     function IsRecordSelected(ARecord: TcxCustomGridRecord): Boolean;
  1115.     procedure MultiSelectKeyDown(var Key: Word; Shift: TShiftState); virtual;
  1116.     procedure MultiSelectMouseDown(AHitTest: TcxCustomGridHitTest; AShift: TShiftState); virtual;
  1117.     procedure MultiSelectMouseUp(AHitTest: TcxCustomGridHitTest; AShift: TShiftState); virtual;
  1118.     procedure SetSelectionAnchor(AGridRecordIndex: Integer);
  1119.     function SupportsAdditiveSelection: Boolean; virtual;
  1120.     function SupportsRecordSelectionToggling: Boolean; virtual;
  1121.     // navigation
  1122.     function CanFocusNextItem(AFocusedItemIndex, ANextItemIndex: Integer;
  1123.       AGoForward, AGoOnCycle, AGoToNextRecordOnCycle: Boolean): Boolean; virtual;
  1124.     function FocusedRecordHasCells(ACheckCellSelect: Boolean): Boolean;
  1125.     procedure FocusNextPage(ASyncSelection: Boolean); virtual;
  1126.     procedure FocusPrevPage(ASyncSelection: Boolean); virtual;
  1127.     function IsKeyForController(AKey: Word; AShift: TShiftState): Boolean; virtual;
  1128.     procedure ScrollPage(AForward: Boolean); virtual;
  1129.     procedure ScrollRecords(AForward: Boolean; ACount: Integer); virtual;
  1130.     procedure ShowNextPage; virtual;
  1131.     procedure ShowPrevPage; virtual;
  1132.     // pull focusing
  1133.     procedure DoPullFocusing(AHitTest: TcxGridRecordHitTest); virtual;
  1134.     procedure DoPullFocusingScrolling(ADirection: TcxDirection); virtual;
  1135.     function GetPullFocusingScrollingDirection(X, Y: Integer; out ADirection: TcxDirection): Boolean; virtual;
  1136.     function IsPullFocusingPosChanged: Boolean;
  1137.     procedure SavePullFocusingPos;
  1138.     procedure StartPullFocusing(AHitTest: TcxCustomGridHitTest); virtual;
  1139.     procedure StopPullFocusing;
  1140.     procedure StartPullFocusingScrolling(ADirection: TcxDirection);
  1141.     procedure StopPullFocusingScrolling;
  1142.     function SupportsPullFocusing: Boolean; virtual;
  1143.     property PullFocusingOriginHitTest: TcxCustomGridHitTest read FPullFocusingOriginHitTest;
  1144.     // delphi drag and drop
  1145.     function GetDragScrollDirection(X, Y: Integer): TcxDirection; virtual;
  1146.     function GetDragScrollInterval: Integer; virtual;
  1147.     function IsFirstRecordForDragScroll(ARecord: TcxCustomGridRecord): Boolean; virtual;
  1148.     function IsLastRecordForDragScroll(ARecord: TcxCustomGridRecord): Boolean; virtual;
  1149.     procedure ProcessDragFocusing(X, Y: Integer);
  1150.     procedure StartDragScroll(ADirection: TcxDirection);
  1151.     procedure StopDragScroll;
  1152.     function IsDragScroll: Boolean;
  1153.     //---
  1154.     function GetDragOpenInfo(AHitTest: TcxCustomGridHitTest): TcxCustomGridDragOpenInfo; virtual;
  1155.     function IsDragOpenHitTest(AHitTest: TcxCustomGridHitTest;
  1156.       out ADragOpenInfo: TcxCustomGridDragOpenInfo): Boolean;
  1157.     //---
  1158.     property DragHighlightedRecord: TcxCustomGridRecord read FDragHighlightedRecord write SetDragHighlightedRecord;
  1159.     // incsearching
  1160.     function GetItemForIncSearching: TcxCustomGridTableItem; virtual;
  1161.     procedure IncSearchKeyDown(var Key: Word; Shift: TShiftState); virtual;
  1162.     property ItemForIncSearching: TcxCustomGridTableItem read GetItemForIncSearching;
  1163.     // customization
  1164.     procedure CheckCustomizationFormBounds(var R: TRect); virtual;
  1165.     function GetCustomizationFormClass: TcxCustomGridTableCustomizationFormClass; virtual;
  1166.     function GetRealCustomizationFormBounds: TRect;
  1167.     procedure HideCustomizationForm;
  1168.     procedure ShowCustomizationForm;
  1169.     function GetEditingControllerClass: TcxGridEditingControllerClass; virtual;
  1170.     property AllowCheckEdit: Boolean read FAllowCheckEdit write FAllowCheckEdit;
  1171.     property BlockRecordKeyboardHandling: Boolean read FBlockRecordKeyboardHandling
  1172.       write FBlockRecordKeyboardHandling;
  1173.     property CancelEditingOnExit: Boolean read GetCancelEditingOnExit;
  1174.     property DragAndDropObject: TcxCustomGridTableDragAndDropObject read GetDragAndDropObject;
  1175.     property EatKeyPress: Boolean read FEatKeyPress write FEatKeyPress;
  1176.     property FocusOnRecordFocusing: Boolean read FFocusOnRecordFocusing write FFocusOnRecordFocusing;
  1177.     property ForcingWidthItem: TcxCustomGridTableItem read FForcingWidthItem write FForcingWidthItem;
  1178.     property InternalTopRecordIndex: Integer read FTopRecordIndex write SetInternalTopRecordIndex;
  1179.     property IsCheckingCoordinates: Boolean read FIsCheckingCoordinates;
  1180.     property IsReadyForImmediateEditing: Boolean read FIsReadyForImmediateEditing
  1181.       write FIsReadyForImmediateEditing;
  1182.     property IsRecordsScrollHorizontal: Boolean read GetIsRecordsScrollHorizontal;
  1183.     property MultiSelect: Boolean read GetMultiSelect;
  1184.     property ScrollBarOffsetBegin: Integer read GetScrollBarOffsetBegin;
  1185.     property ScrollBarOffsetEnd: Integer read GetScrollBarOffsetEnd;
  1186.     property ScrollBarRecordCount: Integer read GetScrollBarRecordCount;
  1187.     property ScrollBarPos: Integer read GetScrollBarPos write SetScrollBarPos;
  1188.     property ViewData: TcxCustomGridTableViewData read GetViewData;
  1189.     property ViewInfo: TcxCustomGridTableViewInfo read GetViewInfo;
  1190.   public
  1191.     constructor Create(AGridView: TcxCustomGridView); override;
  1192.     destructor Destroy; override;
  1193.     procedure BeginDragAndDrop; override;
  1194.     procedure ControlFocusChanged; override;
  1195.     procedure DoCancelMode; override;
  1196.     procedure DoKeyDown(var Key: Word; Shift: TShiftState); override;
  1197.     procedure EndDragAndDrop(Accepted: Boolean); override;
  1198.     function FindNextItem(AFocusedItemIndex: Integer;
  1199.       AGoForward, AGoOnCycle: Boolean; out ACycleChanged: Boolean;
  1200.       ARecord: TcxCustomGridRecord): Integer; virtual;
  1201.     function FindNextRecord(AFocusedRecordIndex: Integer;
  1202.       AGoForward, AGoOnCycle: Boolean; out ACycleChanged: Boolean): Integer;
  1203.     function HasFilterMRUItemsPopup: Boolean;
  1204.     function HasFilterPopup: Boolean;
  1205.     function HasFocusedControls: Boolean; override;
  1206.     function HasItemsCustomizationPopup: Boolean;
  1207.     function IsClickableRecordHitTest(AHitTest: TcxCustomGridHitTest): Boolean;
  1208.     function IsDataFullyVisible(AIsCallFromMaster: Boolean = False): Boolean; override;
  1209.     procedure KeyDown(var Key: Word; Shift: TShiftState); override;
  1210.     procedure KeyPress(var Key: Char); override;
  1211.     procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
  1212.     procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
  1213.     procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
  1214.     function ProcessDetailDialogChar(ADetail: TcxCustomGridView; ACharCode: Word): Boolean; override;
  1215.     function ProcessDialogChar(ACharCode: Word): Boolean; override;
  1216.     function SupportsTabAccelerators(AGridRecord: TcxCustomGridRecord): Boolean; virtual;
  1217.   {$IFDEF VCL}
  1218.     procedure WndProc(var Message: TMessage); override;
  1219.   {$ENDIF}
  1220.     procedure BeforeStartDrag; override;
  1221.     function CanDrag(X, Y: Integer): Boolean; override;
  1222.     procedure DragDrop(Source: TObject; X, Y: Integer); override;
  1223.     procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState;
  1224.       var Accept: Boolean); override;
  1225.     procedure DrawDragImage(ACanvas: TcxCanvas; R: TRect); override;
  1226.     procedure EndDrag(Target: TObject; X, Y: Integer); override;
  1227.     function GetDragDropText(ADragObject: TDragObject): string; virtual;
  1228.     procedure GetDragDropTextViewParams(out AParams: TcxViewParams); virtual;
  1229.     function GetDragImagesSize: TPoint; override;
  1230.     function HasDragImages: Boolean; override;
  1231.     procedure StartDrag(var DragObject: TDragObject); override;
  1232.     property DragDropText: string read FDragDropText;
  1233.     procedure CancelIncSearching;
  1234.     procedure CheckScrolling(const P: TPoint); virtual;
  1235.     procedure ClearSelection; virtual;
  1236.     procedure CreateNewRecord(AtEnd: Boolean); virtual;
  1237.     procedure DeleteSelection; virtual;
  1238.     procedure DoCheckCoordinates;
  1239.     function FocusFirstAvailableItem: Boolean;
  1240.     function FocusNextCell(AGoForward: Boolean; AProcessCellsOnly: Boolean = True;
  1241.       AAllowCellsCycle: Boolean = True): Boolean;
  1242.     function FocusNextItem(AFocusedItemIndex: Integer;
  1243.       AGoForward, AGoOnCycle, AGoToNextRecordOnCycle: Boolean): Boolean;
  1244.     function FocusNextRecord(AFocusedRecordIndex: Integer;
  1245.       AGoForward, AGoOnCycle, AGoIntoOutDetail: Boolean): Boolean;
  1246.     function FocusNextRecordWithSelection(AFocusedRecordIndex: Integer;
  1247.       AGoForward, AGoOnCycle, AGoIntoDetail: Boolean; ASyncSelection: Boolean = True): Boolean;
  1248.     function FocusRecord(AFocusedRecordIndex: Integer; ASyncSelection: Boolean): Boolean;
  1249.     procedure MakeFocusedItemVisible;
  1250.     procedure MakeFocusedRecordVisible;
  1251.     procedure MakeItemVisible(AItem: TcxCustomGridTableItem); virtual; abstract;
  1252.     procedure MakeRecordVisible(ARecord: TcxCustomGridRecord); virtual;
  1253.     procedure SelectAll; virtual;
  1254.     procedure SelectAllRecords;
  1255.     function GoToFirst: Boolean;
  1256.     function GoToLast(AGoIntoDetail: Boolean): Boolean;
  1257.     function GoToNext(AGoIntoDetail: Boolean; ASyncSelection: Boolean = True): Boolean;
  1258.     function GoToPrev(AGoIntoDetail: Boolean; ASyncSelection: Boolean = True): Boolean;
  1259.     function IsFinish: Boolean;
  1260.     function IsStart: Boolean;
  1261.     procedure RefreshCustomizationForm;
  1262.     property ClickedCellViewInfo: TcxGridTableDataCellViewInfo read FClickedCellViewInfo write FClickedCellViewInfo;
  1263.     property Customization: Boolean read FCustomization write SetCustomization;
  1264.     property CustomizationForm: TcxCustomGridTableCustomizationForm read FCustomizationForm;
  1265.     property CustomizationFormBounds: TRect read FCustomizationFormBounds
  1266.       write FCustomizationFormBounds;
  1267.     property EditingController: TcxGridEditingController read FEditingController;
  1268.     property EditingItem: TcxCustomGridTableItem read GetEditingItem write SetEditingItem;
  1269.     property FilterMRUItemsPopup: TcxGridFilterMRUItemsPopup read GetFilterMRUItemsPopup;
  1270.     property FilterPopup: TcxGridFilterPopup read GetFilterPopup;
  1271.     property FocusedItem: TcxCustomGridTableItem read FFocusedItem write SetFocusedItem;
  1272.     property FocusedItemIndex: Integer read GetFocusedItemIndex write SetFocusedItemIndex;
  1273.     property FocusedRecord: TcxCustomGridRecord read GetFocusedRecord write SetFocusedRecord;
  1274.     property FocusedRecordIndex: Integer read GetFocusedRecordIndex write SetFocusedRecordIndex;
  1275.     property GridView: TcxCustomGridTableView read GetGridView;
  1276.     property IncSearchingItem: TcxCustomGridTableItem read GetIncSearchingItem;
  1277.     property IncSearchingText: string read GetIncSearchingText write SetIncSearchingText;
  1278.     property IsPullFocusing: Boolean read FIsPullFocusing;
  1279.     property IsEditing: Boolean read GetIsEditing;
  1280.     property IsIncSearching: Boolean read GetIsIncSearching;
  1281.     property IsItemMoving: Boolean read GetIsItemMoving;
  1282.     property ItemsCustomizationPopup: TcxCustomGridItemsCustomizationPopup read GetItemsCustomizationPopup;
  1283.     property MasterController: TcxCustomGridTableController read GetMasterController;
  1284.     property MovingItem: TcxCustomGridTableItem read FMovingItem;
  1285.     property SelectedRecordCount: Integer read GetSelectedRecordCount;
  1286.     property SelectedRecords[Index: Integer]: TcxCustomGridRecord read GetSelectedRecord;
  1287.     property TopRecordIndex: Integer read FTopRecordIndex write SetTopRecordIndex;
  1288.   end;
  1289.   { painters }
  1290.   TcxCustomGridPartPainter = class(TcxCustomGridCellPainter);
  1291.   // filter
  1292.   TcxCustomGridFilterButtonPainter = class(TcxCustomGridCellPainter)
  1293.   private
  1294.     function GetViewInfo: TcxCustomGridFilterButtonViewInfo;
  1295.   protected
  1296.     function ExcludeFromClipRect: Boolean; override;
  1297.     property ViewInfo: TcxCustomGridFilterButtonViewInfo read GetViewInfo;
  1298.   end;
  1299.   TcxGridFilterCloseButtonPainter = class(TcxCustomGridFilterButtonPainter)
  1300.   protected
  1301.     procedure DrawContent; override;
  1302.   end;
  1303.   TcxGridFilterActivateButtonPainter = class(TcxCustomGridFilterButtonPainter)
  1304.   private
  1305.     function GetViewInfo: TcxGridFilterActivateButtonViewInfo;
  1306.   protected
  1307.     procedure DrawContent; override;
  1308.     property ViewInfo: TcxGridFilterActivateButtonViewInfo read GetViewInfo;
  1309.   end;
  1310.   TcxGridFilterDropDownButtonPainter = class(TcxCustomGridFilterButtonPainter)
  1311.   protected
  1312.     procedure DrawContent; override;
  1313.   end;
  1314.   TcxGridFilterCustomizeButtonPainter = class(TcxCustomGridFilterButtonPainter)
  1315.   protected
  1316.     procedure Paint; override;
  1317.   end;
  1318.   TcxGridFilterPainterClass = class of TcxGridFilterPainter;
  1319.   TcxGridFilterPainter = class(TcxCustomGridPartPainter)
  1320.   private
  1321.     FTextWasUnderlined: Boolean;
  1322.     function GetViewInfo: TcxGridFilterViewInfo;
  1323.   protected
  1324.     procedure DrawButtons; virtual;
  1325.     function ExcludeFromClipRect: Boolean; override;
  1326.     procedure Paint; override;
  1327.     procedure PrepareCanvasForDrawText; override;
  1328.     procedure UnprepareCanvasForDrawText; override;
  1329.     property ViewInfo: TcxGridFilterViewInfo read GetViewInfo;
  1330.   end;
  1331.   // records
  1332.   TcxGridTableDataCellPainterClass = class of TcxGridTableDataCellPainter;
  1333.   TcxGridTableDataCellPainter = class(TcxCustomGridCellPainter)
  1334.   private
  1335.     function GetViewInfo: TcxGridTableDataCellViewInfo;
  1336.   protected
  1337.     procedure DrawContent; override;
  1338.     procedure DrawFocusRect; virtual;
  1339.     procedure Paint; override;
  1340.     property ViewInfo: TcxGridTableDataCellViewInfo read GetViewInfo;
  1341.   end;
  1342.   TcxCustomGridRecordPainterClass = class of TcxCustomGridRecordPainter;
  1343.   TcxCustomGridRecordPainter = class(TcxCustomGridCellPainter)
  1344.   private
  1345.     function GetViewInfo: TcxCustomGridRecordViewInfo;
  1346.   protected
  1347.     procedure AfterPaint; override;
  1348.     procedure BeforePaint; override;
  1349.     procedure DrawBackground; override;
  1350.     procedure DrawExpandButton; virtual;
  1351.     function DrawExpandButtonBeforePaint: Boolean; virtual;
  1352.     procedure DrawFocusRect; virtual;
  1353.     procedure Paint; override;
  1354.     property ViewInfo: TcxCustomGridRecordViewInfo read GetViewInfo;
  1355.   end;
  1356.   TcxCustomGridRecordsPainterClass = class of TcxCustomGridRecordsPainter;
  1357.   TcxCustomGridRecordsPainter = class
  1358.   private
  1359.     FCanvas: TcxCanvas;
  1360.     FViewInfo: TcxCustomGridRecordsViewInfo;
  1361.   protected
  1362.     //procedure BeforePaint; virtual;
  1363.     procedure Paint; virtual;
  1364.     property Canvas: TcxCanvas read FCanvas;
  1365.     property ViewInfo: TcxCustomGridRecordsViewInfo read FViewInfo;
  1366.   public
  1367.     constructor Create(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridRecordsViewInfo); virtual;
  1368.     procedure MainPaint;
  1369.   end;
  1370.   // view
  1371.   TcxNavigatorSitePainter = class(TcxCustomGridCellPainter)
  1372.   protected
  1373.     function ExcludeFromClipRect: Boolean; override;
  1374.   end;
  1375.   TcxCustomGridTablePainter = class(TcxCustomGridPainter)
  1376.   private
  1377.     function GetController: TcxCustomGridTableController;
  1378.     function GetViewInfo: TcxCustomGridTableViewInfo;
  1379.   protected
  1380.     function CanOffset(AItemsOffset, DX, DY: Integer): Boolean; virtual;
  1381.     procedure DrawBackground; override;
  1382.     procedure DrawFilterBar; virtual;
  1383.     procedure DrawInfoText; virtual;
  1384.     procedure DrawNavigator; virtual;
  1385.     procedure DrawRecords; virtual;
  1386.     procedure Offset(AItemsOffset: Integer); overload; virtual;
  1387.     procedure Offset(DX, DY: Integer); overload; virtual;
  1388.     procedure PaintBefore; override;
  1389.     procedure PaintContent; override;
  1390.   public
  1391.     procedure DoOffset(AItemsOffset, DX, DY: Integer);
  1392.     procedure DrawFocusRect(const R: TRect; AHideFocusRect: Boolean); override;
  1393.     property Controller: TcxCustomGridTableController read GetController;
  1394.     property ViewInfo: TcxCustomGridTableViewInfo read GetViewInfo;
  1395.   end;
  1396.   { view infos }
  1397.   // part
  1398.   TcxGridPartAlignment = (gpaTop, gpaBottom);
  1399.   TcxCustomGridPartViewInfo = class(TcxCustomGridViewCellViewInfo)
  1400.   private
  1401.     FHeight: Integer;
  1402.     function GetGridView: TcxCustomGridTableView;
  1403.     function GetGridViewInfo: TcxCustomGridTableViewInfo;
  1404.     function GetIndex: Integer;
  1405.     procedure SetIndex(Value: Integer);
  1406.   protected
  1407.     function CalculateBounds: TRect; virtual;
  1408.     procedure CalculateInvisible; virtual;
  1409.     procedure CalculateVisible; virtual;
  1410.     function CustomDrawBackground(ACanvas: TcxCanvas): Boolean; override;
  1411.     function GetAlignment: TcxGridPartAlignment; virtual; abstract;
  1412.     //function GetHeight: Integer; override;
  1413.     function GetIsAutoWidth: Boolean; virtual; abstract;
  1414.     function GetIsPart: Boolean; virtual;
  1415.     function GetIsScrollable: Boolean; virtual; abstract;
  1416.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1417.     function HasCustomDrawBackground: Boolean; override;
  1418.     procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override;
  1419.     property Height: Integer read FHeight write FHeight;
  1420.     property IsPart: Boolean read GetIsPart;
  1421.   public
  1422.     constructor Create(AGridViewInfo: TcxCustomGridTableViewInfo); reintroduce; virtual; 
  1423.     destructor Destroy; override;
  1424.     procedure MainCalculate;
  1425.     property Alignment: TcxGridPartAlignment read GetAlignment;
  1426.     property GridView: TcxCustomGridTableView read GetGridView;
  1427.     property GridViewInfo: TcxCustomGridTableViewInfo read GetGridViewInfo;
  1428.     property Index: Integer read GetIndex write SetIndex;
  1429.     property IsAutoWidth: Boolean read GetIsAutoWidth;
  1430.     property IsScrollable: Boolean read GetIsScrollable;
  1431.   end;
  1432.   // filter
  1433.   TcxGridFilterButtonAlignment = (fbaLeft, fbaRight);
  1434.   TcxCustomGridFilterButtonViewInfoClass = class of TcxCustomGridFilterButtonViewInfo;
  1435.   TcxCustomGridFilterButtonViewInfo = class(TcxCustomGridViewCellViewInfo)
  1436.   private
  1437.     FContainer: TcxGridFilterButtonsViewInfo;
  1438.     function GetFilter: TcxDataFilterCriteria;
  1439.     function GetGridView: TcxCustomGridTableView;
  1440.   protected
  1441.     function CaptureMouseOnPress: Boolean; override;
  1442.     function GetAlignment: TcxGridFilterButtonAlignment; virtual;
  1443.     function GetCanvas: TcxCanvas; override;
  1444.     function GetHotTrack: Boolean; override;
  1445.     function GetVisible: Boolean; override;
  1446.     property Container: TcxGridFilterButtonsViewInfo read FContainer;
  1447.     property Filter: TcxDataFilterCriteria read GetFilter;
  1448.   public
  1449.     constructor Create(AContainer: TcxGridFilterButtonsViewInfo); reintroduce; virtual;
  1450.     property Alignment: TcxGridFilterButtonAlignment read GetAlignment;
  1451.     property GridView: TcxCustomGridTableView read GetGridView;
  1452.   end;
  1453.   TcxGridFilterCloseButtonViewInfo = class(TcxCustomGridFilterButtonViewInfo)
  1454.   protected
  1455.     function CalculateHeight: Integer; override;
  1456.     function CalculateWidth: Integer; override;
  1457.     procedure Click; override;
  1458.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1459.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1460.   end;
  1461.   TcxGridFilterActivateButtonViewInfo = class(TcxCustomGridFilterButtonViewInfo)
  1462.   private
  1463.     function GetChecked: Boolean;
  1464.   protected
  1465.     function CalculateHeight: Integer; override;
  1466.     function CalculateWidth: Integer; override;
  1467.     procedure Click; override;
  1468.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1469.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1470.   public
  1471.     property Checked: Boolean read GetChecked;
  1472.   end;
  1473.   TcxGridFilterDropDownButtonViewInfo = class(TcxCustomGridFilterButtonViewInfo,
  1474.     IcxCustomGridPopupOwner)
  1475.   private
  1476.     function GetDropDownWindow: TcxGridFilterMRUItemsPopup;
  1477.   protected
  1478.     { IcxCustomGridPopupOwner }
  1479.     function ClosePopupWhenNilOwner: Boolean;
  1480.     function GetOwnerBounds: TRect;
  1481.     procedure PopupClosed;
  1482.     procedure BeforeStateChange; override;
  1483.     function CalculateHeight: Integer; override;
  1484.     function CalculateWidth: Integer; override;
  1485.     function CaptureMouseOnPress: Boolean; override;
  1486.     procedure DropDown; virtual;
  1487.     function DropDownWindowExists: Boolean; virtual;
  1488.     function GetAlignment: TcxGridFilterButtonAlignment; override;
  1489.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1490.     function GetIsCheck: Boolean; override;
  1491.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1492.     function GetVisible: Boolean; override;
  1493.     procedure StateChanged; override;
  1494.   public
  1495.     destructor Destroy; override;
  1496.     procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1;
  1497.       AHeight: Integer = -1); override;
  1498.     property DropDownWindow: TcxGridFilterMRUItemsPopup read GetDropDownWindow;
  1499.   end;
  1500.   TcxGridFilterCustomizeButtonViewInfo = class(TcxCustomGridFilterButtonViewInfo)
  1501.   protected
  1502.     function CalculateHeight: Integer; override;
  1503.     function CalculateWidth: Integer; override;
  1504.     procedure Click; override;
  1505.     function GetAlignment: TcxGridFilterButtonAlignment; override;
  1506.     function GetAlignmentHorz: TAlignment; override;
  1507.     function GetAlignmentVert: TcxAlignmentVert; override;
  1508.     function GetBorders: TcxBorders; override;
  1509.     function GetBorderWidth(AIndex: TcxBorder): Integer; override;
  1510.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1511.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1512.     function GetText: string; override;
  1513.     function GetTextAreaBounds: TRect; override;
  1514.     procedure GetViewParams(var AParams: TcxViewParams); override;
  1515.     function GetVisible: Boolean; override;
  1516.   end;
  1517.   TcxGridFilterButtonsViewInfoClass = class of TcxGridFilterButtonsViewInfo;
  1518.   TcxGridFilterButtonsViewInfo = class
  1519.   private
  1520.     FFilterViewInfo: TcxGridFilterViewInfo;
  1521.     FItems: TList;
  1522.     function GetCount: Integer;
  1523.     function GetGridView: TcxCustomGridTableView;
  1524.     function GetHeight: Integer;
  1525.     function GetItem(Index: Integer): TcxCustomGridFilterButtonViewInfo;
  1526.     function GetWidth(AAlignment: TcxGridFilterButtonAlignment): Integer;
  1527.     function GetWidthLeftPart: Integer;
  1528.     function GetWidthRightPart: Integer;
  1529.   protected
  1530.     FDropDownButtonViewInfo: TcxGridFilterDropDownButtonViewInfo;
  1531.     procedure AddItems; virtual;
  1532.     procedure DestroyItems; virtual;
  1533.     property FilterViewInfo: TcxGridFilterViewInfo read FFilterViewInfo;
  1534.     property GridView: TcxCustomGridTableView read GetGridView;
  1535.   public
  1536.     constructor Create(AFilterViewInfo: TcxGridFilterViewInfo); virtual;
  1537.     destructor Destroy; override;
  1538.     function AddItem(AItemClass: TcxCustomGridFilterButtonViewInfoClass): TcxCustomGridFilterButtonViewInfo;
  1539.     procedure Calculate(const ABounds: TRect); virtual;
  1540.     function GetHitTest(const P: TPoint): TcxCustomGridHitTest; virtual;
  1541.     property Count: Integer read GetCount;
  1542.     property DropDownButtonViewInfo: TcxGridFilterDropDownButtonViewInfo read FDropDownButtonViewInfo;
  1543.     property Height: Integer read GetHeight;
  1544.     property Items[Index: Integer]: TcxCustomGridFilterButtonViewInfo read GetItem; default;
  1545.     property WidthLeftPart: Integer read GetWidthLeftPart;
  1546.     property WidthRightPart: Integer read GetWidthRightPart;
  1547.   end;
  1548.   TcxGridFilterViewInfoClass = class of TcxGridFilterViewInfo;
  1549.   TcxGridFilterViewInfo = class(TcxCustomGridPartViewInfo)
  1550.   private
  1551.     FButtonsViewInfo: TcxGridFilterButtonsViewInfo;
  1552.     function GetFilter: TcxDataFilterCriteria;
  1553.     function GetFiltering: TcxCustomGridTableFiltering;
  1554.     procedure CreateButtonsViewInfo;
  1555.     procedure DestroyButtonsViewInfo;
  1556.   protected
  1557.     function CalculateButtonsViewInfoBounds: TRect; virtual;
  1558.     function CalculateHeight: Integer; override;
  1559.     function CalculateWidth: Integer; override;
  1560.     function GetAlignment: TcxGridPartAlignment; override;
  1561.     function GetAlignmentVert: TcxAlignmentVert; override;
  1562.     function GetBackgroundBitmap: TBitmap; override;
  1563.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1564.     function GetHotTrack: Boolean; override;
  1565.     function GetIsAutoWidth: Boolean; override;
  1566.     function GetIsCheck: Boolean; override;
  1567.     function GetIsScrollable: Boolean; override;
  1568.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1569.     function GetText: string; override;
  1570.     function GetTextAreaBounds: TRect; override;
  1571.     procedure GetViewParams(var AParams: TcxViewParams); override;
  1572.     function GetVisible: Boolean; override;
  1573.     function HasMouse(AHitTest: TcxCustomGridHitTest): Boolean; override;
  1574.     function InvalidateOnStateChange: Boolean; override;
  1575.     procedure StateChanged; override;
  1576.     function GetButtonsViewInfoClass: TcxGridFilterButtonsViewInfoClass; virtual;
  1577.     property Filter: TcxDataFilterCriteria read GetFilter;
  1578.     property Filtering: TcxCustomGridTableFiltering read GetFiltering;
  1579.   public
  1580.     constructor Create(AGridViewInfo: TcxCustomGridTableViewInfo); override;
  1581.     destructor Destroy; override;
  1582.     procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1;
  1583.       AHeight: Integer = -1); override;
  1584.     function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
  1585.     property ButtonsViewInfo: TcxGridFilterButtonsViewInfo read FButtonsViewInfo;
  1586.   end;
  1587.   // cells
  1588.   TcxGridTableCellViewInfo = class(TcxCustomGridViewCellViewInfo)
  1589.   private
  1590.     FRecordViewInfo: TcxCustomGridRecordViewInfo;
  1591.     FSelected: Boolean;
  1592.     FSelectedCalculated: Boolean;
  1593.     function GetCacheItem: TcxCustomGridTableViewInfoCacheItem;
  1594.     function GetController: TcxCustomGridTableController;
  1595.     function GetGridView: TcxCustomGridTableView;
  1596.     function GetGridRecord: TcxCustomGridRecord;
  1597.     function GetSelected: Boolean;
  1598.   protected
  1599.     function CalculateSelected: Boolean; virtual;
  1600.     function GetAlwaysSelected: Boolean; virtual;
  1601.     function GetCanvas: TcxCanvas; override;
  1602.     function GetGridViewInfo: TcxCustomGridTableViewInfo;
  1603.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1604.     function GetTransparent: Boolean; override;
  1605.     procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override;
  1606.     property AlwaysSelected: Boolean read GetAlwaysSelected;
  1607.     property CacheItem: TcxCustomGridTableViewInfoCacheItem read GetCacheItem;
  1608.     property Controller: TcxCustomGridTableController read GetController;
  1609.   public
  1610.     constructor Create(ARecordViewInfo: TcxCustomGridRecordViewInfo); reintroduce; virtual;
  1611.     procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1;
  1612.       AHeight: Integer = -1); override;
  1613.     function CanDrawSelected: Boolean; virtual;
  1614.     function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton;
  1615.       AShift: TShiftState): Boolean; override;
  1616.     property GridRecord: TcxCustomGridRecord read GetGridRecord;
  1617.     property GridView: TcxCustomGridTableView read GetGridView;
  1618.     property GridViewInfo: TcxCustomGridTableViewInfo read GetGridViewInfo;
  1619.     property RecordViewInfo: TcxCustomGridRecordViewInfo read FRecordViewInfo;
  1620.     property Selected: Boolean read GetSelected;
  1621.   end;
  1622.   TcxGridTableDataCellViewInfo = class(TcxGridTableCellViewInfo)
  1623.   private
  1624.     FEditViewData: TcxCustomEditViewData;
  1625.     FEditViewInfo: TcxCustomEditViewInfo;
  1626.     FIsLocalCopyOfEditViewData: Boolean;
  1627.     FItem: TcxCustomGridTableItem;
  1628.     FProperties: TcxCustomEditProperties;
  1629.     FStyle: TcxEditStyle;
  1630.     FWasFocusedBeforeClick: Boolean;
  1631.     function GetEditing: Boolean;
  1632.     function GetMousePos: TPoint;
  1633.     function GetProperties: TcxCustomEditProperties;
  1634.     function GetShowButtons: Boolean;
  1635.   protected
  1636.     procedure AfterCustomDraw(ACanvas: TcxCanvas); override;
  1637.     procedure BeforeCustomDraw(ACanvas: TcxCanvas); override;
  1638.     procedure CalculateEditViewInfo(AEditViewInfo: TcxCustomEditViewInfo;
  1639.       const AMousePos: TPoint); virtual;
  1640.     function CalculateHeight: Integer; override;
  1641.     function CalculateSelected: Boolean; override;
  1642.     function CanShowEdit: Boolean; virtual;
  1643.     function CanShowHint: Boolean; override;
  1644.     procedure CheckEditHotTrack(const AMousePos: TPoint);
  1645.     function CustomDraw(ACanvas: TcxCanvas): Boolean; override;
  1646.     procedure DoCalculateParams; override;
  1647.     procedure EditHotTrackChanged;
  1648.     function GetActivateEditOnMouseDown: Boolean; virtual;
  1649.     function GetAreaBoundsForHint: TRect; override;
  1650.     function GetAutoHeight: Boolean; virtual;
  1651.     function GetCellBoundsForHint: TRect; override;
  1652.     function GetDisplayValue: TcxEditValue; virtual;
  1653.     function GetEditBounds: TRect; virtual;
  1654.     function GetEditViewDataBounds: TRect; virtual;
  1655.     procedure GetEditViewDataContentOffsets(var R: TRect); virtual;
  1656.     function GetFocused: Boolean; virtual;
  1657.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1658.     function GetHotTrack: Boolean; override;
  1659.     function GetMaxLineCount: Integer; virtual;
  1660.     function GetMultiLine: Boolean; override;
  1661.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1662.     function GetShowEndEllipsis: Boolean; override;
  1663.     function GetText: string; override;
  1664.     function GetValue: Variant; virtual;
  1665.     procedure GetViewParams(var AParams: TcxViewParams); override;
  1666.     function HasCustomDraw: Boolean; override;
  1667.     function HasFocusRect: Boolean; virtual;
  1668.     procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override;
  1669.     procedure InitTextSelection; virtual;
  1670.     function InvalidateOnStateChange: Boolean; override;
  1671.     function IsTextSelected: Boolean; virtual;
  1672.     procedure MouseLeave; override;
  1673.     function NeedShowHint(const AMousePos: TPoint; out AHintText: TCaption;
  1674.       out AIsHintMultiLine: Boolean; out ATextRect: TRect): Boolean; override;
  1675.     procedure Offset(DX, DY: Integer); override;
  1676.     procedure RestoreParams(const AParams: TcxViewParams); override;
  1677.     procedure SaveParams(out AParams: TcxViewParams); override;
  1678.     procedure StateChanged; override;
  1679.     function UseStandardNeedShowHint: Boolean; virtual;
  1680.     procedure InitStyle; virtual;
  1681.     function CreateEditViewInfo: TcxCustomEditViewInfo;
  1682.     procedure CreateEditViewData;
  1683.     procedure DestroyEditViewData;
  1684.     property EditViewData: TcxCustomEditViewData read FEditViewData;
  1685.     procedure UpdateEdit;
  1686.     property ActivateEditOnMouseDown: Boolean read GetActivateEditOnMouseDown;
  1687.     property AutoHeight: Boolean read GetAutoHeight;
  1688.     property EditViewDataBounds: TRect read GetEditViewDataBounds;
  1689.     property MaxLineCount: Integer read GetMaxLineCount;
  1690.     property MousePos: TPoint read GetMousePos;
  1691.     property ShowButtons: Boolean read GetShowButtons;
  1692.     property WasFocusedBeforeClick: Boolean read FWasFocusedBeforeClick;
  1693.   public
  1694.     constructor Create(ARecordViewInfo: TcxCustomGridRecordViewInfo;
  1695.       AItem: TcxCustomGridTableItem); reintroduce; virtual;
  1696.     destructor Destroy; override;
  1697.     procedure BeforeRecalculation; override;
  1698.     procedure Calculate(ALeftBound, ATopBound: Integer; AWidth: Integer = -1;
  1699.       AHeight: Integer = -1); override;
  1700.     function CanDrawSelected: Boolean; override;
  1701.     function GetInplaceEditParams: TcxInplaceEditParams;
  1702.     procedure Invalidate(ARecalculate: Boolean); reintroduce; virtual;
  1703.     function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton;
  1704.       AShift: TShiftState): Boolean; override;
  1705.     function MouseMove(AHitTest: TcxCustomGridHitTest; AShift: TShiftState): Boolean; override;
  1706.     function MouseUp(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton;
  1707.       AShift: TShiftState): Boolean; override;
  1708.     property DisplayValue: TcxEditValue read GetDisplayValue;
  1709.     //property Edit: TcxCustomEdit read GetEdit;
  1710.     property EditBounds: TRect read GetEditBounds;
  1711.     property Editing: Boolean read GetEditing;
  1712.     property EditViewInfo: TcxCustomEditViewInfo read FEditViewInfo;
  1713.     property Focused: Boolean read GetFocused;
  1714.     property Item: TcxCustomGridTableItem read FItem;
  1715.     property Properties: TcxCustomEditProperties read GetProperties;
  1716.     property Style: TcxEditStyle read FStyle;
  1717.     property Value: Variant read GetValue;
  1718.   end;
  1719.   // records
  1720.   TcxCustomGridRecordViewInfo = class(TcxCustomGridViewCellViewInfo)
  1721.   private
  1722.     FExpandButtonBounds: TRect;
  1723.     FExpanded: Boolean;
  1724.     FExpandedCalculated: Boolean;
  1725.     FIsRecordViewInfoAssigned: Boolean;
  1726.     FRecordsViewInfo: TcxCustomGridRecordsViewInfo;
  1727.     FSelected: Boolean;
  1728.     FSelectedCalculated: Boolean;
  1729.     function GetCacheItem: TcxCustomGridTableViewInfoCacheItem;
  1730.     function GetExpanded: Boolean;
  1731.     function GetFocused: Boolean;
  1732.     function GetGridView: TcxCustomGridTableView;
  1733.     function GetGridViewInfo: TcxCustomGridTableViewInfo;
  1734.     function GetIndex: Integer;
  1735.     function GetSelected: Boolean;
  1736.     procedure SetExpanded(Value: Boolean);
  1737.   protected
  1738.     FRecord: TcxCustomGridRecord;
  1739.     procedure CalculateExpandButtonBounds(var ABounds: TRect); virtual; abstract;
  1740.     function CalculateSelected: Boolean; virtual;
  1741.     function CanGenerateExpandButtonHitTest: Boolean; virtual;
  1742.     procedure ControlFocusChanged; virtual;
  1743.     function GetAutoHeight: Boolean; virtual;
  1744.     function GetBackgroundBitmap: TBitmap; override;
  1745.     function GetBackgroundBitmapBounds: TRect; virtual;
  1746.     function GetCanvas: TcxCanvas; override;
  1747.     function GetCellTransparent(ACell: TcxGridTableCellViewInfo): Boolean; virtual;
  1748.     function GetContentBounds: TRect; virtual;
  1749.     function GetExpandButtonAreaBounds: TRect; virtual;
  1750.     function GetFocusRectBounds: TRect; virtual;
  1751.     function GetHeight: Integer; override;
  1752.     function GetHideFocusRectOnExit: Boolean; virtual;
  1753.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1754.     function GetVisible: Boolean; override;
  1755.     function HasFocusRect: Boolean; virtual;
  1756.     procedure InitHitTest(AHitTest: TcxCustomGridHitTest); override;
  1757.     function IsClickHitTest(AHitTest: TcxCustomGridHitTest): Boolean; virtual;
  1758.     function IsDetailVisible(ADetail: TcxCustomGridView): Boolean; virtual;
  1759.     procedure Offset(DX, DY: Integer); override;
  1760.     procedure VisibilityChanged(AVisible: Boolean); virtual;
  1761.     property AutoHeight: Boolean read GetAutoHeight;
  1762.     property BackgroundBitmapBounds: TRect read GetBackgroundBitmapBounds;
  1763.     property CacheItem: TcxCustomGridTableViewInfoCacheItem read GetCacheItem;
  1764.     property ExpandButtonAreaBounds: TRect read GetExpandButtonAreaBounds;
  1765.     property Expanded: Boolean read GetExpanded write SetExpanded;
  1766.   public
  1767.     constructor Create(ARecordsViewInfo: TcxCustomGridRecordsViewInfo;
  1768.       ARecord: TcxCustomGridRecord); reintroduce; virtual;
  1769.     destructor Destroy; override;
  1770.     procedure BeforeRecalculation; override;
  1771.     function Click(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton;
  1772.       AShift: TShiftState): Boolean; reintroduce; virtual;
  1773.     function GetBoundsForInvalidate(AItem: TcxCustomGridTableItem): TRect; virtual;
  1774.     function GetBoundsForItem(AItem: TcxCustomGridTableItem): TRect; virtual;
  1775.     function GetCellViewInfoByItem(AItem: TcxCustomGridTableItem): TcxGridTableDataCellViewInfo; virtual;
  1776.     {procedure GetDataCellViewParams(AItem: TcxCustomGridTableItem;
  1777.       ACellViewInfo: TcxGridTableCellViewInfo; var AParams: TcxViewParams); virtual;}
  1778.     function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
  1779.     procedure MainCalculate(ALeftBound, ATopBound: Integer); virtual;
  1780.     function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton;
  1781.       AShift: TShiftState): Boolean; override;
  1782.     function ProcessDialogChar(ACharCode: Word): Boolean; virtual;
  1783.     procedure Recalculate;
  1784.     property ContentBounds: TRect read GetContentBounds;
  1785.     property ExpandButtonBounds: TRect read FExpandButtonBounds;
  1786.     property Focused: Boolean read GetFocused;
  1787.     property FocusRectBounds: TRect read GetFocusRectBounds;
  1788.     property GridView: TcxCustomGridTableView read GetGridView;
  1789.     property GridRecord: TcxCustomGridRecord read FRecord;
  1790.     property GridViewInfo: TcxCustomGridTableViewInfo read GetGridViewInfo;
  1791.     property Index: Integer read GetIndex;
  1792.     property HideFocusRectOnExit: Boolean read GetHideFocusRectOnExit;
  1793.     property RecordsViewInfo: TcxCustomGridRecordsViewInfo read FRecordsViewInfo;
  1794.     property Selected: Boolean read GetSelected;
  1795.   end;
  1796.   TcxCustomGridRecordsViewInfoClass = class of TcxCustomGridRecordsViewInfo;
  1797.   TcxCustomGridRecordsViewInfo = class
  1798.   private
  1799.     FBackgroundBitmap: TBitmap;
  1800.   {$IFDEF LINUX}
  1801.     FBackgroundBitmapBrush: TBrush;
  1802.   {$ENDIF}  
  1803.     FBounds: TRect;
  1804.     FContentBounds: TRect;
  1805.     FGridViewInfo: TcxCustomGridTableViewInfo;
  1806.     FIncSearchingCellViewInfo: TcxGridTableDataCellViewInfo;
  1807.     FIsIncSearchingCellViewInfoCalculated: Boolean;
  1808.     FItems: TList;
  1809.     FItemsOffset: Integer;
  1810.     function GetCanvas: TcxCanvas;
  1811.     function GetController: TcxCustomGridTableController;
  1812.     function GetCount: Integer;
  1813.     function GetFirstRecordIndex: Integer;
  1814.     function GetGridView: TcxCustomGridTableView;
  1815.     function GetIncSearchingCellViewInfo: TcxGridTableDataCellViewInfo;
  1816.     function GetItem(Index: Integer): TcxCustomGridRecordViewInfo;
  1817.     function GetMaxCount: Integer;
  1818.     function GetTopRecordIndex: Integer;
  1819.     function GetViewData: TcxCustomGridTableViewData;
  1820.     procedure CreateItems;
  1821.     procedure DestroyItems;
  1822.     function CreateRecordViewInfo(AIndex: Integer): TcxCustomGridRecordViewInfo;
  1823.   protected
  1824.     FVisibleCount: Integer;
  1825.     procedure AfterCalculate; virtual;
  1826.     procedure BeforeCalculate; virtual;
  1827.     procedure BeforeItemRecalculation; virtual;
  1828.     procedure AfterOffset; virtual;
  1829.     procedure BeforeOffset; virtual;
  1830.     procedure Calculate; virtual;
  1831.     function CalculateBounds: TRect; virtual;
  1832.     function CalculateContentBounds: TRect; virtual;
  1833.     function CalculateIncSearchingCellViewInfo: TcxGridTableDataCellViewInfo; virtual;
  1834.     procedure CalculateVisibleCount; virtual;
  1835.     procedure CreateEditViewDatas;
  1836.     procedure DestroyEditViewDatas;
  1837.     function GetAreaBoundsForCellHint(ACellViewInfo: TcxGridTableDataCellViewInfo): TRect; virtual;
  1838.     function GetAutoDataRecordHeight: Boolean; virtual;
  1839.     function GetAutoRecordHeight: Boolean; virtual;
  1840.     function GetBackgroundBitmap: TBitmap; virtual;
  1841.     function GetItemLeftBound(AIndex: Integer): Integer; virtual; abstract;
  1842.     function GetItemsOffset(AItemCountDelta: Integer): Integer; virtual; abstract;
  1843.     function GetItemTopBound(AIndex: Integer): Integer; virtual; abstract;
  1844.     function GetRecordIndex(AViewInfoIndex: Integer): Integer;
  1845.     function GetViewInfoIndex(ARecordIndex: Integer): Integer;
  1846.     function IsEmpty: Boolean; virtual;
  1847.     procedure OffsetItem(AIndex, AOffset: Integer); virtual; abstract;
  1848.     procedure ControlFocusChanged; virtual;
  1849.     procedure VisibilityChanged(AVisible: Boolean); virtual;
  1850.     function GetPainterClass: TcxCustomGridRecordsPainterClass; virtual;
  1851.   {$IFDEF LINUX}
  1852.     property BackgroundBitmapBrush: TBrush read FBackgroundBitmapBrush;
  1853.   {$ENDIF}
  1854.     property Canvas: TcxCanvas read GetCanvas;
  1855.     property Controller: TcxCustomGridTableController read GetController;
  1856.     property FirstRecordIndex: Integer read GetFirstRecordIndex;
  1857.     property GridViewInfo: TcxCustomGridTableViewInfo read FGridViewInfo;
  1858.     property IncSearchingCellViewInfo: TcxGridTableDataCellViewInfo read GetIncSearchingCellViewInfo;
  1859.     property MaxCount: Integer read GetMaxCount;
  1860.     property TopRecordIndex: Integer read GetTopRecordIndex;
  1861.     property ViewData: TcxCustomGridTableViewData read GetViewData;
  1862.   public
  1863.     constructor Create(AGridViewInfo: TcxCustomGridTableViewInfo); virtual;
  1864.     destructor Destroy; override;
  1865.     function CanOffset(AItemCountDelta: Integer): Boolean; virtual;
  1866.     function GetCellHeight(ACellContentHeight: Integer): Integer; virtual;
  1867.     function GetHitTest(const P: TPoint): TcxCustomGridHitTest; virtual;
  1868.     function GetRealItem(ARecord: TcxCustomGridRecord): TcxCustomGridRecordViewInfo; virtual;
  1869.     procedure MainCalculate; virtual;
  1870.     procedure Offset(AItemCountDelta: Integer); overload; virtual;
  1871.     procedure Offset(DX, DY: Integer); overload; virtual;
  1872.     procedure Paint;
  1873.     property AutoDataRecordHeight: Boolean read GetAutoDataRecordHeight;
  1874.     property AutoRecordHeight: Boolean read GetAutoRecordHeight;
  1875.     property BackgroundBitmap: TBitmap read FBackgroundBitmap write FBackgroundBitmap;
  1876.     property Bounds: TRect read FBounds;
  1877.     property ContentBounds: TRect read FContentBounds;
  1878.     property Count: Integer read GetCount;
  1879.     property GridView: TcxCustomGridTableView read GetGridView;
  1880.     property Items[Index: Integer]: TcxCustomGridRecordViewInfo read GetItem; default;
  1881.     property ItemsOffset: Integer read FItemsOffset;
  1882.     property VisibleCount: Integer read FVisibleCount;
  1883.   end;
  1884.   // view
  1885.   TcxNavigatorSiteViewInfoClass = class of TcxNavigatorSiteViewInfo;
  1886.   TcxNavigatorSiteViewInfo = class(TcxCustomGridViewCellViewInfo)
  1887.   private
  1888.     function GetGridViewInfo: TcxCustomGridTableViewInfo;
  1889.     function GetNavigatorViewInfo: TcxNavigatorViewInfo;
  1890.   protected
  1891.     function CalculateHeight: Integer; override;
  1892.     function CalculateWidth: Integer; override;
  1893.     function GetHitTestClass: TcxCustomGridHitTestClass; override;
  1894.     function GetHotTrack: Boolean; override;
  1895.     function GetPainterClass: TcxCustomGridCellPainterClass; override;
  1896.     function GetVisible: Boolean; override;
  1897.     procedure MouseLeave; override;
  1898.     procedure GetViewParams(var AParams: TcxViewParams); override;
  1899.     function GetWidth: Integer; override;
  1900.   public
  1901.     function MouseDown(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton;
  1902.       AShift: TShiftState): Boolean; override;
  1903.     function MouseMove(AHitTest: TcxCustomGridHitTest; AShift: TShiftState): Boolean; override;
  1904.     function MouseUp(AHitTest: TcxCustomGridHitTest; AButton: TMouseButton;
  1905.       AShift: TShiftState): Boolean; override;
  1906.     property GridViewInfo: TcxCustomGridTableViewInfo read GetGridViewInfo;
  1907.     property NavigatorViewInfo: TcxNavigatorViewInfo read GetNavigatorViewInfo;
  1908.   end;
  1909.   TcxCustomGridTableViewInfo = class(TcxCustomGridViewInfo, IcxNavigatorOwner)
  1910.   private
  1911.     FAllowCheckCoordinates: Boolean;
  1912.     FCalculateDown: Boolean;
  1913.     FFilterViewInfo: TcxGridFilterViewInfo;
  1914.     FFirstRecordIndex: Integer;
  1915.     FNavigatorSize: TPoint;
  1916.     FNavigatorSiteViewInfo: TcxNavigatorSiteViewInfo;
  1917.     FNavigatorViewInfo: TcxNavigatorViewInfo;
  1918.     FParts: TList;
  1919.     FRecordsViewInfo: TcxCustomGridRecordsViewInfo;
  1920.     function GetController: TcxCustomGridTableController;
  1921.     function GetExpandButtonSize: Integer;
  1922.     function GetFirstRecordIndex: Integer;
  1923.     function GetGridView: TcxCustomGridTableView;
  1924.     function GetPart(Index: Integer): TcxCustomGridPartViewInfo;
  1925.     function GetPartCount: Integer;
  1926.     function GetPartsBottomHeight: Integer;
  1927.     function GetPartsCustomHeight(AAlignment: TcxGridPartAlignment): Integer;
  1928.     function GetPartsTopHeight: Integer;
  1929.     function GetScrollableAreaWidth: Integer;
  1930.     function GetViewData: TcxCustomGridTableViewData;
  1931.     function GetVisibleRecordCount: Integer;
  1932.     procedure AddPart(AItem: TcxCustomGridPartViewInfo);
  1933.     procedure RemovePart(AItem: TcxCustomGridPartViewInfo);
  1934.   protected
  1935.     // IcxNavigatorOwner
  1936.     function GetNavigatorBounds: TRect; virtual;
  1937.     function GetNavigatorButtons: TcxCustomNavigatorButtons;
  1938.     function GetNavigatorCanvas: TCanvas;
  1939.     function GetNavigatorControl: TWinControl;
  1940.     function GetNavigatorFocused: Boolean;
  1941.     function GetNavigatorLookAndFeel: TcxLookAndFeel;
  1942.     function GetNavigatorOwner: TComponent;
  1943.     function GetNavigatorShowHint: Boolean;
  1944.     function GetNavigatorTabStop: Boolean;
  1945.     procedure NavigatorButtonsStateChanged;
  1946.     procedure NavigatorChanged(AChangeType: TcxNavigatorChangeType);
  1947.     procedure RefreshNavigator;
  1948.     procedure CreateViewInfos; override;
  1949.     procedure DestroyViewInfos(AIsRecreating: Boolean); override;
  1950.     procedure AfterCalculating; override;
  1951.     procedure AfterOffset; virtual;
  1952.     procedure BeforeOffset; virtual;
  1953.     procedure Calculate; override;
  1954.     function CalculateClientBounds: TRect; override;
  1955.     function CalculatePartBounds(APart: TcxCustomGridPartViewInfo): TRect; virtual;
  1956.     function CalculateVisibleEqualHeightRecordCount: Integer; virtual;
  1957.     procedure ControlFocusChanged; override;
  1958.     function GetDefaultGridModeBufferCount: Integer; virtual;
  1959.     procedure GetHScrollBarBounds(var ABounds: TRect); override;
  1960.     function GetFilterViewInfoClass: TcxGridFilterViewInfoClass; virtual;
  1961.     function GetIsInternalUse: Boolean; override;
  1962.     function GetNavigatorOffset: Integer; virtual;
  1963.     function GetNavigatorSiteBounds: TRect; virtual;
  1964.     function GetNavigatorSiteViewInfoClass: TcxNavigatorSiteViewInfoClass; virtual;
  1965.     function GetNavigatorViewInfoClass: TcxNavigatorViewInfoClass; virtual;
  1966.     function GetNoDataInfoTextAreaBounds: TRect; virtual;
  1967.     procedure GetNoDataInfoTextParams(out AParams: TcxViewParams); virtual;
  1968.     function GetNoDataInfoTextAreaVisible: Boolean; virtual;
  1969.     function GetNonRecordsAreaHeight(ACheckScrollBar: Boolean): Integer; virtual;
  1970.     function GetRecordsViewInfoClass: TcxCustomGridRecordsViewInfoClass; virtual; abstract;
  1971.     function GetScrollableAreaBounds: TRect; virtual;
  1972.     function GetScrollableAreaBoundsForEdit: TRect; virtual;
  1973.     function GetScrollableAreaBoundsHorz: TRect; virtual;
  1974.     function GetScrollableAreaBoundsVert: TRect; virtual;
  1975.     function FirstRecordIndexAssigned: Boolean;
  1976.     procedure Offset(ARecordCountDelta: Integer); overload; virtual;
  1977.     procedure Offset(DX, DY: Integer); overload; virtual;
  1978.     procedure VisibilityChanged(AVisible: Boolean); override;
  1979.     function CanCheckCoordinates: Boolean; virtual;
  1980.     property AllowCheckCoordinates: Boolean read FAllowCheckCoordinates
  1981.       write FAllowCheckCoordinates;
  1982.     property Controller: TcxCustomGridTableController read GetController;
  1983.     property PartCount: Integer read GetPartCount;
  1984.     property Parts[Index: Integer]: TcxCustomGridPartViewInfo read GetPart;
  1985.     property ViewData: TcxCustomGridTableViewData read GetViewData;
  1986.   public
  1987.     constructor Create(AGridView: TcxCustomGridView); override;
  1988.     destructor Destroy; override;
  1989.     function CanOffset(ARecordCountDelta, DX, DY: Integer): Boolean; virtual;
  1990.     function CanOffsetView(ARecordCountDelta: Integer): Boolean; virtual;
  1991.     function GetHitTest(const P: TPoint): TcxCustomGridHitTest; override;
  1992.     procedure DoOffset(ARecordCountDelta, DX, DY: Integer); virtual;
  1993.     // for extended lookup edit
  1994.     function GetNearestPopupHeight(AHeight: Integer; AAdditionalRecord: Boolean = False): Integer; virtual;
  1995.     function GetPopupHeight(ADropDownRecordCount: Integer): Integer; virtual;
  1996.     property CalculateDown: Boolean read FCalculateDown write FCalculateDown;
  1997.     property ExpandButtonSize: Integer read GetExpandButtonSize;
  1998.     property FilterViewInfo: TcxGridFilterViewInfo read FFilterViewInfo;
  1999.     property FirstRecordIndex: Integer read GetFirstRecordIndex write FFirstRecordIndex;
  2000.     property GridView: TcxCustomGridTableView read GetGridView;
  2001.     property NavigatorBounds: TRect read GetNavigatorBounds;
  2002.     property NavigatorOffset: Integer read GetNavigatorOffset;
  2003.     property NavigatorSize: TPoint read FNavigatorSize;
  2004.     property NavigatorSiteViewInfo: TcxNavigatorSiteViewInfo read FNavigatorSiteViewInfo;
  2005.     property NavigatorViewInfo: TcxNavigatorViewInfo read FNavigatorViewInfo;
  2006.     property NoDataInfoTextAreaBounds: TRect read GetNoDataInfoTextAreaBounds;
  2007.     property NoDataInfoTextAreaVisible: Boolean read GetNoDataInfoTextAreaVisible;
  2008.     property PartsBottomHeight: Integer read GetPartsBottomHeight;
  2009.     property PartsTopHeight: Integer read GetPartsTopHeight;
  2010.     property RecordsViewInfo: TcxCustomGridRecordsViewInfo read FRecordsViewInfo;
  2011.     property ScrollableAreaBounds: TRect read GetScrollableAreaBounds;
  2012.     property ScrollableAreaBoundsForEdit: TRect read GetScrollableAreaBoundsForEdit;
  2013.     property ScrollableAreaBoundsHorz: TRect read GetScrollableAreaBoundsHorz;
  2014.     property ScrollableAreaBoundsVert: TRect read GetScrollableAreaBoundsVert;
  2015.     property ScrollableAreaWidth: Integer read GetScrollableAreaWidth;
  2016.     property VisibleRecordCount: Integer read GetVisibleRecordCount;
  2017.   end;
  2018.   // cache
  2019.   TcxCustomGridTableViewInfoCacheItem = class(TcxCustomGridViewInfoCacheItem)
  2020.   private
  2021.     FHeight: Integer;
  2022.     FIsHeightAssigned: Boolean;
  2023.     function GetGridRecord: TcxCustomGridRecord;
  2024.     procedure SetHeight(Value: Integer);
  2025.   protected
  2026.     property GridRecord: TcxCustomGridRecord read GetGridRecord;
  2027.   public
  2028.     procedure UnassignValues(AKeepMaster: Boolean); override;
  2029.     property Height: Integer read FHeight write SetHeight;
  2030.     property IsHeightAssigned: Boolean read FIsHeightAssigned write FIsHeightAssigned;
  2031.   end;
  2032.   TcxCustomGridTableViewInfoCache = class(TcxCustomGridViewInfoCache)
  2033.   private
  2034.     function GetViewData: TcxCustomGridTableViewData;
  2035.   protected
  2036.     function GetItemClass(Index: Integer): TcxCustomGridViewInfoCacheItemClass; override;
  2037.     property ViewData: TcxCustomGridTableViewData read GetViewData;
  2038.   end;
  2039.   { view }
  2040.   // custom item
  2041.   TcxGridTableItemChange = (ticProperty, ticLayout, ticSize);
  2042.   TcxCustomGridTableItemCustomOptions = class(TPersistent)
  2043.   private
  2044.     FItem: TcxCustomGridTableItem;
  2045.     function GetGridView: TcxCustomGridTableView;
  2046.   protected
  2047.     procedure Changed(AChange: TcxGridTableItemChange = ticLayout); virtual;
  2048.   public
  2049.     constructor Create(AItem: TcxCustomGridTableItem); virtual;
  2050.     procedure Assign(Source: TPersistent); override;
  2051.     property GridView: TcxCustomGridTableView read GetGridView;
  2052.     property Item: TcxCustomGridTableItem read FItem;
  2053.   end;
  2054.   TcxGridItemShowEditButtons = (isebDefault, isebNever, isebAlways);
  2055.   TcxGridItemSortByDisplayText = (isbtDefault, isbtOn, isbtOff);
  2056.   TcxCustomGridTableItemOptionsClass = class of TcxCustomGridTableItemOptions;
  2057.   TcxCustomGridTableItemOptions = class(TcxCustomGridTableItemCustomOptions)
  2058.   private
  2059.     FEditing: Boolean;
  2060.     FFiltering: Boolean;
  2061.     FFilteringMRUItemsList: Boolean;
  2062.     FFocusing: Boolean;
  2063.     FGrouping: Boolean;
  2064.     FIncSearch: Boolean;
  2065.     FMoving: Boolean;
  2066.     FShowEditButtons: TcxGridItemShowEditButtons;
  2067.     FSortByDisplayText: TcxGridItemSortByDisplayText;
  2068.     FSorting: Boolean;
  2069.     procedure SetEditing(Value: Boolean);
  2070.     procedure SetFiltering(Value: Boolean);
  2071.     procedure SetFilteringMRUItemsList(Value: Boolean);
  2072.     procedure SetFocusing(Value: Boolean);
  2073.     procedure SetGrouping(Value: Boolean);
  2074.     procedure SetIncSearch(Value: Boolean);
  2075.     procedure SetMoving(Value: Boolean);
  2076.     procedure SetShowEditButtons(Value: TcxGridItemShowEditButtons);
  2077.     procedure SetSortByDisplayText(Value: TcxGridItemSortByDisplayText);
  2078.     procedure SetSorting(Value: Boolean);
  2079.   protected
  2080.     property Grouping: Boolean read FGrouping write SetGrouping default True;
  2081.     property Moving: Boolean read FMoving write SetMoving default True;
  2082.     property SortByDisplayText: TcxGridItemSortByDisplayText read FSortByDisplayText
  2083.       write SetSortByDisplayText default isbtDefault;
  2084.     property Sorting: Boolean read FSorting write SetSorting default True;
  2085.   public
  2086.     constructor Create(AItem: TcxCustomGridTableItem); override;
  2087.     procedure Assign(Source: TPersistent); override;
  2088.   published
  2089.     property Editing: Boolean read FEditing write SetEditing default True;
  2090.     property Filtering: Boolean read FFiltering write SetFiltering default True;
  2091.     property FilteringMRUItemsList: Boolean read FFilteringMRUItemsList
  2092.       write SetFilteringMRUItemsList default True;
  2093.     property Focusing: Boolean read FFocusing write SetFocusing default True;
  2094.     property IncSearch: Boolean read FIncSearch write SetIncSearch default True;
  2095.     property ShowEditButtons: TcxGridItemShowEditButtons read FShowEditButtons
  2096.       write SetShowEditButtons default isebDefault;
  2097.   end;
  2098.   TcxGridGetCellStyleEvent = procedure(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
  2099.     AItem: TcxCustomGridTableItem; {$IFDEF BCB}var{$ELSE}out{$ENDIF} AStyle: TcxStyle) of object;
  2100.   TcxGridGetRecordStyleEvent = procedure(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
  2101.     {$IFDEF BCB}var{$ELSE}out{$ENDIF} AStyle: TcxStyle) of object;
  2102.   TcxCustomGridTableItemStylesClass = class of TcxCustomGridTableItemStyles;
  2103.   TcxCustomGridTableItemStyles = class(TcxCustomGridStyles)
  2104.   private
  2105.     FOnGetContentStyle: TcxGridGetCellStyleEvent;
  2106.     function GetGridViewValue: TcxCustomGridTableView;
  2107.     function GetItem: TcxCustomGridTableItem;
  2108.     procedure SetOnGetContentStyle(Value: TcxGridGetCellStyleEvent);
  2109.   protected
  2110.     procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override;
  2111.     function GetGridView: TcxCustomGridView; override;
  2112.   public
  2113.     procedure Assign(Source: TPersistent); override;
  2114.     procedure GetContentParams(ARecord: TcxCustomGridRecord; out AParams: TcxViewParams); virtual;
  2115.     property GridView: TcxCustomGridTableView read GetGridViewValue;
  2116.     property Item: TcxCustomGridTableItem read GetItem;
  2117.   published
  2118.     property Content: TcxStyle index isContent read GetValue write SetValue;
  2119.     property OnGetContentStyle: TcxGridGetCellStyleEvent read FOnGetContentStyle write SetOnGetContentStyle;
  2120.   end;
  2121.   TcxGridSortOrder = TcxDataSortOrder;
  2122.   TcxGridTableDataCellCustomDrawEvent = procedure(Sender: TcxCustomGridTableView;
  2123.     ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean) of object;
  2124.   TcxGridGetDataTextEvent = procedure(Sender: TcxCustomGridTableItem;
  2125.     ARecordIndex: Integer; var AText: string) of object;
  2126.   TcxGridGetDisplayTextEvent = procedure(Sender: TcxCustomGridTableItem;
  2127.     ARecord: TcxCustomGridRecord; var AText: string) of object;
  2128.   TcxGridGetFilterDisplayTextEvent = procedure(Sender: TcxCustomGridTableItem;
  2129.     const AValue: Variant; var ADisplayText: string) of object;
  2130.   TcxGridGetFilterValuesEvent = procedure(Sender: TcxCustomGridTableItem;
  2131.     AValueList: TcxDataFilterValueList) of object;
  2132.   TcxGridGetPropertiesEvent = procedure(Sender: TcxCustomGridTableItem;
  2133.     ARecord: TcxCustomGridRecord; var AProperties: TcxCustomEditProperties) of object;
  2134.   TcxGridTableItemGetStoredPropertiesEvent = procedure(Sender: TcxCustomGridTableItem;
  2135.     AProperties: TStrings) of object;
  2136.   TcxGridTableItemGetStoredPropertyValueEvent = procedure(Sender: TcxCustomGridTableItem;
  2137.     const AName: string; var AValue: Variant) of object;
  2138.   TcxGridTableItemSetStoredPropertyValueEvent = procedure(Sender: TcxCustomGridTableItem;
  2139.     const AName: string; const AValue: Variant) of object;
  2140.   TcxGridUserFilteringEvent = procedure(Sender: TcxCustomGridTableItem;
  2141.     const AValue: Variant; const ADisplayText: string) of object;
  2142.   TcxCustomGridTableItemClass = class of TcxCustomGridTableItem;
  2143.   TcxCustomGridTableItem = class(TcxComponent, IcxEditRepositoryItemListener, IcxStoredObject)
  2144.   private
  2145.     FBestFitMaxWidth: Integer;
  2146.     FCaption: string;
  2147.     FCells: TList;
  2148.     FCellStyle: TcxEditStyle;
  2149.     FCellStyleUseCounter: Integer;
  2150.     FDataBinding: TcxGridItemDataBinding;
  2151.     FEditData: TcxCustomEditData;
  2152.     FEditViewData: TcxCustomEditViewData;
  2153.     FGridView: TcxCustomGridTableView;
  2154.     FHeaderAlignmentHorz: TAlignment;
  2155.     FHeaderAlignmentVert: TcxAlignmentVert;
  2156.     FHidden: Boolean;
  2157.     FID: Integer;
  2158.     FIgnoreLoadingStatus: Boolean;
  2159.     FIndex: Integer;
  2160.     FIsCaptionAssigned: Boolean;
  2161.     FIsHeaderAlignmentHorzAssigned: Boolean;
  2162.     FIsHeaderAlignmentVertAssigned: Boolean;
  2163.     FIsWidthAssigned: Boolean;
  2164.     FLastUsedDefaultRepositoryItem: TcxEditRepositoryItem;
  2165.     FMinWidth: Integer;
  2166.     FOptions: TcxCustomGridTableItemOptions;
  2167.     FProperties: TcxCustomEditProperties;
  2168.     FPropertiesClass: TcxCustomEditPropertiesClass;
  2169.     FPropertiesValue: TcxCustomEditProperties;
  2170.     FRepositoryItem: TcxEditRepositoryItem;
  2171.     FStyles: TcxCustomGridTableItemStyles;
  2172.     FVisible: Boolean;
  2173.     FVisibleIndex: Integer;
  2174.     FWasVisibleBeforeGrouping: Boolean;
  2175.     FWidth: Integer;
  2176.     FOnCustomDrawCell: TcxGridTableDataCellCustomDrawEvent;
  2177.     FOnGetDataText: TcxGridGetDataTextEvent;
  2178.     FOnGetDisplayText: TcxGridGetDisplayTextEvent;
  2179.     FOnGetFilterDisplayText: TcxGridGetFilterDisplayTextEvent;
  2180.     FOnGetFilterValues: TcxGridGetFilterValuesEvent;
  2181.     FOnGetProperties: TcxGridGetPropertiesEvent;
  2182.     FOnGetStoredProperties: TcxGridTableItemGetStoredPropertiesEvent;
  2183.     FOnGetStoredPropertyValue: TcxGridTableItemGetStoredPropertyValueEvent;
  2184.     FOnSetStoredPropertyValue: TcxGridTableItemSetStoredPropertyValueEvent;
  2185.     FOnUserFiltering: TcxGridUserFilteringEvent;
  2186.     FSubClassEvents: TNotifyEvent;
  2187.     function GetActualMinWidth: Integer;
  2188.     function GetCaption: string;
  2189.     function GetCell(Index: Integer): TcxGridTableDataCellViewInfo;
  2190.     function GetCellCount: Integer;
  2191.     function GetController: TcxCustomGridTableController;
  2192.     function GetDataController: TcxCustomDataController;
  2193.     function GetEditing: Boolean;
  2194.     function GetEditingProperties: TcxCustomEditProperties;
  2195.     function GetFilterCaption: string;
  2196.     function GetFiltered: Boolean;
  2197.     function GetFocused: Boolean;
  2198.     function GetGroupIndex: Integer;
  2199.     function GetHeaderAlignmentHorz: TAlignment;
  2200.     function GetHeaderAlignmentVert: TcxAlignmentVert;
  2201.     function GetIsLoading: Boolean;
  2202.     function GetIncSearching: Boolean;
  2203.     function GetIsDestroying: Boolean;
  2204.     function GetIsFirst: Boolean;
  2205.     function GetIsLast: Boolean;
  2206.     function GetIsReading: Boolean;
  2207.     function GetIsUpdating: Boolean;
  2208.     function GetMinWidth: Integer;
  2209.     function GetPropertiesClassName: string;
  2210.     function GetSortIndex: Integer;
  2211.     function GetSortOrder: TcxGridSortOrder;
  2212.     function GetTag: TTag;
  2213.     function GetViewData: TcxCustomGridTableViewData;
  2214.     function GetWidth: Integer;
  2215.     procedure SetBestFitMaxWidth(Value: Integer);
  2216.     procedure SetCaption(const Value: string);
  2217.     procedure SetDataBinding(Value: TcxGridItemDataBinding);
  2218.     procedure SetEditing(Value: Boolean);
  2219.     procedure SetFiltered(Value: Boolean);
  2220.     procedure SetFocused(Value: Boolean);
  2221.     procedure SetGroupIndex(Value: Integer);
  2222.     procedure SetHeaderAlignmentHorz(Value: TAlignment);
  2223.     procedure SetHeaderAlignmentVert(Value: TcxAlignmentVert);
  2224.     procedure SetHidden(Value: Boolean);
  2225.     procedure SetIndex(Value: Integer);
  2226.     procedure SetMinWidth(Value: Integer);
  2227.     procedure SetOnCustomDrawCell(Value: TcxGridTableDataCellCustomDrawEvent);
  2228.     procedure SetOnGetDataText(Value: TcxGridGetDataTextEvent);
  2229.     procedure SetOnGetDisplayText(Value: TcxGridGetDisplayTextEvent);
  2230.     procedure SetOnGetFilterDisplayText(Value: TcxGridGetFilterDisplayTextEvent);
  2231.     procedure SetOnGetFilterValues(Value: TcxGridGetFilterValuesEvent);
  2232.     procedure SetOnGetProperties(Value: TcxGridGetPropertiesEvent);
  2233.     procedure SetOnGetStoredProperties(Value: TcxGridTableItemGetStoredPropertiesEvent);
  2234.     procedure SetOnGetStoredPropertyValue(Value: TcxGridTableItemGetStoredPropertyValueEvent);
  2235.     procedure SetOnSetStoredPropertyValue(Value: TcxGridTableItemSetStoredPropertyValueEvent);
  2236.     procedure SetOnUserFiltering(Value: TcxGridUserFilteringEvent);
  2237.     procedure SetOptions(Value: TcxCustomGridTableItemOptions);
  2238.     procedure SetProperties(Value: TcxCustomEditProperties);
  2239.     procedure SetPropertiesClass(Value: TcxCustomEditPropertiesClass);
  2240.     procedure SetPropertiesClassName(const Value: string);
  2241.     procedure SetRepositoryItem(Value: TcxEditRepositoryItem);
  2242.     procedure SetSortIndex(Value: Integer);
  2243.     procedure SetSortOrder(Value: TcxGridSortOrder);
  2244.     procedure SetStyles(Value: TcxCustomGridTableItemStyles);
  2245.     procedure SetTag(Value: TTag);
  2246.     procedure SetVisible(Value: Boolean);
  2247.     procedure SetVisibleIndex(Value: Integer);
  2248.     procedure SetWidth(Value: Integer);
  2249.     procedure ReadIsCaptionAssigned(Reader: TReader);
  2250.     procedure WriteIsCaptionAssigned(Writer: TWriter);
  2251.     function IsCaptionStored: Boolean;
  2252.     function IsSortOrderStored: Boolean;
  2253.     function IsTagStored: Boolean;
  2254.     function IsWidthStored: Boolean;
  2255.     function GetDataBindingClass: TcxGridItemDataBindingClass;
  2256.     procedure CreateProperties;
  2257.     procedure DestroyProperties;
  2258.     procedure RecreateProperties;
  2259.   protected
  2260.     procedure DefineProperties(Filer: TFiler); override;
  2261.     procedure SetParentComponent(AParent: TComponent); override;
  2262.     // IcxEditRepositoryItemListener
  2263.     procedure ItemRemoved(Sender: TcxEditRepositoryItem);
  2264.     procedure IcxEditRepositoryItemListener.PropertiesChanged = RepositoryItemPropertiesChanged;
  2265.     procedure RepositoryItemPropertiesChanged(Sender: TcxEditRepositoryItem); virtual;
  2266.     // IcxStoredObject
  2267.     function GetObjectName: string; virtual;
  2268.     function IcxStoredObject.GetProperties = GetStoredProperties;
  2269.     function GetStoredProperties(AProperties: TStrings): Boolean; virtual;
  2270.     procedure GetPropertyValue(const AName: string; var AValue: Variant); virtual;
  2271.     procedure SetPropertyValue(const AName: string; const AValue: Variant); virtual;
  2272.     procedure CreateDataBinding; virtual;
  2273.     procedure DestroyDataBinding; virtual;
  2274.     procedure CreateSubClasses; virtual;
  2275.     procedure DestroySubClasses; virtual;
  2276.     function IsHeaderAlignmentHorzStored: Boolean;
  2277.     function IsHeaderAlignmentVertStored: Boolean;
  2278.     function CalculateBestFitWidth: Integer; virtual;
  2279.     function CanAutoHeight: Boolean; virtual;
  2280.     function CanEdit: Boolean; virtual;
  2281.     function CanFilter(ACheckGridViewOptions: Boolean): Boolean; virtual;
  2282.     function CanFilterMRUValueItems: Boolean; virtual;
  2283.     function CanFocus(ARecord: TcxCustomGridRecord): Boolean; virtual;
  2284.     function CanGroup: Boolean; virtual;
  2285.     function CanHide: Boolean; virtual;
  2286.     function CanHorzSize: Boolean; virtual;
  2287.     function CanIncSearch: Boolean; virtual;
  2288.     function CanInitEditing: Boolean; virtual;
  2289.     function CanMove: Boolean; virtual;
  2290.     function CanScroll: Boolean; virtual;
  2291.     function CanSort: Boolean; virtual;
  2292.     procedure CaptionChanged; virtual;
  2293.     procedure Changed(AChange: TcxGridTableItemChange); virtual;
  2294.     procedure ChangeGroupIndex(Value: Integer);
  2295.     procedure ChangeSortIndex(Value: Integer);
  2296.     procedure CheckWidthValue(var Value: Integer);
  2297.     procedure DataChanged; virtual;
  2298.     procedure ForceWidth(Value: Integer); virtual;
  2299.     function GetActuallyVisible: Boolean; virtual;
  2300.     function GetBestFitWidth: Integer; virtual;
  2301.     function GetEditPartVisible: Boolean; virtual;
  2302.     function GetEditValue: Variant; virtual;
  2303.     function GetFilterable: Boolean; virtual;
  2304.     procedure GetFilterDisplayText(const AValue: Variant; var ADisplayText: string); virtual;
  2305.     function GetFixed: Boolean; virtual;
  2306.     function GetFocusedCellViewInfo: TcxGridTableDataCellViewInfo; virtual;
  2307.     function GetHidden: Boolean; virtual;
  2308.     function GetMultiLine: Boolean; virtual;
  2309.     function GetPropertiesValue: TcxCustomEditProperties;
  2310.     function GetVisible: Boolean; virtual;
  2311.     function GetVisibleCaption: string; virtual;
  2312.     function GetVisibleIndex: Integer;
  2313.     function GetVisibleInQuickCustomizationPopup: Boolean; virtual;
  2314.     function HasCustomDrawCell: Boolean;
  2315.     function HasFixedWidth: Boolean; virtual;
  2316.     procedure HiddenChanged; virtual;
  2317.     procedure InitProperties(AProperties: TcxCustomEditProperties); virtual;
  2318.     function IsHiddenStored: Boolean; virtual;
  2319.     function IsSortingByDisplayText(ASortByDisplayText: Boolean): Boolean;
  2320.     function IsVisibleStored: Boolean; virtual;
  2321.     procedure PropertiesChanged; virtual;
  2322.     procedure PropertiesChangedHandler(Sender: TObject); virtual;
  2323.     procedure PropertiesValueChanged;
  2324.     procedure RecalculateDefaultWidth;
  2325.     procedure SetEditValue(const Value: Variant); virtual;
  2326.     procedure SetGridView(Value: TcxCustomGridTableView); virtual;
  2327.     function ShowButtons(AFocused: Boolean): Boolean; virtual;
  2328.     function ShowOnUngrouping: Boolean; virtual;
  2329.     function UseOwnProperties: Boolean;
  2330.     procedure ValueTypeClassChanged; virtual;
  2331.     function GetOptionsClass: TcxCustomGridTableItemOptionsClass; virtual;
  2332.     function GetStylesClass: TcxCustomGridTableItemStylesClass; virtual;
  2333.     function DefaultCaption: string; virtual;
  2334.     function DefaultHeaderAlignmentHorz: TAlignment;
  2335.     function DefaultHeaderAlignmentVert: TcxAlignmentVert;
  2336.     function DefaultRepositoryItem: TcxEditRepositoryItem;
  2337.     function DefaultWidth: Integer; virtual;
  2338.     function GetCellStyle: TcxEditStyle;
  2339.     procedure InitStyle(AStyle: TcxCustomEditStyle; const AParams: TcxViewParams;
  2340.       AFocused: Boolean); virtual;
  2341.     procedure ReleaseCellStyle;
  2342.     procedure AddCell(ACell: TcxGridTableDataCellViewInfo);
  2343.     procedure RemoveCell(ACell: TcxGridTableDataCellViewInfo);
  2344.     property CellCount: Integer read GetCellCount;
  2345.     property Cells[Index: Integer]: TcxGridTableDataCellViewInfo read GetCell;
  2346.     function CreateEditViewData(AProperties: TcxCustomEditProperties): TcxCustomEditViewData;
  2347.     procedure DestroyEditViewData(var AEditViewData: TcxCustomEditViewData);
  2348.     procedure DoCreateEditViewData;
  2349.     procedure DoDestroyEditViewData;
  2350.     procedure EditViewDataGetDisplayTextHandler(Sender: TcxCustomEditViewData; var AText: string);
  2351.     function GetEditViewData(AProperties: TcxCustomEditProperties;
  2352.       out AIsLocalCopy: Boolean): TcxCustomEditViewData;
  2353.     procedure ReleaseEditViewData(var AEditViewData: TcxCustomEditViewData; AIsLocalCopy: Boolean);
  2354.     property EditViewData: TcxCustomEditViewData read FEditViewData;
  2355.     procedure DoCustomDrawCell(ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
  2356.       var ADone: Boolean); virtual;
  2357.     procedure DoGetDataText(ARecordIndex: Integer; var AText: string); virtual;
  2358.     procedure DoGetDisplayText(ARecord: TcxCustomGridRecord; var AText: string); virtual;
  2359.     procedure DoGetFilterValues(AValueList: TcxDataFilterValueList); virtual;
  2360.     function DoGetProperties(ARecord: TcxCustomGridRecord): TcxCustomEditProperties; virtual;
  2361.     procedure DoUserFiltering(const AValue: Variant; const ADisplayText: string); virtual;
  2362.     function HasDataTextHandler: Boolean;
  2363.     function HasCustomPropertiesHandler: Boolean;
  2364.     property IsDestroying: Boolean read GetIsDestroying;
  2365.     property IsLoading: Boolean read GetIsLoading;
  2366.     property IsReading: Boolean read GetIsReading;
  2367.     property IsUpdating: Boolean read GetIsUpdating;
  2368.     property ActualMinWidth: Integer read GetActualMinWidth;
  2369.     property Controller: TcxCustomGridTableController read GetController;
  2370.     property DataController: TcxCustomDataController read GetDataController;
  2371.     property EditingProperties: TcxCustomEditProperties read GetEditingProperties;
  2372.     property EditPartVisible: Boolean read GetEditPartVisible;
  2373.     property Filterable: Boolean read GetFilterable;
  2374.     property FilterCaption: string read GetFilterCaption;
  2375.     property Filtered: Boolean read GetFiltered write SetFiltered;
  2376.     property Fixed: Boolean read GetFixed;
  2377.     property GroupIndex: Integer read GetGroupIndex write SetGroupIndex default -1;
  2378.     property HeaderAlignmentHorz: TAlignment read GetHeaderAlignmentHorz write SetHeaderAlignmentHorz
  2379.       stored IsHeaderAlignmentHorzStored;
  2380.     property HeaderAlignmentVert: TcxAlignmentVert read GetHeaderAlignmentVert
  2381.       write SetHeaderAlignmentVert stored IsHeaderAlignmentVertStored;
  2382.     property Hidden: Boolean read GetHidden write SetHidden stored IsHiddenStored;
  2383.     property IgnoreLoadingStatus: Boolean read FIgnoreLoadingStatus write FIgnoreLoadingStatus;
  2384.     property InternalVisible: Boolean read FVisible;
  2385.     property MinWidth: Integer read GetMinWidth write SetMinWidth
  2386.       default cxGridItemDefaultMinWidth;
  2387.     property MultiLine: Boolean read GetMultiLine;
  2388.     property ViewData: TcxCustomGridTableViewData read GetViewData;
  2389.     property VisibleInQuickCustomizationPopup: Boolean read GetVisibleInQuickCustomizationPopup;
  2390.     property WasVisibleBeforeGrouping: Boolean read FWasVisibleBeforeGrouping;
  2391.     property Width: Integer read GetWidth write SetWidth stored IsWidthStored;
  2392.     property OnGetFilterDisplayText: TcxGridGetFilterDisplayTextEvent read FOnGetFilterDisplayText
  2393.       write SetOnGetFilterDisplayText;
  2394.     property OnGetFilterValues: TcxGridGetFilterValuesEvent read FOnGetFilterValues write SetOnGetFilterValues;
  2395.   public
  2396.     constructor Create(AOwner: TComponent); override;
  2397.     destructor Destroy; override;
  2398.     procedure Assign(Source: TPersistent); override;
  2399.     function GetParentComponent: TComponent; override;
  2400.     function HasParent: Boolean; override;
  2401.     procedure ApplyBestFit; virtual;
  2402.     function CalculateDefaultCellHeight(ACanvas: TcxCanvas; AFont: TFont): Integer; virtual;
  2403.     function CreateEditStyle: TcxEditStyle; virtual;
  2404.     procedure FocusWithSelection; virtual;
  2405.     function GetDefaultValuesProvider(AProperties: TcxCustomEditProperties = nil): IcxEditDefaultValuesProvider;
  2406.     function GetProperties: TcxCustomEditProperties; overload;
  2407.     function GetProperties(ARecord: TcxCustomGridRecord): TcxCustomEditProperties; overload;
  2408.     function GetRepositoryItem: TcxEditRepositoryItem;
  2409.     procedure RestoreDefaults; virtual;
  2410.     property ActuallyVisible: Boolean read GetActuallyVisible;
  2411.     property BestFitMaxWidth: Integer read FBestFitMaxWidth write SetBestFitMaxWidth default 0;
  2412.     property Editing: Boolean read GetEditing write SetEditing;
  2413.     property EditValue: Variant read GetEditValue write SetEditValue;
  2414.     property Focused: Boolean read GetFocused write SetFocused;
  2415.     property FocusedCellViewInfo: TcxGridTableDataCellViewInfo read GetFocusedCellViewInfo;
  2416.     property GridView: TcxCustomGridTableView read FGridView;
  2417.     property Hideable: Boolean read CanHide;
  2418.     property ID: Integer read FID;
  2419.     property IncSearching: Boolean read GetIncSearching;
  2420.     property Index: Integer read FIndex write SetIndex;
  2421.     property IsFirst: Boolean read GetIsFirst;
  2422.     property IsLast: Boolean read GetIsLast;
  2423.     property Options: TcxCustomGridTableItemOptions read FOptions write SetOptions;
  2424.     property PropertiesClass: TcxCustomEditPropertiesClass read FPropertiesClass write SetPropertiesClass;
  2425.     property SortIndex: Integer read GetSortIndex write SetSortIndex default -1;
  2426.     property SortOrder: TcxGridSortOrder read GetSortOrder write SetSortOrder stored IsSortOrderStored;
  2427.     property Styles: TcxCustomGridTableItemStyles read FStyles write SetStyles;
  2428.     property VisibleCaption: string read GetVisibleCaption;
  2429.     property VisibleIndex: Integer read FVisibleIndex write SetVisibleIndex;
  2430.   published
  2431.     property Caption: string read GetCaption write SetCaption stored IsCaptionStored;
  2432.     property DataBinding: TcxGridItemDataBinding read FDataBinding write SetDataBinding;
  2433.     property PropertiesClassName: string read GetPropertiesClassName write SetPropertiesClassName;
  2434.     property Properties: TcxCustomEditProperties read FProperties write SetProperties;
  2435.     property RepositoryItem: TcxEditRepositoryItem read FRepositoryItem write SetRepositoryItem;
  2436.     property Visible: Boolean read GetVisible write SetVisible stored IsVisibleStored default True;
  2437.     property PropertiesEvents: TNotifyEvent read FSubClassEvents write FSubClassEvents;
  2438.     property StylesEvents: TNotifyEvent read FSubClassEvents write FSubClassEvents;
  2439.     property Tag: TTag read GetTag write SetTag stored IsTagStored;
  2440.     property OnCustomDrawCell: TcxGridTableDataCellCustomDrawEvent read FOnCustomDrawCell write SetOnCustomDrawCell;
  2441.     property OnGetDataText: TcxGridGetDataTextEvent read FOnGetDataText write SetOnGetDataText;
  2442.     property OnGetDisplayText: TcxGridGetDisplayTextEvent read FOnGetDisplayText write SetOnGetDisplayText;
  2443.     property OnGetProperties: TcxGridGetPropertiesEvent read FOnGetProperties write SetOnGetProperties;
  2444.     property OnGetStoredProperties: TcxGridTableItemGetStoredPropertiesEvent
  2445.       read FOnGetStoredProperties write SetOnGetStoredProperties;
  2446.     property OnGetStoredPropertyValue: TcxGridTableItemGetStoredPropertyValueEvent
  2447.       read FOnGetStoredPropertyValue write SetOnGetStoredPropertyValue;
  2448.     property OnSetStoredPropertyValue: TcxGridTableItemSetStoredPropertyValueEvent
  2449.       read FOnSetStoredPropertyValue write SetOnSetStoredPropertyValue;
  2450.     property OnUserFiltering: TcxGridUserFilteringEvent read FOnUserFiltering write SetOnUserFiltering;
  2451.   end;
  2452.   // grid view options
  2453.   TcxCustomGridTableBackgroundBitmaps = class(TcxCustomGridBackgroundBitmaps)
  2454.   protected
  2455.     function GetBitmapStyleIndex(Index: Integer): Integer; override;
  2456.   public
  2457.     procedure Assign(Source: TPersistent); override;
  2458.   published
  2459.     property Content: TBitmap index bbContent read GetValue write SetValue;
  2460.     property FilterBox: TBitmap index bbFilterBox read GetValue write SetValue;
  2461.   end;
  2462.   TcxGridFilterMRUItem = class(TcxMRUItem)
  2463.   private
  2464.     function GetCaption: string;
  2465.   protected
  2466.     function StreamEquals(AStream: TMemoryStream): Boolean;
  2467.   public
  2468.     Filter: TcxDataFilterCriteria;
  2469.     constructor Create(AFilter: TcxDataFilterCriteria);
  2470.     destructor Destroy; override;
  2471.     procedure AssignTo(AFilter: TcxDataFilterCriteria);
  2472.     function Equals(AItem: TcxMRUItem): Boolean; override;
  2473.     function FilterEquals(AFilter: TcxDataFilterCriteria): Boolean;
  2474.     function GetStream: TMemoryStream;
  2475.     property Caption: string read GetCaption;
  2476.   end;
  2477.   TcxGridFilterMRUItemsClass = class of TcxGridFilterMRUItems;
  2478.   TcxGridFilterMRUItems = class(TcxMRUItems)
  2479.   private
  2480.     FFiltering: TcxCustomGridTableFiltering;
  2481.     FVisibleItems: TList;
  2482.     function GetItem(Index: Integer): TcxGridFilterMRUItem;
  2483.     function GetVisibleCount: Integer;
  2484.     function GetVisibleItem(Index: Integer): TcxGridFilterMRUItem;
  2485.   protected
  2486.     procedure DeleteEmptyItems;
  2487.     procedure FilterChanged;
  2488.     procedure RefreshVisibleItemsList;
  2489.   public
  2490.     constructor Create(AFiltering: TcxCustomGridTableFiltering); reintroduce; virtual;
  2491.     destructor Destroy; override;
  2492.     procedure Add(AFilter: TcxDataFilterCriteria);
  2493.     property Filtering: TcxCustomGridTableFiltering read FFiltering;
  2494.     property Items[Index: Integer]: TcxGridFilterMRUItem read GetItem; default;
  2495.     property VisibleCount: Integer read GetVisibleCount;
  2496.     property VisibleItems[Index: Integer]: TcxGridFilterMRUItem read GetVisibleItem;
  2497.   end;
  2498.   TcxGridFilterPosition = (fpTop, fpBottom);
  2499.   TcxGridFilterVisible = (fvNever, fvNonEmpty, fvAlways);
  2500.   TcxCustomGridTableFilteringClass = class of TcxCustomGridTableFiltering;
  2501.   TcxCustomGridTableFiltering = class(TcxCustomGridOptions)
  2502.   private
  2503.     FCustomizeDialog: Boolean;
  2504.     FDropDownWidth: Integer;
  2505.     FItemMRUItemsList: Boolean;
  2506.     FItemMRUItemsListCount: Integer;
  2507.     FMaxDropDownCount: Integer;
  2508.     FMRUItems: TcxGridFilterMRUItems;
  2509.     FMRUItemsList: Boolean;
  2510.     FMRUItemsListCount: Integer;
  2511.     FMRUItemsListDropDownCount: Integer;
  2512.     FPosition: TcxGridFilterPosition;
  2513.     FVisible: TcxGridFilterVisible;
  2514.     function GetGridView: TcxCustomGridTableView;
  2515.     procedure SetCustomizeDialog(Value: Boolean);
  2516.     procedure SetDropDownWidth(Value: Integer);
  2517.     procedure SetItemMRUItemsList(Value: Boolean);
  2518.     procedure SetItemMRUItemsListCount(Value: Integer);
  2519.     procedure SetMaxDropDownCount(Value: Integer);
  2520.     procedure SetMRUItemsList(Value: Boolean);
  2521.     procedure SetMRUItemsListCount(Value: Integer);
  2522.     procedure SetMRUItemsListDropDownCount(Value: Integer);
  2523.     procedure SetPosition(Value: TcxGridFilterPosition);
  2524.     procedure SetVisible(Value: TcxGridFilterVisible);
  2525.     procedure FilterControlDialogApply(Sender: TObject);
  2526.   protected
  2527.     procedure FilterChanged; virtual;
  2528.     function GetMRUItemsClass: TcxGridFilterMRUItemsClass; virtual;
  2529.     function IsMRUItemsListAvailable: Boolean; virtual;
  2530.     procedure MRUItemsVisibleCountChanged(AOldCount, ANewCount: Integer); virtual;
  2531.     property CustomizeDialog: Boolean read FCustomizeDialog write SetCustomizeDialog default True;
  2532.     property DropDownWidth: Integer read FDropDownWidth write SetDropDownWidth default 0;
  2533.     property ItemMRUItemsList: Boolean read FItemMRUItemsList write SetItemMRUItemsList default True;
  2534.     property ItemMRUItemsListCount: Integer read FItemMRUItemsListCount write SetItemMRUItemsListCount
  2535.       default cxGridFilterDefaultItemMRUItemsListCount;
  2536.     property MaxDropDownCount: Integer read FMaxDropDownCount write SetMaxDropDownCount
  2537.       default cxGridFilterDefaultMaxDropDownCount;
  2538.     property MRUItemsList: Boolean read FMRUItemsList write SetMRUItemsList default True;
  2539.     property MRUItemsListCount: Integer read FMRUItemsListCount write SetMRUItemsListCount
  2540.       default cxGridFilterDefaultMRUItemsListCount;
  2541.     property MRUItemsListDropDownCount: Integer read FMRUItemsListDropDownCount
  2542.       write SetMRUItemsListDropDownCount default 0;
  2543.     property Position: TcxGridFilterPosition read FPosition write SetPosition default fpBottom;
  2544.     property Visible: TcxGridFilterVisible read FVisible write SetVisible default fvNonEmpty;
  2545.   public
  2546.     constructor Create(AGridView: TcxCustomGridView); override;
  2547.     destructor Destroy; override;
  2548.     procedure AddFilterToMRUItems(AFilter: TcxDataFilterCriteria = nil);
  2549.     procedure Assign(Source: TPersistent); override;
  2550.     function GetDropDownCount(AItemCount: Integer): Integer;
  2551.     procedure RunCustomizeDialog(AItem: TcxCustomGridTableItem = nil);
  2552.     property GridView: TcxCustomGridTableView read GetGridView;
  2553.     property MRUItems: TcxGridFilterMRUItems read FMRUItems;
  2554.   end;
  2555.   TcxGridDragFocusing = (dfNone, dfDragOver, dfDragDrop);
  2556.   TcxCustomGridTableOptionsBehavior = class(TcxCustomGridOptionsBehavior)
  2557.   private
  2558.     FAlwaysShowEditor: Boolean;
  2559.     FBestFitMaxRecordCount: Integer;
  2560.     FCellHints: Boolean;
  2561.     FCopyCaptionsToClipboard: Boolean;
  2562.     FDragDropText: Boolean;
  2563.     FDragFocusing: TcxGridDragFocusing;
  2564.     FDragHighlighting: Boolean;
  2565.     FDragOpening: Boolean;
  2566.     FDragScrolling: Boolean;
  2567.     FFocusCellOnCycle: Boolean;
  2568.     FFocusCellOnTab: Boolean;
  2569.     FFocusFirstCellOnNewRecord: Boolean;
  2570.     FGoToNextCellOnEnter: Boolean;
  2571.     FImmediateEditor: Boolean;
  2572.     FIncSearch: Boolean;
  2573.     FIncSearchItem: TcxCustomGridTableItem;
  2574.     FNavigatorHints: Boolean;
  2575.     FPullFocusing: Boolean;
  2576.     function GetGridView: TcxCustomGridTableView;
  2577.     procedure SetAlwaysShowEditor(Value: Boolean);
  2578.     procedure SetBestFitMaxRecordCount(Value: Integer);
  2579.     procedure SetCellHints(Value: Boolean);
  2580.     procedure SetCopyCaptionsToClipboard(Value: Boolean);
  2581.     procedure SetDragDropText(Value: Boolean);
  2582.     procedure SetDragFocusing(Value: TcxGridDragFocusing);
  2583.     procedure SetDragHighlighting(Value: Boolean);
  2584.     procedure SetDragOpening(Value: Boolean);
  2585.     procedure SetDragScrolling(Value: Boolean);
  2586.     procedure SetFocusCellOnCycle(Value: Boolean);
  2587.     procedure SetFocusCellOnTab(Value: Boolean);
  2588.     procedure SetFocusFirstCellOnNewRecord(Value: Boolean);
  2589.     procedure SetGoToNextCellOnEnter(Value: Boolean);
  2590.     procedure SetImmediateEditor(Value: Boolean);
  2591.     procedure SetIncSearch(Value: Boolean);
  2592.     procedure SetIncSearchItem(Value: TcxCustomGridTableItem);
  2593.     procedure SetNavigatorHints(Value: Boolean);
  2594.     procedure SetPullFocusing(Value: Boolean);
  2595.   protected
  2596.     property FocusCellOnCycle: Boolean read FFocusCellOnCycle write SetFocusCellOnCycle default False;
  2597.     property PullFocusing: Boolean read FPullFocusing write SetPullFocusing default False;
  2598.   public
  2599.     constructor Create(AGridView: TcxCustomGridView); override;
  2600.     procedure Assign(Source: TPersistent); override;
  2601.     property BestFitMaxRecordCount: Integer read FBestFitMaxRecordCount write SetBestFitMaxRecordCount default 0;
  2602.     property GridView: TcxCustomGridTableView read GetGridView;
  2603.   published
  2604.     property AlwaysShowEditor: Boolean read FAlwaysShowEditor write SetAlwaysShowEditor default False;
  2605.     property CellHints: Boolean read FCellHints write SetCellHints default False;
  2606.     property CopyCaptionsToClipboard: Boolean read FCopyCaptionsToClipboard write SetCopyCaptionsToClipboard default True;
  2607.     property DragDropText: Boolean read FDragDropText write SetDragDropText default False;
  2608.     property DragFocusing: TcxGridDragFocusing read FDragFocusing write SetDragFocusing default dfNone;
  2609.     property DragHighlighting: Boolean read FDragHighlighting write SetDragHighlighting default True;
  2610.     property DragOpening: Boolean read FDragOpening write SetDragOpening default True;
  2611.     property DragScrolling: Boolean read FDragScrolling write SetDragScrolling default True;
  2612.     property FocusCellOnTab: Boolean read FFocusCellOnTab write SetFocusCellOnTab default False;
  2613.     property FocusFirstCellOnNewRecord: Boolean read FFocusFirstCellOnNewRecord
  2614.       write SetFocusFirstCellOnNewRecord default False;
  2615.     property GoToNextCellOnEnter: Boolean read FGoToNextCellOnEnter write SetGoToNextCellOnEnter default False;
  2616.     property ImmediateEditor: Boolean read FImmediateEditor write SetImmediateEditor default True;
  2617.     property IncSearch: Boolean read FIncSearch write SetIncSearch default False;
  2618.     property IncSearchItem: TcxCustomGridTableItem read FIncSearchItem write SetIncSearchItem;
  2619.     property NavigatorHints: Boolean read FNavigatorHints write SetNavigatorHints default False;
  2620.   end;
  2621.   TcxCustomGridTableOptionsCustomizeClass = class of TcxCustomGridTableOptionsCustomize;
  2622.   TcxCustomGridTableOptionsCustomize = class(TcxCustomGridOptions)
  2623.   private
  2624.     FItemFiltering: Boolean;
  2625.     FItemGrouping: Boolean;
  2626.     FItemHiding: Boolean;
  2627.     FItemMoving: Boolean;
  2628.     FItemSorting: Boolean;
  2629.     FItemsQuickCustomization: Boolean;
  2630.     FItemsQuickCustomizationMaxDropDownCount: Integer;
  2631.     procedure SetItemFiltering(Value: Boolean);
  2632.     procedure SetItemGrouping(Value: Boolean);
  2633.     procedure SetItemHiding(Value: Boolean);
  2634.     procedure SetItemMoving(Value: Boolean);
  2635.     procedure SetItemSorting(Value: Boolean);
  2636.     procedure SetItemsQuickCustomization(Value: Boolean);
  2637.     procedure SetItemsQuickCustomizationMaxDropDownCount(Value: Integer);
  2638.   protected
  2639.     property ItemFiltering: Boolean read FItemFiltering write SetItemFiltering default True;
  2640.     property ItemGrouping: Boolean read FItemGrouping write SetItemGrouping default True;
  2641.     property ItemHiding: Boolean read FItemHiding write SetItemHiding default False;  {2m}
  2642.     property ItemMoving: Boolean read FItemMoving write SetItemMoving default True;
  2643.     property ItemSorting: Boolean read FItemSorting write SetItemSorting default True;
  2644.     property ItemsQuickCustomization: Boolean read FItemsQuickCustomization
  2645.       write SetItemsQuickCustomization default False;  {3}
  2646.     property ItemsQuickCustomizationMaxDropDownCount: Integer read FItemsQuickCustomizationMaxDropDownCount
  2647.       write SetItemsQuickCustomizationMaxDropDownCount default 0;  {3}
  2648.   public
  2649.     constructor Create(AGridView: TcxCustomGridView); override;
  2650.     procedure Assign(Source: TPersistent); override;
  2651.   end;
  2652.   TcxCustomGridTableOptionsData = class(TcxCustomGridOptionsData)
  2653.   private
  2654.     FAppending: Boolean;
  2655.     FCancelOnExit: Boolean;
  2656.     FDeleting: Boolean;
  2657.     FDeletingConfirmation: Boolean;
  2658.     FEditing: Boolean;
  2659.     FInserting: Boolean;
  2660.     function GetGridView: TcxCustomGridTableView;
  2661.     procedure SetAppending(Value: Boolean);
  2662.     procedure SetCancelOnExit(Value: Boolean);
  2663.     procedure SetDeleting(Value: Boolean);
  2664.     procedure SetDeletingConfirmation(Value: Boolean);
  2665.     procedure SetEditing(Value: Boolean);
  2666.     procedure SetInserting(Value: Boolean);
  2667.   public
  2668.     constructor Create(AGridView: TcxCustomGridView); override;
  2669.     procedure Assign(Source: TPersistent); override;
  2670.     property GridView: TcxCustomGridTableView read GetGridView;
  2671.   published
  2672.     property Appending: Boolean read FAppending write SetAppending default False;
  2673.     property CancelOnExit: Boolean read FCancelOnExit write SetCancelOnExit default True;
  2674.     property Deleting: Boolean read FDeleting write SetDeleting default True;
  2675.     property DeletingConfirmation: Boolean read FDeletingConfirmation
  2676.       write SetDeletingConfirmation default True;
  2677.     property Editing: Boolean read FEditing write SetEditing default True;
  2678.     property Inserting: Boolean read FInserting write SetInserting default True;
  2679.   end;
  2680.   TcxCustomGridTableOptionsSelection = class(TcxCustomGridOptionsSelection)
  2681.   private
  2682.     FCellSelect: Boolean;
  2683.     FHideFocusRectOnExit: Boolean;
  2684.     FHideSelection: Boolean;
  2685.     FInvertSelect: Boolean;
  2686.     FUnselectFocusedRecordOnExit: Boolean;
  2687.     function GetGridView: TcxCustomGridTableView;
  2688.     function GetMultiSelect: Boolean;
  2689.     procedure SetHideFocusRectOnExit(Value: Boolean);
  2690.     procedure SetHideSelection(Value: Boolean);
  2691.     procedure SetUnselectFocusedRecordOnExit(Value: Boolean);
  2692.   protected
  2693.     function IsInvertSelectStored: Boolean; virtual;
  2694.     function IsMultiSelectStored: Boolean; virtual;
  2695.     procedure SetCellSelect(Value: Boolean); virtual;
  2696.     procedure SetInvertSelect(Value: Boolean); virtual;
  2697.     procedure SetMultiSelect(Value: Boolean); virtual;
  2698.     property GridView: TcxCustomGridTableView read GetGridView;
  2699.   public
  2700.     constructor Create(AGridView: TcxCustomGridView); override;
  2701.     procedure Assign(Source: TPersistent); override;
  2702.   published
  2703.     property CellSelect: Boolean read FCellSelect write SetCellSelect default True;
  2704.     property HideFocusRect: Boolean read FHideFocusRectOnExit write SetHideFocusRectOnExit stored False;  // for compatibility
  2705.     property HideFocusRectOnExit: Boolean read FHideFocusRectOnExit write SetHideFocusRectOnExit default True;
  2706.     property HideSelection: Boolean read FHideSelection write SetHideSelection default False;
  2707.     property InvertSelect: Boolean read FInvertSelect write SetInvertSelect stored IsInvertSelectStored;
  2708.     property MultiSelect: Boolean read GetMultiSelect write SetMultiSelect stored IsMultiSelectStored;
  2709.     property UnselectFocusedRecordOnExit: Boolean read FUnselectFocusedRecordOnExit
  2710.       write SetUnselectFocusedRecordOnExit default True;
  2711.   end;
  2712.   TcxGridShowEditButtons = (gsebNever, gsebForFocusedRecord, gsebAlways);
  2713.   TcxCustomGridTableOptionsView = class(TcxCustomGridOptionsView)
  2714.   private
  2715.     FCellAutoHeight: Boolean;
  2716.     FCellEndEllipsis: Boolean;
  2717.     FCellTextMaxLineCount: Integer;
  2718.     FFocusRect: Boolean;
  2719.     FItemCaptionAutoHeight: Boolean;
  2720.     FItemCaptionEndEllipsis: Boolean;
  2721.     FNavigator: Boolean;
  2722.     FNavigatorOffset: Integer;
  2723.     FShowEditButtons: TcxGridShowEditButtons;
  2724.     function GetGridView: TcxCustomGridTableView;
  2725.     procedure SetCellAutoHeight(Value: Boolean);
  2726.     procedure SetCellEndEllipsis(Value: Boolean);
  2727.     procedure SetCellTextMaxLineCount(Value: Integer);
  2728.     procedure SetFocusRect(Value: Boolean);
  2729.     procedure SetItemCaptionAutoHeight(Value: Boolean);
  2730.     procedure SetItemCaptionEndEllipsis(Value: Boolean);
  2731.     procedure SetNavigator(Value: Boolean);
  2732.     procedure SetNavigatorOffset(Value: Integer);
  2733.     procedure SetShowEditButtons(Value: TcxGridShowEditButtons);
  2734.   protected
  2735.     procedure ItemCaptionAutoHeightChanged; dynamic;
  2736.     property CellAutoHeight: Boolean read FCellAutoHeight write SetCellAutoHeight default False;
  2737.     property CellTextMaxLineCount: Integer read FCellTextMaxLineCount write SetCellTextMaxLineCount default 0;
  2738.     property ItemCaptionAutoHeight: Boolean read FItemCaptionAutoHeight
  2739.       write SetItemCaptionAutoHeight default False;
  2740.     property ItemCaptionEndEllipsis: Boolean read FItemCaptionEndEllipsis
  2741.       write SetItemCaptionEndEllipsis default False;
  2742.   public
  2743.     constructor Create(AGridView: TcxCustomGridView); override;
  2744.     procedure Assign(Source: TPersistent); override;
  2745.     property GridView: TcxCustomGridTableView read GetGridView;
  2746.   published
  2747.     property CellEndEllipsis: Boolean read FCellEndEllipsis write SetCellEndEllipsis
  2748.       default False;
  2749.     property FocusRect: Boolean read FFocusRect write SetFocusRect default True;
  2750.     property Navigator: Boolean read FNavigator write SetNavigator default False;
  2751.     property NavigatorOffset: Integer read FNavigatorOffset write SetNavigatorOffset default cxGridNavigatorDefaultOffset;
  2752.     property ShowEditButtons: TcxGridShowEditButtons read FShowEditButtons
  2753.       write SetShowEditButtons default gsebNever;
  2754.   end;
  2755.   TcxGridDataCellPos = class
  2756.     GridRecord: TcxCustomGridRecord;
  2757.     Item: TcxCustomGridTableItem;
  2758.   end;
  2759.   TcxCustomGridTableViewStyles = class(TcxCustomGridViewStyles)
  2760.   private
  2761.     FOnGetContentStyle: TcxGridGetCellStyleEvent;
  2762.     function GetGridViewValue: TcxCustomGridTableView;
  2763.     procedure SetOnGetContentStyle(Value: TcxGridGetCellStyleEvent);
  2764.   protected
  2765.     procedure GetDefaultViewParams(Index: Integer; AData: TObject; out AParams: TcxViewParams); override;
  2766.   public
  2767.     procedure Assign(Source: TPersistent); override;
  2768.     procedure GetContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
  2769.       out AParams: TcxViewParams); virtual;
  2770.     procedure GetDataCellContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
  2771.       out AParams: TcxViewParams); virtual;
  2772.     procedure GetDataCellParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
  2773.       out AParams: TcxViewParams; AUseViewInfo: Boolean = False; ACellViewInfo: TcxGridTableCellViewInfo = nil); virtual;
  2774.     procedure GetRecordContentParams(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
  2775.       out AParams: TcxViewParams); virtual;
  2776.     property GridView: TcxCustomGridTableView read GetGridViewValue;
  2777.   published
  2778.     property Content: TcxStyle index vsContent read GetValue write SetValue;
  2779.     property ContentEven: TcxStyle index vsContentEven read GetValue write SetValue;
  2780.     property ContentOdd: TcxStyle index vsContentOdd read GetValue write SetValue;
  2781.     property FilterBox: TcxStyle index vsFilterBox read GetValue write SetValue;
  2782.     property Inactive: TcxStyle index vsInactive read GetValue write SetValue;
  2783.     property IncSearch: TcxStyle index vsIncSearch read GetValue write SetValue;
  2784.     property Selection: TcxStyle index vsSelection read GetValue write SetValue;
  2785.     property OnGetContentStyle: TcxGridGetCellStyleEvent read FOnGetContentStyle write SetOnGetContentStyle;
  2786.   end;
  2787.   // grid view
  2788.   TcxGridOpenTableItemList = class(TList)
  2789.   private
  2790.     function GetItem(Index: Integer): TcxCustomGridTableItem;
  2791.     procedure SetItem(Index: Integer; Value: TcxCustomGridTableItem);
  2792.   public
  2793.     property Items[Index: Integer]: TcxCustomGridTableItem read GetItem write SetItem; default;
  2794.   end;
  2795.   TcxGridTableCellCustomDrawEvent = procedure(Sender: TcxCustomGridTableView;
  2796.     ACanvas: TcxCanvas; AViewInfo: TcxGridTableCellViewInfo; var ADone: Boolean) of object;
  2797.   TcxGridAllowRecordOperationEvent = procedure(Sender: TcxCustomGridTableView;
  2798.     ARecord: TcxCustomGridRecord; var AAllow: Boolean) of object;
  2799.   TcxGridCellClickEvent = procedure(Sender: TcxCustomGridTableView;
  2800.     ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
  2801.     AShift: TShiftState; var AHandled: Boolean) of object;
  2802.   TcxGridCustomTableViewEvent = procedure(Sender: TcxCustomGridTableView) of object;
  2803.   TcxGridEditingEvent = procedure(Sender: TcxCustomGridTableView;
  2804.     AItem: TcxCustomGridTableItem; var AAllow: Boolean) of object;
  2805.   TcxGridEditKeyEvent = procedure(Sender: TcxCustomGridTableView; AItem: TcxCustomGridTableItem;
  2806.     AEdit: TcxCustomEdit; var Key: Word; Shift: TShiftState) of object;
  2807.   TcxGridEditKeyPressEvent = procedure(Sender: TcxCustomGridTableView;
  2808.     AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit; var Key: Char) of object;
  2809.   TcxGridCustomTableItemEvent = procedure(Sender: TcxCustomGridTableView;
  2810.     AItem: TcxCustomGridTableItem) of object;
  2811.   TcxGridFilterCustomizationEvent = procedure(Sender: TcxCustomGridTableView;
  2812.     var ADone: Boolean) of object;
  2813.   TcxGridFilterDialogShowEvent = procedure(Sender: TcxCustomGridTableView;
  2814.     AItem: TcxCustomGridTableItem; var ADone: Boolean) of object;
  2815.   TcxGridFocusedItemChangedEvent = procedure(Sender: TcxCustomGridTableView;
  2816.     APrevFocusedItem, AFocusedItem: TcxCustomGridTableItem) of object;
  2817.   TcxGridFocusedRecordChangedEvent = procedure(Sender: TcxCustomGridTableView;
  2818.     APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean) of object;
  2819.   TcxGridGetCellHeightEvent = procedure(Sender: TcxCustomGridTableView;
  2820.     ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
  2821.     ACellViewInfo: TcxGridTableDataCellViewInfo; var AHeight: Integer) of object;
  2822.   TcxGridGetDragDropTextEvent = procedure(Sender: TcxCustomGridTableView;
  2823.     ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; var AText: string) of object;
  2824.   TcxGridInitEditEvent = procedure(Sender: TcxCustomGridTableView;
  2825.     AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit) of object;
  2826.   TcxGridInitStoredObjectEvent = procedure(Sender: TcxCustomGridTableView; AObject: TObject) of object;
  2827.   TcxGridPartCustomDrawBackgroundEvent = procedure(Sender: TcxCustomGridTableView;
  2828.     ACanvas: TcxCanvas; AViewInfo: TcxCustomGridCellViewInfo; var ADone: Boolean) of object;
  2829.   TcxGridRecordEvent = procedure(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord) of object;
  2830.   TcxGridDataControllerChange = (dccItemAdded, dccItemRemoved, dccIndexesChanged);
  2831.   TcxCustomGridTableView = class(TcxCustomGridView, IcxFilterControl, IcxNavigator)
  2832.   private
  2833.     FAssigningGroupedItems: TcxGridOpenTableItemList;
  2834.     FAssigningSortedItems: TcxGridOpenTableItemList;
  2835.     FCopyToClipboardItems: TList;
  2836.     FCopyToClipboardStr: string;
  2837.     FDontMakeMasterRecordVisible: Boolean;
  2838.     FFilterableItems: TList;
  2839.     FFiltering: TcxCustomGridTableFiltering;
  2840.     FIsAfterAssigningItems: Boolean;
  2841.     FIsAssigningItems: Boolean;
  2842.     FItems: TList;
  2843.     FNavigatorButtons: TcxNavigatorControlButtons;
  2844.     FNavigatorNotifier: TcxNavigatorControlNotifier;
  2845.     FNextID: Integer;
  2846.     FOptionsCustomize: TcxCustomGridTableOptionsCustomize;
  2847.     FRestoringItems: TcxGridOpenTableItemList;
  2848.     FVisibleItems: TList;
  2849.     FOnCanFocusRecord: TcxGridAllowRecordOperationEvent;
  2850.     FOnCanSelectRecord: TcxGridAllowRecordOperationEvent;
  2851.     FOnCellClick: TcxGridCellClickEvent;
  2852.     FOnCellDblClick: TcxGridCellClickEvent;
  2853.     FOnCustomDrawCell: TcxGridTableDataCellCustomDrawEvent;
  2854.     FOnCustomDrawPartBackground: TcxGridPartCustomDrawBackgroundEvent;
  2855.     FOnCustomization: TNotifyEvent;
  2856.     FOnEditing: TcxGridEditingEvent;
  2857.     FOnEditChanged: TcxGridCustomTableItemEvent;
  2858.     FOnEditKeyDown: TcxGridEditKeyEvent;
  2859.     FOnEditKeyPress: TcxGridEditKeyPressEvent;
  2860.     FOnEditKeyUp: TcxGridEditKeyEvent;
  2861.     FOnEditValueChanged: TcxGridCustomTableItemEvent;
  2862.     FOnFilterControlDialogShow: TNotifyEvent;
  2863.     FOnFilterCustomization: TcxGridFilterCustomizationEvent;
  2864.     FOnFilterDialogShow: TcxGridFilterDialogShowEvent;
  2865.     FOnFocusedItemChanged: TcxGridFocusedItemChangedEvent;
  2866.     FOnFocusedRecordChanged: TcxGridFocusedRecordChangedEvent;
  2867.     FOnGetCellHeight: TcxGridGetCellHeightEvent;
  2868.     FOnGetDragDropText: TcxGridGetDragDropTextEvent;
  2869.     FOnInitEdit: TcxGridInitEditEvent;
  2870.     FOnInitStoredObject: TcxGridInitStoredObjectEvent;
  2871.     //FOnRecordCreated: TcxGridRecordEvent;
  2872.     //FOnRecordDestroying: TcxGridRecordEvent;
  2873.     FOnSelectionChanged: TcxGridCustomTableViewEvent;
  2874.     FOnTopRecordIndexChanged: TNotifyEvent;
  2875.     function GetBackgroundBitmaps: TcxCustomGridTableBackgroundBitmaps;
  2876.     function GetController: TcxCustomGridTableController;
  2877.     function GetFilterableItem(Index: Integer): TcxCustomGridTableItem;
  2878.     function GetFilterableItemCount: Integer;
  2879.     function GetGroupedItem(Index: Integer): TcxCustomGridTableItem;
  2880.     function GetGroupedItemCount: Integer;
  2881.     function GetItem(Index: Integer): TcxCustomGridTableItem;
  2882.     function GetItemCount: Integer;
  2883.     function GetMasterGridRecord: TcxCustomGridRecord;
  2884.     function GetOptionsBehavior: TcxCustomGridTableOptionsBehavior;
  2885.     function GetOptionsData: TcxCustomGridTableOptionsData;
  2886.     function GetOptionsSelection: TcxCustomGridTableOptionsSelection;
  2887.     function GetOptionsView: TcxCustomGridTableOptionsView;
  2888.     function GetPainter: TcxCustomGridTablePainter;
  2889.     function GetNavigatorButtonsControl: IcxNavigator;
  2890.     function GetSortedItem(Index: Integer): TcxCustomGridTableItem;
  2891.     function GetSortedItemCount: Integer;
  2892.     function GetStyles: TcxCustomGridTableViewStyles;
  2893.     function GetViewData: TcxCustomGridTableViewData;
  2894.     function GetViewInfo: TcxCustomGridTableViewInfo;
  2895.     function GetVisibleItem(Index: Integer): TcxCustomGridTableItem;
  2896.     function GetVisibleItemCount: Integer;
  2897.     procedure SetBackgroundBitmaps(Value: TcxCustomGridTableBackgroundBitmaps);
  2898.     procedure SetFiltering(Value: TcxCustomGridTableFiltering);
  2899.     procedure SetItem(Index: Integer; Value: TcxCustomGridTableItem);
  2900.     procedure SetNavigatorButtons(Value: TcxNavigatorControlButtons);
  2901.     procedure SetOnCanFocusRecord(Value: TcxGridAllowRecordOperationEvent);
  2902.     procedure SetOnCanSelectRecord(Value: TcxGridAllowRecordOperationEvent);
  2903.     procedure SetOnCellClick(Value: TcxGridCellClickEvent);
  2904.     procedure SetOnCellDblClick(Value: TcxGridCellClickEvent);
  2905.     procedure SetOnCustomDrawCell(Value: TcxGridTableDataCellCustomDrawEvent);
  2906.     procedure SetOnCustomDrawPartBackground(Value: TcxGridPartCustomDrawBackgroundEvent);
  2907.     procedure SetOnCustomization(Value: TNotifyEvent);
  2908.     procedure SetOnEditChanged(Value: TcxGridCustomTableItemEvent);
  2909.     procedure SetOnEditing(Value: TcxGridEditingEvent);
  2910.     procedure SetOnEditKeyDown(Value: TcxGridEditKeyEvent);
  2911.     procedure SetOnEditKeyPress(Value: TcxGridEditKeyPressEvent);
  2912.     procedure SetOnEditKeyUp(Value: TcxGridEditKeyEvent);
  2913.     procedure SetOnEditValueChanged(Value: TcxGridCustomTableItemEvent);
  2914.     procedure SetOnFilterControlDialogShow(Value: TNotifyEvent);
  2915.     procedure SetOnFilterCustomization(Value: TcxGridFilterCustomizationEvent);
  2916.     procedure SetOnFilterDialogShow(Value: TcxGridFilterDialogShowEvent);
  2917.     procedure SetOnFocusedItemChanged(Value: TcxGridFocusedItemChangedEvent);
  2918.     procedure SetOnFocusedRecordChanged(Value: TcxGridFocusedRecordChangedEvent);
  2919.     procedure SetOnGetCellHeight(Value: TcxGridGetCellHeightEvent);
  2920.     procedure SetOnGetDragDropText(Value: TcxGridGetDragDropTextEvent);
  2921.     procedure SetOnInitEdit(Value: TcxGridInitEditEvent);
  2922.     procedure SetOnInitStoredObject(Value: TcxGridInitStoredObjectEvent);
  2923.     procedure SetOnSelectionChanged(Value: TcxGridCustomTableViewEvent);
  2924.     procedure SetOnTopRecordIndexChanged(Value: TNotifyEvent);
  2925.     procedure SetOptionsBehavior(Value: TcxCustomGridTableOptionsBehavior);
  2926.     procedure SetOptionsCustomize(Value: TcxCustomGridTableOptionsCustomize);
  2927.     procedure SetOptionsData(Value: TcxCustomGridTableOptionsData);
  2928.     procedure SetOptionsSelection(Value: TcxCustomGridTableOptionsSelection);
  2929.     procedure SetOptionsView(Value: TcxCustomGridTableOptionsView);
  2930.     procedure SetStyles(Value: TcxCustomGridTableViewStyles);
  2931.     procedure CopyForEachRowProc(ARowIndex: Integer; ARowInfo: TcxRowInfo);
  2932.     procedure RefreshItemIndexes;
  2933.   protected
  2934.     // IcxFilterControl
  2935.     function IcxFilterControl.GetCaption = GetFilterCaption;
  2936.     function IcxFilterControl.GetCount = GetFilterCount;
  2937.     function IcxFilterControl.GetCriteria = GetFilterCriteria;
  2938.     function IcxFilterControl.GetFieldName = GetFilterFieldName;
  2939.     function IcxFilterControl.GetItemLink = GetFilterItemLink;
  2940.     function IcxFilterControl.GetProperties = GetFilterProperties;
  2941.     function IcxFilterControl.GetValueType = GetFilterValueType;
  2942.     function GetFilterCaption(Index: Integer): string;
  2943.     function GetFilterCount: Integer;
  2944.     function GetFilterCriteria: TcxFilterCriteria;
  2945.     function GetFilterFieldName(Index: Integer): string;
  2946.     function GetFilterItemLink(Index: Integer): TObject;
  2947.     function GetFilterProperties(Index: Integer): TcxCustomEditProperties;
  2948.     function GetFilterValueType(Index: Integer): cxDataStorage.TcxValueTypeClass;
  2949.     // IcxNavigator
  2950.     function IcxNavigator.IsActive = NavigatorIsActive;
  2951.     function IcxNavigator.IsBof = NavigatorIsBof;
  2952.     function IcxNavigator.IsEof = NavigatorIsEof;
  2953.     function IcxNavigator.CanEdit = NavigatorCanEdit;
  2954.     function IcxNavigator.CanDelete = NavigatorCanDelete;
  2955.     function IcxNavigator.CanInsert = NavigatorCanInsert;
  2956.     function IcxNavigator.IsEditing = NavigatorIsEditing;
  2957.     procedure IcxNavigator.ClearBookmark = NavigatorClearBookmark;
  2958.     function IcxNavigator.IsBookmarkAvailable = NavigatorIsBookmarkAvailable;
  2959.     procedure IcxNavigator.DoAction = NavigatorDoAction;
  2960.     function IcxNavigator.GetNotifier = NavigatorGetNotifier;
  2961.     function IcxNavigator.IsActionSupported = NavigatorIsActionSupported;
  2962.     function NavigatorIsActive: Boolean;
  2963.     function NavigatorIsBof: Boolean;
  2964.     function NavigatorIsEof: Boolean;
  2965.     function NavigatorCanEdit: Boolean;
  2966.     function NavigatorCanDelete: Boolean;
  2967.     function NavigatorCanInsert: Boolean;
  2968.     function NavigatorIsEditing: Boolean;
  2969.     procedure NavigatorClearBookmark;
  2970.     function NavigatorIsBookmarkAvailable: Boolean;
  2971.     procedure NavigatorDoAction(AButtonIndex: Integer);
  2972.     function NavigatorGetNotifier: TcxNavigatorControlNotifier;
  2973.     function NavigatorIsActionSupported(AButtonIndex: Integer): Boolean;
  2974.     // IcxStoredObject
  2975.     function GetProperties(AProperties: TStrings): Boolean; override;
  2976.     procedure GetPropertyValue(const AName: string; var AValue: Variant); override;
  2977.     procedure SetPropertyValue(const AName: string; const AValue: Variant); override;
  2978.     // IcxStoredParent
  2979.     function CreateChild(const AObjectName, AClassName: string): TObject; override;
  2980.     procedure GetStoredChildren(AChildren: TStringList); override;
  2981.     // IcxGridViewLayoutEditorSupport - for design-time layout editor
  2982.     procedure AssignLayout(ALayoutView: TcxCustomGridView); override;
  2983.     procedure BeforeEditLayout(ALayoutView: TcxCustomGridView); override;
  2984.     function HasLayoutCustomizationForm: Boolean; override;
  2985.     procedure RunLayoutCustomizationForm; override;
  2986.     procedure BeforeRestoring; override;
  2987.     procedure AfterRestoring; override;
  2988.     procedure ReadState(Reader: TReader); override;
  2989.     property RestoringItems: TcxGridOpenTableItemList read FRestoringItems;
  2990.     procedure BeginAssignItems;
  2991.     procedure DoBeforeAssignItems; virtual;
  2992.     procedure DoItemsAssigned; virtual;
  2993.     procedure EndAssignItems;
  2994.     property AssigningGroupedItems: TcxGridOpenTableItemList read FAssigningGroupedItems;
  2995.     property AssigningSortedItems: TcxGridOpenTableItemList read FAssigningSortedItems;
  2996.     property IsAssigningItems: Boolean read FIsAssigningItems;
  2997.     property IsAfterAssigningItems: Boolean read FIsAfterAssigningItems;
  2998.     function CanOffset(ARecordCountDelta: Integer): Boolean; virtual;
  2999.     function CanSelectRecord(ARecordIndex: Integer): Boolean; virtual;
  3000.     function CanTabStop: Boolean; override;
  3001.     procedure DetailVisibleChanged(ADetailLevel: TComponent;
  3002.       APrevVisibleDetailCount, AVisibleDetailCount: Integer); override;
  3003.     procedure DoAssign(ASource: TcxCustomGridView); override;
  3004.     function FindItemByObjectName(const AObjectName: string): TcxCustomGridTableItem;
  3005.     procedure FocusEdit(AItemIndex: Integer; var ADone: Boolean); virtual;
  3006.     procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
  3007.     function GetDefaultActiveDetailIndex: Integer; virtual;
  3008.     function GetDisplayText(ARecordIndex, AItemIndex: Integer; out AText: string): Boolean;
  3009.     procedure GetFakeComponentLinks(AList: TList); override;
  3010.     function GetIsControlFocused: Boolean; override;
  3011.     procedure GetItemsListForClipboard(AItems: TList; ACopyAll: Boolean); virtual;
  3012.     function GetItemSortByDisplayText(AItemIndex: Integer; ASortByDisplayText: Boolean): Boolean;
  3013.     function GetItemValueSource(AItemIndex: Integer): TcxDataEditValueSource;
  3014.     procedure GetVisibleItemsList(AItems: TList); virtual;
  3015.     function HasCustomDrawCell: Boolean;
  3016.     function HasCustomDrawPartBackground: Boolean;
  3017.     procedure Init; override;
  3018.     function IsDetailVisible(AGridView: TcxCustomGridView): Boolean; override;
  3019.     function IsEqualHeightRecords: Boolean; virtual;
  3020.     procedure LoadingComplete; override;
  3021.     procedure Offset(ARecordCountDelta, DX, DY: Integer); virtual;
  3022.     procedure SetChildOrder(Child: TComponent; Order: Integer); override;
  3023.     procedure SetName(const NewName: TComponentName); override;
  3024.     procedure UpdateControl(AInfo: TcxUpdateControlInfo); override;
  3025.     procedure UpdateDataController(AChange: TcxGridDataControllerChange;
  3026.       AItem: TcxCustomGridTableItem = nil);
  3027.     procedure UpdateRecord; virtual;
  3028.     procedure CreateHandlers; override;
  3029.     procedure DestroyHandlers; override;
  3030.     procedure CreateOptions; override;
  3031.     procedure DestroyOptions; override;
  3032.     procedure AddItem(AItem: TcxCustomGridTableItem); virtual;
  3033.     procedure RemoveItem(AItem: TcxCustomGridTableItem); virtual;
  3034.     procedure AssignVisibleItemsIndexes;
  3035.     procedure ChangeItemIndex(AItem: TcxCustomGridTableItem; Value: Integer); virtual;
  3036.     procedure ItemVisibilityChanged(AItem: TcxCustomGridTableItem; Value: Boolean); virtual;
  3037.     procedure RefreshVisibleItemsList; virtual;
  3038.     function GetItemClass: TcxCustomGridTableItemClass; virtual; abstract;
  3039.     function GetItemDataBindingClass: TcxGridItemDataBindingClass; virtual;
  3040.     function GetNextID: Integer;
  3041.     procedure ReleaseID(AID: Integer);
  3042.     procedure DataChanged; virtual;
  3043.     procedure DataLayoutChanged; virtual;
  3044.     function DoCellClick(ACellViewInfo: TcxGridTableDataCellViewInfo;
  3045.       AButton: TMouseButton; AShift: TShiftState): Boolean; virtual;
  3046.     function DoCellDblClick(ACellViewInfo: TcxGridTableDataCellViewInfo;
  3047.       AButton: TMouseButton; AShift: TShiftState): Boolean; virtual;
  3048.     function DoEditing(AItem: TcxCustomGridTableItem): Boolean; virtual;
  3049.     procedure DoTopRecordIndexChanged; virtual;
  3050.     procedure FilterChanged; virtual;
  3051.     procedure FocusedItemChanged(APrevFocusedItem, AFocusedItem: TcxCustomGridTableItem); virtual;
  3052.     procedure FocusedRecordChanged(APrevFocusedRecordIndex, AFocusedRecordIndex: Integer;
  3053.       ANewItemRecordFocusingChanged: Boolean); virtual;
  3054.     procedure ItemValueTypeClassChanged(AItemIndex: Integer); virtual;
  3055.     procedure RecalculateDefaultWidths;
  3056.     procedure RecordChanged(ARecordIndex: Integer); virtual;
  3057.     procedure RecordCountChanged; virtual;
  3058.     procedure RefreshFilterableItemsList;
  3059.     procedure RefreshNavigators;
  3060.     procedure SearchChanged; virtual;
  3061.     procedure SelectionChanged(AInfo: TcxSelectionChangedInfo); virtual;
  3062.     function CalculateDataCellSelected(ARecord: TcxCustomGridRecord;
  3063.       AItem: TcxCustomGridTableItem; AUseViewInfo: Boolean;
  3064.       ACellViewInfo: TcxGridTableCellViewInfo): Boolean; virtual;
  3065.     function DrawDataCellSelected(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
  3066.       AUseViewInfo: Boolean = False; ACellViewInfo: TcxGridTableCellViewInfo = nil): Boolean; virtual;
  3067.     function DrawRecordActive(ARecord: TcxCustomGridRecord): Boolean; virtual;
  3068.     function DrawRecordFocused(ARecord: TcxCustomGridRecord): Boolean; virtual;
  3069.     function DrawRecordSelected(ARecord: TcxCustomGridRecord): Boolean; virtual;
  3070.     function DoCanFocusRecord(ARecord: TcxCustomGridRecord): Boolean; virtual;
  3071.     procedure DoCustomDrawCell(ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
  3072.       var ADone: Boolean); virtual;
  3073.     procedure DoCustomDrawPartBackground(ACanvas: TcxCanvas; AViewInfo: TcxCustomGridCellViewInfo;
  3074.       var ADone: Boolean); virtual;
  3075.     procedure DoCustomization; virtual;
  3076.     procedure DoEditChanged(AItem: TcxCustomGridTableItem); virtual;
  3077.     procedure DoEditKeyDown(AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit;
  3078.       var Key: Word; Shift: TShiftState); virtual;
  3079.     procedure DoEditKeyPress(AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit;
  3080.       var Key: Char); virtual;
  3081.     procedure DoEditKeyUp(AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit;
  3082.       var Key: Word; Shift: TShiftState); virtual;
  3083.     procedure DoEditValueChanged(AItem: TcxCustomGridTableItem); virtual;
  3084.     function DoFilterCustomization: Boolean; virtual;
  3085.     function DoFilterDialogShow(AItem: TcxCustomGridTableItem): Boolean; virtual;
  3086.     procedure DoGetCellHeight(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
  3087.       ACellViewInfo: TcxGridTableDataCellViewInfo; var AHeight: Integer); virtual;
  3088.     function DoGetDragDropText(ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem): string; virtual;
  3089.     procedure DoInitEdit(AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit); virtual;
  3090.     //procedure DoRecordCreated(ARecord: TcxCustomGridRecord); virtual;
  3091.     //procedure DoRecordDestroying(ARecord: TcxCustomGridRecord); virtual;
  3092.     procedure DoSelectionChanged; virtual;
  3093.     function IsGetCellHeightAssigned: Boolean;
  3094.     procedure RefreshCustomizationForm;
  3095.     function GetControllerClass: TcxCustomGridControllerClass; override;
  3096.     function GetPainterClass: TcxCustomGridPainterClass; override;
  3097.     function GetViewDataClass: TcxCustomGridViewDataClass; override;
  3098.     function GetViewInfoCacheClass: TcxCustomGridViewInfoCacheClass; override;
  3099.     function GetViewInfoClass: TcxCustomGridViewInfoClass; override;
  3100.     function GetBackgroundBitmapsClass: TcxCustomGridBackgroundBitmapsClass; override;
  3101.     function GetFilteringClass: TcxCustomGridTableFilteringClass; virtual;
  3102.     function GetNavigatorButtonsClass: TcxNavigatorControlButtonsClass; virtual;
  3103.     function GetOptionsBehaviorClass: TcxCustomGridOptionsBehaviorClass; override;
  3104.     function GetOptionsCustomizeClass: TcxCustomGridTableOptionsCustomizeClass; virtual;
  3105.     function GetOptionsDataClass: TcxCustomGridOptionsDataClass; override;
  3106.     function GetOptionsSelectionClass: TcxCustomGridOptionsSelectionClass; override;
  3107.     function GetOptionsViewClass: TcxCustomGridOptionsViewClass; override;
  3108.     function GetStylesClass: TcxCustomGridViewStylesClass; override;
  3109.     function GetSummaryGroupItemLinkClass: TcxDataSummaryGroupItemLinkClass; virtual;
  3110.     function GetSummaryItemClass: TcxDataSummaryItemClass; virtual;
  3111.     property BackgroundBitmaps: TcxCustomGridTableBackgroundBitmaps read GetBackgroundBitmaps
  3112.       write SetBackgroundBitmaps;
  3113.     property DontMakeMasterRecordVisible: Boolean read FDontMakeMasterRecordVisible
  3114.       write FDontMakeMasterRecordVisible;
  3115.     property FilterableItemCount: Integer read GetFilterableItemCount;
  3116.     property FilterableItems[Index: Integer]: TcxCustomGridTableItem read GetFilterableItem;
  3117.     property NavigatorNotifier: TcxNavigatorControlNotifier read FNavigatorNotifier;
  3118.     property NextID: Integer read FNextID;
  3119.     property VisibleItemsList: TList read FVisibleItems;
  3120.     property OnCustomization: TNotifyEvent read FOnCustomization write SetOnCustomization;  {2m}
  3121.     property OnFilterControlDialogShow: TNotifyEvent read FOnFilterControlDialogShow
  3122.       write SetOnFilterControlDialogShow;
  3123.     property OnFilterCustomization: TcxGridFilterCustomizationEvent read FOnFilterCustomization