Class TMCustomDBGrid (unit MyDbgrids)

Inherits from

TCustomGrid

Constructors


constructor Create(AOwner: TComponent);

brush origin tics in painting / scrolling.


Functions

procedure DefaultDrawColumnCell(const Rect: TRect; DataCol: Integer; Column: TMColumn; State: TGridDrawState);

obsolete

procedure DefaultDrawDataCell(const Rect: TRect; Field: TField; State: TGridDrawState);

Build the column/field map from the field list order

destructor Destroy;


function ValidFieldIndex(FieldIndex: Integer): Boolean;


function AcquireLayoutLock: Boolean;


procedure BeginLayout;


procedure BeginUpdate;


procedure CancelLayout;


function CanEditAcceptKey(Key: Char): Boolean;


function CanEditModify: Boolean;


function CanEditShow: Boolean;

Allow editing of memo fields if OnSetText event is assigned

procedure ColEnter;


procedure ColExit;


procedure ColumnMoved(FromIndex, ToIndex: Longint);


procedure ColWidthsChanged;


function CreateColumns: TMDBGridColumns;


function CreateEditor: TInplaceEdit;


procedure CreateWnd;


function DataToRawColumn(ACol: Integer): Integer;


procedure DeferLayout;


procedure DefineFieldMap;


procedure DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState);


procedure DrawColumnCell(const Rect: TRect; DataCol: Integer; Column: TMColumn; State: TGridDrawState);

obsolete

procedure DrawDataCell(const Rect: TRect; Field: TField; State: TGridDrawState);


procedure EditButtonClick;


procedure EndLayout;


procedure EndUpdate;


function GetColField(DataCol: Integer): TField;


function GetEditLimit: Integer;


function GetEditMask(ACol, ARow: Longint): string;


function GetEditText(ACol, ARow: Longint): string;


function GetFieldValue(ACol: Integer): string;


function HighlightCell(DataCol, DataRow: Integer; const Value: string; AState: TGridDrawState): Boolean;


procedure KeyDown(var Key: Word; Shift: TShiftState);

updatelock eliminates flicker when tabbing between rows

procedure KeyPress(var Key: Char);


procedure LayoutChanged;

Force columns to reaquire fields (in case dataset has changed)

procedure LinkActive(Value: Boolean);


procedure Loaded;


procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);


procedure Notification(AComponent: TComponent; Operation: TOperation);


function RawToDataColumn(ACol: Integer): Integer;


procedure Scroll(Distance: Integer);


procedure SetColumnAttributes;


procedure SetEditText(ACol, ARow: Longint; const Value: string);


function StoreColumns: Boolean;


procedure TimedScroll(Direction: TGridScrollDirection);


function AcquireFocus: Boolean;


procedure CMDeferLayout(var Message);


procedure CMDesignHitTest(var Msg: TCMDesignHitTest);


procedure CMExit(var Message: TMessage);


procedure CMFontChanged(var Message: TMessage);


procedure CMParentFontChanged(var Message: TMessage);


procedure DataChanged;

prevent updates in WMSize message that follows WMCreate

function Edit: Boolean;


procedure EditingChanged;


function GetDataSource: TDataSource;


function GetFieldCount: Integer;


function GetFields(FieldIndex: Integer): TField;


function GetRecNo : LongInt;


function GetSelectedField: TField;


function GetSelectedIndex: Integer;


procedure InternalLayout;

InternalLayout is called with layout locks and column locks in effect

procedure MoveCol(RawCol: Integer);

draw editor, if needed

procedure RecordChanged(Field: TField);


procedure SetColumns(Value: TMDBGridColumns);


procedure SetDataSource(Value: TDataSource);


procedure SetOptions(Value: TDBGridOptions);


procedure SetSelectedField(Value: TField);


procedure SetSelectedIndex(Value: Integer);


procedure SetTitleFont(Value: TFont);


procedure TitleFontChanged(Sender: TObject);


procedure UpdateActive;


procedure UpdateData;


procedure UpdateRowCount;


procedure UpdateScrollBar;


procedure WMSetCursor(var Msg: TWMSetCursor);


procedure WMSize(var Message: TWMSize);


procedure WMVScroll(var Message: TWMVScroll);


Properties

property EditorMode :


property FieldCount : Integer


property Fields : TField


property RecNo : Longint


property SelectedField : TField


property SelectedIndex : Integer


property Columns : TMDBGridColumns


property DataLink : TMGridDataLink


property DataSource : TDataSource


property DefaultDrawing : Boolean


property IndicatorOffset : Byte


property LayoutLock : Byte


property Options : TDBGridOptions


property ParentColor :


property ReadOnly : Boolean


property SelectedRows : TMBookmarkList


property TitleFont : TFont


property UpdateLock : Byte


Events

event OnColEnter : TNotifyEvent


event OnColExit : TNotifyEvent


event OnColumnMoved : TMovedEvent


event OnDrawColumnCell : TMDrawColumnCellEvent

obsolete

event OnDrawDataCell : TDrawDataCellEvent


event OnEditButtonClick : TNotifyEvent


Variables

FAcquireFocus : Boolean;


FUpdateFields : Boolean;


FBookmarks : TMBookmarkList;


FColumns : TMDBGridColumns;


FConnected : Boolean;


FDataChanged : Boolean;


FDataLink : TMGridDataLink;


FDefaultDrawing : Boolean;


FEditRequest : Boolean;


FEditText : string;


FInColExit : Boolean;


FIndicatorOffset : Byte;


FIndicators : TImageList;


FLayoutFromDataset : Boolean;


FLayoutLock : Byte;


FOnColEnter : TNotifyEvent;


FOnColExit : TNotifyEvent;


FOnColumnMoved : TMovedEvent;


FOnDrawColumnCell : TMDrawColumnCellEvent;


FOnDrawDataCell : TDrawDataCellEvent;


FOnEditButtonClick : TNotifyEvent;


FOptions : TDBGridOptions;


FReadOnly : Boolean;


FSelecting : Boolean;


FSelectionAnchor : TBookmarkStr;


FSelfChangingTitleFont : Boolean;


FSelRow : Integer;


FTitleFont : TFont;


FTitleOffset : Byte;


FUpdateLock : Byte;


FUserChange : Boolean;



Constructors


constructor Create(AOwner: TComponent);

brush origin tics in painting / scrolling.


Functions


procedure DefaultDrawColumnCell(const Rect: TRect; DataCol: Integer; Column: TMColumn; State: TGridDrawState);

obsolete


procedure DefaultDrawDataCell(const Rect: TRect; Field: TField; State: TGridDrawState);

Build the column/field map from the field list order


destructor Destroy;


function ValidFieldIndex(FieldIndex: Integer): Boolean;


function AcquireLayoutLock: Boolean;


procedure BeginLayout;


procedure BeginUpdate;


procedure CancelLayout;


function CanEditAcceptKey(Key: Char): Boolean;


function CanEditModify: Boolean;


function CanEditShow: Boolean;

Allow editing of memo fields if OnSetText event is assigned


procedure ColEnter;


procedure ColExit;


procedure ColumnMoved(FromIndex, ToIndex: Longint);


procedure ColWidthsChanged;


function CreateColumns: TMDBGridColumns;


function CreateEditor: TInplaceEdit;


procedure CreateWnd;


function DataToRawColumn(ACol: Integer): Integer;


procedure DeferLayout;


procedure DefineFieldMap;


procedure DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState);


procedure DrawColumnCell(const Rect: TRect; DataCol: Integer; Column: TMColumn; State: TGridDrawState);

obsolete


procedure DrawDataCell(const Rect: TRect; Field: TField; State: TGridDrawState);


procedure EditButtonClick;


procedure EndLayout;


procedure EndUpdate;


function GetColField(DataCol: Integer): TField;


function GetEditLimit: Integer;


function GetEditMask(ACol, ARow: Longint): string;


function GetEditText(ACol, ARow: Longint): string;


function GetFieldValue(ACol: Integer): string;


function HighlightCell(DataCol, DataRow: Integer; const Value: string; AState: TGridDrawState): Boolean;


procedure KeyDown(var Key: Word; Shift: TShiftState);

updatelock eliminates flicker when tabbing between rows


procedure KeyPress(var Key: Char);


procedure LayoutChanged;

Force columns to reaquire fields (in case dataset has changed)


procedure LinkActive(Value: Boolean);


procedure Loaded;


procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);


procedure Notification(AComponent: TComponent; Operation: TOperation);


function RawToDataColumn(ACol: Integer): Integer;


procedure Scroll(Distance: Integer);


procedure SetColumnAttributes;


procedure SetEditText(ACol, ARow: Longint; const Value: string);


function StoreColumns: Boolean;


procedure TimedScroll(Direction: TGridScrollDirection);


function AcquireFocus: Boolean;


procedure CMDeferLayout(var Message);


procedure CMDesignHitTest(var Msg: TCMDesignHitTest);


procedure CMExit(var Message: TMessage);


procedure CMFontChanged(var Message: TMessage);


procedure CMParentFontChanged(var Message: TMessage);


procedure DataChanged;

prevent updates in WMSize message that follows WMCreate


function Edit: Boolean;


procedure EditingChanged;


function GetDataSource: TDataSource;


function GetFieldCount: Integer;


function GetFields(FieldIndex: Integer): TField;


function GetRecNo : LongInt;


function GetSelectedField: TField;


function GetSelectedIndex: Integer;


procedure InternalLayout;

InternalLayout is called with layout locks and column locks in effect


procedure MoveCol(RawCol: Integer);

draw editor, if needed


procedure RecordChanged(Field: TField);


procedure SetColumns(Value: TMDBGridColumns);


procedure SetDataSource(Value: TDataSource);


procedure SetOptions(Value: TDBGridOptions);


procedure SetSelectedField(Value: TField);


procedure SetSelectedIndex(Value: Integer);


procedure SetTitleFont(Value: TFont);


procedure TitleFontChanged(Sender: TObject);


procedure UpdateActive;


procedure UpdateData;


procedure UpdateRowCount;


procedure UpdateScrollBar;


procedure WMSetCursor(var Msg: TWMSetCursor);


procedure WMSize(var Message: TWMSize);


procedure WMVScroll(var Message: TWMVScroll);


Properties


property EditorMode :


property FieldCount : Integer


property Fields : TField


property RecNo : Longint


property SelectedField : TField


property SelectedIndex : Integer


property Columns : TMDBGridColumns


property DataLink : TMGridDataLink


property DataSource : TDataSource


property DefaultDrawing : Boolean


property IndicatorOffset : Byte


property LayoutLock : Byte


property Options : TDBGridOptions


property ParentColor :


property ReadOnly : Boolean


property SelectedRows : TMBookmarkList


property TitleFont : TFont


property UpdateLock : Byte


Events


event OnColEnter : TNotifyEvent


event OnColExit : TNotifyEvent


event OnColumnMoved : TMovedEvent


event OnDrawColumnCell : TMDrawColumnCellEvent

obsolete


event OnDrawDataCell : TDrawDataCellEvent


event OnEditButtonClick : TNotifyEvent


Variables


FAcquireFocus : Boolean;


FUpdateFields : Boolean;


FBookmarks : TMBookmarkList;


FColumns : TMDBGridColumns;


FConnected : Boolean;


FDataChanged : Boolean;


FDataLink : TMGridDataLink;


FDefaultDrawing : Boolean;


FEditRequest : Boolean;


FEditText : string;


FInColExit : Boolean;


FIndicatorOffset : Byte;


FIndicators : TImageList;


FLayoutFromDataset : Boolean;


FLayoutLock : Byte;


FOnColEnter : TNotifyEvent;


FOnColExit : TNotifyEvent;


FOnColumnMoved : TMovedEvent;


FOnDrawColumnCell : TMDrawColumnCellEvent;


FOnDrawDataCell : TDrawDataCellEvent;


FOnEditButtonClick : TNotifyEvent;


FOptions : TDBGridOptions;


FReadOnly : Boolean;


FSelecting : Boolean;


FSelectionAnchor : TBookmarkStr;


FSelfChangingTitleFont : Boolean;


FSelRow : Integer;


FTitleFont : TFont;


FTitleOffset : Byte;


FUpdateLock : Byte;


FUserChange : Boolean;