Unit Fltcback |
***************************************************************************** ** ** TFILTERCALLBACK Component. ** ** Author: Andy Strong e-mail: ANDREWS@NBAQSL.CO.UK ** CompuServe: 100716,3015 ** ** History ** ======= ** Vers Date Comments ** 2.00 10 Aug 97 Added Blob Filtering. ** Added limited Property Editor - About. ** Changed TFilterRecord name to TFilterObject - more sensible. ** Discovered Paradox Tables can hold TDate(LongInt) as separate ** to TDateTime(Double). Add fix to handle either correctly. ** 1.05 05 Aug 97 Added DbiFunction DbiGetExactRecordCount and ** FilteredRecordCount property. NOTE: DO NOT REFERENCE THIS ** property from within the CALLBACK METHOD - YOU WILL CRASH ** YOUR SYSTEM! ** 1.04 24 Jul 97 Penultimate hack to fix AsDate and AsDateTime functions. ** Added AsTime method. ** 1.03 10 Jun 97 Ensure FieldList is loaded every time Active set to True. ** Ensuring list always upto date. ** 1.02 06 Feb 97 Fixes for Date/Time handling of raw data, and boolean ** handling. ** 1.01 Not Rel. Minor Raw Data problems ** 1.00 10 Sep 96 First Public Release ** ** A component to be dropped on a form, to allow low-level BDE callback ** on a table independently of any other indexes, ranges set. ** Encapsulates the BDE callback in a standard Delphi event passing ** adequate information to allow selective filtering using Pascal code. ** ** Taken from an idea on the BDE Compuserve forum. ** ** This unit consists of three objects and one component. ** The component is used to encapsulate the usage of the BDE callback filter, ** and raw data handling. ** The TFilterCallback Component sets up the callback filter for the BDE; ** the TFilterObject object, is the object passed to the users Delphi callback ** routine to enable easy access to the raw data to work on; ** the TRaw object is an internal sanitiser of the raw BDE data for the Delphi ** users event handler. ** ** NOTE: The function DbiGetExactRecordcount works by iterating through all ** records and requesting a filter callback to see if the records are ** allowed in the set. This means that the DB is potentially parsed ** multiple times. ** Once for the Filter in the first place. ** Once for each time the DbiGetExcactRecordCount is called. ** This may have a dramatic performance effect if BLOB filtering is being ** used. **
Classes |
TFilterBlobStream -
Object which is used to hide all the nasty reading and seeking of the BDE
blob data.
TFilterCallback -
Actual component doing the work.
TFilterEditor -
Little component editor to show an about box, and an About menu item on
a right-click during design time.
TFilterObject -
Object which is passed to the users Filter callback, giving access to the
BDEs raw data for a record in a useable state.
TRawData -
Object to handle the conversion of RAW data to a known Pascal type
Functions |
Register -
** Standard Component Palette register procedure
Types |
Constants |
Variables |
Functions |
Types |
TBDEFieldType = (ftUnknown, ftString, ftDate, ftBlob, ftBoolean, ftSmallint, ftInteger, ftFloat, ftBCD, ftBytes, ftTime, ftDateTime, ftWord);
TFilterEvent = procedure(FilterRec: TFilterObject; var Allow: boolean) of objectFunction prototype for our sanitised Delphi filter event.
Constants |
Variables |