TDateComboBox version 1.1
Copyright (c) 1997 Christian Maas
All Rights Reserved

CONTENTS
========
I.   Summary
II.  Requirements
III. Installation
IV.  License agreement
V.   Disclaimer agreement
VI.  Order form


I. SUMMARY
==========

a) Note
   In all of my components, additional (not inherited or known from similar
   components) read/write properties (appear in object inspector) begin with
   an underscore "_".
   So you can see them at a glance at the end of the object inspector.

   You can evaluate this component *BEFORE* installing:

   1. Try the demo DCB_DEMO.EXE which is supplied with this archive.
   2. You can compile and modify the demo source *WITHOUT* having
      installed TDateComboBox, because of dynamically creating within
      this project. Note that you will see a ComboBox1 component instead of
      DateComboBox1 on the form at design time.

b) About TDateComboBox
   In my opinion, the easiest way to enter a date in a narrow scope (i.e. several weeks)
   is to pick it from a list. Otherwise, it's easier to enter it directly.

   TDateComboBox is a descendant of TCustomComboBox, which is designed for this
   purpose. You can either select a date from a drop-down list or enter a valid date
   manually (only selecting possible if property Style is set to csDropDownList).

   The format in which the date is displayed (and accepted as valid when
   entered) depends on the following variables from unit SysUtils:
   ShortDateFormat, DateSeparator, ShortDayNames
   I recommend to set these variables explicitly to values according to your
   target language. Thus, no "language mix" will appear in your application (e.g.
   Win95 german version / your app english!)


c) Properties
   The following new properties are defined for TDateComboBox and appear in
   object inspector (read/write properties)

   _DisplayWeekday (boolean)
   If true, the weekday of a valid date will be displayed according to ShortDayNames

   _DefaultRelativeToday (integer)
   The date which is displayed as default, indicated in days relative to the actual
   date (0 is for today, 1 for tomorrow, -1 for yesterday and so on)

   _DayScope (integer)
   The scope of days back and forth around the default date selectable in the drop-down
   list.

   The following new properties are read only (don't appear in object inspector),
   i.e. you evaluate them after the user has entered a date:

   Date (TDateTime)
   The date selected or entered in DELPHI's TDateTimeFormat. The integer part of
   a TDateTime variable is the number of the day (0 is 12-30-1899, 1 is 12-31-1899
   and so on), the fraction part is the time gone since 0:00 h (refer to the
   DELPHI documentation for more details). Because TDateTime is for entering only
   the date (without time part), the fractional part is always 0. According to DELPHI's
   own behaviour, an invalid date is represented by -1 (although -1 can stand for
   the valid date 12-29-1899, too!). Therefore, an additional property DateValid
   is defined (see below). Of course, you can also evaluate the inherited property
   Text which contains exactly the displayed characters.

   DateValid (boolean)
   True if the entered date is valid

   In addition, TDateComboBox has all properties of TComboBox except MaxLength, which
   is set automatically depending on length of ShortDateFormat.

d) Example:
   Today is 01-22-97, ShortDateFormat is 'mm-dd-yy'
   _DisplayWeekday := false
   _DefaultRelativeToday := 0
   _DayScope := 2

   Then the drop-down list will consist of the four items
   01-20-97, 01-21-97, 01-22-97, 01-23-97, 01-24-97
   with default (i.e. displayed) value 01-22-97.

   If _DisplayWeekday is set to true, the weekday is displayed trailing
   within brackets, e.g. 01-22-97 (We)
   If you enter the field for input via keyboard, the trailing weekday is
   automatically removed. Entering has to take place in the ShortDateFormat,
   e.g. 01-22-97 or 1-22-97.

   If the property Style is set to csDropDownList, only selecting of a
   date (not entering) is possible.

e) Declaration of the component

   type
     TDateComboBox = class (TCustomComboBox)
     private
       FDate: TDateTime;
       FDayScope: integer;
       FDefaultRelativeToday: integer;
       FDisplayWeekday: boolean;
       FDateValid: boolean;
       function  ComputeText (Day: TDateTime): string;
       function  RemoveWeekday (const s: string): string;
       procedure SetDefaultRelativeToday (ADefaultRelativeToday: integer);
       procedure SetDayScope (ADayScope: integer);
       procedure SetDisplayWeekday (ADisplayWeekday: boolean);
     protected
       procedure DoExit; override;
       procedure KeyPress (var Key: Char); override;
       procedure KeyDown (var Key: Word; Shift: TShiftState); override;
     public
       constructor Create (AOwner: TComponent); override;
       { compute items for listbox }
       procedure ComputeItems;
       { validation, compute FDate and display date in ShortDateFormat }
       procedure Validate;
     published
       { first publish properties of TCustomComboBox... }
       property Style;
       property Color;
       property Ctl3D;
       property DragMode;
       property DragCursor;
       property DropDownCount;
       property Enabled;
       property Font;
       property ItemHeight;
       property Items;
       { property MaxLength not published, because it depends on
         ShortDateFormat and is adapted automatically! That's the reason
         why DateComboBox is derived from TCustomComboBox instead of TComboBox}
       property ParentColor;
       property ParentCtl3D;
       property ParentFont;
       property ParentShowHint;
       property PopupMenu;
       property ShowHint;
       property Sorted;
       property TabOrder;
       property TabStop;
       property Text;
       property Visible;
       property OnChange;
       property OnClick;
       property OnDblClick;
       property OnDragDrop;
       property OnDragOver;
       property OnDrawItem;
       property OnDropDown;
       property OnEndDrag;
       property OnEnter;
       property OnExit;
       property OnKeyDown;
       property OnKeyPress;
       property OnKeyUp;
       property OnMeasureItem;
       { ... then publish additional (new) properties }
       property Date: TDateTime read FDate; { read only property }
       property DateValid: boolean read FDateValid; { read only property }
       property _DayScope: integer read FDayScope
         write SetDayScope;
       property _DefaultRelativeToday: integer read FDefaultRelativeToday
         write SetDefaultRelativeToday;
       property _DisplayWeekday: boolean read FDisplayWeekday
         write SetDisplayWeekday;
     end;


II. REQUIREMENTS
================

TDateComboBox is a component for DELPHI 2.0.


III. INSTALLATION
=================

1. Extract DCB11US.ZIP into a directory on your hard disk.
2. The archive contains the following files:
   README.TXT   (this file)
   DATCOMBO.DCU (the installable unit containing TDateComboBox)
   DATCOMBO.DCR (DELPHI component ressource for TDateComboBox)
   DCB_DEMO.EXE (demo for TDateComboBox; try before you install it!)
   DCB_DEMO.DPR (demo project source)
   DCB_W1.PAS   (first form of demo project source)
   DCB_W1.DFM   (.dfm for first form of demo project)
   DCB_W2.PAS   (second form of demo project source)
   DCB_W2.DFM   (.dfm for second form of demo project)
3. Copy DATCOMBO.DCU and DATCOMBO.DCR in the directory which contains your own component
   units. Then install the component unit DATCOMBO.DCU from DELPHI IDE (change the filter
   from *.pas to *.dcu!). The new component TDateComboBox is added to the page "CM".


IV. LICENSE AGREEMENT
=====================

This component is shareware. You can freely distribute copies of the main archive
DCB11US.ZIP as long as no alterations are made to the contents and no charge is
raised except a reasonable fee for distributing costs.

You are hereby granted the permission to use TDateComboBox for a period of 30 days (from
first use on) for evaluation purposes. If you use this component after that, you are 
required to register.

Register by sending the ordering form along with US$ 15 or the equivalent in any 
other currency to the author. Registered users will get the source code via e-mail.
NOTE: Please understand that it's not possible to deliver the source code on floppy disk.

Registered users of this component can use it in their own programs for private and commercial
purposes, provided their software contains the copyright notice
"TDateComboBox Copyright (c) 1996 Christian Maas".


V. DISCLAIMER AGREEMENT
=======================

This software has been thoroughly tested. Nevertheless it is provided "as is" and
without any warranties expressed or implied, including, but not limited to, implied
warranties of merchantability and fitness for a particlar purpose.

Any liability of the author, Christian Maas, will be limited exclusively to product
replacement or refund of the product purchase price. In no event shall the author
be liable for any damages whatsoever (including, without limitation, damages for loss
of business profits, business interruption, loss of business information, or other
pecuniary loss) arising out of the use of or inability to use this software or
documentation, even if the author has been advised of the possibility of
such damages.


VI. ORDER FORM
==============

Thank you for choosing TDateComboBox. Please fill in the information below and send this
form along with the registration fee to:

  Christian Maas
  Nelkenweg 7
  D-66740 Saarlouis
  Germany

Please send simultaneous a message to 

  chmaas@hit.sb.sub.de

This is the most reliable way to transmit your address (prevents from illegible handwriting
in the form below).



Hereby, I order the component TDateComboBox (with source code) for delivery via e-mail
as follows:

Name:            ___________________________________________

Organization:    ___________________________________________

Address:         ___________________________________________

                 ___________________________________________

                 ___________________________________________

                 ___________________________________________

Phone:           ___________________________________________

e-mail address:  ___________________________________________

Where did you hear about TDateComboBox?   __________________



Single-user copy:   ____ copies at US$ 15 each =    ________


Total amount                                        ________


Price is guaranteed until end of 1997.


Date and signature: __________________________________________


Comments:
