Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TDataColumns = class(TCollection)
- private
- FDataSet: TDataSet;
- function GetColumn(Index: Integer): TDataColumn;
- function GetColumn(const Name: String): TDataColumn;
- protected
- property DataSet: TDataSet read FDataSet;
- procedure DoChanging; override;
- public
- constructor Create(ADataSet: TDataSet); virtual;
- property Column[Index: Integer]: TDataColumn read GetColumn; default;
- property Column[const Name: String]: TDataColumn read GetColumn; default;
- function Add: TDataColumn;
- end;
- TDataSet = class(TComponent)
- private
- FOwnerDatabase: TDatabase;
- FColumns: TDataColumns;
- FRows: TObjectList;
- FAppendLoad: Boolean;
- FColumnLoad: Boolean;
- FParams: TStringList;
- FLastRowID: Integer;
- FEmptyRow: TDataRow;
- FOldRow: TDataRow;
- FRowNo: Integer;
- FBOF: Boolean=True;
- FEOF: Boolean=True;
- FBookmarks: TObjectList;
- FFindIndex: Integer;
- FAutoEdit: Boolean=True;
- FDataSetName: String;
- FInitializing: Boolean;
- FLocalizeDateTimeColumns: Boolean;
- FState: TDataSetState;
- FSaveState: TDataSetState;
- FControlUpdateCount: Integer;
- FDisableCount: Integer;
- FTransRefCount: Integer;
- FUndoing: Boolean;
- FUndoRowID: Integer;
- FSortColumns: TObjectList;
- FSortCaseInsensitive: Boolean;
- FSortLocaleInsensitive: Boolean;
- FCalculating: Boolean;
- FNotifying: Boolean;
- FBeforeLoadColumns: TDataSetEvent;
- FOnLoadColumnsError: TDataSetErrorEvent;
- FAfterLoadColumns: TNotifyEvent;
- FBeforeOpen: TDataSetEvent;
- FAfterOpen: TNotifyEvent;
- FBeforeClose: TDataSetEvent;
- FAfterClose: TNotifyEvent;
- FBeforeScroll: TDataSetEvent;
- FAfterScroll: TNotifyEvent;
- FBeforeInsert: TDataSetEvent;
- FAfterInsert: TNotifyEvent;
- FBeforeUpdate: TDataSetEvent;
- FAfterUpdate: TNotifyEvent;
- FBeforeSave: TDataSetEvent;
- FAfterSave: TNotifyEvent;
- FBeforeCancel: TDataSetEvent;
- FAfterCancel: TNotifyEvent;
- FBeforeDelete: TDataSetEvent;
- FAfterDelete: TNotifyEvent;
- FBeforeLoad: TDataSetEvent;
- FOnLoadError: TDataSetErrorEvent;
- FAfterLoad: TNotifyEvent;
- FOnInitRow: TNotifyEvent;
- FOnStateChange: TNotifyEvent;
- FOnRowChanged: TDataRowEvent;
- FOnSortChanged: TDataRowEvent;
- FOnCalculateRow: TDataRowEvent;
- procedure SetLocalizeDateTimeColumns(Value: Boolean);
- function GetRowID: Integer;
- procedure SetRowID(Value: Integer);
- procedure SetRowNo(Value: Integer);
- procedure SetSortCaseInsensitive(Value: Boolean);
- procedure SetSortLocaleInsensitive(Value: Boolean);
- procedure SetState(Value: TDataSetState);
- procedure SaveState(NewState: TDataSetState);
- procedure RestoreState;
- function GetActiveRow: TDataRow;
- function GetColumnCount: Integer;
- function GetDataSetName: String;
- function GetRowCount: Integer;
- function GetEditing: Boolean;
- function GetModified: Boolean;
- function GetSorted: Boolean;
- procedure ParseColumns;
- procedure ParseRows;
- procedure ClearBookmarks;
- procedure InternalClose;
- function SortCompare(L: TDataRow; R: TDataRow;
- CompareRowIDs: Boolean=False): Integer;
- function InternalFind(NearestMatch: Boolean;
- CaseInsensitive: Boolean;
- LocaleInsensitive: Boolean): Boolean;
- function InternalSortFind(NearestMatch: Boolean): Boolean;
- procedure SortRows(L, R: Integer);
- procedure InternalSort;
- procedure CheckSort;
- procedure CheckTransRefCount;
- procedure SaveFocusedControl;
- procedure SaveControls;
- protected
- property AppendLoad: Boolean read FAppendLoad write FAppendLoad;
- property ColumnLoad: Boolean read FColumnLoad write FColumnLoad;
- property ActiveRow: TDataRow read GetActiveRow;
- property Initializing: Boolean read FInitializing;
- property Calculating: Boolean read FCalculating;
- property OldRow: TDataRow read FOldRow;
- property SortColumns: TObjectList read FSortColumns;
- function CreateNewRow: TDataRow;
- procedure IncTransRefCount;
- procedure DecTransRefCount;
- procedure CheckColumns;
- procedure CheckOpened;
- procedure CheckClosed;
- function DoBeforeLoadColumns: Boolean; virtual;
- procedure DoLoadColumnsError(const ErrorMsg: String); virtual;
- procedure DoAfterLoadColumns; virtual;
- function DoBeforeOpen: Boolean; virtual;
- procedure DoAfterOpen; virtual;
- function DoBeforeClose: Boolean; virtual;
- procedure DoAfterClose; virtual;
- function DoBeforeScroll: Boolean; virtual;
- procedure DoAfterScroll; virtual;
- function DoBeforeInsert: Boolean; virtual;
- procedure DoAfterInsert; virtual;
- function DoBeforeUpdate: Boolean; virtual;
- procedure DoAfterUpdate; virtual;
- function DoBeforeSave: Boolean; virtual;
- procedure DoAfterSave; virtual;
- function DoBeforeCancel: Boolean; virtual;
- procedure DoAfterCancel; virtual;
- function DoBeforeDelete: Boolean; virtual;
- procedure DoAfterDelete; virtual;
- function DoBeforeLoad: Boolean; virtual;
- procedure DoLoadError(const ErrorMsg: String); virtual;
- procedure DoAfterLoad; virtual;
- procedure DoInitRow; virtual;
- procedure DoStateChange; virtual;
- procedure DoRowChanged(Column: TDataColumn); virtual;
- procedure CalculateRow(Column: TDataColumn=nil); virtual;
- procedure RowChanged(Column: TDataColumn=nil); virtual;
- procedure RowsChanged; virtual;
- procedure DoSortChanged(Column: TDataColumn); virtual;
- function CanFireEvents: Boolean;
- procedure Notify(ID: Integer; Data: TObject=nil); override;
- function Notification(Sender: TComponent; ID: Integer; Data: TObject): Boolean; override;
- function GotoRowID(Value: Integer): Boolean;
- procedure UpdateSort(Column: TDataColumn);
- function CanUseSort(CaseInsensitive: Boolean;
- LocaleInsensitive: Boolean): Boolean;
- function NewOperation(OperationType: TDataSetOperationType): TDataSetOperation;
- procedure UndoOperation(Operation: TDataSetOperation);
- procedure EndUndoOperations;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- property OwnerDatabase: TDatabase read FOwnerDatabase;
- property ColumnCount: Integer read GetColumnCount;
- property RowCount: Integer read GetRowCount;
- property RowID: Integer read GetRowID write SetRowID;
- property RowNo: Integer read FRowNo write SetRowNo;
- property BOF: Boolean read FBOF;
- property EOF: Boolean read FEOF;
- property Editing: Boolean read GetEditing;
- property Modified: Boolean read GetModified;
- property SortCaseInsensitive: Boolean read FSortCaseInsensitive
- write SetSortCaseInsensitive;
- property SortLocaleInsensitive: Boolean read FSortLocaleInsensitive
- write SetSortLocaleInsensitive;
- property Sorted: Boolean read GetSorted;
- property State: TDataSetState read FState;
- function GetColumns: String;
- function GetRows: String;
- procedure LoadColumns(const ColumnData: String); virtual;
- procedure LoadRows(const RowData: String;
- Append: Boolean=False); virtual;
- function CheckBrowseMode: Boolean;
- procedure Open;
- procedure Close;
- procedure SaveBookmark;
- function GotoBookmark: Boolean;
- procedure FreeBookmark;
- procedure First;
- procedure Next;
- procedure Prior;
- procedure Last;
- function MoveBy(Value: Integer): Integer;
- procedure MoveTo(Value: Integer);
- procedure InitFind;
- function Find(NearestMatch: Boolean=False;
- CaseInsensitive: Boolean=False;
- LocaleInsensitive: Boolean=False): Boolean;
- procedure Sort;
- procedure Insert(Append: Boolean=False);
- procedure Update;
- procedure Save;
- procedure Cancel;
- procedure Delete;
- procedure Empty;
- procedure DisableControls;
- procedure EnableControls;
- procedure BeginControlUpdate;
- procedure EndControlUpdate;
- published
- property AutoEdit: Boolean read FAutoEdit write FAutoEdit default True
- description 'Specifies that any data-bound controls can automatically edit the rows in the dataset';
- property Columns: TDataColumns read FColumns
- description 'The defined columns for this dataset';
- property DataSetName: String read GetDataSetName write FDataSetName
- description 'The dataset name to use when loading the dataset from the web server or sending transaction '+
- 'operations to the web server';
- property LocalizeDateTimeColumns: Boolean read FLocalizeDateTimeColumns
- write SetLocalizeDateTimeColumns default False
- description 'Specifies whether date/time strings are treated as local (True) or UTC (False)';
- property Params: TStrings read FParams
- description 'Specifies the dataset-specific parameters to include with any dataset requests for this dataset';
- property Tag;
- property BeforeLoadColumns: TDataSetEvent read FBeforeLoadColumns write FBeforeLoadColumns
- description 'Fired before columns are loaded for the dataset';
- property OnLoadColumnsError: TDataSetErrorEvent read FOnLoadColumnsError write FOnLoadColumnsError
- description 'Fired when an error occurs while loading the columns for the dataset';
- property AfterLoadColumns: TNotifyEvent read FAfterLoadColumns write FAfterLoadColumns
- description 'Fired after columns are loaded for the dataset';
- property BeforeOpen: TDataSetEvent read FBeforeOpen write FBeforeOpen
- description 'Fired before the dataset is opened';
- property AfterOpen: TNotifyEvent read FAfterOpen write FAfterOpen
- description 'Fired after the dataset is opened';
- property BeforeClose: TDataSetEvent read FBeforeClose write FBeforeClose
- description 'Fired before the dataset is closed';
- property AfterClose: TNotifyEvent read FAfterClose write FAfterClose
- description 'Fired after the dataset is closed';
- property BeforeScroll: TDataSetEvent read FBeforeScroll write FBeforeScroll
- description 'Fired before the dataset is scrolled';
- property AfterScroll: TNotifyEvent read FAfterScroll write FAfterScroll
- description 'Fired after the dataset is scrolled';
- property BeforeInsert: TDataSetEvent read FBeforeInsert write FBeforeInsert
- description 'Fired before a row insert operation is started for the dataset';
- property AfterInsert: TNotifyEvent read FAfterInsert write FAfterInsert
- description 'Fired after a row insert operation is started for the dataset';
- property BeforeUpdate: TDataSetEvent read FBeforeUpdate write FBeforeUpdate
- description 'Fired before a row update operation is started for the dataset';
- property AfterUpdate: TNotifyEvent read FAfterUpdate write FAfterUpdate
- description 'Fired after a row update operation is started for the dataset';
- property BeforeSave: TDataSetEvent read FBeforeSave write FBeforeSave
- description 'Fired before a row insert or update operation is saved for the dataset';
- property AfterSave: TNotifyEvent read FAfterSave write FAfterSave
- description 'Fired after a row insert or update operation is saved for the dataset';
- property BeforeCancel: TDataSetEvent read FBeforeCancel write FBeforeCancel
- description 'Fired before a row insert or update operation is cancelled for the dataset';
- property AfterCancel: TNotifyEvent read FAfterCancel write FAfterCancel
- description 'Fired after a row insert or update opeation is cancelled for the dataset';
- property BeforeDelete: TDataSetEvent read FBeforeDelete write FBeforeDelete
- description 'Fired before a row is deleted from the dataset';
- property AfterDelete: TNotifyEvent read FAfterDelete write FAfterDelete
- description 'Fired after a row is deleted from the dataset';
- property BeforeLoad: TDataSetEvent read FBeforeLoad write FBeforeLoad
- description 'Fired before new rows are loaded into the dataset';
- property OnLoadError: TDataSetErrorEvent read FOnLoadError write FOnLoadError
- description 'Fired when an error occurs while loading new rows into the dataset';
- property AfterLoad: TNotifyEvent read FAfterLoad write FAfterLoad
- description 'Fired after new rows are loaded into the dataset'; default;
- property OnInitRow: TNotifyEvent read FOnInitRow write FOnInitRow
- description 'Fired when a row is inserted in order to allow for initializing column values without the values being marked as modified';
- property OnStateChange: TNotifyEvent read FOnStateChange write FOnStateChange
- description 'Fired when the dataset state changes';
- property OnRowChanged: TDataRowEvent read FOnRowChanged write FOnRowChanged
- description 'Fired when the active row changes, either due to column modifications or scrolling';
- property OnSortChanged: TDataRowEvent read FOnSortChanged write FOnSortChanged
- description 'Fired when the active sort changes';
- property OnCalculateRow: TDataRowEvent read FOnCalculateRow write FOnCalculateRow
- description 'Fired when the active row requires that its calculated columns be updated due to non-calculatd column modifications';
- end;
- TBindableControl = class(TControl)
- private
- FActive: Boolean;
- FDataSet: TDataSet;
- FEditable: Boolean;
- FEditing: Boolean;
- FError: Boolean;
- FModified: Boolean;
- FReadOnly: Boolean;
- FUpdating: Boolean;
- procedure SetActive(Value: Boolean);
- procedure SetDataSet(Value: TDataSet);
- procedure SetEditable(Value: Boolean);
- procedure SetEditing(Value: Boolean);
- procedure SetError(Value: Boolean);
- procedure SetReadOnly(Value: Boolean);
- protected
- property Active: Boolean read FActive write SetActive;
- property DataSet: TDataSet read FDataSet write SetDataSet
- description 'Specifies the dataset that the control is bound to'
- reference;
- property Editable: Boolean read FEditable write SetEditable;
- property Editing: Boolean read FEditing write SetEditing;
- property Error: Boolean read FError write SetError default False
- description 'Specifies whether the control is in an error state';
- property Modified: Boolean read FModified;
- property ReadOnly: Boolean read FReadOnly write SetReadOnly default False
- description 'Specifies whether the control is read-only';
- procedure UpdateInterfaceState; override;
- function Notification(Sender: TComponent; ID: Integer; Data: TObject): Boolean; override;
- procedure Bind; virtual;
- function ColumnFocus(Value: TDataColumn): Boolean; virtual;
- function CanModify: Boolean; virtual;
- function DataBound: Boolean; virtual;
- function Edit: Boolean;
- procedure SetModified; virtual;
- procedure DoReadOnlyChanged; virtual;
- procedure Reset; virtual;
- procedure UpdateData; virtual;
- procedure UpdateRow; virtual;
- procedure UpdateState; virtual;
- procedure ActiveChanged; virtual;
- procedure DataSetChanged; virtual;
- procedure DataChanged; virtual;
- procedure RowChanged(Value: TDataColumn); virtual;
- procedure RowsChanged; virtual;
- procedure SortChanged(Value: TDataColumn); virtual;
- end;
- TGridControl = class(TBindableControl)
- private
- FClientElement: TElement;
- FColumnNavBar: TGridColumnNavBar;
- FHeaderBar: TGridHeaderBar;
- FAllowAppends: Boolean=True;
- FAllowDeletes: Boolean=True;
- FAllowInserts: Boolean=True;
- FAlwaysShowControls: Boolean;
- FUpdatingGridCells: Boolean;
- FGridColumnCount: Integer;
- FGridRowCount: Integer;
- FGridRowHeight: Integer;
- FColumnHeaders: Boolean=True;
- FColumnIndex: Integer=-1;
- FColumnControlActive: Boolean;
- FColumnControlVisible: Boolean;
- FMultiSelect: Boolean;
- FRowHeight: Integer;
- FRowIndex: Integer=-1;
- FUpdatingRowIndex: Boolean;
- FRowOffset: Integer;
- FAnchorRowIndex: Integer;
- FHotRowIndex: Integer=-1;
- FRows: TGridRows;
- FRowSelect: Boolean;
- FSortColumns: TObjectList;
- FSortCaseInsensitive: Boolean;
- FSortLocaleInsensitive: Boolean;
- FHorzScrollBar: TControlScrollBar;
- FVertScrollBar: TGridScrollBar;
- FScrollBars: TScrollBars=sbBoth;
- FScrollSupport: TScrollSupport=ssBoth;
- FUpdatingScrollBars: Boolean;
- FScrollBarsUpdateRequired: Boolean;
- FScrollY: Integer;
- FSelected: TSet;
- FShowLines: Boolean=True;
- FWantTabs: Boolean=True;
- FOnColumnChanged: TNotifyEvent;
- FOnRowChanged: TNotifyEvent;
- procedure SetAlwaysShowControls(Value: Boolean);
- function GetBackground: TBackground;
- function GetBorder: TBorder;
- function GetColumnCount: Integer;
- function GetColumn(AIndex: Integer): TGridColumn;
- function GetColumn(const AName: String): TGridColumn;
- function GetVisibleColumnCount: Integer;
- function GetVisibleColumn(AIndex: Integer): TGridColumn;
- function GetCorners: TCorners;
- procedure UpdateColumnsDataSet;
- function GetDefaultRowHeight: Integer;
- procedure UpdateDimensions;
- procedure UpdateScrollBars;
- function HandleScroll(X,Y: Integer): Boolean;
- function GetColumnHeaders: Boolean;
- procedure SetColumnHeaders(Value: Boolean);
- function GetColumnHeadersHeight: Integer;
- procedure SetColumnHeadersHeight(Value: Integer);
- procedure ColumnIndexChanged;
- procedure CheckColumnIndex(AIndex: Integer);
- procedure DoColumnEnter(AIndex: Integer);
- procedure DoColumnExit(AIndex: Integer);
- procedure SetColumnIndex(Value: Integer);
- procedure PushColumn;
- procedure UpdateColumnControls;
- procedure UpdateColumnFocus;
- function GetRowCount: Integer;
- procedure SetRowCount(Value: Integer);
- procedure SetRowHeight(Value: Integer);
- function GetRowVisible: Boolean;
- function UpdateDataSetRow(ARowIndex: Integer): Boolean;
- procedure ParseRows(const RowData: String);
- procedure UpdateRowOffset;
- procedure RowIndexChanged;
- procedure CheckRowIndex(AIndex: Integer);
- procedure SetRowIndex(Value: Integer);
- procedure UpdateRowIndex(Value: Integer);
- procedure SetHotRowIndex(Value: Integer);
- function GetSorted: Boolean;
- procedure InternalSort;
- procedure UpdateMultiSelect;
- procedure SetMultiSelect(Value: Boolean);
- procedure SetRowSelect(Value: Boolean);
- procedure UpdateScrollSupport;
- procedure SetScrollBars(Value: TScrollBars);
- procedure SetScrollSupport(Value: TScrollSupport);
- function GetSelectedCount: Integer;
- function GetSelected(ARowIndex: Integer): Boolean;
- procedure SetSelected(ARowIndex: Integer; Value: Boolean);
- procedure SetShowLines(Value: Boolean);
- procedure SetSortCaseInsensitive(Value: Boolean);
- procedure SetSortLocaleInsensitive(Value: Boolean);
- procedure SetWantTabs(Value: Boolean);
- protected
- property ColumnNavBar: TGridColumnNavBar read FColumnNavBar;
- property HeaderBar: TGridHeaderBar read FHeaderBar;
- property GridRowCount: Integer read FGridRowCount;
- property HotRowIndex: Integer read FHotRowIndex write SetHotRowIndex;
- property SortColumns: TObjectList read FSortColumns;
- property AllowAppends: Boolean read FAllowAppends write FAllowAppends default True
- description 'Specifies that the user can append new rows in the grid';
- property AllowDeletes: Boolean read FAllowDeletes write FAllowDeletes default True
- description 'Specifies that the user can delete rows in the grid';
- property AllowInserts: Boolean read FAllowInserts write FAllowInserts default True
- description 'Specifies that the user can insert new rows in the grid';
- property Background: TBackground read GetBackground
- description 'Specifies the background for the control';
- property Border: TBorder read GetBorder
- description 'Specifies the border for the control';
- property ColumnHeaders: Boolean read GetColumnHeaders write SetColumnHeaders default True
- description 'Specifies whether to show the column headers';
- property ColumnHeadersHeight: Integer read GetColumnHeadersHeight write SetColumnHeadersHeight
- description 'Specifies the height of the column headers';
- property Corners: TCorners read GetCorners
- description 'Specifies the corners for the control';
- property MultiSelect: Boolean read FMultiSelect write SetMultiSelect default False
- description 'Specifies whether multiple rows can be selected in the grid';
- property RowHeight: Integer read FRowHeight write SetRowHeight
- description 'Specifies the height of each row in the grid';
- property RowSelect: Boolean read FRowSelect write SetRowSelect default False
- description 'Specifies that selections comprise entire rows instead of just columns';
- { This must appear *before* the ScrollBars property !!! }
- property ScrollSupport: TScrollSupport read FScrollSupport write SetScrollSupport default ssNone
- description 'Specifies whether to allow horizontal/vertical scrolling';
- property ScrollBars: TScrollBars read FScrollBars write SetScrollBars default sbBoth
- description 'Specifies whether to show the horizontal/vertical scrollbars';
- property ShowLines: Boolean read FShowLines write SetShowLines default True
- description 'Specifies whether to show the grid lines';
- property WantTabs: Boolean read FWantTabs write SetWantTabs default True
- description 'Specifies whether the tab key can be used to navigate columns';
- property OnColumnChanged: TNotifyEvent read FOnColumnChanged write FOnColumnChanged
- description 'Fired when the active column changes';
- property OnRowChanged: TNotifyEvent read FOnRowChanged write FOnRowChanged
- description 'Fired when the active row changes';
- procedure InitializeProperties; override;
- function CreateElement: TElement; override;
- procedure CreateInterfaceElements; override;
- function GetClientElement: TElement; override;
- function DoChildChanging(AControl: TControl): Boolean; override;
- { Column handling }
- procedure CheckColumn;
- procedure ColumnsChanged;
- procedure ColumnAdded(AColumn: TGridColumn);
- procedure ColumnRemoved(AColumn: TGridColumn);
- procedure ColumnShown(AColumn: TGridColumn);
- procedure ColumnHidden(AColumn: TGridColumn);
- procedure ColumnSortChanged(AColumn: TGridColumn);
- function GetVisibleIndexOfColumn(AColumn: TGridColumn): Integer;
- function FindFirstColumn: TGridColumn;
- function FindPriorColumn: TGridColumn;
- function FindNextColumn: TGridColumn;
- function FindLastColumn: TGridColumn;
- procedure DoColumnChanged; virtual;
- procedure ClearSortedColumns(ASkipColumn: TGridColumn=nil);
- { Cell handling }
- procedure RefreshGridCells;
- procedure UpdateRowGridCells(ARowIndex: Integer;
- AUpdateData: Boolean=True;
- AInterfaceChanged: Boolean=False);
- procedure UpdateGridCells(AUpdateData: Boolean=True;
- AInterfaceChanged: Boolean=False;
- ARowIndex: Integer=-1);
- function SelectGridCell(ACell: TGridCell; ShiftKey, CtrlKey, AltKey: Boolean): Boolean; virtual;
- { Row handling }
- procedure SetAnchorRow(ARowIndex: Integer);
- procedure ClearAnchorRow;
- procedure DoRowChanged; virtual;
- { Column control handling }
- function IsDropDownColumnControl: Boolean;
- function IsInputColumnControl: Boolean;
- function IsButtonColumnControl: Boolean;
- procedure UpdateColumnControlVisibility;
- procedure UpdateCell(AColumnIndex, ACellIndex: Integer; const Value: String);
- { Normal event handling }
- procedure DoClientSize; override;
- procedure DoScrollBarSize(AScrollBar: TScrollBar); override;
- procedure DoScrollSize; override;
- procedure DoScroll; override;
- function DoDblClick: Boolean; override;
- procedure DoEnter; override;
- procedure DoExit; override;
- { Mouse/key handling }
- function DoMouseWheel(WheelDelta: Integer; ShiftKey, CtrlKey, AltKey: Boolean; X,Y: Integer): Boolean; override;
- function DoTouchStart(ShiftKey, CtrlKey, AltKey: Boolean; X,Y: Integer): Boolean; override;
- function DoTouchScroll(X,Y: Integer): Boolean; override;
- function DoInertiaScroll(X,Y: Integer): Boolean; override;
- function DoKeyDown(Key: Integer; ShiftKey, CtrlKey, AltKey, PreviewKey: Boolean): Boolean; override;
- { Sorting methods }
- function SortCompare(L,R: TGridRow): Integer; virtual;
- function SortCompare(L: TGridRow; const R: String): Integer; virtual;
- { Dataset methods }
- procedure DataSetChanged; override;
- procedure ActiveChanged; override;
- procedure RowChanged(Value: TDataColumn); override;
- procedure RowsChanged; override;
- procedure SortChanged(Value: TDataColumn); override;
- function ColumnFocus(Value: TDataColumn): Boolean; override;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- property ColumnCount: Integer read GetColumnCount;
- property Columns[AIndex: Integer]: TGridColumn read GetColumn;
- property Columns[const AName: String]: TGridColumn read GetColumn;
- property VisibleColumnCount: Integer read GetVisibleColumnCount;
- property VisibleColumns[AIndex: Integer]: TGridColumn read GetVisibleColumn;
- property ColumnIndex: Integer read FColumnIndex write SetColumnIndex;
- property ColumnControlActive: Boolean read FColumnControlActive;
- property ColumnControlVisible: Boolean read FColumnControlVisible;
- property AlwaysShowControls: Boolean read FAlwaysShowControls
- write SetAlwaysShowControls default False
- description 'Specifies whether the grid column controls should always be visible';
- property RowCount: Integer read GetRowCount write SetRowCount;
- property RowIndex: Integer read FRowIndex write SetRowIndex;
- property RowOffset: Integer read FRowOffset;
- property RowVisible: Boolean read GetRowVisible;
- property Rows: TGridRows read FRows;
- property Selected[ARowIndex: Integer]: Boolean read GetSelected write SetSelected;
- property SelectedCount: Integer read GetSelectedCount;
- property Sorted: Boolean read GetSorted;
- property SortCaseInsensitive: Boolean read FSortCaseInsensitive
- write SetSortCaseInsensitive;
- property SortLocaleInsensitive: Boolean read FSortLocaleInsensitive
- write SetSortLocaleInsensitive;
- procedure AddColumnsFromDataSet;
- function NewColumn: TGridColumn;
- procedure RemoveColumn(AColumn: TGridColumn);
- procedure SetToColumn(AIndex: Integer);
- function FirstColumn: Boolean;
- function PriorColumn(AWrap: Boolean=False): Boolean;
- function NextColumn(AWrap: Boolean=False): Boolean;
- function LastColumn: Boolean;
- procedure MakeColumnVisible(AColumn: TGridColumn);
- function GetGridColumn(Value: TDataColumn): TGridColumn;
- procedure AppendRow;
- procedure InsertRow;
- procedure DeleteRow;
- procedure SortRows;
- function GetRows: String;
- procedure LoadRows(const RowData: String; Append: Boolean=False);
- procedure ShowColumnControl;
- procedure HideColumnControl;
- procedure SetToRow(AIndex: Integer; ShiftKey, CtrlKey: Boolean=False);
- procedure FirstRow(ShiftKey, CtrlKey: Boolean=False);
- procedure LastRow(ShiftKey, CtrlKey: Boolean=False);
- procedure PriorRow(ShiftKey, CtrlKey: Boolean=False);
- procedure NextRow(ShiftKey, CtrlKey: Boolean=False;
- CanAppend: Boolean=False);
- procedure PriorPage(ShiftKey, CtrlKey: Boolean=False);
- procedure NextPage(ShiftKey, CtrlKey: Boolean=False);
- procedure ScrollTo(ARowIndex: Integer);
- procedure ScrollBy(ACount: Integer);
- procedure ScrollNext;
- procedure ScrollPrior;
- procedure ScrollNextPage;
- procedure ScrollPriorPage;
- procedure ToggleSelected(ARowIndex: Integer);
- procedure SelectRange(AFromRowIndex, AToRowIndex: Integer; AClear: Boolean=False);
- procedure SelectAll;
- procedure MakeRowVisible;
- procedure SetFocus; override;
- end;
- TGrid = class(TGridControl)
- protected
- function GetInterfaceClassName: String; override;
- published
- property Top;
- property Left;
- property Height;
- property Width;
- property AllowAppends;
- property AllowDeletes;
- property AllowInserts;
- property AlwaysOnTop;
- property AlwaysShowControls;
- property Animations;
- property Background;
- property Border;
- property ColumnHeaders;
- property ColumnHeadersHeight;
- property Constraints;
- property Corners;
- property Cursor;
- property DataSet;
- property DisplayOrder;
- property Enabled;
- property Hint;
- property Layout;
- property LayoutOrder;
- property Margins;
- property MultiSelect;
- property ReadOnly;
- property RowHeight;
- property RowSelect;
- { This must appear *before* the ScrollBars property !!! }
- property ScrollSupport;
- property ScrollBars;
- property ShowLines;
- property TabOrder;
- property TabStop default True;
- property Tag;
- property Visible;
- property WantTabs;
- property OnAnimationComplete;
- property OnAnimationsComplete;
- property OnShow;
- property OnHide;
- property OnMove;
- property OnSize;
- property OnScroll;
- property OnClick;
- property OnDblClick;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnMouseEnter;
- property OnMouseLeave;
- property OnMouseWheel;
- property OnTouchStart;
- property OnTouchMove;
- property OnTouchEnd;
- property OnTouchCancel;
- property OnTouchScroll;
- property OnKeyDown;
- property OnKeyPress;
- property OnKeyUp;
- property OnColumnChanged;
- property OnRowChanged;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement