Copyright: Copyright ® 1995-1996 Steve Flynn
Citation: Copyright ® 1995-1996 Steve Flynn


Component Overview
DBFilterCombo Component Overview

Properties	Events	Tasks

Unit

DBFltCom

Description

DBFilterCombo is a Data Aware Lookup ComboBox control for Borland's Delphi. It looks and works just like the standard Delphi DBLookupCombo with a couple of notable exceptions;

DBFilterCombo will not only create a lookup list from a second database it allows the items in the lookup list to be Filtered by a third and independent LookupFilterField. The LookupFilterField has both Minimum and Maximum values which may be Inclusive or Exclusive. The LookupFilterField does NOT have to be a key.

DBFilterCombo can be set to add records to the Lookup Datasource if the user enters a value that is not already contained in the lookup list. DBFilterCombo alerts you to this operation and allows you to programatically accept or cancel the record addition on a record by record basis.

DBFilterCombo suppoert Incremental List Searching with or without Case Sensitivity to allow the user to enter the first letters of an item in the list and have the rest of the field filled in automatically.

DBFilterCombo has intelligent Drop Down List placement when the drop down list is near to a screen edge.

DBFilterCombo is really great for those little Helper Tables that all Databases need. You know the ones that store things like Titles (Mrs, Mrs, Colonel etc) or Shipping Method (Air, Sea, Courier etc etc). In fact you can now store all of these little helpers in a single table and use DBFilterCombo to provide Dropdown lists Filtered by category (eg, Titles, Shipping Method, Religion etc). I am sure that you will find it equally as useful.


DBFilterCombo
DBFilterCombo for Delphi

DBFilterCombo Copyright © 1995-1996 Steve Flynn

Component Overview

New Features in Version 2

Installation

Finding the DBFilterCombo Software Version

Shareware Limitations

Sample Program

Ordering the Registered Version of DBFilterCombo

Software License Agreement

Other products by Steve Flynn

Getting Technical support

Delphi is a trademerk of Borland.

Windows and Windows 95 are trademarks of Microsoft.

Norton Utilities is a trademark of Symantec.


DBLookupText
DBLookupText Component

DBLookupText Component

The idea behind DBLookupText is simple.

Its a Label control that sources its text from a Database Field. The contents of this field is not actually displayed, but is used as a Lookup reference for a second Database. The result of the Lookup operation is used as the Text that is displayed in the Label.

DBLookupText is very useful for Display Only data. This data may have been entered into a Database using one of the Lookup components like DBLookupCombo of DBFilterCombo etc.

DBLookupText is free of charge to all registered DBFilterCombo users.


DBZipMemo
DBZipMemo Component

DBZipMemo Component

DBZipMemo is two components in one. In its inactive state it looks and works just like an ordinary DBMemo control. When you double click on the DBMemo control a window pops up complete with a larger Memo control to allow easier editing and viewing of the Memo details. The window is complete with Caption and Hint lines taken from the original DBMemo's Hint property. The window also has OK and Cancel buttons to allow you to accept or reject changes. When one of the buttons is pressed the window disappears and the focus returns to the original DBMemo control (or optionally to the next control in the Tab order). If the changes were accepted then the windows contents are copied to the original DBMemo control otherwise they are discarded.

DBZipMemo is free of charge to all registered DBFilterCombo users.


DataField Property

Applies to

TDBFilterCombo

Declaration

property DataField: string;

Description

The DataField property identifies the field in the DataSource which DBFilterCombo uses as its Lookup reference data.


DataSorcerer for Delphi

DataSorcerer for Delphi

DataSorcerer gives Delphi Database Programmers the much sought after feature of a Global Datasource: The main features of DataSorcerer are:

A single DataSorcerer and its Dataset can be accessed Globally from all form within an application.

Links between DataSorcerers on different Forms can be created at Design Time.

All data linkages are present at Design time to allow testing before compilation.

There is No Code required on any Form to make the the data available.

There is No Code required on any Form to keep the data synchronized.

All Data Aware controls on all forms are automatically kept synchronized.

Direct access is available to the underlying DataSet, no matter what type it is.

Abbreviated program syntax to access database fields.

All public TDataSource methods and properties are directly accessible.

All public TDataSet methods and properties are directly accessible.

All public TDBDataSet methods and properties are directly accessible.

All public TTable methods and properties are directly accessible.

All public TQuery methods and properties are directly accessible.

All public TStoredProc methods and properties are directly accessible.

The TTable Fields Editor is available from any linked DataSorcerer.

The TQuery/TStoredProc Params Editor is available from any linked DataSorcerer.

The Master Fields Designer is available from any linked DataSorcerer.

Full support for InfoPower Data Access components

The InfoPower Property Editors are available from any linked DataSorcerer.

Exception trapping of Database errors

Support for both Delphi V1.x 16bit and Delphi V2.x 32bit platforms

Availability of Source Code

Delphi Online Help compatible Help File

You can download a copy of the shareware version of DataSorcerer from the Compuserve Delphi DataBase Library. Look for the DATSORC2.EXE file.

We are certain that you will find DataSorcerer the next most valuable tool to Delphi itself.


DataSource Property

Applies to

TDBFilterCombo

Declaration

property DataSource: TDataSource;

Description

The DataSource property determines where the component obtains the data to be used as the Lookup reference field.


Directory Sorter for Windows 95

Directory Sorter for Windows 95

Do you use the DOS prompt in Windows 95 ?

Are you annoyed when you archive, copy or backup files and they are not processed in Alphabetic order ?

Are you annoyed that the latest version of Norton Utilities for Windows 95 does not include a DirSort ?

Then get Directory Sorter!

Directory Sorter will physically store all the files and directories on your drives in Alphabetic order. This

means that whenever you do a dir, copy, xcopy, backup or archive operation etc, all the files and directories will be processed in Alphabetic order.

The shareware version of Directory Sorter is available in the WINUTILITY and MSWIN95 forums on

Compuserve. If you like the shareware version then registration is also available on-line on Compuserve.

Grab a copy and try it out.

STOP PRESS: Directory Sorter V2.0 with tons of new features is due out in May 96. Look for it in the Compuserve WINUTILITY and MSWIN95 forums, filename DIRSORT2.EXE.


DropDownCount Property

Applies to

TDBFilterCombo

Declaration

property DropDownCount: integer;

Default Value

8

Description

The DropDownCount specifies how many lines of items will be dislpayed in the DBFilterCombo drop down Listbox.


DropDownItemHeight Property

Applies to

TDBFilterCombo

Declaration

property DropDownItemHeight: integer;

Default Value

16

Description

The DropDownItemHeight property specifies the height of each item line in the DBFilterCombo dropdown Listbox. It effectively sets the size of the Font used for the drop down list items.


DropDownWidth Property

Applies to

TDBFilterCombo

Declaration

property DropDownWidth: integer;

Default Value

0

Description

The DropDownWidth property sets the width of the drop down Listbox. Using the default value of 0 will allow DBFilterCombo to size the drop down list to suit the size and style of the edit box part of the comtrol.


Events
DBFilterCombo Events

See Also

OnAfterLookup OnBeforeLookup	OnListClick	OnNewLookupRecord


IncrementalSearch Property

Applies to

TDBFilterCombo

Declaration

property IncrementalSearch: boolean;

Default Value

False

Description

Setting IncrementalSearch to True will cause DBFilterCombo to search the items in the drop down list each time a character is entered in the edit box part of the control. If DBFilterCombo finds a string in the list that matches the characters entered so far, up to the number of characters entered, it will complete the edit box entry to match the item from the list. Characters added automatically in this way are left selected during entry to allow them to be overtyped by the user should the retrieved string not be the one desired.

The searching of the list can be made Case Sensitive or Case Insensitive using the IncrementalUseCase property.

Note:

This property is only effective for DBFilterCombos with the Style property set to csDropDown.


IncrementalUseCase Property

Applies to

TDBFilterCombo

Declaration

property IncrementalUseCase: boolean;

Default Value

False

Description

By setting the IncrementalUseCase property to True, DBFilterCombo can be forced to match the characters entered exactly during Incremental Searching. If this property is set to False then the character case is ignored during Incremental Searches.


Installation
DBFilterCombo Installation

DBFilterCombo Installation

Now that there are two versions of Delphi in concurrent use by many programmers to support both Windows 3.x and Windows 95, it is not possible to specify exact directory locations for any of Delphi's sub-directories. The Delphi Installation program allows you to install Delphi into a directory of your own choice. The installation instructions below refer to your "Delphi Library" directory. This library directory will be a sub-directory of your chosen Delphi installation directory and is named LIB. For example, if you installed Delphi V1.0 in the C:\DELPHI10 directory, the library directory is C:\DELPHI10\LIB and if you installed Delphi V2.0 in the C:\DELPHI20 directory the library directory is C:\DELPHI20\LIB. The Delphi BIN and HELP directories can be located in the same way.

If you have installed both Delphi V1.0 and Delphi V2.0 then you will need to install DBFilterCombo in the library sub-directories of BOTH Delphi directories. You will need to follow the instructions for installation for both versions of Delphi.

The method for adding and/or removing components from your Delphi Component Library is different for each version of Delphi. Please refer to your manuals or Delphi Help files for precise instructions on adding and/or removing components from the Delphi Component Library.

As always, before installing or removing a component from the Component Library, it is prudent to make a backup copy of the Component Library file, just in case something goes wrong and you need to revert to the old version.

Upgrading

Version 1.x of DBFilterCombo was supplied as a single DCU file named DBFLTCOM.DCU. Version 2.0 is supplied as two DCU files, DBFLTCOM.DCU and DBFLPROP.DCU. The latter of these files now holds the Property Editors for DBFilterCombo. The Property Editors have been seperated to reduce the size of compiled programs, since Property Editors are not required for Executable files.

If you are upgrading from V1.x then you will NOT already have a DBFLPROP.DCU file installed on your system.

Installing the Source Code Version of DBFilterCombo

To install the Source Code Version of DataSorcerer follow these steps:

1.	If you previously installed a Shareware or Component only version of DBFilterCombo then you will first need to Delete the DBFLTCOM.DCU and DBFLPROP.DCU files from your Delphi Library directory.

2.	Copy the Source Code distribution program file DFSOURCE.EXE to a temporary directory and run this program from the Windows File Manager / Program Manager / Explorer or Windows 95 DOS prompt. This will Un-Zip the distribution files.

3.	Copy the DBFLTCOM.PAS and  DBFLPROP.PAS files to your Delphi Library directory.

4a.	If you are using Delphi V1.0.

Copy the DBFLTCOM.16 file to the Delphi Library directory and rename it to DBFLTCOM.DCR.

4b.	If you are using Delphi V2.0.

Copy the DBFLTCOM.32 file to the Delphi Library directory and rename it to DBFLTCOM.DCR.

5.	If you previously installed V1.x, the Shareware or Component Only version of DBFilterCombo, remove any existing DBFLTCOM and DBFLPROP references from your Delphi Components Library.

6.	Add BOTH the DBFLTCOM.PAS and DBFLPROP.PAS files to your Delphi Component Library in that order.

7.	When the Library is Rebuilt the DBFilterCombo Icon will appear in the Data Controls Tool Palette.

Note:

If the DBFilterCombo icon was previously displayed in a different Tool Palette, it will remain there. Delphi will not move a preexisting icon in the Tool Palettes when the library is rebuilt. See the Delphi documentation or Help files for instructions on moving the Palette icons.

Installing the Shareware & Component Only Version of DBFilterCombo

To install DBFilter Shareware or Component Only versions follow these steps:

1.	Copy the distribution EXE file to a temporary directory and run the EXE program from the Windows File Manager/Program Manager/Explorer. This will Un-Zip the distribution files.

2a.	If you are using Delphi V1.0.

Unzip the 16BIT.ZIP file.

2b.	If you are using Delphi V2.0.

Unzip the 32BIT.ZIP file.

3.	Now copy the DBFLTCOM.DCU, DBFLPROP.DCU and DBFLTCOM.DCR files to your Delphi Library directory.

4.	Add BOTH the DBFLTCOM.DCU and DBFLPROP.DCU files to your Delphi Component Library.

5.	When the Library is Rebuilt the DataSorcerer Icon will appear in the Data Controls Tool Palette.

Adding the DBFilterCombo Help file to Delphi's Online Help

To add the DBFilterCombo Help file to the Delphi Online Help system follow these steps:

1a.	If you are using Delphi V1.0.

Copy the DBFLTCOM.HLP file to the Delphi BIN directory and copy the DBFLTCOM.KWF file to the Delphi HELP directory.

1b.	If you are using Delphi V2.0.

Copy both the DBFLTCOM.HLP and DBFLTCOM.KWF files to the Delphi HELP directory.

2.	Now add the DBFLTCOM.KWF file to the Delphi Online Help keyword list using the Help Installer program supplied with Delphi. Please refer to the Delphi documentation or Online Help for precise instructions on adding keyword files to the keyword index.

Note:

The first time that you use DBFilterCombo's Help file within Delphi, you may need to tell the system where to find the Help file. Just use the path where you have installed it above. You should only have to do this once.

Installing the Sample Program

To install the sample program files follow these steps:

1.	Unzip the SAMPLE.ZIP file supplied as part of the distribution archive into a directory of your own choice.

2.	Load Delphi and open the the FISHFACT.DPR project file.

Installing the Sample Database

To install the sample database files follow these steps:

1.	Unzip the DATABASE.ZIP file supplied as part of the distribution archive.

2.	Copy all the files you have just unzipped to the directory defined as your DBDEMOS directory.

Installing the Free DBLookupText and DBZipMemo Components

1a.	If you are installing the Source Code version then copy the DBZIPMEM.PAS, DBZIPMEM.DCR, DBZIPMEM.DFM, DBLUTEXT.PAS and DBLUTEXT.DCR files the appropriate Delphi LIB directory.

1b.	If you are installing the Component Only version then copy the DBZIPMEM.DCU, DBZIPMEM.DCR, DBZIPMEM.DFM, DBLUTEXT.DCU and DBLUTEXT.DCR to the appropriate Delphi LIB directory.

2a.	If you are installing the Source Code version then add both the *.PAS files just copied to your Delphi Component Library.

2b.	If you are installing the Component Only version then add both the *.DCU files just copied to your Delphi Component Library.

3.	The new components will appear in the Data Controls tool palette.


LookupDisplay Property

Applies to

TDBFilterCombo

Declaration

property LookupDisplay : string;

Description

The LookupDisplay property determines which field in the lookup table is displayed in the edit box part of DBFilterCombo.


LookupField Property

Applies to

TDBFilterCombo

Declaration

property LookupField: string;

Description

The LookupField property links the DataSource and LookupSource datasets. Although the name of the field specified as the LookupField does not have to be the same as the name of the field specified as the DataField, the two fields must contain the same values. For example, the LookupField value can be CustomerNumber and the DataField value can be CustNo, as along as both fields use the same number to identify a particular customer. When you specify a LookupField, the current value of that field appears in the control, if the Active property of both datasets is True.

After you specify a LookupField field, you can choose which field you prefer to display in the control with the LookupDisplay property.


LookupFilterExclusive Property

Applies to

TDBFilterCombo

Declaration

property LookupFilterExclusive: boolean;

Default Value

False

Description

If TRUE, the LookupFilterMax and LookupFilterMin values are excluded as valid values for items in the lookup list. Only values BETWEEN the Max and Min values will appear in the list. If FALSE, the LookupFilterMax and LookupFilterMin values are included in the lookup list. Values BETWEEN and INCLUDING the Max and Min values will appear in the list.


LookupFilterField Property

Applies to

TDBFilterCombo

Declaration

property LookupFilterField: string;

Description

This is the field name from the lookup datasource that you want to use as the filter field. Records are only added to the drop down list if they fit within the Maximum  and Minimum filter limits.


LookupFilterMax Property

Applies to

TDBFilterCombo

Declaration

property LookupFilterMax: string;

Description

The maximum value allowed in the LookupFilterField for record inclusion in the lookup list. This may be a numeric string if required in which case the LookupFilterRelaxed property should be set to False.


LookupFilterMin Property

Applies to

TDBFilterCombo

Declaration

property LookupFilterMin: string;

Description

The minimum value allowed in the LookupFilterField for record inclusion in the lookup list. This may be a numeric string if required in which case the LookupFilterRelaxed property should be set to False.


LookupFilterRelaxed Property

Applies to

TDBFilterCombo

Declaration

property LookupFilterRelaxed: boolean;

Default Value

False

Description

If True this property sets the Lookup filtering to Relaxed mode. In this mode the filter function only compares the LookupFilterMin LookupFilterMax and the LookupFilterField value up to the length of the shortest string.

If set False then stricter filtering is used whereby the lengths of the strings are also checked.

In practise you should set this property to False (default state) when comparing Numeric values or when the filter and the field must have exactly the same number of characters. For example if LookupFilterMin := 10 and LookupFilterMax := 20 then if this property is False only fields with values between 10 and 20 will be let through the filter, if this property is True then numbers like 110, 1100, 121, 15121723874 would all be let through the filter since their first two letters (digits) fit the filter up to the length of the filter.

Setting this property to True is useful for example if you set the LookupFilterMin := A and the LookupFilterMax := Z, then all records with LookupFilterFields having the first letter in the range A..Z will be added to the list.


LookupSource Property

Applies to

TDBFilterCombo

Declaration

property LookupSource: TDataSource;

Description

The LookupSource is the data source component that identifies the dataset you want the control to use to "look up" the information you want displayed in the control.


MegaPanel for Delphi

MegaPanel for Delphi

MegaPanel is a Delphi control that provides all the functionality of the standard Delphi TPanel control plus:

 Supports both Delphi 1.x and Delphi 2.x

 Automatically generated Panel Labels.

 Automatic Quicken Style Labels.

 Multi-line Labels and Captions

 Rotation of Labels and Captions

 16 different Label positioning options

 12 different Caption positioning options

 Selectable Label background colors

 Selectable Caption background colors

 Each label may be assigned a separate foreground or background color

 Transparent Labels and Panels

 3 different Captioning styles

 Many options to control the Caption location

 Background bitmaps for Panel or Caption or Both

 14 different Bitmap positioning options including Stretch and Tile

 7 different Bitmap location options

 Transparent Bitmaps.

 Automatic Panel Dividers

 Automatic Child Control Centering and Resizing

 Automatic Child Control Font Resizing

 Automatic Caption Resizing and Label Resizing

 Gradient Fills in many different styles for Panel or Caption or Both

 Automatic Keyboard Fixup to allow the Enter or Arrow keys to work like the Tab key

 Automatic Hot Key Label generation from label text

 Automatic Hot Key Focusing

 Label color effects for Focused control

 Label 3D effects for Focused control

 Use Any Form as a Panel. This allows you to modularize your code

 And Lots More...

MegaPanel can create some truly spectacular results. Download a copy of the shareware version from the Compuserve Delphi Forum and try it for yourself (Filename MEGAPANL.EXE). I know you will be impressed.

Source code is available as a separate registration from Version 2.0 onwards.


New Features
DBFilterCombo New Features in V2.0

New Features of DBFIlterCombo  V2.0

Version 2.0 of DBFilterCombo has some inportant new features. These include:

Incremental Search of csDropDown style DBFilterCombos

Incremental Search Case Sensitivity

Intelligent positioning of Drop Down List

Delphi 1.x and Delphi 2.x compatible

All features available in Delphi 1.x

Delphi compatible Online Help file

Source Code availability


OnAfterLookup Event

Applies to

TDBFilterCombo

Declaration

property OnAfterLookup: TNotifyEvent

Description

This event can call a standard TNotify type event procedure, for example;

procedure AfterLookup(Sender: TObject);

The event procedure is called after the Dropdown ListBox has been filled.


OnBeforeLookup Event

Applies to

TDBFilterCombo

Declaration

property OnBeforeLookup: TNotifyEvent;

Description

This event can call a standard TNotify type event procedure, for example;

procedure BeforeLookup(Sender: TObject);

The event procedure is called after the Dropdown ListBox has been created but before it has been filled.


OnListClick Event

Applies to

TDBFilterCombo

Declaration

property OnListClick: TOnListClick;

Description

This event can calls a TOnListClick procedure whenever a selection is made from the drop down list. The procedure is passed the Index of the item that was selected in the list.


OnNewLookupRecord Event
OnNewLookupRecord Ebent

Applies to

TDBFilterCombo

Declaration

property OnNewLookupRecord: TNewLookupRecord;

Description

The event procedure is called when a new record is about to be added to the LookupSource. When the event procedure is called the LookupSource's new record fields are already filled in and ready for saving to the LookupSource. The value of the LookupDisplay field is set to the value entered by the user and the LookupFilterField is set to the value of LookupFilterMin. You will need to change the LookupFilterField value if required and set the value of the LookupField before returning from this event procedure (unless the LookupField is a Paradox Autoincrement field like I normally use). The boolean value Cancelled can be set to TRUE to prevent a new record being added to the LookupSource. Cancelled can be set to FALSE to allow a new record to be added to the LookupSource using the field values as described above. If no NewLookupRecord event procedure is defined and the DBFilterCombo Style is set to csDropDown then new records will be automatically added to the Lookup Datasource.


Ordering the Registered Version
Ordering the Registered Version of DBFilterCombo

Registration Benefits

Registered users of DBFilterCombo are free to use it in their own Delphi programs without payment of additional license fees or royalties in accordance with the terms of the DBFilterCombo Software License Agreement.

Registered users also receive two free Data Aware components, DBLookupText and DBZipMemo. Users who register the Source Code version of DBFilterCombo will also receive the Source Code for these two free components.

Registered users are entitled to bug fixes and minor version upgrades at no additional cost. All bug fixes and upgrades will be distributed via Compuserve.

By using the DBFilterCombo software you are agreeing to be bound by the terms of the DBFIlterCombo Software License Agreement.

Registering Online via Compuserve

You may order any of the registered version of DBFilterCombo via Compuserve's SWREG facility.  On Compuserve use the Services menu, GO command then enter SWREG as the service name and follow Compuserve's instructions. There are no shipping charges when you order via Compuserve.

Registering via Internet

We expect that on-line registration via Internet should be available during April/May 1996. The actual date is out of our control and up to the registration service provider. Announcements of this service should be made by the provider on Compuserve, Internet and other on-line services when the registration service comes on line. There is a $3 additional shipping charge to cover mailing of diskettes when you register via Internet. Unfortunately we have found that E-Mail delivery of Binary files via Internet is troublesome at best and we are therefore not providing E-Mail delivery via Internet at this time (until we can do it reliably to all our customers).

There are four ways to Register DBFilterCombo

1. Component Only Version

This version of DBFilterCombo IS NOT supplied with Source Code and includes the free DBLookupText and DBZipMemo components.

The Compuserve SWREG Registration ID Number for the Component Only Version of DBFilterCombo is 10921, the price of this version is $14.95 and includes delivery by Compuserve E-Mail. There is an additional $3 shipping charge when registering via Internet.

2. Source Code Version

This version of DBFilterCombo IS supplied in Source Code form and provides all the same features as the Component Only version. Source code for the free DBLookupText and DBZipMemo components is also included. Because this version is supplied as source code you get both the security of having access to the source and the ability to recompile or adapt the source code for different versions of Delphi or other third party products. Any changes you make to the source are still subject to the DBFilterCombo Software License Agreement.

The Compuserve SWREG Registration ID number for the Source Code Version of DBFilterCombo is 10922, the price of this version is $49.95 and includes delivery by Compuserve E-Mail.  There is an additional $3 shipping charge when registering via Internet.

3. Component Only Upgrade Version

This version of DBFilterCombo IS NOT supplied with Source Code and includes the free DBLookupText and DBZipMemo components. It provides registered users of V1.x of DBFilterCombo an upgrade to the Component only version of DBFilterCombo V2.0 at a reduced price of $10.

The Compuserve SWREG Registration ID number for the Component Only Upgrade Version of DBFilterCombo is 10923, the price of this version is $10 and includes delivery by Compuserve E-Mail.  There is an additional $3 shipping charge when registering via Internet.

4. Source Code Upgrade Version

This version of DBFilterCombo IS supplied in Source Code form. It provides registered users of V1.x of DBFilterCombo with an upgrade to the Source Code version of DBFilterCombo V2.0 including the Source Code for the free DBLookupText and DBZipMemo controls at a reduced price.

The Compuserve SWREG Registration ID number for the Source Code Upgrade Version of DBFilterCombo is 11120, the price of this version is $39.95 and includes delivery by Compuserve E-Mail.  There is an additional $3 shipping charge when registering via Internet.

Credit Card Orders

At the time of writing we are not providing direct purchase via credit card. This may change should demand for this service increase.


Other products by Steve Flynn

Other products by Steve Flynn

MegaPanel for Delphi

DataSorcerer for Delphi

Directory Sorter for Windows 95


Properties
DBFilterCombo Properties

See Also

  Key Properties

DropDownItemHeight DropDownWidth DropDownCount DataSource DataField IncrementalSearch IncrementalUseCase	LookupSource LookupDisplay LookupField LookupFilterField LookupFilterMin LookupFilterMax LookupFilterExclusive LookupFilterRelaxed	Style


Sample Program
The DBFilterCombo Sample Program

The DBFilterCombo Sample Program

The distribution archive includes a sample program based on the standard Delphi FISHFACT demo project. To install the sample files see the Installation section of this Help file. The Database files provided with the sample are modified versions of those supplied with Delphi. The HELPER database files contain the "Helpers" that are used in the sample to demonstrate DBFilterCombo.

You are free (within the terms of Borlands license agreement) to use the sample program and database files or portions thereof in any of your applications.

Note

1.	The creation order of the "Helper" table is important. It must be created before the main table that uses it as a Lookup table. This is set from the Delphi menu using the Edit|Creation Order... command. The sample program is already setup this way.

2.	The shareware version of DBFilterCombo will only work while Delphi is running. This restriction is removed in the registered version.

3.	Each of the DBFilterCombos in the sample program is set up slightly different. They all have a different DropDownCount and DropDownItemHeight, simply to draw attention to the fact that this is possible.


See Also
DBFilterCombo Component

Using DBFilterCombo


Shareware Limitations

Shareware Limitations

The Shareware version of DBFilterCombo is fully functional except that it will only operate while Delphi is running. There are no other limitations.

The registered version of DBFilterCombo has this limitation removed and includes two free Data Aware components, DBLookupText and DBZipMemo.


Software License Agreement
DBFilterCombo Software License Agreement

DBFilterCombo Software License Agreement

Use of the Software

Steven M. Flynn (the "Author") grants you, the end user, a non-exclusive single-user license to use the supplied software program and all associated materials including Source Code where supplied (the "Software").  The Software and all Intellectual Property embodied in the Software always remains the property of the Author.  Your use of the Software indicates your acceptance in full of the terms and conditions of this agreement.

Copying the Software

You may make copies of the Software for backup or archival purposes only.  You may use the Software on one or more computers provided there is no possibility of it being used concurrently by more than one person.  A separate license is required for each concurrent user of the Software.

Distribution of the Shareware Version of the Software

The Shareware version of the Software, which is limited in functionality and does not include Source Code, may be distributed royalty free in any form providing that no charge is made for the Software itself. Only a nominal fee for media and/or copying services is allowed. All files that are supplied with the Shareware version that you have received must also be included.

Distribution of the Registered Version of the Software

The Licensed or Registered version of the Software may not be distributed in any form without prior written consent from the Author.  You are granted permission to include the Software in your own original works in its Compiled Form Only.  Specifically this means that you may not distribute the Source Code Files or the Delphi Library Files (DCU or OBJ files) without paying additional License Fees to the Author.  No further License Fee or Royalty is required for including the Software in your own original works in its Compiled form.

Derived Works

You may NOT use the Software to derive any works which are based in part or in full on the Software or portion of the Software..

Modified Versions of the Software

All updated, revised, modified or improved versions of the Software are also subject to the conditions of this license agreement and shall remain the property of the Author.

Termination of this Agreement

You may terminate this License Agreement at any time by destroying the Software along with all copies in any form.

Limited Warranty

The Software is distributed and licensed "AS IS".  The Author specifically disclaims all other warranties, express or implied, including but not limited to, implied warranties of merchantability and fitness for a particular purpose, with regard to the Software.

Damages

By using the Software you do so at your own risk. In no event shall the Author be responsible for any damages whatsoever (including but not limited to, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss or any other real or consequential damages) arising out of the use or inability to use this product.

Liability

In the event of failure of the Software for any reason, the Author's sole liability shall be to refund the purchase price of the Software or to provide a corrected version of the Software, at the option of the Author.

Copyright

The Software and the Intellectual Property embodied in the Software shall always remain the property of the Author and is protected by Australian Copyright Law and International Treaty Provisions.

Agreement

Your use of the Software indicates your agreement with the above terms and conditions. If you do not agree with these terms and conditions then you should destroy all copies of the software and return the original copy of the software (where it has been supplied on diskette) within 14 days for a refund.

Consumer Rights

If any clause in the above Software License Agreement is in violation of your consumer rights under your local laws then that clause will be deemed to be excluded in your specific case without effect on the remainder of the agreement.


Software Version
Finding the DBFilterCombo Software Version

Finding the DBFilterCombo Software Version

To find out the version number of your DBFilterCombo software just:

1.	In Design mode select any DBFilterCombo component by Left Clicking on it.

2.	Now Right Click on the same DBFilterCombo. This brings up the Component Editor Menu.

3.	Choose About DBFilterCombo from the popup menu.


Style Property

Applies to

TDBFilterCombo

Declaration

property Style: TDBFilterComboStyle;

Default Value

csDropDown

Description

This detemines the style of the DBFilterCombo control. The Style value is a subset of the standard ComboBox styles.

The csDropDown style creates a DBFilterCombo which has an editable Edit control while csDropDownList creates a Read-Only style DBFilterCombo where the Edit control can not be changed an the only entries which are valid are those from the drop down list.

Note:

Since the csDropDownList style does not allow editing of the selected value, the OnNewLookupRecord event is never generated for this style of DBFilterCombo.

Also, Incremental Search is not available for a csDropDownList style DBFilterCombo, since the user can not type into the edit control when this style is set.


TDBFilterComboStyle
TDBFilterComboStyle Declaration

Applies to

TDBFilterCombo

Declaration

TDBFilterComboStyle = (csDropDown, csDropDownList);

Description

This is the enumerated property declaration for the Style property.


TNewLookupRecord
TNewLookupRecord Declaration

Applies to

TDBFilterCombo

Declaration

TNewLookUpRecord = procedure(Sender: TObject; var Cancelled: boolean) of object;

Description

This is the event procedure declaration for the OnNewLookupRecord event.


TNotifyEvent
TNotifyEvent Declaration

Unit

Classes

Declaration

TNotifyEvent = procedure (Sender: TObject) of object;

Description

The TNotifyEvent type is the type for events that have no parameters. These events simply notify the component that a specific event occurred. For example, OnClick, which is type TNotifyEvent, notifies the control that a click event occurred on the control.


TOnListClick
TOnListClick Declaration

Applies to

TDBFilterCombo

Declaration

TOnListClick = procedure (Combo: TDBFilterCombo; ListBox: TListBox; Index: integer) of Object;

Description

This is the event procedure declaration for the OnListClick event. The Combo variable is the DBFilterCombo control that generated the event. ListBox is the TListBox control that makes up the drop down list and Index is the index into the ListBox's Item array of the selected item in the list.

Note:

The ListBox variable is not valid once the DBFilterCombo looses the input focus.


Technical support
DBFilterCombo Technical support

Technical Support

We are always interested in your suggestions for improvements to our products. If you would like to contact us with your ides, or if you are experiencing any problems, please E-Mail us at one of the following addressed

Compuserve:	100351,2607.

Internet:	100351,2607@compuserve.com

Because we are located in Australia we have a time difference problem with the rest of the world and can therefore only provide technical support via E-Mail.

Since it is often difficult to describe and/or duplicate problem conditions, we may ask you to E-Mail us a program sample to allow us to investigate any reported problems.


Using DBFilterCombo

Using DBFilterCombo

DBFilterCombo is essentially the same as the standard Delphi DBLookupCombo with the following exceptions or additions;

Pedigree

Although DBFilterCombo looks and feels exactly like the standard DBLookupCombo control, it is in fact only distantly related. DBFilterCombo is a descendant of TCustomEdit.

Major difference between DBFilterCombo and DBLookupCombo

The Dropdown ListBox part of DBFilterCombo is dynamic. That is it Created when the control gains the Input Focus and is Destroyed when the control looses the Input Focus. It does not exist at any other time. Each time the Dropdown ListBox is created, the Lookup DataSource is re-searched for values to fill the Dropdown ListBox. The OnBeforeLookup event procedure (see below) is called every time the Dropdown ListBox is created.

The LookupDisplay is the name of a field in the LookupSource that holds the values that are actually displayed in the Dropdown ListBox. This field need not be related in any way to any another field in either the LookupSource or the DataSource and does NOT have to be a key field.

The LookupField is the name of a field in the LookupSource that holds the actual data that is copied to the DataSource DataField field. It should be of the same type and size as the DataSource Datafield and MUST be a key field.

The Dropdown ListBox portion of DBFilterCombo is only a single column job. If there is enough interest I will consider making the Dropdown ListBox a Grid instead which will allow multiple fields to be displayed. There are some other implications involved in doing this eg: How are the fields filled in when a new record is to be automatically added to the LookupSource.

Note

1.	The creation order of the "Helper" table is important. It must be created before the main table that uses it as a Lookup table. This is set from the Delphi menu using the Edit|Creation Order... command. The sample program is already setup this way.

2.	The shareware version of DBFilterCombo will only work while Delphi is running. This restriction is removed in the registered version.

3.	Each of the DBFilterCombos in the sample program is set up slightly different. They all have a different DropDownCount and DropDownItemHeight, simply to draw attention to the fact that this is possible.