[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 1346

type TDBCustomNavigator = class(TCustomPanel)

protected

  Buttons: ;

  

The list of Buttons included in the navigator tool.

  FocusableButtons: ;

  

Contains the focusable button for the DB navigator control.

  procedure DataChanged; virtual;

  

DataChanged - update status of all the buttons to reflect new data.

  procedure EditingChanged; virtual;

  

EditingChanged - the status of the buttons is set to CanModify.

  procedure ActiveChanged; virtual;

  

ActiveChanged - if datalink is active, calls DataChanged and EditingChanged.

  procedure Loaded; override;

  

Performs actions needed when the component has finished loading in the LCL streaming mechanism.

  procedure Notification(); override;

  

Notification handler for insertion or deletion of components.

  procedure UpdateButtons; virtual;

  

UpdateButtons - if the position of the buttons need to be changed, does this, then updates the status of the buttons (see ActiveChanged).

  procedure UpdateHints; virtual;

  

UpdateHints - reloads the default hints and modifies any that have been changed.

  procedure HintsChanged(); virtual;

  

HintsChanged - calls UpdateHints.

  procedure ButtonClickHandler(); virtual;

  

ButtonClickHandler - performs BtnClick for the appropriate button.

  class function GetControlClassDefaultSize; override;

  

Returns the default size for this class of controls (when added to a form).

  procedure BeginUpdateButtons; virtual;

  

BeginUpdateButtons - locks the buttons before updating them.

  procedure EndUpdateButtons; virtual;

  

EndUpdateButtons - unlocks each button in turn and updates it if needed.

  procedure SetEnabled(); override;

  

Sets the value for the Enabled property.

public

  constructor Create(); override;

  

Create - constructor for TDBCustomNavigator: locks the buttons, calls inherited Create, sets default size, style, forms datalinks, initializes hints, updates the buttons.

  destructor Destroy; override;

  

Destroy - destructor for TDBCustomNavigator: frees datalinks and hints, then calls inherited Destroy.

  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;

  

Number of visible buttons on the control.

  property BeforeAction: TDBNavClickEvent; [rw]

  

BeforeAction - code to be executed before an action is performed.

  property ConfirmDelete: Boolean; [rw]

  

Indicates if the user is asked to confirm a record deletion.

  property DataSource: TDataSource; [rw]

  

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

  property Direction: TDBNavButtonDirection; [rw]

  

Contains the orientation for buttons displayed on the control: horizontal or vertical.

  property Flat: Boolean; [rw]

  

Flat - if True, buttons have no 3-D effect.

  property Hints: TStrings; [rw]

  

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

  property Options: TDBNavigatorOptions; [rw]

  

Options enabled for the navigator.

  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]

  

Controls whether button hints are displayed for the control.

  property Images: TCustomImageList; [rw]

  

Contains the images available for display on the navigator buttons.

end;

Inheritance

TDBCustomNavigator

  

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

|

TCustomPanel

  

The base class for a general container which can hold other objects. It has a customizable border and a central text.

|

TCustomControl

  

The base class for windowed controls which paint themselves.

|

TWinControl

  

The base class for controls which can contain other (child) controls.

|

TControl

  

The base class for visible controls.

|

TLCLComponent

  

The base class for LCL components which have an associated widget.

|

TComponent

?

TObject

Description

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

It consists of a series of toolbuttons used to perform navigation and maintenance for records in the linked dataset. For example:

Navigation
First, Prior, Next or Last
Maintenance
Insert, Delete, Edit, Post, Cancel or Refresh

Use the VisibleButtons property to specify which of the Buttons can be displayed in the control.

If used in conjunction with a data-aware controls, it controls which record is 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 assigned to link to the dataset for the control.

See also

How To Use Data-aware Controls

  

HowToUseDataAwareControls - Hints for accessing databases.

TDBNavigator

  

TDBNavigator - a data-aware Button-Bar to facilitate navigating between records of a dataset.

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