About the TQDBView component

Purpose
TQDBView (like TQDBItem) builds upon TQDB by defining a field structure for QDB files.

Tasks
TQDBView defines a file structure visually within the Delphi IDE as you place controls (ordinary controls rather than data-aware ones) upon an associated panel. The contents of such controls are automatically stored and retrieved in a QDB file.

A TQDBView has an associated Panel. The contents of the panel's controls are stored in the QDB file. While FileName is blank or the assigned file is empty you can place controls upon the panel to define the file structure. Controls can be nested within other controls and all their data will be stored automatically. If you wish to exclude a particular control (or set of controls) you should set its Tag property to match the TQDBView's ExcludeTag property. If you just intend to view data already in the file that's all you have to do but if you intend to add more items you must also provide a handler for the OnKey event to supply a key by which to index each item.

You can navigate around a QDB file using TQDBNavigator or by calling the FirstItem, PrevItem, NextItem, LastItem, Refresh, Edit, Insert, and Post methods. The methods of the underlying TQDBItem and TQDB classes are also available.

Use ActiveColor and InactiveColor to select the way to display data which is being edited or just viewed respectively.

As supplied TQDBView knows how to handle controls descended from TCustomEdit, TRichEdit, TCustomRadioGroup, TCustomCheckBox, TCustomComboBox, TCustomListBox, and TImage. Edit controls (including memos) store the text they contain. Rich edit boxes store their formatted contents (just as SaveToFile would generate). Radio groups store the index of the selected item; check boxes their state; and combo boxes the selected text. List boxes store only the indices of selected items rather than the list itself. Finally image controls store the image data (internally prefixed with a code to identify the image format).

If you need to provide different behaviors for a kind of control, add an entirely new control type, or specialize within a class (as TRichEdit does within TCustomEdit) you can easily do so with RegisterControl. If you add a graphic format to TImage you must also register that format with TQDBView through RegisterGraphicFormat.