[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'DbCtrls' (#lcl)

# TDBCalendar

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TDBCalendar - a data-aware version of TCalendar, for selecting a date to put in a database field

## Declaration

Source position: dbctrls.pp line 991

`type TDBCalendar = class(TCalendar)`
`FDataLink: TFieldDataLink;` |  | FDataLink - local variable to hold identity of the field data link
`procedure DataChange();` |  | DataChange - if the link is active, transmit the changed data
`procedure UpdateData();` |  | UpdateData copy changed data into the text fileld
`procedure FocusRequest();` |  | FocusRequest - a request has been received to give focus, so it is given
`function GetDataField;` |  | GetDataField - returns the name of the Data Field
`function GetDataSource;` |  | GetDataSource - returns the identity of the data source
`function GetField;` |  | GetField - returns the identity of the data field
`function GetReadOnly;` |  | GetReadOnly - returns the ReadOnly state
`procedure SetReadOnly();` |  | SetReadOnly - specifies the value for ReadOnly
`procedure SetDate();` |  | SetDate - specifies the date as a string
`procedure SetDataField();` |  | SetDataField - specifies the data field to use for the calendar
`procedure SetDataSource();` |  | SetDataSource - specifies the data source to which the calendar is linked
`procedure UpdateDate();` |  | UpdateDate - implements any pending changes in the date selected
`procedure CMGetDataLink(); message;` |  | CMGetDataLink - control message method for getting the data link
`protected`
`procedure Loaded; override;` |  |
`procedure Notification(); override;` |  |
`public`
`constructor Create(); override;` |  | Create - constructor for TDBCalendar: calls inherited Create and forms datalinks and actions
`destructor Destroy; override;` |  | Destroy - destructor for TDBCalendar: frees datalinks and calls inherited Destroy
`procedure EditingDone; override;` |  | EditingDone - changes data over the link then calls inherited EditingDone
`property Field: TField; [r]` |  | The Field to which the calendar is attached
`published`
`property BorderSpacing;` |  | Determines the border spacing for this control
`property DataField: String; [rw]` |  | The name of the DataField as a string
`property DataSource: TDataSource; [rw]` |  | The identity of the DataSource holding the date information
`property Date; [ws]` |  | The Date obtained from the Calendar
`property ReadOnly: Boolean; [rw]` |  | ReadOnly - if True, calendar can only be viewed but not changed
`property DisplaySettings; [s]` |  | DisplaySettings - various options governing the appearance of the display
`property DragCursor;` |  | DragCursor - the style of cursor to be used during the Drag process
`property DragMode;` |  | DragMode - whether manual or automatic
`property Visible;` |  | Visible - can the control be seen?
`property OnClick;` |  | Event Handler for mouse click
`property OnDragDrop;` |  | Event handler for the Drag-Drop manoeuvre
`property OnDragOver;` |  | Event handler for the case when a control is dragged over another control
`property OnEndDrag;` |  | Event handler for the end of a dragging process
`property OnMouseMove;` |  | Event handler for mouse movement within the current control
`property OnMouseDown;` |  | Event handler for when a mouse button is pressed down
`property OnDayChanged;` |  | OnDayChanged - event handler for a change in Day selected
`property OnMonthChanged;` |  | OnMonthChanged - event handler for a change in month selected
`property OnStartDrag;` |  | Event handler for start of dragging process
`property OnYearChanged;` |  | OnYearChanged - event handler for a change in the year selected
`end;`

## Inheritance

`TDBCalendar` |  | TDBCalendar - a data-aware version of TCalendar, for selecting a date to put in a database field
`TCalendar` |  | TCalendar - a graphic allowing the user to select a date which is returned as data to the calling routine
`TCustomCalendar` |  | TCustomCalendar - base class for TCalendar, a graphic for selecting a date
`TWinControl`
?
`TObject`

## Description

A pop-up calendar appears, and the user can navigate through years, months and days to select the date that is required. When a date is selected, it is inserted into the Date field of the appropriate record in the database.

## See also

HowToUseDataAwareControls |  | HowToUseDataAwareControls - Hints for accessing databases

The latest version of this document can be found at lazarus-ccr.sourceforge.net.