DUNOGRAD.DCU v1.1  Graduated Panel and Caption for Delphi 1.0, 2.0 & 3.0
------------------------------------------------------------------------
(C)1996-1998 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 updates
* Reporting errors


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

This document describes the components included in DUNOGRAD.DCU. The
VCL includes two new components you can use in your own projects:
TGradientPanel and TGradientCaption. In addition to these components it
makes a new function available, when it is added to the project. The 
code has been tested under Delphi 3, but should work with Delphi 2.0
as well. The 16-bit version of DUNOGRAD can't be compiled from this
source code, so if you need Delphi 1.0 support, you have to do with
the compiled version or modify this code to work with Delphi 1.


-----------
* 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 to 3.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 to 3.0) it should work, however.


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

Copy the files (DUNOGRAD.PAS and DUNOGRAD.DCR) to a directory in
the search path of Delphi and install them using "Install
component" in Delphi.


--------------------
* 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.
v1.11	Modified to work with Delphi 3.


--------------------
* 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 somewhere in your program (in the About box or in the 
help file) or in the documentation (the manual or "read me" file).
The statement should read:

Portions copyright DuNo Electronics I/S

The copyright statement in the source code must not be changed!


- 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 UPDATES *
---------------------

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

http://users.cybercity.dk/~ccc9169


--------------------
* 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).

