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

TDBCustomNavigator

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

TDBCustomNavigator - the base class for TDBNavigator, a tool for navigating through the records of a dataset

Declaration

Source position: dbctrls.pp line 872

type TDBCustomNavigator = class(TCustomPanel)

protected

  Buttons: ;

  

The list of Buttons included in the navigator tool

  procedure DataChanged; virtual;

  

  procedure EditingChanged; virtual;

  

  procedure ActiveChanged; virtual;

  

  procedure Loaded; override;

  

  procedure Notification(); override;

  

  procedure UpdateButtons; virtual;

  

  procedure UpdateHints; virtual;

  

  procedure HintsChanged(); virtual;

  

  procedure ButtonClickHandler(); virtual;

  

  procedure DoOnResize; override;

  

  function GetControlClassDefaultSize; override;

  procedure BeginUpdateButtons; virtual;

  

  procedure EndUpdateButtons; virtual;

  

  procedure SetEnabled(); override;

public

  constructor Create(); override;

  

Create an instance of this control

  destructor Destroy; override;

  

Destroy the control and returns its resources

  procedure BtnClick(); virtual;

  

BtnClick - procedure to respond to button clicks, and select an action from a list according to the value of the Index of the clicked button

  function VisibleButtonCount; virtual;

  

Finds the number of visible buttons

  property BeforeAction: TDBNavClickEvent; [rw]

  

  property ConfirmDelete: Boolean; [rw]

  

Should the user be asked for confirmation before a record is deleted? If True, a dialog appears asking for confirmation

  property DataSource: TDataSource; [rw]

  

The Data Source to which the control must be linked in order to function

  property Direction: TDBNavButtonDirection; [rw]

  

The direction in which the buttons appear: horizontal or vertical

  property Flat: Boolean; [rw]

  

  property Hints: TStrings; [rw]

  

A list of hints to be shown if the mouse hovers over a button

  property OnClick: TDBNavClickEvent; [rw]

  

The action to be taken when a navigator button is clicked

  property VisibleButtons: TDBNavButtonSet; [rw]

  

The set of visible buttons (some of them can be suppressed if their function appears redundant)

  property ShowButtonHints: Boolean; [rw]

  

Determines whether button hints are to be shown

end;

Inheritance

TDBCustomNavigator

  

TDBCustomNavigator - the base class for TDBNavigator, a tool for navigating through the records of a dataset

|

TCustomPanel

?

TObject

Description

TDBCustomNavigator is the parent class for TDBNavigator, an advanced tool for navigating through datasets held locally in response to a query sent to the database. Most of the important properties are defined here.

It consists of a series of toolbuttons to move to the First, Prior, Next or Last record; to Insert or Delete a record; to Edit a record (enter Edit mode), to Post the changes. to Cancel the changes, and to Refresh the display from the database. The set of buttons for display can be customised in VisibleButtons, which allows display of individual buttons to be suppressed

If used in conjunction with a DataAware control such as TDBGrid or TDBMemo it controls which records are displayed , the position of the record selection cursor, and the initiation of changes to the dataset and ultimately the database.

Most of the functionality of the toolbar is already built-in to the control, but if the programmer needs to specify actions to be associated with individual buttons, there is a procedure BtnClick to which an argument can be sent with the index value of the button clicked, and the procedure chooses which action to call dependent on the button index.

The DataSource property must be set to link to the appropriate set of data.

See also

HowToUseDataAwareControls

  

HowToUseDataAwareControls - Hints for accessing databases