DUNOGRAD.DCU v1.1  Graduated Panel and Caption for Delphi 1.0 & 2.0
-------------------------------------------------------------------
(C)1996 by DuNo Electronics I/S

** IMPORTANT ******************************************************
* This VCL is freeware only if you follow the terms stated in the *
* end of this document!                                           *
*******************************************************************

CONTENTS
* Introduction
* WARNING
* Installation
* Version overview
* GradientFillRect procedure
* TGradientPanel component
* TGradientCaption component
* Terms for use of this vcl
* Obtaining the source code
* Obtaining updates
* Reporting errors


----------------
* INTRODUCTION *
----------------

This document describes the components included in DUNOGRAD.DCU. The
VCL includes two new components you can use in your projects:
TGradientPanel and TGradientCaption. In addition to the components it
makes a new function available, when it is added to the project.


-----------
* WARNING *
-----------

The TGradientCaption uses a technique to gradute the caption of
existing TForm's, which is based on the internal layout of objects
in Delphi 1.0 and Delphi 2.0. Even minor changes in the layout of
objects will cause TGradientCaption to fail (cause an run-time
error). In the current versions of Delphi (1.0 & 2.0) it should
work, however.


----------------
* INSTALLATION *
----------------

When you have unpacked DUNOGRAD.ZIP you have got the following files:

DUNOGRAD.TXT   This file
DGRAD_16.ZIP  VCL for Delphi 1.0 (16 bit)
DGRAD_32.ZIP  VCL for Delphi 2.0 (32 bit)

- Delphi 1.0 -
Unpack DGRAD_16.ZIP in a Delphi 1.0 related directory
(eg. c:\delphi\lib) and use "Options|Install components" to add the
VCL (DUNOGRAD.DCU).

- Delphi 2.0 -
Unpack DGRAD_32.ZIP in a Delphi 2.0 related directory
(eg. "c:\Program Files\Borland\Delphi 2.0\LIB") and use
"Component|Install" to add the VCL (DUNOGRAD.DCU).

Please be aware that both the 16 bit and the 32 bit VCL is
named DUNOGRAD.DCU. If they have to reside in the same directory, you
must rename one of the VCL's (and the resource file) to another name
before unpacking the second file.


--------------------
* VERSION OVERVIEW *
--------------------

v1.0    Original release of the DUNOGRAD VCL.
v1.1    Fixes two problems:
        v1.0 only allowed one form per project to use the
        TGradientCaption. With v1.1 TGradientCaption can be added to
        as many form as you may wish.
        v1.0 didn't handle all TForm.BorderStyle's correctly. v1.1
        handles all default BorderStyle's correctly.


--------------------
* GradientFillRect *
--------------------

GradientFillRect is the graduation function used by TGradientPanel and
TGradientCaption. When DUNOGRAD is added to the project, the function
can be used to graduate any TRect on any TCanvas.

procedure GradientFillRect(Canvas : TCanvas;
                           const Rect : TRect;
                           Direction : TGradientDirection;
                           Steps : integer;
                           Color : TColor;
                           ColorSteps : integer);

Canvas          the canvas to draw the graduated rectangle on.
Rect            the rectangle to fill
Direction       the direction of the graduation (see TGradientPanel)
Steps           the no. of color steps in the graduation (see below)
Color           the color to graduate from (always graduates towards black)
ColorSteps      the no. of colors (out of Steps) used (see below)

"Steps" defines the number of color steps *available* in the graduation and
"ColorSteps" defines the number of the steps actually used. Normally "Steps"
is set to 256 (or 16 to create a "special effect") and "ColorSteps" to
256 (graduates to totally black) or 192 (graduates to very dark "Color").


------------------
* TGradientPanel *
------------------

TGradientPanel is a descendant of TPanel and has the properties of a TPanel
plus three new properties. TGradientPanel is used to create graduated
panels or backgrounds, like the blue background in Microsoft Setup (drop a
TGradientPanel on the form, and set Align to alClient).

----
property ColorSteps : integer;  { Range 1..256 }

Sets the number of colors used in the graduation (default is 256). When
the default value of 256 is used, the color of the panel will be graduated
from the panel color all the way to black. If a smaller value is used then
the color will be graduated in this number of steps towards black.

Example:
procedure Form1.Button1Click(Sender : TObject);
begin
  { Graduate from blue to very dark blue }
  TGradientPanel1.Color := clBlue;
  TGradientPanel1.GradientSteps := 256;
  TGradientPanel1.ColorSteps := 192
end;
----
property GradientDirection : TGradientDirection;

Sets the direction of the graduation as defined by TGradientDirection:

TGradientDirection = (gdLeftRight,gdRightLeft,gdTopBottom,gdBottomTop)

The default value is gdTopBottom.

Example:
procedure Form1.Button2Click(Sender : TObject);
begin
  { Graduate from left to right }
  TGradientPanel1.GradientDirection := gdLeftRight;
end;
----
property GradientSteps : integer;  { Range 1..256 }

Sets the number of colors steps in the graduation. Default is 256 which means
that the panel is graduated with 256 colors. If you choose a smaller number
the graduation will be made up of a smaller number of color making the
graduation appear less smooth.

Example:
procedure Form1.Button3Click(Sender : TObject);
begin
  { Graduate from blue to black in 16 steps }
  TGradientPanel1.Color := clBlue;
  TGradientPanel1.GradientSteps := 16;
end;
----


--------------------
* TGradientCaption *
--------------------

WARNING: To procedure the gradient caption, TGradientCaption uses a
         technique to grab the windows procedure of an existing
         TForm, which is based heavyly on the internal layout of
         objects in Delphi 1.0 and Delphi 2.0. Even minor changes in
         the layout of objects will cause TGradientCaption to fail
         (cause an run-time error). In the current versions of Delphi
         (1.0 & 2.0) it should work, however.

TGradientCaption is a descendant of TComponent. It only has two properties,
Name and Tag. It is used to make a graduated window caption like the one
in Microsoft Word. Just drop this non-visual component on the form, and
compile...

NOTE: The caption is always graduated from right to left using
clActiveColor as color and the text is always clWhite.

Another warning: Do NOT place two TGradientCaption's on the same
                 form - they will "compete" for the windows procedure,
                 and cause a run-time error, when you run the program.
----


-----------------------------
* TERMS FOR USE OF THIS VCL *
-----------------------------

When you use our freeware components you must include our copyright
statement everywhere you claim your own copyright (in the About box,
in the help file [excluding the about box for the help file], the
documentation and so on). The statement should read:

Portions copyright DuNo Electronics I/S

The statement must be in a readable size but does not have to be in
the same size (as big) as your copyright statement.

- DISCLAIMER -
DuNo Electronics I/S makes no representations or warranty that the software
or documentation are "error free" or meet any user's particular standards,
requirements, or needs. DuNo Electronics I/S can not be held liable for any
error or claims that arises directly or indirectly from the use of this
software.


-----------------------------
* OBTAINING THE SOURCE CODE *
-----------------------------

You can obtain the source code for our VCL's by licensing it from
DuNo Electronics I/S. When you have licensed a VCL you do not have to
include our copyright message. For detail about licensing please
check out our web-site:

www.cybercity.dk/users/ccc9169/home.html

The actual licencing scheme wasn't available as this document was
written but will be something like $xx for 10 points worth of VCL's,
where most VCL's will cost one point (we currently have 4 VCL's
planned for release within the next months - three 1 point VCL's and
one 3 point VCL). The points must be used within a year and includes
free e-mailed source-code updates if a component is updated.


---------------------
* OBTAINING UPDATES *
---------------------

You should check out our web-page for updates and new VCL's
periodically:

www.cybercity.dk/users/ccc9169/home.html


--------------------
* REPORTING ERRORS *
--------------------

The components we develop is often used by at least two danish
companies before being released as freeware - this should take care
of BIG bugs. If you do find an error please report it immediately
by e-mail by sending an error report (let the first line read "ERROR
REPORT FOR XXXXXX" where XXXXXX is the name of the component eg.
TGradientPanel) to:

johnnynorre@vip.cybercity.dk

Errors will be corrected as fast as possible (normally within 24-48
hours).

