Data-Aware controls commonly used for viewing and operating on information held in databases
TDBEdit - a data-aware edit box for processing a single text-string from a dataset
Create a new instance of the Window Control
Destroy this instance of the Window Control, and return the resources used
The field in the DataSet from which data are to be displayed in the Edit
Refers to the complete Field entity, not just its name
The name (as a string) of the field whose data are to be displayed
The DataSource to be used for supplying the data in the required Field. Ususally the result of a data query
ReadOnly - the contents of the edit box may only be read, not written or erased
The set of anchor definitions for this control

// standard properties, which should be supported by all descendants

Determines how the control is to be anchored to its client or parent control

Either reads a flag containing the set of anchors to be used, or writes a set of anchors. If they have been written, this is indicated in IsAnchorsStored

Whether auto-size is to be used

// standard properties, which should be supported by all descendants

AutoSize permits the size of a control to be adjusted automatically, for example a button can become bigger or smaller to accommodate a longer or shorter caption.

Reads logical (boolean) flag to see whether auto-sizing is to be operated, or writes the flag to say it should be done. Default is false, ie no auto-sizing

CharCase - rules for what case to use (upper or lower) to display text

Indicates how text is displayed in a text editing control in the following ways:

- Normal case letters
- Upper case letters
- Lower case letters

The rules can, of course, be overridden by use of the shift key.

Determine the colour for the current control

// standard properties, which should be supported by all descendants

Reads the value for colour, or stores the value, and sets a flag if the colour is stored.

The default colour is the same as the window in which the control is located.

Determine Constraints (max and min height and width) for this control

// standard properties, which should be supported by all descendants

Determine Constraints (max and min height and width) for this control; reads the size constraints or stores new ones.

DragCursor - the style of cursor to be used during the Drag process
DragKind - what sort of dragging? Drag or Dock
DragMode - whether manual or automatic
Whether the control is Enabled. If not, it usually appears 'greyed-out'

// standard properties, which should be supported by all descendants

Whether the control is Enabled. If not, it usually appears 'greyed-out'

Reads a flag to see whether the control is enabled, or stores a new value. If stored, sets a flag to say so.

The Font to be used for text in this control

// standard properties, which should be supported by all descendants

Reads a flag to see what font should be used, or sets a flag to store it. If stored, sets a flag to say so

The properties of Font are defined in the parent class TFont

MaxLength: maximum length allowed for text string
ParentColor - should the control have the same colour as the parent? Default is true
ParentFont - should the control use the same font as the parent? Default is true
ParentShowHint - does the control adopt the same hinting behaviour as its parent? Default is true
PasswordChar: the character which appears in the Edit box replacing and masking the actual character typed

PasswordChar

: the character which appears in the Edit box replacing and masking the actual character typed.

Typically used in password input, to prevent the typed characters from being seen by passers-by or casual observers (or even malicious observers!)

PopupMenu - a context-sensitive menu that pops up when the right mouse button is clicked over this control
// standard properties, which should be supported by all descendants
Reads the details of the pop-up menu, or stores them.
Properties are defined in the parent class TPopupMenu
Flag to determine: Is hint to be displayed for this control?
// standard properties, which should be supported by all descendants
Reads flag or writes one to determine if a hint is to be shown when mouse hovers over this control. If value is stored, a storage flag is set. Display of the actual hint is controlled by OnShowHint
The place this control occupies in the list of tabs
Reads or writes information in flag; default is -1
TabStop - determines if the user can tab to a control.

Reads or writes boolean flag; default is False

Use the TabStop to allow or disallow access to the control using the Tab key.

If TabStop is True, the control is in the tab order. If TabStop is False, the control is not in the tab order and the user can't use the Tab key to move to the control.

Visible - can the control be seen?

    The Visible property represents the ability to see a visual control.
              If Visible is True the control is shown, otherwise it is hidden.
              Calling Show sets, among others, Visible to True.
              Setting Visible to False is equivalent to calling Hide method.

The Visible property does not depend on control's parent visibility. Use IsVisible method to consider this and get real visibility.
OnChange - event handler for any change in text
Event Handler for mouse click

// standard properties, which should be supported by all descendants

This is often the default action for many controls, and is often the ONLY action specified by the programmer. The action can be spcified by the user, either by typing explicit code into the implementation section for this control, or by selecting an action from a pre-supplied ActionList

Reads or writes a flag if a mouse click is detected, and sets a flag if a value is stored.

Event Handle for mouse double-click

Double-clicking is much more common in a Windows environment than in Unix or Linux, where single-clicking is the default method for selecting an object. However, in all environments there could be valid use for a double-click, and a method should be supplied if appropriate.

Event handler for the Drag-Drop manoeuvre
Event handler for the case when a control is dragged over another control
Event handler for the end of a dragging process
OnEnter - event handler for when the mouse enters the control, and the control receives focus
OnExit - event handler for when the mouse leaves the control and it loses focus
OnKeyDown - event handler for instance when key is down while control has focus

OnKeyDown - event handler for instance when key is down while control has focus

Differs from OnKeyPress in that the key may have already been down when the control received focus; with OnKeyPress the key needs to become pressed while the control has focus.

OnKeyPress - event controller for a key being pressed while the control has focus

OnKeyPress - event controller for a key being pressed while the control has focus

Differs from OnKeyDown in that the key needs to become pressed while the control has focus; with OnKeyDown the key may have already been down when the control received focus.

OnKeyUp - event handler for instance when a key is up (not pressed) while the control has focus

OnKeyUp - event handler for instance when a key is up (not pressed) while the control has focus

The key may already have been up when the control received focus, or a pressed key may become released during the time the control has focus.

Event handler for when a mouse button is pressed down
Event handler for mouse movement within the current control
Event handler for when the mouse button is released, ie "up"
Event handler for start of dragging process
TDBText - a data-aware text component to display a single text-string from a dataset
Called when the component has finished loading.

Loaded is called by the streaming system when a root component was completely read from a stream and all properties and references to other objects have been resolved by the streaming system. Descendents of TComponent should override this method to do some additional processing of properties after all published properties have been set from values obtained from the stream.

Application programmers should never call Loaded directly, this is done automatically by the streaming system.

Called by components that are freed and which received a FreeNotification.

Notification is called whenever a child component is destroyed, inserted or removed from the list of owned component. Components that were requested to send a notification when they are freed ((with FreeNotification) will also call Notification when they are freed.

The AComponent parameter specifies which component sends the notification, and Operation specifies whether the component is being inserted into or removed from the child component list, or whether it is being destroyed.

Descendents of TComponent can use FreeNotification to request notification of the destruction of another object. By overriding the Notification method, they can do special processing (typically, set a reference to this component to Nil) when this component is destroyed. The Notification method is called quite often in the streaming process, so speed should be a consideration when overriding this method.

Create a new instance of a Graphic Control
Destroy this instance of a graphic control and return its resources
The field in the DataSet to which this control is to be linked. Can be referred to by name, or as an index
Used to align the control in one of four directions.

// standard properties, which should be supported by all descendants

Either reads a flag containing alignment instructions (FAlign) or writes alignment instructions (SetAlign)

May have no alignment, may have custom or client alignment, or can be aligned to top, bottom, left or right

Alignment - whether text is centered, left- or right-justified
The set of anchor definitions for this control

// standard properties, which should be supported by all descendants

Determines how the control is to be anchored to its client or parent conrol

Either reads a flag containing the set of anchors to be used, or writes a set of anchors. If they have been written, this is indicated in IsAnchorsStored

Whether auto-size is to be used

// standard properties, which should be supported by all descendants

AutoSize permits the size of a control to be adjusted automatically, for example a button can become bigger or smaller to accommodate a longer or shorter caption.

Reads logical (boolean) flag to see whether auto-sizing is to be operated, or writes the flag to say it should be done. Default is false, ie no auto-sizing

Caption - the text-string appearing on the Control, usually used to identify its function

Gets caption as a text-string (GetText), or stores the new caption (SetText). Shows flag if caption is stored (IsCaptionStored).

By default, the Caption appears the same as the control Name in the Object Inspector, and the developer needs to set it explicitly to some new text.

The VCL implementation relies on the virtual Get/SetTextBuf to exchange text between widgets and VCL. This means a lot of (unnecesary) text copies.

The LCL uses strings for exchanging text (more efficient). To maintain VCL compatibility, the virtual RealGet/SetText is introduced. These functions interface with the LCLInterface.

The default Get/SetTextBuf implementation calls the RealGet/SetText. As long as the Get/SetTextBuf isn't overridden Get/SetText calls RealGet/SetText to avoid PChar copying.

To keep things optimal, LCL implementations should always override RealGet/SetText. Get/SetTextBuf is only kept for compatibility.

Determine the colour for the current control

// standard properties, which should be supported by all descendants

Reads the value for colour, or stores the value, and sets a flag if the colour is stored.

The default colour is the same as the window in which the control is located.

The name of the field, as a string (ie cannot be referred to as an Index)
The DataSource from which information is obtained to display in this control. Usually the result of a SQLQuery
FocusControl - whether this control has focus
The Font to be used for text in this control

// standard properties, which should be supported by all descendants

Reads a flag to see what font should be used, or sets a flag to store it. If stored, sets a flag to say so

The properties of Font are defined in the parent class TFont

Layout - How the Text is to be laid out in the text rectangle: at the Bottom, Centre or Top
ShowAccelChar - underline the character in the label that acts as an accelerator with a shortcut key

ShowAccelChar

- underline the character in the label that acts as an accelerator with a shortcut key

Boolean property - default True

Visible - can the control be seen?

    The Visible property represents the ability to see a visual control.
              If Visible is True the control is shown, otherwise it is hidden.
              Calling Show sets, among others, Visible to True.
              Setting Visible to False is equivalent to calling Hide method.

The Visible property does not depend on control's parent visibility. Use IsVisible method to consider this and get real visibility.
WordWrap - whether a word is to be wrapped to the next line if the text is about to become too long for the width available

WordWrap

- whether a word is to be wrapped to the next line if the text is about to become too long for the width available

Boolean property, default False

TDBListBox - a data-aware version of TListBox, for displaying lists of entries from a field in a database
Called when the component has finished loading.

Loaded is called by the streaming system when a root component was completely read from a stream and all properties and references to other objects have been resolved by the streaming system. Descendents of TComponent should override this method to do some additional processing of properties after all published properties have been set from values obtained from the stream.

Application programmers should never call Loaded directly, this is done automatically by the streaming system.

Called by components that are freed and which received a FreeNotification.

Notification is called whenever a child component is destroyed, inserted or removed from the list of owned component. Components that were requested to send a notification when they are freed ((with FreeNotification) will also call Notification when they are freed.

The AComponent parameter specifies which component sends the notification, and Operation specifies whether the component is being inserted into or removed from the child component list, or whether it is being destroyed.

Descendents of TComponent can use FreeNotification to request notification of the destruction of another object. By overriding the Notification method, they can do special processing (typically, set a reference to this component to Nil) when this component is destroyed. The Notification method is called quite often in the streaming process, so speed should be a consideration when overriding this method.

Click - a procedure that allows the programmer to simulate a mouse click over the control, and initiates the same Action as that associated with the OnClick event
EditingDone - what to do when you have finished editing

TControl.EditingDone

Called when user has finished editing. This procedure can be used by data links to commit the changes.

For example:

- When focus switches to another control (default)
- When user selected another item

It's totally up to the control, what events will commit.

Create a new instance of the Window Control
Destroy this instance of the Window Control, and return the resources used
The Field of the DataSet for which data are to be displayed
Regers to the whole Field entity, not just its name
The name (as a string) of the Field for which data are to be displayed
The DataSource from which Field data are to be displayed - usually the results of a database query
The array of strings representing the list of entries in the list box
ReadOnly - if True, data can be seen and displayed but not writen or modified
Used to align the control in one of four directions.

// standard properties, which should be supported by all descendants

Either reads a flag containing alignment instructions (FAlign) or writes alignment instructions (SetAlign)

May have no alignment, may have custom or client alignment, or can be aligned to top, bottom, left or right

The set of anchor definitions for this control

// standard properties, which should be supported by all descendants

Determines how the control is to be anchored to its client or parent conrol

Either reads a flag containing the set of anchors to be used, or writes a set of anchors. If they have been written, this is indicated in IsAnchorsStored

BorderStyle - none, or single
ExtendedSelect - boolean. Whether extended selection is allowed. Default True
ItemHeight - the height of the individual Items
MultiSelect - allows more than one Item from the list to be selected at a time, by pressing the CTRL or SHIFT key while selecting
Event Handler for mouse click

// standard properties, which should be supported by all descendants

This is often the default action for many controls, and is often the ONLY action specified by the programmer. The action can be spcified by the user, either by typing explicit code into the implementation section for this control, or by selecting an action from a pre-supplied ActionList

Reads or writes a flag if a mouse click is detected, and sets a flag if a value is stored.

Event Handle for mouse double-click

Double-clicking is much more common in a Windows environment than in Unix or Linux, where single-clicking is the default method for selecting an object. However, in all environments there could be valid use for a double-click, and a method should be supplied if appropriate.

OnDrawItem - event handler for drawing an Item

OnDrawItem

- event handler for drawing an Item

For example, selecting an item may require it to be highlighted or have its font or background changed

OnEnter - event handler for when the mouse enters the control, and the control receives focus
OnExit - event handler for when the mouse leaves the control and it loses focus
OnKeyPress - event controller for a key being pressed while the control has focus

OnKeyPress - event controller for a key being pressed while the control has focus

Differs from OnKeyDown in that the key needs to become pressed while the control has focus; with OnKeyDown the key may have already been down when the control received focus.

OnKeyDown - event handler for instance when key is down while control has focus

OnKeyDown - event handler for instance when key is down while control has focus

Differs from OnKeyPress in that the key may have already been down when the control received focus; with OnKeyPress the key needs to become pressed while the control has focus.

OnKeyUp - event handler for instance when a key is up (not pressed) while the control has focus

OnKeyUp - event handler for instance when a key is up (not pressed) while the control has focus

The key may already have been up when the control received focus, or a pressed key may become released during the time the control has focus.

Event handler for mouse movement within the current control
Event handler for when a mouse button is pressed down
Event handler for when the mouse button is released, ie "up"
Event Handler for resize of control
// standard properties, which should be supported by all descendants
Reads or Writes flag if control is re-sized.
ParentShowHint - does the control adopt the same hinting behaviour as its parent? Default is true
Flag to determine: Is hint to be displayed for this control?
// standard properties, which should be supported by all descendants
Reads flag or writes one to determine if a hint is to be shown when mouse hovers over this control. If value is stored, a storage flag is set. Display of the actual hint is controlled by OnShowHint
Sorted - whether the selected Items in the list have been arranged in alphabetical order
Style of List Box - normal, owner-draw fixed, or owner-draw variable
The place this control occupies in the list of tabs
Reads or writes information in flag; default is -1
TabStop - determines if the user can tab to a control.

Reads or writes boolean flag; default is False

Use the TabStop to allow or disallow access to the control using the Tab key.

If TabStop is True, the control is in the tab order. If TabStop is False, the control is not in the tab order and the user can't use the Tab key to move to the control.

Topindex - the highest value of Index in this list
Visible - can the control be seen?

    The Visible property represents the ability to see a visual control.
              If Visible is True the control is shown, otherwise it is hidden.
              Calling Show sets, among others, Visible to True.
              Setting Visible to False is equivalent to calling Hide method.

The Visible property does not depend on control's parent visibility. Use IsVisible method to consider this and get real visibility.
TDBRadioGroup - a data-aware version of TRadioGroup, providing a series of mutually exclusive buttons to select an entry to insert into a database field

The properties of TDBRadioGroup are similar to those of TRadioGroup (and TCustomRadioGroup). Access is obtained to members of the group by selecting (in the Object Inspector) the ellipsis (...) next to the entry Items, and then editing the stringlist.

At runtime, selecting one of the radiobuttons makes the corresponding ItemIndex available to the programmer, and the corresponding string Item gets selected and appears as the string value for the record in that field.

Create a new instance of the Window Control
Destroy this instance of the Window Control, and return the resources used
The DataSet Field relevant to the data being selected
Refers to the complete Field entity, not just its name
The Index value in the list of Items (a stringlist with the names of the selections for radio buttons)
The selected value (as indicated by ItemIndex)
Used to align the control in one of four directions.

// standard properties, which should be supported by all descendants

Either reads a flag containing alignment instructions (FAlign) or writes alignment instructions (SetAlign)

May have no alignment, may have custom or client alignment, or can be aligned to top, bottom, left or right

The set of anchor definitions for this control

// standard properties, which should be supported by all descendants

Determines how the control is to be anchored to its client or parent conrol

Either reads a flag containing the set of anchors to be used, or writes a set of anchors. If they have been written, this is indicated in IsAnchorsStored

Caption - the text-string appearing on the Control, usually used to identify its function

Gets caption as a text-string (GetText), or stores the new caption (SetText). Shows flag if caption is stored (IsCaptionStored).

By default, the Caption appears the same as the control Name in the Object Inspector, and the developer needs to set it explicitly to some new text.

The VCL implementation relies on the virtual Get/SetTextBuf to exchange text between widgets and VCL. This means a lot of (unnecesary) text copies.

The LCL uses strings for exchanging text (more efficient). To maintain VCL compatibility, the virtual RealGet/SetText is introduced. These functions interface with the LCLInterface.

The default Get/SetTextBuf implementation calls the RealGet/SetText. As long as the Get/SetTextBuf isn't overridden Get/SetText calls RealGet/SetText to avoid PChar copying.

To keep things optimal, LCL implementations should always override RealGet/SetText. Get/SetTextBuf is only kept for compatibility.

Columns - the number of columns in which the Items (radio buttons) are to be arranges

Don't confuse this with the Columns entity in a DBGrid, nor with the COLUMNS entity in a SQL database - it simply refers to the number of columns of radiobuttons to be displayed

The name (as a string) of the Field whose data are linked to the control
The DataSource from which relevant Field data are to be linked - usually the result of a database query
Whether the control is Enabled. If not, it usually appears 'greyed-out'

// standard properties, which should be supported by all descendants

Whether the control is Enabled. If not, it usually appears 'greyed-out'

Reads a flag to see whether the control is enabled, or stores a new value. If stored, sets a flag to say so.

Items - a string list containing the captions for the radio boxes
Event Handler for any change in the radiogroup selection
Event handler for a change in bounds of the control

// standard properties, which should be supported by all descendants

Reads or Writes flag if bounds are changed

Event Handler for mouse click

// standard properties, which should be supported by all descendants

This is often the default action for many controls, and is often the ONLY action specified by the programmer. The action can be spcified by the user, either by typing explicit code into the implementation section for this control, or by selecting an action from a pre-supplied ActionList

Reads or writes a flag if a mouse click is detected, and sets a flag if a value is stored.

Event handler for when a mouse button is pressed down
Event handler for mouse movement within the current control
Event handler for when the mouse button is released, ie "up"
Event Handler for resize of control
// standard properties, which should be supported by all descendants
Reads or Writes flag if control is re-sized.
ReadOnly - if True, data can only be read, not written or modified. (Doesn't really make sense for a RadioGroup!)
The values of the strings in Items
Visible - can the control be seen?

    The Visible property represents the ability to see a visual control.
              If Visible is True the control is shown, otherwise it is hidden.
              Calling Show sets, among others, Visible to True.
              Setting Visible to False is equivalent to calling Hide method.

The Visible property does not depend on control's parent visibility. Use IsVisible method to consider this and get real visibility.
TDBCheckBox - a data-aware checkbox for use with logical fields in a database
Create a new instance of this component
Destroy this instance of the Window Control, and return the resources used
Whether the box is checked
The Field in the DataSet with which the box is to be associated

Refers to the whole Field entity, not just its name

Indicates whether the check box is checked (selected), unchecked (deselected) or grayed.

See TCheckBoxState for possible values of State.

Determines whether the check box can be in a "grayed" state.

If AllowGrayed is set to True, the check box has three possible states: checked, unchecked and grayed. If AllowGrayed is set to False, the check box has only two possible states: checked and unchecked.

The set of anchor definitions for this control

// standard properties, which should be supported by all descendants

Determines how the control is to be anchored to its client or parent conrol

Either reads a flag containing the set of anchors to be used, or writes a set of anchors. If they have been written, this is indicated in IsAnchorsStored

Whether auto-size is to be used

// standard properties, which should be supported by all descendants

AutoSize permits the size of a control to be adjusted automatically, for example a button can become bigger or smaller to accommodate a longer or shorter caption.

Reads logical (boolean) flag to see whether auto-sizing is to be operated, or writes the flag to say it should be done. Default is false, ie no auto-sizing

Caption - the text-string appearing on the Control, usually used to identify its function

Gets caption as a text-string (GetText), or stores the new caption (SetText). Shows flag if caption is stored (IsCaptionStored).

By default, the Caption appears the same as the control Name in the Object Inspector, and the developer needs to set it explicitly to some new text.

The VCL implementation relies on the virtual Get/SetTextBuf to exchange text between widgets and VCL. This means a lot of (unnecesary) text copies.

The LCL uses strings for exchanging text (more efficient). To maintain VCL compatibility, the virtual RealGet/SetText is introduced. These functions interface with the LCLInterface.

The default Get/SetTextBuf implementation calls the RealGet/SetText. As long as the Get/SetTextBuf isn't overridden Get/SetText calls RealGet/SetText to avoid PChar copying.

To keep things optimal, LCL implementations should always override RealGet/SetText. Get/SetTextBuf is only kept for compatibility.

The name (as a string) of the field with which the checkbox is to be associated
The DataSource containing the Field that is to be associated with this checkbox
DragCursor - the style of cursor to be used during the Drag process
DragKind - what sort of dragging? Drag or Dock
DragMode - whether manual or automatic
Whether the control is Enabled. If not, it usually appears 'greyed-out'

// standard properties, which should be supported by all descendants

Whether the control is Enabled. If not, it usually appears 'greyed-out'

Reads a flag to see whether the control is enabled, or stores a new value. If stored, sets a flag to say so.

Hint - a small informative pop-up box that appears when the mouse 'hovers' over a control

Hint - a small informative pop-up box that appears when the mouse 'hovers' over a control

Requires ShowHint to be True

OnChange - event handler for any change in properties of the control
Event Handler for mouse click

// standard properties, which should be supported by all descendants

This is often the default action for many controls, and is often the ONLY action specified by the programmer. The action can be spcified by the user, either by typing explicit code into the implementation section for this control, or by selecting an action from a pre-supplied ActionList

Reads or writes a flag if a mouse click is detected, and sets a flag if a value is stored.

Event handler for the Drag-Drop manoeuvre
Event handler for the case when a control is dragged over another control
Event handler for the end of a dragging process
OnEnter - event handler for when the mouse enters the control, and the control receives focus
OnExit - event handler for when the mouse leaves the control and it loses focus
Event handler for when a mouse button is pressed down
Event handler for mouse movement within the current control
Event handler for when the mouse button is released, ie "up"
Event handler for start of dragging process
ParentShowHint - does the control adopt the same hinting behaviour as its parent? Default is true
PopupMenu - a context-sensitive menu that pops up when the right mouse button is clicked over this control
// standard properties, which should be supported by all descendants
Reads the details of the pop-up menu, or stores them.
Properties are defined in the parent class TPopupMenu
ReadOnly - if True, data may be read but not written or modified (doesn't make much sense for a check-box unless the box is NOT Enabled!)
Flag to determine: Is hint to be displayed for this control?
// standard properties, which should be supported by all descendants
Reads flag or writes one to determine if a hint is to be shown when mouse hovers over this control. If value is stored, a storage flag is set. Display of the actual hint is controlled by OnShowHint
The place this control occupies in the list of tabs
Reads or writes information in flag; default is -1
Is the control in the sequence of controls accessed by successive presses of the Tab key?
Use the TabStop to allow or disallow access to the control using the Tab key.

If the TabStop is True, the control is in the tab order. If TabStop is False, the control is not in the tab order and the user can't press the Tab key to move to the control.
Visible - can the control be seen?

    The Visible property represents the ability to see a visual control.
              If Visible is True the control is shown, otherwise it is hidden.
              Calling Show sets, among others, Visible to True.
              Setting Visible to False is equivalent to calling Hide method.

The Visible property does not depend on control's parent visibility. Use IsVisible method to consider this and get real visibility.
TDBComboBox - a data-aware version of TComboBox to allow selection of a value from a list of entries into a database field

TDBComboBox has properties similar to TComboBox and TCustomComboBox. It consists of an Edit Box which is th eData-aware part of the component, and a drop-down list box.

In a typical application a user would be presented with the drop-down list, would make a selection and then this would appear in the edit box and become the data value for that cell in the database.

So for example a list of countries might be presented, and the selected value from the list would be used to populate the appropriate field ('Country') in that record of the database.

Create a new instance of the Window Control
Destroy this instance of the Window Control, and return the resources used
The field in the dataset to which this control is attached
Text - the string appearing in the main box. If an item on the drop-down list is selected, it replaces the contents of Text
Index - the number of the currently selected item (starting at zero)

Index

- the number of the currently selected item

The first item has number 0, the second has number 1, the third number 2, etc.

In case no item is selected, ItemIndex has value -1.

The set of anchor definitions for this control

// standard properties, which should be supported by all descendants

Determines how the control is to be anchored to its client or parent conrol

Either reads a flag containing the set of anchors to be used, or writes a set of anchors. If they have been written, this is indicated in IsAnchorsStored

ArrowKeysTraverseList - enables the operator to use the keyboard Arrow keys to move through the list as an alternative to using the mouse
AutoDropDown - if True, the drop-down list appears as soon as the cursor moves over the text box

AutoDropDown

- if True, the drop-down list appears as soon as the cursor moves over the text box

If False, the drop-down box only appears when the downward triangular indicator at the end of the box is selected

The name (as a string) of the Feild whose data are to be linked to the ComboBox
The DataSet whose Field data are to be linked to the ComboBox
DropDownCount - number of entries in the drop-down list
Whether the control is Enabled. If not, it usually appears 'greyed-out'

// standard properties, which should be supported by all descendants

Whether the control is Enabled. If not, it usually appears 'greyed-out'

Reads a flag to see whether the control is enabled, or stores a new value. If stored, sets a flag to say so.

The Font to be used for text in this control

// standard properties, which should be supported by all descendants

Reads a flag to see what font should be used, or sets a flag to store it. If stored, sets a flag to say so

The properties of Font are defined in the parent class TFont

ItemHeight - the height of the current item in the drop-down list
Items - an array of strings that holds the entries of the drop-down list
ItemWidth - the width of the current item in the drop-down list
MaxLength - the maximum allowed length of a string
OnChange - event handler for any change in properties of the combo box
Event Handler for mouse click

// standard properties, which should be supported by all descendants

This is often the default action for many controls, and is often the ONLY action specified by the programmer. The action can be spcified by the user, either by typing explicit code into the implementation section for this control, or by selecting an action from a pre-supplied ActionList

Reads or writes a flag if a mouse click is detected, and sets a flag if a value is stored.

OnCloseUp - event handler for when the drop-down box is closed up again
OnDrawItem - event handler for when an entry is written to the Items list
OnDropDown - event handler for when the drop-down list appears
OnEnter - event handler for when the mouse enters the control, and the control receives focus
OnExit - event handler for when the mouse leaves the control and it loses focus
OnKeyDown - event handler for instance when key is down while control has focus

OnKeyDown - event handler for instance when key is down while control has focus

Differs from OnKeyPress in that the key may have already been down when the control received focus; with OnKeyPress the key needs to become pressed while the control has focus.

OnKeyPress - event controller for a key being pressed while the control has focus

OnKeyPress - event controller for a key being pressed while the control has focus

Differs from OnKeyDown in that the key needs to become pressed while the control has focus; with OnKeyDown the key may have already been down when the control received focus.

OnKeyUp - event handler for instance when a key is up (not pressed) while the control has focus

OnKeyUp - event handler for instance when a key is up (not pressed) while the control has focus

The key may already have been up when the control received focus, or a pressed key may become released during the time the control has focus.

ParentFont - should the control use the same font as the parent? Default is true
ParentShowHint - does the control adopt the same hinting behaviour as its parent? Default is true
ReadOnly - if True, data can only be read, not written or modified
Flag to determine: Is hint to be displayed for this control?
// standard properties, which should be supported by all descendants
Reads flag or writes one to determine if a hint is to be shown when mouse hovers over this control. If value is stored, a storage flag is set. Display of the actual hint is controlled by OnShowHint
Sorted - whether the entries in the drop-down list have been sorted
Style: may be Simple, a single-line Drop-Down or a Drop-Down list, or some version drawn by the Owner
The place this control occupies in the list of tabs
Reads or writes information in flag; default is -1
TabStop - determines if the user can tab to a control.

Reads or writes boolean flag; default is False

Use the TabStop to allow or disallow access to the control using the Tab key.

If TabStop is True, the control is in the tab order. If TabStop is False, the control is not in the tab order and the user can't use the Tab key to move to the control.

Visible - can the control be seen?

    The Visible property represents the ability to see a visual control.
              If Visible is True the control is shown, otherwise it is hidden.
              Calling Show sets, among others, Visible to True.
              Setting Visible to False is equivalent to calling Hide method.

The Visible property does not depend on control's parent visibility. Use IsVisible method to consider this and get real visibility.
TDBMemo - a data-aware Memo box to process the multi-line text of a single field in a dataset
The field in the DataSet to which this control is to be linked. Can be referred to by name, or as an index
The name of the field, as a string (ie cannot be referred to as an Index)
The DataSource from which information is obtained to display in this control. Usually the result of a SQLQuery
TDBGroupBox - a data-aware version of TGroupBox, allowing a number of data-aware objects to be grouped together on a form
Called when the component has finished loading.

Loaded is called by the streaming system when a root component was completely read from a stream and all properties and references to other objects have been resolved by the streaming system. Descendents of TComponent should override this method to do some additional processing of properties after all published properties have been set from values obtained from the stream.

Application programmers should never call Loaded directly, this is done automatically by the streaming system.

Called by components that are freed and which received a FreeNotification.

Notification is called whenever a child component is destroyed, inserted or removed from the list of owned component. Components that were requested to send a notification when they are freed ((with FreeNotification) will also call Notification when they are freed.

The AComponent parameter specifies which component sends the notification, and Operation specifies whether the component is being inserted into or removed from the child component list, or whether it is being destroyed.

Descendents of TComponent can use FreeNotification to request notification of the destruction of another object. By overriding the Notification method, they can do special processing (typically, set a reference to this component to Nil) when this component is destroyed. The Notification method is called quite often in the streaming process, so speed should be a consideration when overriding this method.

Create a new instance of the Window Control
Destroy this instance of the Window Control, and return the resources used
The field in the DataSet to which this control is to be linked. Can be referred to by name, or as an index
Used to align the control in one of four directions.

// standard properties, which should be supported by all descendants

Either reads a flag containing alignment instructions (FAlign) or writes alignment instructions (SetAlign)

May have no alignment, may have custom or client alignment, or can be aligned to top, bottom, left or right

The set of anchor definitions for this control

// standard properties, which should be supported by all descendants

Determines how the control is to be anchored to its client or parent conrol

Either reads a flag containing the set of anchors to be used, or writes a set of anchors. If they have been written, this is indicated in IsAnchorsStored

Caption - the text-string appearing on the Control, usually used to identify its function

Gets caption as a text-string (GetText), or stores the new caption (SetText). Shows flag if caption is stored (IsCaptionStored).

By default, the Caption appears the same as the control Name in the Object Inspector, and the developer needs to set it explicitly to some new text.

The VCL implementation relies on the virtual Get/SetTextBuf to exchange text between widgets and VCL. This means a lot of (unnecesary) text copies.

The LCL uses strings for exchanging text (more efficient). To maintain VCL compatibility, the virtual RealGet/SetText is introduced. These functions interface with the LCLInterface.

The default Get/SetTextBuf implementation calls the RealGet/SetText. As long as the Get/SetTextBuf isn't overridden Get/SetText calls RealGet/SetText to avoid PChar copying.

To keep things optimal, LCL implementations should always override RealGet/SetText. Get/SetTextBuf is only kept for compatibility.

ClientHeight - determines the height of the client within which the control exists

// standard properties, which should be supported by all descendants

Finds or sets the client height, and sets a flag if it has been stored

ClientWidth - determines the width of the client within which the control exists

// standard properties, which should be supported by all descendants

ClientWidth - determines the width of the client within which the control exists; reads the width of the client control or sets the value. Sets flag if value is stored

Determine the colour for the current control

// standard properties, which should be supported by all descendants

Reads the value for colour, or stores the value, and sets a flag if the colour is stored.

The default colour is the same as the window in which the control is located.

Determine Constraints (max and min height and width) for this control

// standard properties, which should be supported by all descendants

Determine Constraints (max and min height and width) for this control; reads the size constraints or stores new ones.

The name of the field, as a string (ie cannot be referred to as an Index)
The DataSource from which information is obtained to display in this control. Usually the result of a SQLQuery
Whether the control is Enabled. If not, it usually appears 'greyed-out'

// standard properties, which should be supported by all descendants

Whether the control is Enabled. If not, it usually appears 'greyed-out'

Reads a flag to see whether the control is enabled, or stores a new value. If stored, sets a flag to say so.

The Font to be used for text in this control

// standard properties, which should be supported by all descendants

Reads a flag to see what font should be used, or sets a flag to store it. If stored, sets a flag to say so

The properties of Font are defined in the parent class TFont

Event Handler for mouse click

// standard properties, which should be supported by all descendants

This is often the default action for many controls, and is often the ONLY action specified by the programmer. The action can be spcified by the user, either by typing explicit code into the implementation section for this control, or by selecting an action from a pre-supplied ActionList

Reads or writes a flag if a mouse click is detected, and sets a flag if a value is stored.

Event Handle for mouse double-click

Double-clicking is much more common in a Windows environment than in Unix or Linux, where single-clicking is the default method for selecting an object. However, in all environments there could be valid use for a double-click, and a method should be supplied if appropriate.

OnEnter - event handler for when the mouse enters the control, and the control receives focus
OnExit - event handler for when the mouse leaves the control and it loses focus
OnKeyDown - event handler for instance when key is down while control has focus

OnKeyDown - event handler for instance when key is down while control has focus

Differs from OnKeyPress in that the key may have already been down when the control received focus; with OnKeyPress the key needs to become pressed while the control has focus.

OnKeyPress - event controller for a key being pressed while the control has focus

OnKeyPress - event controller for a key being pressed while the control has focus

Differs from OnKeyDown in that the key needs to become pressed while the control has focus; with OnKeyDown the key may have already been down when the control received focus.

OnKeyUp - event handler for instance when a key is up (not pressed) while the control has focus

OnKeyUp - event handler for instance when a key is up (not pressed) while the control has focus

The key may already have been up when the control received focus, or a pressed key may become released during the time the control has focus.

Event handler for when a mouse button is pressed down
Event handler for mouse movement within the current control
Event handler for when the mouse button is released, ie "up"
Event Handler for resize of control
// standard properties, which should be supported by all descendants
Reads or Writes flag if control is re-sized.
ParentColor - should the control have the same colour as the parent? Default is true
ParentFont - should the control use the same font as the parent? Default is true
ParentShowHint - does the control adopt the same hinting behaviour as its parent? Default is true
PopupMenu - a context-sensitive menu that pops up when the right mouse button is clicked over this control
// standard properties, which should be supported by all descendants
Reads the details of the pop-up menu, or stores them.
Properties are defined in the parent class TPopupMenu
Flag to determine: Is hint to be displayed for this control?
// standard properties, which should be supported by all descendants
Reads flag or writes one to determine if a hint is to be shown when mouse hovers over this control. If value is stored, a storage flag is set. Display of the actual hint is controlled by OnShowHint
The place this control occupies in the list of tabs
Reads or writes information in flag; default is -1
TabStop - determines if the user can tab to a control.

Reads or writes boolean flag; default is False

Use the TabStop to allow or disallow access to the control using the Tab key.

If TabStop is True, the control is in the tab order. If TabStop is False, the control is not in the tab order and the user can't use the Tab key to move to the control.

Visible - can the control be seen?

    The Visible property represents the ability to see a visual control.
              If Visible is True the control is shown, otherwise it is hidden.
              Calling Show sets, among others, Visible to True.
              Setting Visible to False is equivalent to calling Hide method.

The Visible property does not depend on control's parent visibility. Use IsVisible method to consider this and get real visibility.
TDBImage - a data-aware Image box to display a single image from a dataset
The Image is stored in the database as a Binary Large Object (BLOB)
The picture that is to be stored or displayed
True if image is proportional
TDBCalendar - a data-aware version of TCalendar, for selecting a date to put in a database field
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.
TDBCustomNavigator - the base class for TDBNavigator, a tool for navigating through the records of a dataset

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.

The list of Buttons included in the navigator tool
Create an instance of this control
Destroy the control and returns its resources
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
Finds the number of visible buttons
Should the user be asked for confirmation before a record is deleted? If True, a dialog appears asking for confirmation
The Data Source to which the control must be linked in order to function
The direction in which the buttons appear: horizontal or vertical
A list of hints to be shown if the mouse hovers over a button
The action to be taken when a navigator button is clicked
The set of visible buttons (some of them can be suppressed if their function appears redundant)

The VisibleButtons entry in the Object Inspector can be used to set whether or not a particular button is to be visible.

Determines whether button hints are to be shown
TDBNavButton
- one of the SpeedButtons on a TDBNavigator tool
Index
- the value from the enumerated type that specifies which button is being selected

Button may be

nbFirst, nbPrior, nbNext, nbLast, nbInsert, nbDelete, nbEdit, nbPost, nbCancel, nbRefresh

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

TDBNavigator is an advanced tool for navigating through datasets held locally in response to a query sent to the database.

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 programmer may determine, at design time, which buttons are to be displayed or suppressed by adjusting the VisibleButtons property in the Object Inspector.

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 TDBCustomNavigator.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.

HowToUseDataAwareControls - Hints for accessing databases

HowToUseDataAwareControls - Hints for accessing databases. A set of Data-Aware components is provided, to make it easier to access information held in databases.

Before using Data-Aware components, it is necessary to make a connection with a database, and this should be done either using a TSQLConnection or a TDBf component, depending on the type of database that is being used. In any case, the components for connection with the database need to be found in $Lazdir/components/sqldb/, $Lazdir/components/tdbf/ or whatever other source is appropriate. They need to be added using the Components Menu Item of the IDE, and compiled ready for adding. The IDE needs to be re-built to include the new components.

To make the connection with the database: first place a DataBase Connection on the Form (invisible at run-time, so put it anywhere convenient); set its properties to connect the user (with name and password) to the appropriate server, database and table (the connection component should deal with all the user-authentication issues, opening and closing the database etc). Then put on a TDataSource from the Data Access tab of the Component Palette, and perhaps items such as TSQLTransaction and TSQLQuery, depending on the particular database you are using. The various database components need to be linked to each other, for example by setting the Transaction property of a database connector to the appropriate transaction component, and linking the DataBase property of the Transaction component back to the database connector; link the DataSource's DataSet property to the appropriate SQLQuery or other set of data, and its Transaction property to the transaction component

Each Data-Aware control (on the Data Controls tab of the Component Palette) has the usual set of properties to determine its shape and size, position, colour and font etc. But there are also special properties to define the data to be displayed or modified. These include the DataSource property which must be set to link to the defined set of data, and often a Field component to determine which of the columns in the database is to be displayed.

Most of the components operate on a single Row or record of the database, but the TDBGrid is capable of displaying and operating on multiple rows and columns, in a StringGrid format, allowing the user to get an overview of what is in the database. The DBGrid will display the contents of the DataSet even at design time, provided the various components are enabled or rendered active; this allows the designer to ensure that all the connections to the database have been correctly made.

The TDBNavigator component is used in conjunction with the Data-Aware components. It consists of a series of buttons to allow browsing through the DataSet, displaying the first, previous, next or last record (or Row), inserting or deleting records, committing the changes back to the database or refreshing the DataSet from the database.

The way database programming works is typically as follows:

- a database is opened for access by the user (Database Connection)
- a command is issued (eg by TSQLQuery) to select or extract some or all of the records which are then stored locally in the DataSet
- the contents of the DataSet are acted on by the Data-Aware components, displaying one Row or record at a time from selected Columns, or perhaps the whole DataSet in a DBGrid, editing records, inserting or deleting records, or using the data to perform statistical tests or calculations
- at intervals usually prescribed by the user (sometimes after every change, sometimes after a whole series of changes), the contents of the local DataSet are sent back to the database, causing an update of the database's contents. This process is referred to as 'Commit' or 'Post' or sometimes as 'Update'

The programmer can determine which events are associated with a Commit action by supplying suitable event handlers for OnClick, OnChange, OnFinishedEdit etc.

The following table shows the approximate correspondence between conventional and data-aware control classes

| Standard Control | Data-Aware Control | Comment
TCalendar | TDBCalendar | Select a date from pop-up calendar
TCheckBox | TDBCheckBox | Check a box to show an option has been selected
TComboBox | TDBComboBox | Select an option from a list and return it (or some custom text) in the main edit box
TEdit | TDBEdit | Single-line text editing box
TGroupBox | TDBGroupBox | A container for several related controls
TImage | TDBImage | A Picture
TListBox | TDBListBox | A list of string items
TMemo | TDBMemo | Multiple-line text editing box
TRadioGroup | TDBRadioGroup | A group of mutually exclusive Radio Buttons; only one at a time may be checked and selected. Note there is no data-aware equivalent of the isolated TRadioButton
TText | TDBText | A simple text-string, usually read-only
TStringGrid | TdbGrid | A grid to display information in Rows and Columns

Standard Controls can, of course, be used to display information from a database, but they lack the direct link with the DataSet and its Navigation aids, so the programmer must write explicit code to extract data from the DataSet and put it in the Standard Control

Determines the border spacing for this control

// standard properties, which should be supported by all descendants

Determines the border spacing for this control

Reads flag to find stored spacing values required for the border of the control, or writes the flag to set the spacing.

The properties are defined in the parent class TControlBorderSpacing

DragCursor - the style of cursor to be used during the Drag process
DragMode - whether manual or automatic
Event handler for the Drag-Drop manoeuvre
Event handler for the case when a control is dragged over another control
Event handler for start of dragging process
Determines the border spacing for this control

// standard properties, which should be supported by all descendants

Determines the border spacing for this control

Reads flag to find stored spacing values required for the border of the control, or writes the flag to set the spacing.

The properties are defined in the parent class TControlBorderSpacing

DragCursor - the style of cursor to be used during the Drag process
DragMode - whether manual or automatic
Event handler for the Drag-Drop manoeuvre
Event handler for the case when a control is dragged over another control
Event handler for the end of a dragging process
Event handler for start of dragging process
Determines the border spacing for this control

// standard properties, which should be supported by all descendants

Determines the border spacing for this control

Reads flag to find stored spacing values required for the border of the control, or writes the flag to set the spacing.

The properties are defined in the parent class TControlBorderSpacing

DragCursor - the style of cursor to be used during the Drag process
DragMode - whether manual or automatic
Event handler for the Drag-Drop manoeuvre
Event handler for the case when a control is dragged over another control
Event handler for the end of a dragging process
Event handler for start of dragging process
Determines the border spacing for this control

// standard properties, which should be supported by all descendants

Determines the border spacing for this control

Reads flag to find stored spacing values required for the border of the control, or writes the flag to set the spacing.

The properties are defined in the parent class TControlBorderSpacing

Determine the colour for the current control

// standard properties, which should be supported by all descendants

Reads the value for colour, or stores the value, and sets a flag if the colour is stored.

The default colour is the same as the window in which the control is located.

ParentColor - should the control have the same colour as the parent? Default is true
Determines the border spacing for this control

// standard properties, which should be supported by all descendants

Determines the border spacing for this control

Reads flag to find stored spacing values required for the border of the control, or writes the flag to set the spacing.

The properties are defined in the parent class TControlBorderSpacing

Determine the colour for the current control

// standard properties, which should be supported by all descendants

Reads the value for colour, or stores the value, and sets a flag if the colour is stored.

The default colour is the same as the window in which the control is located.

DragCursor - the style of cursor to be used during the Drag process
DragMode - whether manual or automatic
Event handler for a change in bounds of the control

// standard properties, which should be supported by all descendants

Reads or Writes flag if bounds are changed

Event Handle for mouse double-click

Double-clicking is much more common in a Windows environment than in Unix or Linux, where single-clicking is the default method for selecting an object. However, in all environments there could be valid use for a double-click, and a method should be supplied if appropriate.

Event handler for the Drag-Drop manoeuvre
Event handler for the case when a control is dragged over another control
Event handler when editing is done
Event handler for the end of a dragging process
Event handler for when a mouse button is pressed down
Event handler for mouse movement within the current control
Event handler for when the mouse button is released, ie "up"
Event Handler for selection of an item in the ComboBox
Event handler for start of dragging process
ParentColor - should the control have the same colour as the parent? Default is true
Determines the border spacing for this control

// standard properties, which should be supported by all descendants

Determines the border spacing for this control

Reads flag to find stored spacing values required for the border of the control, or writes the flag to set the spacing.

The properties are defined in the parent class TControlBorderSpacing

DragCursor - the style of cursor to be used during the Drag process
DragMode - whether manual or automatic
Event handler for the Drag-Drop manoeuvre
Event handler for the case when a control is dragged over another control
Event handler for the end of a dragging process
Event handler for start of dragging process