
KSF Components Library

------------------------------------------------------------------------


Read more about KSF Components:

TDBTreeView
TDBListView
TDBImagelist
TDBBitCheckBox
TDBValueLookupCombo



------------------------------------------------------------------------

TDBTreeView Component

    TDBTreeView component is a data-bound control derived from the
TDBCustomTreeView. It is an explorer-style window control that can display
an hierarchical list of items, files or directories on a disk, objects in
database and so on.
    This component has features of a data set navigator, a data-field
editor and a lookup list at the same time, because it loads entries from a
data set and allows the user to change an entry name (in-place editing).
The control supports changing of an entry's parent by dragging the entry to
another entry. It also reflects external record changing and synchronizes
entry with the source record.
A data set to be used with this control has to match following conditions:

    The data set should have:

*A text field, which can be used as the entrys name source;
*A primary index (a set of fields, that uniquely identifies records);
*A parent-child one-to-many relation on itself;
*A parent index (a set of fields, that are involved in the parent-child
relation as a foreign key).
*Fields from the primary index (and hence in the parent index) should be
of an integer type.
*There should be a criteria that allows to distinct root entries (entries
those have no par-ents) those will be displayed at the topmost tree level.
*The data set may have: an integer field, that can be used as the image
index and an integer field, that can be used as the status index.

    The topmost tree level (root level) in the TDBCustomTreeView consists
of objects that have no parent, (for instance, items, containing NULL-value
in the parent index fields). The user may expand an entry by clicking the
'+' button, double-clicking the entry's name or pic-ture, or by selecting
an item and pressing '+' key. Expanding an entry causes the entry's child
loading, unless the children have already been loaded. Loaded entries
remain in the tree until entire tree is reloaded. To display a recently
loaded entry with a proper button, the control looks for its children and,
if there are any, loads them all, or just the first one, depending on
LoadStyle property.
    A TDBTreeView component uses one data source. The referred data set can
be a table data set only. This data set should match listed above
condition. The table should have an index property (IndexName, or
IndexFieldName) set according to the primary index fields, it should have
fields, required for using the DataSource as the master source for the same
data set.


TDBListView

    TDBListView component is a data-bound control, derived from
TDBCustomListView. It is an explorer-style window that display a list of
items with images. Each item has a label (so called entry name) and may
have one or two images (so called entry image and status im-age) and data
in some additional columns.
    This component has features of a data set navigator, a data field
editor and a lookup list at the same time, because it loads entries from a
data set and allows the user to change an entry name (in-place editing).
The control supports navigating over the data set by moving the data set's
cursor to the entry's source record. It also reflects external record
changing and synchronizes entry with the source record.

 A data set, to be used with this control, has to match following
conditions:
 The data set should have:

*A text field that can be used as the entry name source.
*Fields for the additional columns.
*A primary index (a set of fields, that uniquely identifies records).
*Fields from the primary index (and, so in the parent index) should be of
an integer type.
*The data set may have: an integer field, that can be used as the image
index and an integer field, that can be used as the status index.

    The component loads entries from the data set. It processes all
records, so this control is not appropriate for data sets with huge number
of records. Entries are loaded when the data set is being opened and are
removed when the data set is being closed.


TDBImageList

    The TCustomDBImageList is a regular component, descendant of
TImageList. It is intended to use a data source (TTable and TQuery) for
image loading.

The data set, to be used with this component should satisfy following
conditions:

*It should have a BLOB field, containing BMP images.
*It should have a primary index - an integer field (so called ID-field),
that contains positive numbers (or zero) and uniquely identifies records.

    Loading data from the table into the list storage is performed
corresponding to the follow-ing rules:

TCustomDBImageList loads image into the storage position, specified by the
its ID-field. In other words, ID-field defines a cell index in the list
where corresponding to that ID image is stored. The ID values are supposed
to be zero-based, continuous numbers. If there are some list items, that
didnt get any images from the table, TCustomDBImageL-ist fills them by
template images. A template image is a rectangle of the current window
worksheet color with the solid pattern.


TDBBitCheckBox

    TDBBitCheckBox is a data aware control that allows the user to select
or deselect a single logical value that represents content of one or
several bits in a data field. The control is useful if a developer wants a
field to hold more than one boolean value. In that case is stored in one
bit of the field. If a developer wants to control some bits of the field
simultaneously it is also possible by specifying a proper value for the
Mask property.
    Behavior of the control is the same as the standard DBCheckBox has: if
the fields data can be interpreted as true the box control is checked and
vise a versa. The check box is grayed if the field is empty. There is one
new feature implemented in the bit check box. If the control has multiple
bit data scheme and they are different the check box will be grayed.


TDBValueLookupCombo

    TDBValueLookupCombo is a descendant of TCustomComboBox.
TDBValueLookupCombo is a combo box that represents a set of field values by
its mnemonic readable names.
     Use TDBValueLookupCombo to allow the user to change the value of a
field on the current record in a dataset either by selecting an item from a
list or by typing in the edit box part of the control. An associated value
of the selected item or of entered text becomes the new value of the field
if the database combo boxs ReadOnly property is False. As TDBCombo-Box the
combo box can be customized to enable or disable typing in the edit region
of the control, to display the list as a drop down or as a permanently
displayed list, to sort the items in the list as well.

