You are on page 1of 120

Volume 1

Essentials
User’s Manual

© TurboPower Software Company, 1997


First Edition July 1997

TurboPower Software Company


15 North Nevada
Colorado Springs, CO 80903-1708

Order line (U.S. and Canada): 800/333.4160


Elsewhere: 719/471.3898

www.turbopower.com
License Agreement
Agr eement
This software and accompanying documentation (the “Software”) are protected by United States copyright law
and also by International treaty provisions. Any use of this Software in violation of copyright law or the terms of
this agreement will be prosecuted to the best of our ability.

Essentials is copyright © 1997 by TurboPower Software Company, all rights reserved.

TurboPower Software Company authorizes you to make archival copies of this software for the sole purpose of
back-up and protecting your investment from loss. Under no circumstances may you copy the Software for the
purposes of distribution to others. Under no conditions may you remove the copyright notices made part of the
software or documentation.

You may distribute, without runtime fees or further licenses, your own compiled programs based on any of the
source code of Essentials. You may not distribute any of the Essentials source code, compiled units, or compiled
example programs without written permission from TurboPower Software Company.

Note that the previous restrictions do not prohibit you from distributing your own source code, units, or
components that depend upon Essentials. However, others who receive your source code, units, or components
need to purchase their own copies of Essentials in order to compile the source code or to write programs that use
your units or components.

This software and accompanying documentation is deemed to be “commercial software” and “commercial
computer software documentation,” respectively, pursuant to DFAR Section 227.7202 and FAR 12.212, as
applicable. Any use, modification, reproduction, release, performance, display or disclosure of the Software by the
U.S. Government or any of its agencies shall be governed solely by the terms of this agreement and shall be
prohibited except to the extent expressly permitted by the terms of this agreement. TurboPower Software
Company, 15 North Nevada, Colorado Springs, CO 80903-1708.

The supplied Software may be used by one person on as many computer systems as that person uses. Group
programming projects making use of this Software must purchase a copy of the Software for each member of the
group. Contact TurboPower Software Company for volume discounts and site licensing agreements.

With respect to the physical media and documentation provided with Essentials, TurboPower Software Company
warrants the same to be free of defects in materials and workmanship for a period of 60 days from the date of
receipt. If you notify us of such a defect within the warranty period, TurboPower Software Company will replace
the defective media or documentation at no cost to you.

TurboPower Software Company warrants that the Software will function as described in this documentation for a
period of 60 days from receipt. If you encounter a bug or deficiency, we will require a problem report detailed
enough to allow us to find and fix the problem. If you properly notify us of such a software problem within the
warranty period, TurboPower Software Company will update the defective software at no cost to you.

TurboPower Software Company further warrants that the purchaser will remain fully satisfied with the product for
a period of 60 days from receipt. If you are dissatisfied for any reason, and TurboPower Software Company cannot
correct the problem, contact the party from whom the Software was purchased for a return authorization. If you
purchased the product directly from TurboPower Software Company, we will refund the full purchase price of the
Software (not including shipping costs) upon receipt of the original media and documentation in undamaged
condition. TurboPower Software Company honors returns from authorized dealers, but cannot offer refunds
directly to anyone who did not purchase a product directly from us.

TURBOPOWER SOFTWARE COMPANY


COMP ANY DOES NOT ASSUME ANY LIABILITY FOR THE USE OF ESSENTIALS
BEYOND THE ORIGINAL PURCHASE PRICE OF THE SOFTWARE. IN NO EVENT WILL TURBOPOWER SOFTWARE
COMPANY BE LIABLE TO YOU FOR ADDITIONAL DAMAGES, INCLUDING ANY LOST PROFITS, LOST SAVINGS,
OR OTHER INCIDENTAL
INCIDEN TAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF OR INABILITY TO USE
THESE PROGRAMS, EVEN IF TURBOPOWER SOFTWARE COMPANY HAS BEEN ADVISED OF THE POSSIBILITY
OF SUCH DAMAGES.

By using this software, you agree to the terms of this section. If you do not agree, you should immediately return
the entire Essentials package for a refund.

All TurboPower product names are trademarks or registered trademarks of TurboPower Software Company. Other
brand and product names are trademarks or registered trademarks of their respective holders.
Table of Contents

Chapter 1: Introduction 6

System Requirements 8

Installation 9

Tutorial 12

Organization of this Manual 17

Technical Support 19

Chapter 2: Calculator 21

TEsCalculator Component 24

Chapter 3: Calendar 31

TEsCalendar Component 33

Chapter 4: Color Combo Box 39

TEsColorComboBox Component 40

Chapter 5: Date Edit 43

TEsDateEdit Component 45

TEsDbDateEdit Component 50

3
Chapter 6: Gradient 53

TEsGradient Component 54

Chapter 7: Label 57

TEsLabel Component 61

Chapter 8: Scrolling Marquee 65

TEsScrollingMarquee 66

Chapter 9: Menu Button 71

TEsMenuButton Component 72

Chapter 10: Number Edit 75

TEsNumberEdit Component 76

TEsDbNumberEdit Component 80

Chapter 11: Roll Up


Up 83

TEsRollUp Component 84

Chapter 12: Tiled Bitmap 89

TEsTile Component 90

Chapter 13: Miscellaneous Classes 93

TEsBase Class 94

TEsLabelInfo Class 96

TEsCalcColors Class 98

4 Chapter 1: Introduction
TEsCalColors Class 101

TEsEdPopup Class 104

TEsCustomSettings Class 106

Index 111
Chapter 1: Introduction
Essentials Volume One provides a unique set of visual and non-visual components that
can be used in nearly every application you create. Its components were designed with
ease of use and visual appeal as the primary goals. Most of the components can be
dropped on a form and used without changing the default property settings. The
remaining components require only minimal adjustment.
These are just some of the Essentials components:

The entire list of Essentials components includes:

Calculator
A four function calculator, plus memory, square root, percent, invert, and sign change.

6 Chapter 1: Introduction
Calendar
A monthly calendar that allows browsing by month and year.

Color Combo Box


A combo box for selecting one of the basic colors.

Date Edit
An edit field for entering dates, plus an attached popup calendar.

Data-
Data-aware Date Edit
A data-aware version of the date edit component.

Gradient
A gradient-filled component supporting from and to colors.

Label
An enhanced label component supporting 3D, floating, and shadowed text, plus an
assortment of special “looks.”

Scrolling Marquee
Scrolling text using the Essentials label styles.

Menu Button
A button that displays a drop-down menu when it is pressed.

Number Edit
An edit field for entering numeric values, plus an attached pop-up calculator.

Data-
Data-aware Number Edit
A data-aware version of the number edit component.

Roll Up
A non-visual component that allows the owning form to be “rolled” up and down.

Tiled Bitmap
Tiles any bitmap to fill the client area of the control.
Most of the Essentials components have a very special feature—the ability to create an
attached label. An attached label is a label that maintains its relative position when its
associated component is moved. For example, if an attached label is displayed one pixel
above and to the left of the top left corner of a component, it maintains its position one
pixel above and to the left of the component even after the component is moved.
Most of the Essentials components implement common sets of property settings as
schemes, so simply changing one property has the effect of changing many individual
properties. Of course, if you need more control, you can change the individual
properties. The reference section for each component contains a complete list of the
design- and run-time properties, events, and methods.
System Requirements
To use Essentials, you must have the following hardware and software:
• A computer capable of running Windows 3.1, Windows 95, or Windows NT. The
graphics system must be capable of supporting at least 256 colors.
• Delphi version 1.0, 2.0, or 3.0.
• A hard disk with at least 10 MB of free space is strongly recommended. To install
all files and compile the example programs requires about 5 MB of disk space.

8 Chapter 1: Introduction
Installation
Essentials can be installed directly from the CD-ROM (or diskettes) or, if you have
Essentials on disk, you can copy the complete set of installation files to your hard disk
and run the installation from there.

The Setup Program


Delphi cannot be running during the installation process. Exit Delphi before starting the
SETUP program.
Insert the TurboPower Product Suite CD and follow the instructions presented by the
SETUP program.
If you are installing from diskettes, run SETUP.EXE to start the installation process.
Since SETUP is a Windows application, you must start Windows first. From the taskbar
select Start and then Run (or the Files|Run option from the Program Manager for
Windows 3.1) and type X:\SETUP. Replace X:\ with the appropriate drive letter or the
name of a directory if you copied the distribution files to your hard disk.
SETUP installs Essentials in the C:\ESSENCE directory. You can specify a different
directory, if desired.
SETUP creates a new program group named Essentials (you can specify a different name,
if desired) and puts the following program icons in it:

Essentials Volume One help


The Essentials Volume One help system.

Last minute news about Essentials Volume One


A text file that describes changes to the documentation and new features added after
the manual was printed. Please read this file before using Essentials.

Component Installation
The process for installing the Essentials components depends on the Delphi version. This
section describes component installation for Delphi 1.0, 2.0, and 3.0.

Component Installation for Delphi 3.0


Essentials consists of four packages. The two design-time packages (ES30D.DPL and
ESDB30D.DPL) are automatically installed into Delphi 3.0 by the SETUP program. The
two run-time packages (ES30.DPL and ESDB30.DPL) are automatically copied to the
\WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 directory by the SETUP program.

Installation 9
If you need to install manually, perform the following steps:
1. If Delphi is running, shut it down before performing this step. The run-time
packages (ES30.DPL and ESDB30.DPL) must be placed in a location where
Windows and Delphi can locate them. Put them in Delphi’s \BIN directory, the
\WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 directory, the system path,
or the current directory.
2. Start Delphi. Use the “Install Packages” menu option to install the two Essentials
design-time packages (ES30D.DPL and ESDB30D.DPL).
3. Alter Delphi’s library path so that it includes the path to the Essentials source files
(Tools|Environment Options - Library Page) so that Delphi can find the Essentials
source files when required. Or, you can add the Essentials path to your system
Path environment variable.

Component Installation for Delphi 1.0 and 2.0


Before you can use Essentials, you must install the Essentials components and rebuild the
component library. From within Delphi, do the following:
1. Select Component|Install from the main menu (Options|Install components for
Delphi 1.0).
2. Select ‘Add’, and then select the ‘Browse’ button.
3. Locate and select the ESREG.PAS file in the ESSENCE directory and select the OK
button from the ‘Add Module’ dialog.
4. If you want to register the data-aware components, repeat step 3 selecting
ESREGDB.PAS, and then select the OK button.
5. Select OK from the ‘Install Components’ dialog to have Delphi compile and add
the Essentials components to the component library.
The Delphi component palette is updated with a tab for ‘Essentials’. If you registered the
data-aware components, they are also placed on the Essentials tab. Select this tab to start
using the Essentials components.

Installing Integrated Help


The process for installing integrated help depends on the Delphi version. This section
describes integrated help installation for Delphi 1.0, 2.0, and 3.0.

Installing integrated help for Delphi 3.0


The SETUP program automatically installs Essentials integrated help.
If you need to install manually, perform the following steps:

10 Chapter 1: Introduction
1. Edit the DELPHI3.CNT file (in the Delphi Help directory) and add the following
line to the “index” section:
:Index Essentials Reference =ESSENCE.HLP

2. The first time you attempt to access Essentials help, Delphi/Windows won’t be
able to locate the help file and will ask if you want to find the file yourself. Answer
yes to this question and browse for the Essentials help file (ESSENCE.HLP) in the
ESSENCE directory. This step is required only the first time you access Essentials
help.

Installing integrated help for Delphi 2.0


The SETUP program copies the Essentials help, contents, and keyword files to the
ESSENCE directory.
Install the keyword file (ESSENCE.KWF) by running Delphi’s HelpInst utility,
HELPINST.EXE (located in the Delphi HELP\TOOLS directory). Do not do this while
Delphi is running. Select File|Open from the menu and open DELPHI.HDX in the
DELPHI\BIN directory. A list of the current *.KWF files is shown. You might need to
specify a search path so that HelpInst can locate the *.KWF files already merged into
DELPHI.HDX.
Select the Keywords|Add option from the menu and add the ESSENCE.KWF file
(located in the ESSENCE directory). Select File|Save and exit HelpInst.
The SETUP program adds an entry to the [Files] section of WINHELP.INI and the
[Index Path] section of MULTIHLP.INI specifying the location of the ESSENCE.HLP
file. If you put ESSENCE.HLP in a directory other than the ESSENCE directory, modify
these files to reflect the new location.

Installing integrated help for Delphi 1.0


The SETUP program copies the Essentials help and keyword files to the ESSENCE
directory.
Install the keyword file (ESHLP16.KWF) by running Delphi’s HelpInst utility,
HELPINST.EXE (located in the Delphi HELP directory). Do not do this while Delphi is
running. Select File|Open from the menu and open DELPHI.HDX in the DELPHI\BIN
directory. A list of the current *.KWF files is shown. You might need to specify a search
path so that HelpInst can locate the *.KWF files already merged into DELPHI.HDX.
Select the Keywords|Add option from the menu and add the ESHLP16.KWF file
(located in the ESSENCE directory). Select File|Save and exit HelpInst.
The SETUP program adds an entry to the WINHELP.INI and MULTIHLP.INI files
specifying the location of the ESHLP16.HLP file. If you put ESHLP16.HLP in a directory
other than the ESSENCE directory, modify these files to reflect the new location.

Installation 11
Tutorial
This tutorial is a simple, step-by-step example that illustrates common uses for many of
the Essentials components. It takes you through the steps necessary to add the
components to a form and shows how the completed form functions. When an
Essentials component is used in this tutorial, its icon is shown at the beginning of the step
to make it easier for you to find it on the Essentials tab in Delphi.
1. Create a new application in Delphi. Set the BorderStyle property to bsDialog.

2. Drop a TEsTile on the form. Set the Align property to alClient. Double-click
on the Bitmap property and load WHEEL.BMP (it is in the
\ESSENCE\EXAMPLES\DELPHI directory). This displays a TurboPower turbine
wheel as a tiled bitmap background for the form.

3. Drop a TEsDateEdit in the top left corner of the form. Drop a TLabel just
under the TEsDateEdit. Set the Caption to ‘Entered date’. When a date is entered in
the date edit and the field is exited, this label will display the date.
Click on the TEsDateEdit to select it. Double-click on the OnExit event in the Events
tab of the Object Inspector to add the following event handler:
procedure TForm1.EsDateEdit1Exit(Sender : TObject);
begin
Label1.Caption := FormatDateTime(LongDateFormat,
EsDateEdit1.Date);
end;

4. Double-
Double-click on the EsLabelInfo property to display the properties for the attached
label. Set Visible to true, OffsetX to –8, and OffsetY to –6. This causes the date edit’s
attached label to become visible and to be placed just above and to the left of the
control. Double-click on the attached label to display its properties in the Object
Inspector and change the Caption property to ‘Date Edit’.

5. Drop a TEsNumberEdit in the top right corner of the form. Drop a TLabel
just under the TEsNumberEdit. Set the Caption to ‘Entered number’. When a
number is entered in the number edit and the field is exited, this label will display the
number.
Click on the TEsNumberEdit to select it. Double-click on the OnExit event in the
Events tab of the Object Inspector to add the following event handler:
procedure TForm1.EsNumberEdit1Exit(Sender : TObject);
begin
Label2.Caption := EsNumberEdit1.AsString;
end;

12 Chapter 1: Introduction
6. Double-
Double-click on the EsLabelInfo property to display the properties for the attached
label. Set Visible to true, OffsetX to –8, and OffsetY to –6. This causes the number
edit’s attached label to become visible and to be placed just above and to the left of the
control. Double-click on the attached label to display its properties in the Object
Inspector and change the Caption property to ‘Number Edit’.
7. Drop a TListBox just under the TEsDateEdit. Set the Visible property to false. The
list box is used as a place to load the text file that is displayed in the scrolling marquee,
so the list box itself does not need to be visible.
8. Drop a TPanel at the bottom of the form. Size it so that it is about the same width as
the form.

9. Drop a TEsScrollingMarquee on the TPanel. Resize it to almost the entire


width of the panel. Double-click on the OnCycle event in the Events tab of the Object
Inspector to add the following event handler:
procedure TForm1.EsScrollingMarquee1Cycle(Sender : TObject);
var
I : Integer;
begin
{pick the next string to display}
I := ListBox1.ItemIndex+1;
if I > ListBox1.Items.Count-1 then
I := 0;
ListBox1.ItemIndex := I;
EsScrollingMarquee1.Caption := ListBox1.Items[I];
end;

10. Drop a TEsRollUp on the form. It is non-visual, so it doesn’t matter where


you put it. Set the Animate property to false. Double-click on the OnRollDown event
in the Events tab of the Object Inspector to add the following event handler:
procedure TForm1.EsRollUp1RollDown(Sender : TObject);
begin
EsScrollingMarquee1.Active := True;
end;

This event handler causes the scrolling marquee to start scrolling when the form is
rolled down.
11. Add an OnRollUp event handler. Double-click on the OnRollUp event in the
Events tab of the Object Inspector to add the following event handler:
procedure TForm1.EsRollUp1RollUp(Sender : TObject);
begin
EsScrollingMarquee1.Active := False;
end;

This event handler causes the scrolling marquee to stop scrolling when the form is
rolled up.

Tutorial 13
12. Drop two TBitBtn components,
components side by side, in the middle of the form near the
right edge. Click on the first TBitBtn to display its properties in the Object Inspector.
Set the Name to LessBtn, set the Caption to ‘Less’, and set Layout to blGlyphRight.
Double-click on the Glyph property and load ARROWU.BMP (it is in the
\ESSENCE\EXAMPLES\DELPHI directory). This displays an up arrow after the
Caption on the ‘Less’ button.
Click on the second TBitBtn to display its properties in the Object Inspector. Set the
Name to MoreBtn, set the Caption to ‘More’, and set Layout to blGlyphRight.
Double-click on the Glyph property and load ARROWD.BMP (it is in the
\ESSENCE\EXAMPLES\DELPHI directory). This displays a down arrow after the
Caption on the ‘More’ button.
13. Add a LessBtn.OnClick event handler. Click on the ‘Less’ button to select it.
Double-click on the OnClick event in the Events tab of the Object Inspector to add
the following event handler:
procedure TForm1.LessBtnClick(Sender : TObject);
begin
EsRollUp1.RolledUp := not EsRollUp1.RolledUp;
if EsRollUp1.RolledUp then begin
MoreBtn.Visible := True;
LessBtn.Visible := False;
end else begin
LessBtn.Visible := True;
MoreBtn.Visible := False;
end;
end;

This event handler causes the form to roll up or down and displays the appropriate
button for each state.
14. Add a MoreBtn.OnClick event handler. Click on the ‘More’ button to select it.
Click on the down arrow in the OnClick event in the Events tab of the Object
Inspector. Select the LessBtnClick event handler. This selects the event handler
created in the previous step. That event handler takes the appropriate action for a
click on either button.
15. Add an OnCreate event handler for the form. Select Form1 from the drop down list
in the Object Inspector. Double-click on the OnCreate event in the Events tab of the
Object Inspector to add the following event handler:
procedure TForm1.FormCreate(Sender : TObject);
begin
{load text to display}
ListBox1.Items.LoadFromFile('EXTUTOR.TXT');
{set initial state}
LessBtn.Visible := False;
MoreBtn.Visible := True;
EsRollUp1.MinHeight := MoreBtn.Top + MoreBtn.Height + 4;
EsRollUp1.RolledUp := True;
ListBox1.ItemIndex := 0;
EsScrollingMarquee1.Caption := ListBox1.Items[0];
end;

14 Chapter 1: Introduction
This loads text from a file to display in a scrolling marquee and initializes various
properties.
16. Compile and run the tutorial. It should look something like this:

17. Click on the small button at the right side of the date edit. A drop-down calendar is
displayed. If you select a date from the calendar, it is displayed in the date edit. When
you exit the field, the long form of the selected date is displayed in the label below the
date edit.
18. Click on the small button at the right side of the number edit. A drop-down
calculator is displayed. If you perform a calculation with the calculator, the result is
displayed in the number edit. When you exit the field, the result is also displayed in
the label below the number edit.
19. Click on the ‘More’ button. The form rolls down and the scrolling marquee begins
scrolling. It looks something like this:

20. Click on the ‘Less’ button. The form rolls up.


This tutorial is in the EXTUTOR project in the \ESSENCE\EXAMPLES\DELPHI
directory.

Tutorial 15
This tutorial demonstrated many of the Essentials components, but there are still more.
The following chapters contain descriptions of each component and detailed examples
showing how to use each component.

16 Chapter 1: Introduction
Organization of this Manual
Each chapter starts with an overview of the classes and components discussed in that
chapter. Each class and component is then documented individually, in the following
format:

Overview
A description of the class or component.

Example
For components only, an example showing how to use the component.

Hierarchy
Shows the ancestors of the class or component. The hierarchy also lists the unit in which
each class or component is declared.

Properties
A list of all the properties in the class or component. All properties are read/write and are
available at both design and run time unless otherwise indicated.
A ! symbol is used to mark a property that is “run-time only,” which means that it is not
published and therefore not available at design time.
A " symbol is used to mark a property that is protected and usually means that it has not
been implemented for this component.
A # symbol beside the property indicates that it is documented in the following
Reference Section. Properties without a # symbol are documented in the ancestor’s
description, by Delphi, or only by the source code.

Events
A list of all the events in the class or component.
A # symbol beside the event indicates that it is documented in the following Reference
Section. Events without a # symbol are documented in the ancestor’s description, by
Delphi, or only by the source code.

Methods
A list of all the methods in the class or component.
A " symbol is used to mark a method that is protected. Protected methods are normally
virtual or dynamic, thus allowing you to redefine their behavior in descendant classes.

Organization of this Manual 17


A # symbol beside the method indicates that it is documented in the following
Reference Section. Methods without a # symbol are documented in the ancestor’s
description, by Delphi, or only by the source code.

Reference Section
Detailed documentation for the properties, events, and methods implemented at this
level in the class hierarchy. These descriptions are in alphabetical order. They have the
following format:
• Declaration of the property, event, or method. The event handler declaration or
any special data type is shown, if appropriate.
• Default value for properties, if appropriate.
• A short, one-sentence purpose. A $ symbol is used to mark the purpose to make
it easy to skim through these descriptions.
• Description of the property, event, or method. Parameters are also described here.
• Examples are provided in many cases.
• The See also section lists other properties, events, and methods that are pertinent
to this item. If the property, event, or method is not in the same class, component,
or unit, the appropriate class, component, or unit name is listed first (e.g.,
ClassName.MethodName).
Throughout the manual, the % symbol is used to mark a warning or caution. Please pay
special attention to these items.

Naming Conventions
To avoid class name conflicts with components and classes included with Delphi or from
other third party suppliers, all Essentials class names begin with ‘TEs’. The ‘Es’ stands for
Essentials.

On-
On-Line Help
Although this manual provides a complete discussion of Essentials, keep in mind that
there is an alternative source of information available. Help is available by selecting the
Essentials help icon from the Essentials program group or by selecting Essentials Help
from the Start menu.

18 Chapter 1: Introduction
Technical Support
Technical support questions can be sent to support@turbopower.com. Each message
that you send must include your name, serial number, and Essentials version number
(inspect the Version property in any Essentials component to see the version number).
TurboPower Software Company offers a variety of other technical support options. For
details, please see the “Product Support News” enclosed in the original package.

Technical Support 19
Chapter 2: Calculator
The Essentials calculator provides the four basic math functions (add, subtract, multiply,
and divide), plus a few extras like memory, square root, percent, invert, and sign change.

To add a calculator to your form, use the icon on the Essentials tab to drop on a
calculator component. It looks like this:

You can resize the calculator to almost any size. The buttons are automatically resized to
maintain the proper position and size ratio.
The rectangle at the top of the calculator component represents the calculator display.
This is where entered values and calculation results are displayed.
You can use the calculator by clicking on the desired buttons using the mouse. The
column of buttons on the left are used to manipulate the memory value. The MC button
clears the memory contents (sets it to zero). It is only active when the memory value is
not zero. The MR button recalls the contents of the memory and places it in the display.
The MS button stores the current display value in the memory. The M+ and M- buttons
add or subtract the display value from the current memory value and place the result in
the memory.
The Back button deletes the last entered character. It can be used only to delete a number
or a decimal point (otherwise it is ignored). The CE button clears the display, but leaves
any pending operation active. The C button clears the display, the operation, and any
pending errors.

21
The Sqrt button calculates the square root of the display value and places the result in the
display. The % button causes the previously entered number to be treated as a percentage
(e.g., 10 is treated as 10%). The 1/x button calculates the inverse of the display value and
places the result in the display. The +/- button changes the sign of the display value.
The character displayed on the decimal button is determined by Delphi’s
DecimalSeparator variable (defined in the SysUtils unit). By default, DecimalSeparator is
set to the decimal separator character defined in the current Windows international
settings, but you can change its value at run time if necessary.
You can also use the calculator by typing the desired keystrokes on the keyboard. Most of
the calculator functions can be performed using the numeric keypad (or the equivalent
keys on the typewriter keyboard). For functions that are not on the numeric keypad,
keystroke equivalents are defined. The following table lists the keystroke equivalents for
the calculator buttons. These keystroke equivalents are compatible with the standard
Windows calculator (CALC.EXE).

Calculator button Keystroke


0-9 0-9
* *
/ /
- -
+ +
= <Enter>
% %
. . or ,
Copy <CtrlC>
Paste <CtrlV>
MC (memory clear) <CtrlL>
MR (memory <CtrlR>
recall)
MS (memory store) <CtrlM>
M+ (memory add) <CtrlP>
M- (memory <CtrlS>
subtract)
Back <Backspace
>
CE (clear entry) <Del>
C (clear) <Esc>
Sqrt (square <@>
root)
1/x (inverse) <R>
+/- (change sign) <F9>

If you don’t need the memory functions on your calculator, set the
ShowMemoryButtons property to false. The calculator is then displayed without the
memory buttons:

22 Chapter 2: Calculator
You can customize the colors used in the calculator to your needs. You can set any of the
colors individually to the desired color, or you can choose a color scheme for all of the
calculator colors. A color scheme is a pre-defined set of coordinated colors.

23
TEsCalculator Component
The TEsCalculator component is derived from the TEsBase class and inherits its
properties, events, and methods. For descriptions of the inherited properties, see
“TEsBase Class” on page 94.

Example
This example uses a calculator and displays the result of calculations in a label.
Create a new project, add components, and set the property values as indicated in the
following table:

Component Property
Property Value
TEsCalculato
r
TLabel Caption 'Result:'
TLabel Caption '0'

Position the two TLabels, side-by-side, under the calculator. Click on the TEsCalculator
to select it. Double-click on the OnButtonPressed event in the Events tab of the Object
Inspector to add the following event handler:
procedure TForm1.EsCalculator1ButtonPressed(Sender : TObject;
Button :
TEsCalculatorButton);
begin
if Button = ccEqual then
Label2.Caption := FloatToStr(EsCalculator1.Value);
end;

Compile and run the project. It will look something like this:

24 Chapter 2: Calculator
When you use the calculator, the result of your calculation is displayed in the label each
time you press the = button.
This example is in the EXCALC project in the \ESSENCE\EXAMPLES\DELPHI
directory.

Hierarchy
TCustomControl
(VCL)

TEsBase
(EsBase)

TEsCustomCalculator
(EsCalc)

TEsCalculator
(EsCalc)

Properties
# Colors # ShowMemoryButtons Version
EsLabelInfo # Text !
# Memory ! # Value !

Events
# OnButtonPressed

EsCalc TEsCalculator Component 25


Methods
# CopyToClipboard
# PasteFromClipboard
# PressButton

26 Chapter 2: Calculator
Reference Section
Colors property
property Colors : TEsCalcColors

$ Colors determines the colors used in the calculator.


Colors is a TEsCalcColors class that allows you to set all of the calculator colors. The
properties of TEsCalcColors are used to set colors for the DisabledMemoryButtons,
Display, DisplayText, EditButtons, FunctionButtons, MemoryButtons,
NumberButtons, and OperatorButtons. You can set any of these properties individually
to the desired color.
Alternatively, you can choose a color scheme for all of the calculator colors. A color
scheme is a pre-defined set of coordinated colors that you choose by setting the
ColorScheme property of the TEsCalcColors class.
See “TEsCalcColors Class” on page 98 for more information about the calculator colors.

CopyToClipboard method
procedure CopyToClipboard;

$ CopyToClipboard copies the value in the calculator display to the Windows clipboard.
The keyboard equivalent for this method is <CtrlC>.
See also: PasteFromClipboard

Memory run-time property


property Memory : Double

$ Memory contains the value of the calculator’s memory register.


If you assign a value to Memory, the contents of the memory register are changed to that
value.

EsCalc TEsCalculator Component 27


OnButtonPressed event
property OnButtonPressed: TButtonPressedEvent
TButtonPressedEvent = procedure(Sender : TObject;
Button : TEsCalculatorButton) of
object;
TEsCalculatorButton = (ccNone, ccBack, ccClearEntry, ccClear, ccAdd,
ccSub,
ccMul, ccDiv, cc0, cc1, cc2, cc3, cc4, cc5,
cc6, cc7,
cc8, cc9, ccDecimal, ccEqual, ccInvert,
ccChangeSign,
ccPercent, ccSqrt, ccMemClear, ccMemRecall,
ccMemStore,
ccMemAdd, ccMemSub);

$ OnButtonPressed defines an event handler that is called when a calculator button is


pressed.
Sender is the instance of the calculator. Button is the button that was pressed.
For example, OnButtonPressed could be used to detect when the ccEqual button is
pressed so that the result of the calculation can be retrieved for use elsewhere in the
application. The example on page 24 uses the OnButtonPressed event.

PasteFromClipboard method
procedure PasteFromClipboard;

$ PasteFromClipboard copies the contents of the Windows clipboard to the calculator.


Data in the clipboard is applied to the calculator just as if it were entered using the mouse
or the keyboard. Invalid characters are ignored.
The keyboard equivalent for this method is <CtrlV>.
See also: CopyToClipboard

PressButton method
procedure PressButton (Button : TEsCalculatorButton);
TEsCalculatorButton = (ccNone, ccBack, ccClearEntry, ccClear, ccAdd,
ccSub,
ccMul, ccDiv, cc0, cc1, cc2, cc3, cc4, cc5,
cc6, cc7,
cc8, cc9, ccDecimal, ccEqual, ccInvert,
ccChangeSign,
ccPercent, ccSqrt, ccMemClear, ccMemRecall,
ccMemStore,
ccMemAdd, ccMemSub);

$ PressButton causes a button on the calculator to be pressed.


The button specified by Button is pressed on the calculator.

28 Chapter 2: Calculator
ShowMemoryButtons property
property ShowMemoryButtons: Boolean

Default: true
$ ShowMemoryButtons determines whether the memory buttons are on the calculator.
If ShowMemoryButtons is true, the memory buttons are displayed. If it is false, the
memory buttons are hidden. The calculator is automatically adjusted as necessary.

Text run-time property


property Text : string

$ Text represents the contents of the calculator display.


Assigning a value to Text is similar to pasting from the Windows clipboard. Characters
are entered into the calculator just as if they were entered using the mouse or the
keyboard.
See also: PasteFromClipboard

Value run-time read-only property


property Value : Double

$ Value is the current value in the calculator’s display.

EsCalc TEsCalculator Component 29


Chapter 3: Calendar
The Essentials calendar displays one month at a time and allows you to select any date
supported by the Delphi TDateTime data type.

To add a calendar to your form, use the icon on the Essentials tab to drop on a
calendar component. It looks like this:

The selected day is indicated by a 3D box around it. The arrow buttons at the top of the
calendar are used to select the previous or next month. The button at the bottom right
returns the calendar to today’s date.
The size of the calendar is fully adjustable. The contents of the calendar (e.g., day names,
buttons, date) are automatically resized and repositioned. It is possible to make the
calendar too small for the buttons and text to fit. If this happens, try using a smaller font.
The date at the top of the calendar is displayed using the month names defined in the
current Windows international settings. The day names are displayed using Delphi’s
ShortDayNames array (defined in the SysUtils unit).
You can customize the colors used in the calendar to your needs. You can set any of the
colors individually to the desired color, or you can choose a color scheme for all of the
calendar colors. A color scheme is a pre-defined set of coordinated colors.
You can change years using <CtrlPgUp> and <CtrlPgDn>. The following table lists all
of the keystrokes accepted by the calendar.

31
Keystroke
Keystroke Function
<Right> Select the next day. If the currently selected day
is the last day of the month, the first day of the
next month is selected.

<Left> Select the previous day. If the currently selected


day is the first day of the month, the last day of
the previous month is selected.

<Up> Move back one week. The same week day is selected
in the previous week.

<Down> Move ahead one week. The same week day is selected
in the next week.

<Home> Select the first day of the month.

<End> Select the last day of the month.

<PgUp> Move back one month. The same day is selected in


the previous month. If the selected day is invalid
for the previous month, the last day of the month
is selected.

<PgDn> Move ahead one month. The same day is selected in


the next month. If the selected day is invalid for
the next month, the last day of the month is
selected.

<CtrlPgUp Move back one year. The same day and month are
> selected in the previous year. If the selected day
is invalid for the month in the previous year, the
last day of the month is selected.

<CtrlPgDn Move ahead one year. The same day and month are
> selected in the next year. If the selected day is
invalid for the month in the next year, the last
day of the month is selected.

<CtrlZ> Select today's date as indicated by the system


or clock.
<AltBkSp>

<Enter> The popup window is closed and the selected date is


or returned.
<Space>

<Esc> The popup window is closed and the selected date is


ignored.

32 Chapter 3: Calendar
TEsCalendar Component
The TEsCalendar component is derived from the TEsBase class and inherits its
properties, events, and methods. For descriptions of the inherited properties, see
“TEsBase Class” on page 94.

Example
This example uses a calendar and displays the long format of the selected date in a label.
Create a new project, add components, and set the property values as indicated in the
following table:

Component Property Value


TEsCalendar
TLabel Caption 'Date:'
TLabel

Move the two TLabels, side-by-side, under the calendar. Click on the TEsCalendar to
select it. Double-click on the OnChange event in the Events tab of the Object Inspector
to add the following event handler:
procedure TForm1.EsCalendar1Change(Sender : TObject; Date :
TDateTime);
begin
Label2.Caption := FormatDateTime(LongDateFormat,
EsCalendar1.Date);
end;

Compile and run the project. It will look something like this:

EsCal TEsCalendar Component 33


Each time a date is selected, it is displayed in the label.
This example is in the EXCAL project in the \ESSENCE\EXAMPLES\DELPHI
directory.

Hierarchy
TCustomControl
(VCL)

TEsBase
(EsBase)

TEsCustomCalendar
(EsCal)

TEsCalendar
(EsCal)

Properties
# Colors EsLabelInfo Version
# DayNameWidth # ShowDate # WeekStarts
# Date ! # ShowInactive
# DateFormat # ShowToday

Events
# OnChange

34 Chapter 3: Calendar
Reference Section
Colors property
property Colors : TEsCalColors

$ Colors determines the colors used in the calendar.


Colors is a TEsCalColors class that allows you to set all of the calendar colors. The
properties of TEsCalColors are used to set colors for the ActiveDay, DayNames, Days,
InactiveDays, MonthAndYear, and Weekend. You can set any of these properties
individually to the desired color.
Alternatively, you can choose a color scheme for all of the calendar colors. A color
scheme is a pre-defined set of coordinated colors that you choose by setting the
ColorScheme property of the TEsCalColors class.
See “TEsCalColors Class” on page 101 for more information about the calendar colors.

Date run-time property


property Date : TDateTime

$ Date is the currently selected date.


If you assign a value to this property, the calendar displays the new date.

DateFormat property
property DateFormat : TEsDateFormat
TEsDateFormat = (dfShort, dfLong);

Default: dfLong
$ DateFormat is the format used to display the month and year at the top of the calendar.
The Delphi Format() routine is used to format the displayed date. If DateFormat is
dfLong, the full month name is displayed using the mask ‘mmmm yyyy’. If DateFormat
is dfShort, the short month name is displayed using the mask ‘mmm yyyy’.

DayNameWidth property
property DayNameWidth : TEsDayNameWidth
TEsDayNameWidth = 1..3;

Default: 3
$ DayNameWidth is the number of characters used to display the names of the days of the
week.

EsCal TEsCalendar Component 35


OnChange event
property OnChange : TDateChangeEvent
TDateChangeEvent = procedure(Sender : TObject; Date : TDateTime) of
object;

$ OnChange defines an event handler that is called when a new date is selected.
OnChange is called when the mouse is clicked on a date or <Enter> or <Space> is
pressed. You could use OnChange detect when a date is selected, retrieve the selected
date, and use it elsewhere in your application.

ShowDate property
property ShowDate : Boolean

Default: true
$ ShowDate determines whether the month and year are displayed at the top of the
calendar.

ShowInactive property
property ShowInactive : Boolean

Default: false
$ ShowInactive determines whether portions of the previous and next months are shown.
If ShowInactive is true, the calendar looks like this:

If you click on a day in the previous or next month, that month is displayed with the day
selected.

36 Chapter 3: Calendar
ShowToday property
property ShowToday: Boolean

Default: true
$ ShowToday determines whether the button used to return to today’s date is displayed.
If ShowToday is true (the default), a button that returns the calendar to today’s date is
displayed at the bottom right of the calendar.

WeekStarts property
property WeekStarts : TEsDayType
TEsDayType = (dtSunday, dtMonday, dtTuesday, dtWednesday, dtThursday,
dtFriday,
dtSaturday);

Default: dtSunday
$ WeekStarts determines which day of the week is displayed in the left column of the
calendar.

EsCal TEsCalendar Component 37


38 Chapter 3: Calendar
Chapter 4: Color Combo Box
The Essentials color combo box allows you to select a color from a drop-down list of
color names and samples. It is a descendant of the standard Delphi combo box that
displays the sixteen basic colors. The available colors are the same as the ones in the
Object Inspector’s drop-down list of colors for the Color property.

To add a color combo box to your form, use the icon on the Essentials tab to drop
on a color combo box component. It looks like this:

When you click on the button, the available colors are displayed:

You can customize the color combo box to your needs. You can choose which color to
display at the top using the SelectedColor property. If you don’t want the color names
displayed, you can use the ShowColorNames property to turn off that feature. The
names used for the colors can be modified to support other languages.

39
TEsColorComboBox Component
The TEsColorComboBox component is derived from Delphi’s TCustomComboBox
and inherits its properties, events, and methods. For descriptions of the inherited
properties, see the Delphi documentation.
If you need to change the names used for the colors in the color combo box (most likely
for international support), you must edit the strings in the ESCONST.RC resource file.
The following is the portion of the ESCONST.RC file that contains the color names:
SCColorBlack, "Black\0"
SCColorMaroon, "Maroon\0"
SCColorGreen, "Green\0"
SCColorOlive, "Olive\0"
SCColorNavy, "Navy\0"
SCColorPurple, "Purple\0"
SCColorTeal, "Teal\0"
SCColorGray, "Gray\0"
SCColorSilver, "Silver\0"
SCColorRed, "Red\0"
SCColorLime, "Lime\0"
SCColorYellow, "Yellow\0"
SCColorBlue, "Blue\0"
SCColorFuchsia, "Fuchsia\0"
SCColorAqua, "Aqua\0"
SCColorWhite, "White\0"

The names of the colors must be followed by “\0”, which indicates the end of the string.
Edit the color names as desired. Then use the supplied make file (ESSENCE.MAK) to
rebuild the resource file. Alternatively, you can use Delphi’s BRCC.EXE or
BRCC32.EXE program to compile this single resource file only.

Example
This example uses a color combo box to select a color. The background color of a label is
changed to the selected color.
Create a new project, add components, and set the property values as indicated in the
following table:

Component Property Value


TEsColorComboB
ox
TLabel Caption 'Selected
color:'
TLabel

40 Chapter 4: Color Combo Box


Click on the TEsColorComboBox to select it. Double-click on the OnChange event in
the Events tab of the Object Inspector to add the following event handler:
procedure TForm1.EsColorComboBox1Change(Sender : TObject);
begin
Label2.Color := EsColorComboBox1.SelectedColor;
end;

Compile and run the project. It should look something like this:

When you select a color, the label is displayed in the new color.
This example is in the EXCCBX project in the \ESSENCE\EXAMPLES\DELPHI
directory.

Hierarchy
TCustomComboBox
(VCL)

TEsCustomColorComboBox
(EsClrCBx)

TEsColorComboBox
(EsClrCBx)

Properties
# EsLabelInfo
# SelectedColor
# ShowColorNames
# Version

EsClrCBx TEsColorComboBox Component 41


Reference Section
EsLabelInfo property
property EsLabelInfo : TEsLabelInfo

$ EsLabelInfo is the status of the color combo box’s attached label.


EsLabelInfo groups the properties that determine whether the attached label is visible
and where it is positioned. See “TEsLabelInfo Class” on page 96 for more information.

SelectedColor property
property SelectedColor : TColor

$ SelectedColor is the color that is selected in the combo box.


If you assign a TColor value to SelectedColor, the corresponding entry in the list is
selected. If the specified TColor is not in the color combo box list, the assignment is
ignored and the current selection is unchanged.

ShowColorNames property
property ShowColorNames : Boolean

Default: true
$ ShowColorNames determines whether the names of the colors are displayed to the left of
the colors in the color combo box.

Version read-only property


property Version : string

$ Version is the current version of Essentials.


Version is provided so you can identify your Essentials version if you need technical
support.

42 Chapter 4: Color Combo Box


Chapter 5: Date Edit
The Essentials date edit component provides hassle-free date display and entry. It
automatically uses the display format in the Window’s international settings, so you
don’t have to worry about ensuring consistency in the date format. But even more
importantly, date entry is simplified. The user no longer has to try to remember and use
an arbitrary designation for the date (numbers or letters? separator or not? what is the
separator?). The date edit component allows users to enter the date in almost any format
that is logical to them. This puts the burden of formatting the date on the control, where
it belongs, not on the user.

To add a date edit to your form, use the icon on the Essentials tab to drop on a date
edit component. It looks something like this:

Probably the easiest way to enter the date is to use the button on the right to display a
popup calendar:

You can use the calendar to find the desired date visually and then just click on it. For
more information on using the popup calendar, see “Chapter 3: Calendar” on page 31.

43
Of course, you can always just type the date on the keyboard instead of using the popup
calendar. The basic format for an entered date must conform to the order of month, day,
and year specified in the current Windows international settings. Whether you enter 12,
or a partial month name does not matter. Neither does the character used to separate the
day, month, and year.
You can optionally allow entry of partial dates (see the RequiredFields property). This
allows the user to leave one or more of the day, month, and year blank during entry. The
date edit component fills in the missing parts using the current day, month, and year.
The following table shows some sample entries and the values displayed by the date edit
component. For these examples, the current Windows date format is assumed to be
‘M/d/yyyy’ and the current date is assumed to be June 17, 1997.

If you enter: The displayed value is:


jan 5 95 1/5/1995
2.2.72 2/2/1972
nov 13 11/13/1997 (current year assumed)
/ 6/17/1997 (current date assumed)
may 5/17/1997 (current day and year
assumed)

You can customize the colors used in the calendar to your needs. You can set any of the
colors individually to the desired color, or you can choose a color scheme for all of the
calendar colors. A color scheme is a pre-defined set of coordinated colors.

44 Chapter 5: Date Edit


TEsDateEdit Component
The TEsDateEdit component is derived from the TEsEdPopup class and inherits its
properties, events, and methods. For descriptions of the inherited properties, see
“TEsEdPopup Class” on page 104.

Example
This example uses a date edit field and displays the long format of the entered date in a
label.
Create a new project, add components, and set the property values as indicated in the
following table:

Component Property Value


TEsDateEdit
TLabel Caption 'Date:'
TLabel
TButton Caption 'OK'

Position the two TLabels, side-by-side, beside the date edit. Click on the TEsDateEdit to
select it. Double-click on the OnExit event in the Events tab of the Object Inspector to
add the following event handler:
procedure TForm1.EsDateEdit1Exit(Sender : TObject);
begin
Label2.Caption := FormatDateTime(LongDateFormat,
EsDateEdit1.Date);
end;

Compile and run the project. It should look something like this:

Click on the down arrow on the right side of the date edit to see the drop-down calendar.
Select a date. For the OnExit event to fire, the date edit field must lose the focus. Pressing
Tab or clicking on the button accomplishes this. The button is there simply so that the
focus has somewhere to go.

EsEdCal TEsDateEdit Component 45


This example is in the EXDATE project in the \ESSENCE\EXAMPLES\DELPHI
directory.

Hierarchy
TCustomEdit
(VCL)

TEsEdPopup
(EsEdPop)

TEsCustomDateEdit
(EsEdCal)

TEsDateEdit
(EsEdCal)

Properties
# AllowIncDec # PopupCalFont ShowButton
# Date ! # PopupCalHeight # TodayString
EsLabelInfo # PopupCalWidth Version
# PopupCalColors # RequiredFields

Events
# OnGetDate # OnSetDate

Methods
# FormatDate

46 Chapter 5: Date Edit


Reference Section
AllowIncDec property
property AllowIncDec : Boolean

Default: true
$ AllowIncDec determines whether the date can be incremented and decremented using
the + and - keys.
If AllowIncDec is true and you press the + or – key, the date is incremented or
decremented by one day. The + and - keys are not active while the popup calendar is
active.

Date run-time property


property Date : TDateTime

$ Date is the date value in the date edit field.


If you assign a value to Date, the date edit displays the new date using the Delphi short
date format. Delphi determines the short date picture mask at program startup by
inspecting the current Windows international settings

FormatDate virtual method


function FormatDate(Value : TDateTime) : string;

$ FormatDate formats a date value.


FormatDate converts Value into a string using the Delphi short date format.

OnGetDate event
property OnGetDate : TEsGetDateEvent
TEsGetDateEvent = procedure(Sender : TObject; var Value : string) of
object;

$ OnGetDate defines an event handler that is called when the string version of the date is
converted into a TDateTime value.
Value must be a valid date. OnGetDate is called when the edit field loses the focus and
when the date is retrieved using the Date property.
OnGetDate could be used to provide a simple form of input correction. You could verify
the entered string in your event handler and, if necessary, return the corrected version of
the date in Value.
See also: Date

EsEdCal TEsDateEdit Component 47


OnSetDate event
property OnSetDate : TNotifyEvent

$ OnSetDate defines an event handler that is called when a date is assigned to the Date
property.
OnSetDate could be used to detect when a new date is entered so you can use the new
value in your application.

PopupCalColors property
property PopupCalColors : TEsCalColors

$ PopupCalColors determines the colors used in the popup calendar.


PopupCalColors is a TEsCalColors class that allows you to set all of the popup calendar
colors. The properties of TEsCalColors are used to set colors for the ActiveDay,
DayNames, Days, InactiveDays, MonthAndYear, and Weekend. You can set any of these
properties individually to the desired color.
Alternatively, you can choose a color scheme for all of the popup calendar colors. A color
scheme is a pre-defined set of coordinated colors that you choose by setting the
ColorScheme property of the TEsCalColors class.
See “TEsCalColors Class” on page 101 for more information about the popup calendar
colors.

PopupCalFont property
property PopupCalFont : TFont

$ PopupCalFont is the font used in the popup calendar.

PopupCalHeight property
property PopupCalHeight : Integer

Default: 140
$ PopupCalHeight is the height of the popup calendar.
You can resize the calendar to almost any size. The contents of the calendar (e.g., day
names, buttons, date) are automatically resized and repositioned to accommodate the
new size. It is possible to make the calendar too small for the buttons and text to fit. If this
happens, try using a smaller font (using PopupCalFont).
See also: PopupCalFont

48 Chapter 5: Date Edit


PopupCalWidth property
property PopupCalWidth : Integer

Default: 200
$ PopupCalWidth is the width of the popup calendar.
You can resize the calendar to almost any size. The contents of the calendar (e.g., day
names, buttons, date) are automatically resized and repositioned to accommodate the
new size. It is possible to make the calendar too small for the buttons and text to fit. If this
happens, try using a smaller font (using PopupCalFont).
See also: PopupCalFont

RequiredFields property
property RequiredFields : TEsRequiredFields
TEsRequiredFields = set of TEsRequiredField;
TEsRequiredField = (rfYear, rfMonth, rfDay);

Default: [rfMonth, rfDay]


$ RequiredFields determines which date fields (if any) must be entered.
If a field is required and it is left blank, an invalid date exception is raised. For example, if
the current date order defined in the Windows international settings is month, day, year
and Required fields is set to [rfMonth, rfYear], the user can enter just the month and year
and the current day is assumed. If the user enters only the month, an exception is raised
because the year is required.

TodayString property
property TodayString : string

Default: DateSeparator
$ TodayString is a string used to indicate today’s date.
If you enter the string specified by TodayString into the edit field, today’s date is inserted
when the field is exited. By default, TodayString is the same value as Delphi’s
DateSeparator variable (defined in the SysUtils unit).

EsEdCal TEsDateEdit Component 49


TEsDbDateEdit Component
The TEsDbDateEdit component is the data-aware version of the TEsDateEdit. This
means that the TEsDbDateEdit can be connected to a data source and edit the contents
of date fields in the data source.
TEsDbDateEdit is a direct descendant of the TEsCustomDateEdit class and inherits all of
its properties, events, and methods. For descriptions of the properties, events, and
methods, see “TEsDateEdit Component” on page 45.

Example
This example shows how to use a TEsDbDateEdit component. It is basically the same as
using a TEsDateEdit except that the DataSource and DataField properties must be set.
Create a new project, add components, and set the property values as indicated in the
following table:

Component Property Value


TTable DatabaseNa "DBDEMOS"
me
TableName "CUSTOMER.DBF
"
Active true
TDataSource DataSet Table1

TDBNavigator DataSource DataSource1

TEsDbDateEdi DataSource DataSource1


t
DataField LastInvoiceDa
te

Compile and run the project. It will look something like this:

The last invoice date for the current record is displayed and can be edited using a
convenient drop-down calendar.

50 Chapter 5: Date Edit


This example is in the EXDBDT project in the \ESSENCE\EXAMPLES\DELPHI
directory.

Hierarchy
TCustomEdit
(VCL)

TEsEdPopup
(EsEdPop)

TEsCustomDateEdit
(EsEdCal)

TEsDbDateEdit
(EsDbEd)

Properties
AllowIncDec
# DataField
# DataSource
Date !
EsLabelInfo
# Field !
PopupCalColors
PopupCalFont
PopupCalHeight
PopupCalWidth
RequiredFields
ShowButton
TodayString
Version

EsDbEd TEsDbDateEdit Component 51


Reference Section
DataField property
property DataField : string

$ DataField identifies the field (in the data source component) from which the date edit
field component displays data.

DataSource property
property DataSource : TDataSource

$ DataSource specifies the data source component where the date edit field obtains the
data to display.

Field run-time read-only property


property Field : TField

$ Field returns the TField object to which the date edit field component is linked.
Use the Field object to change the value of the data in the field programmatically. For
example, to set the value of a string field to ‘NEW TEXT’, you could use:
EsDbDateEdit1.Field.AsString := 'NEW TEXT';

52 Chapter 5: Date Edit


Chapter 6: Gradient
The Essentials gradient component displays a rectangle with a color pattern that blends
from one color to another. You can select the starting and ending color and the number
of colors that are used to do the blending.

To add a gradient to your form, use the icon on the Essentials tab to drop on a
gradient component. You can specify one of two directions for a gradient. It can be
horizontal:

or vertical:
The quality of the gradient depends on the number of color bands (2 to 255) drawn
between the starting and ending colors and on the color resolution of the computer. The
more colors that are available, the better the quality.
Although quality increases as the number of color bands increases, painting speed also
increases. Choosing fewer color bands gives faster painting times.
Displaying a gradient as the background of an MDI client form involves a little more than
simply dropping the component on the form and setting a couple of properties. The
EXMDI example project in the \ESSENCE\EXAMPLES\DELPHI directory
demonstrates how to display a gradient on an MDI client form.

53
TEsGradient Component
The TEsGradient component is derived from Delphi’s TGraphicControl and inherits its
properties, events, and methods. For descriptions of the inherited properties, events, and
methods, see the Delphi documentation.

Example
This example shows how to use a gradient as a backdrop for a form.
Create a new project, add components, and set the property values as indicated in the
following table:

Component Property Value


TEsGradient FromColor clBlack
ToColor clWhite
Direction dVertical
Align alClient
TEdit
TButton Caption 'OK'

The resulting program will look something like this:

The TEsGradient can produce very attractive backgrounds for those special forms that
you need to draw attention to.
This example is in the EXGRAD project in the \ESSENCE\EXAMPLES\DELPHI
directory.

54 Chapter 6: Gradient
Hierarchy
TGraphicControl
(VCL)

TEsCustomGradient
(EsGrad)

TEsGradient
(EsGrad)

Properties
# ColorBands
# Direction
# FromColor
# ToColor
# Version

EsGrad TEsGradient Component 55


Reference Section
ColorBands property
property ColorBands : TEsColorBand
TEsColorBand = MinColorBands..MaxColorBands;

Default: 128
$ ColorBands determines the number of color bands that are painted between the starting
and ending colors.
The valid range for ColorBands is 2 to 255. A greater number of color bands usually
produces better quality. However, as the number of color bands increases, painting
speed also increases. Choosing fewer color bands gives faster painting times.

Direction property
property Direction : TGradDirection
TGradDirection = (dHorizontal, dVertical);

Default: dHorizontal
$ Direction determines whether the gradient is horizontal (drawn from top to bottom) or
vertical (drawn from left to right).

FromColor property
property FromColor : TColor

Default: clBlue
$ FromColor is the starting color for the gradient.

ToColor property
property ToColor : TColor

Default: clRed
$ ToColor is the ending color for the gradient.

Version read-only property


property Version : string

$ Version is the current version of Essentials.


Version is provided so you can identify your Essentials version if you need technical
support.

56 Chapter 6: Gradient
Chapter 7: Label
The Essentials label lets you create eye-catching captions for your applications. It
expands on the Delphi TLabel with special shading, color, and highlight capabilities.

To add a label to your form, use the icon on the Essentials tab to drop on a label
component. Here are some example labels:

57
The Essentials label provides several different appearances and color schemes that you
can use for labels. You can just choose one of the pre-defined values for the Appearance
and ColorScheme properties.
If none of the pre-defined appearances or color schemes are just right for your
application, you can change them or even create your own unique style. There are three
parts of the label text that you can control: the characters, the highlight, and the shadow.
This is illustrated in the diagram below:

This character is dark gray, with a white highlight and a black shadow. You can set the
color for each of the three parts. The highlight and shadow can be placed in any of eight
positions around the text and be placed at virtually any distance (in pixels) from the text.
You can use a gradient method (a gradual change from one color to another) to paint the
text, shadow, or highlight. This character has a gradient highlight (the highlight color is
blended into the text color):

The highlight and shadow can be drawn using a color extrusion method (the character is
drawn repeatedly, each time in a slightly different position). This character has a color
extrusion highlight:

58 Chapter 7: Label
The possible combinations of colors and appearances give you an almost endless number
of looks for your labels.
It is easy to experiment with the size, color, and look of the font, highlight, and shadow
using the TEsLabel property editor. Right click on the TEsLabel and choose ‘Style
Manager’ or double-click on the CustomSettings property.

The ‘Text Gradient Style’ radio buttons allow you to choose a horizontal or vertical
gradient for the text (or no gradient). If you do not use a gradient, the text color is set in
the ‘Text Color/Gradient To Color’ combo box. If you choose a gradient, the “from”
color is set in the ‘Gradient Color’ combo box and the “to” color is set in the ‘Text
Color/Gradient To Color’ combo box.
The ‘Highlight Style’ radio buttons allow you to choose the drawing method for the
highlight. You can choose a plain highlight or use the color extrusion method or the
gradient method to draw the highlight. If you use a plain highlight or the extrusion
method, the highlight color is set in the ‘Highlight Color’ combo box. If you use a

59
gradient method, the “from” color is set in the ‘Highlight Color’ combo box and the “to”
color is set in the ‘Text Color/Gradient To Color’ combo box.
The ‘Shadow Style’ radio buttons allow you to choose the drawing method for the
shadow. You can choose a plain shadow or use the color extrusion method or the
gradient method to draw the shadow. If you use a plain shadow or the extrusion method,
the shadow color is set in the ‘Shadow Color’ combo box. If you use a gradient method,
the “from” color is set in the ‘Shadow Color’ combo box and the “to” color is set in the
‘Text Color/Gradient To Color’ combo box.
If you use a gradient method for the text, highlight or shadow, for the best results your
graphics system should be set to more than 256 colors.
The ‘Highlight Direction’ color wheel allows you to choose the direction (with respect to
the text) in which the highlight is painted. If you choose the button in the middle of the
wheel, no highlight is displayed.
The ‘Shadow Direction’ color wheel allows you to choose the direction (with respect to
the text) in which the shadow is painted. If you choose the button in the middle of the
wheel, no shadow is displayed.
The font size, highlight depth, and shadow depth are set using the scroll bars at the
bottom of the dialog. The range for the font size is zero to 100. A font size of zero just
displays a small black dot. The range for highlight depth and shadow depth is zero to 50.
A highlight depth of zero means no highlight. A shadow depth of 0 means no shadow.
As you make changes in the Style Manager, the label at the top displays the result. Once
you find a set of properties that produce the desired effect, you can save them as a style
for use again and again. Just press the ‘Save As…’ button and enter a name for the style.
The ‘Appearance’ combo box allows you to select a “look” for the text, highlight, and
shadow. This allows you to start from any of the pre-defined “looks” (see the Appearance
property) and modify it to fit your needs.
The ‘Color Scheme’ combo box allows you to select a color scheme for the text,
highlight, and shadow. This allows you to start from any of the pre-defined color
schemes (see the ColorScheme property) and modify it to fit your needs.

60 Chapter 7: Label
TEsLabel Component
The TEsLabel component is derived from Delphi’s TCustomLabel and inherits its
properties, events, and methods. For descriptions of the inherited properties, events, and
methods, see the Delphi documentation.
The attached label capability supplied by the TEsBase Class creates a special descendant
of the TEsLabel to display as an associated label. This means that the labels you associate
with other Essential controls can have all of the TEsLabel special looks. For more
information, see “TEsBase Class” on page 94.

Example
This example creates a label similar to the last one shown on page 57.
Drop a TEsLabel component on the form and change the Caption to ‘Many Shadow and
Highlight Styles’. Right click on the TEsLabel component and choose the Style Manager.
Set the following values:

Name Value
Shadow Style Graduate
Highlight Color Yellow
Shadow Color Silver
Text Color/Gradient To Purple
Color
Highlight Direction upper/lef
t
Shadow Direction upper/lef
t
Font Size 28
Highlight Depth 1
Shadow Depth 20

By setting the shadow color to the same color as the background (this example assumes
the form color is Silver, which is the default), the shadow appears to emerge from the
background.
If this is a label style you would like to use again, you probably won’t want to go through
all those steps again. That’s why Essentials provides a way to save the current settings as a
“scheme.” Select the ‘Save As …’ button from the Style Manager dialog and enter a name
for the scheme. Later, you can select this name from the Scheme combo box and all of the
settings you just made are applied automatically.

EsLabel TEsLabel Component 61


Hierarchy
TCustomLabel
(VCL)

TEsCustomLabel
(EsLabel)

TEsLabel
(EsLabel)

Properties
# Appearance
# ColorScheme
# CustomSettings
# Version
# WordWrap

62 Chapter 7: Label
Reference Section
Appearance property
property Appearance : TEsAppearance
TEsAppearance = (apNone, apCustom, apFlying, apRaised, apSunken,
apShadow);

Default: apRaised
$ Appearance determines the “look” of the text in the label.
The “look” of the text includes the position and size of the highlight and shadow as well
as the method used to draw them. The possible values for Appearance include some
common styles of text:
apNone The text is basically the same as in a standard TLabel
component.

apFlying The text has a shadow below it to simulate the shadow


under a hovering object.

apRaised The text has a raised 3-D look.

apSunken The text appears to be beneath the drawing surface.

apShadow The text appears to be slightly above the drawing


surface and thus produces a small shadow.

apCustom The text has a user-defined appearance.

Appearance is automatically set to apCustom when any of the CustomSettings values are
changed. You can use the CustomSettings property to create many other styles.
See also: CustomSettings

ColorScheme property
property ColorScheme : TEsColorScheme
TEsColorScheme = (csCustom, csText, csWindows, csEmbossed, csGold,
csSteel);

Default: csWindows
$ ColorScheme is the color scheme for the label.
You can use ColorScheme to set the label colors to a pre-defined set of coordinated
colors. If none of the pre-defined color schemes fits your needs, you can use the
CustomSettings property to create you own color scheme.
See also: CustomSettings

EsLabel TEsLabel Component 63


CustomSettings property
property CustomSettings : TEsCustomSettings

$ CustomSettings determines size, color, and look of the font, highlight, and shadows.
The property editor (described on page 59) makes it easy to experiment with all of the
settings that determine how the text in the label looks. As you make changes in the
property editor, a sample text shows you how it looks. The property editor also allows
you to save the settings as a named style for later use.
See “TEsCustomSettings Class” on page 106 for more information about the custom
settings.

Version read-only property


property Version : string

$ Version is the current version of Essentials.


Version is provided so you can identify your Essentials version if you need technical
support.

WordWrap property
property WordWrap : Boolean

Default: true
$ WordWrap determines whether words that extend past the right edge of the label are
wrapped to the next line.
If WordWrap is false and the text exceeds the width of the component, the text that
extends past the edge of the component is not shown.

64 Chapter 7: Label
Chapter 8: Scrolling Marquee
The Essentials scrolling marquee is a direct descendant of the TEsLabel and provides all
of the functionality of the TEsLabel, plus the ability to scroll the associated text. You can
make the text scroll once, or scroll repeatedly in a circular manner, or bounce back and
forth between the ends of the label. You can also control the speed and direction of the
scrolling. If you need to draw attention to something, the scrolling marquee can do it for
you.
Since the scrolling marquee uses several internal bitmaps and a multimedia timer, you
should use these components sparingly in 16-bit programs where systems resources are
scarce.

To add a scrolling marquee to your form, use the icon on the Essentials tab to drop
on a scrolling marquee component. To see a scrolling marquee, follow the steps in the
example on page 66.

65
TEsScrollingMarquee
TEsScrollingMarquee is a direct descendant of the TEsLabel and inherits all its
properties, events, and methods. For descriptions of the inherited properties, see
“TEsLabel Component” on page 61.

Example
This example demonstrates some of the features of the scrolling marquee.
Drop a TEsScrollingMarquee on a form. Set the Width property to 250 so you can see the
entire text of the label. Set the Active property to true and the label starts to scroll. It will
look something like this:

The scrolling behavior is visible at design time to make it easier for you to design your
scrolling marquee. However, you will probably want to turn off scrolling by setting
Active to false while you are working on other parts of your form.
Set the Behavior property to bhBounce to see the bouncing version of the label. Set the
Width property to 400. The speed of the scroll is also adjustable. Set the ScrollSpeed
property to 10 for the fastest scrolling. Then set it back to a more reasonable 6.
Another version of the scrolling marquee lets the text bounce up and down within the
label. Set the ScrollDirection property to sdTopToBottom to see this behavior. Set the
Height property to 150.
This example is in the EXMARQ project in the \ESSENCE\EXAMPLES\DELPHI
directory.

66 Chapter 8: Scrolling Marquee


Hierarchy
TCustomLabel
(VCL)

TEsCustomLabel
(EsLabel)

TEsCustomScrollingMarquee
(EsMarque)

TEsScrollingMarquee
(EsMarque)

Properties
# Active ColorScheme CustomSettings
Appearance # ScrollDirection Version
# Behavior # ScrollSpeed

Events
# OnCycle

EsMarque TEsScrollingMarquee 67
Reference Section
Section
Active property
property Active : Boolean

Default: false
$ Active determines whether the marquee text scrolls.
If Active is true, the text scrolls. If Active is false, the text is displayed in its normal (for a
TEsLabel) position.

Behavior property
property Behavior : TEsBehaviors
TEsBehaviors = (bhCycle, bhBounce, bhOnce);

Default: bhCycle
$ Behavior determines which action is taken when the text scrolls to one of the control’s
boundaries.
The possible values for Behavior are:
bhCycle The text scrolls repeatedly in a circular manner. For
example, if the text scrolls off the right edge of the
control, it scrolls back on to the control from the
left.

bhBounc The scroll direction changes to the opposite direction


e when the text reaches each boundary of the control.

bhOnce The first time the text is scrolled to one of the


boundaries, Active is set to false to stop the
scrolling.

See also: Active

OnCycle event
property OnCycle : TNotifyEvent

$ OnCycle defines an event handler that is called each time the text completes a scrolling
cycle.
OnCycle is called at different times, depending on the setting of the Behavior property. If
Behavior is bhCycle, OnCycle is called when the text is about to return to its original
starting position. If Behavior is bhBounce, OnCycle is called each time the scroll
direction changes. If Behavior is bhOnce, OnCycle is called only once, when the text
reaches the opposite edge and then the Active property is set to false. Set Active to true to
cause another cycle.

68 Chapter 8: Scrolling Marquee


OnCycle can also be used as a trigger to tell you when to change the text so that you can
scroll several strings rather than just one. For example, you could create a list of strings
and each time OnCycle is fired, change to the next string in the list by assigning the new
string to the Caption property. See “Tutorial” on page 12 for an example that does this.
See also: Active, Behavior

ScrollDirection property
property ScrollDirection : TEsScrollDirection
TEsScrollDirection = (sdRightToLeft, sdLeftToRight, sdTopToBottom,
sdBottomToTop);

Default: sdRightToLeft
$ ScrollDirection determines the scrolling direction.
The possible values for ScrollDirection are:
sdRightToLe The text starts scrolling in from the right side of
ft the control and scrolls to the left.

sdLeftToRig The text starts scrolling in from the left side of


ht the control and scrolls to the right.

sdTopToBott The text starts scrolling in at the top of the


om control and scrolls to the bottom.

sdBottomToT The text starts scrolling in at the bottom of the


op control and scrolls to the top.

The position of the text is determined by the inherited Alignment property. However,
Alignment is ignored if ScrollDirection is sdRightToLeft or sdLeftToRight.

ScrollSpeed property
property ScrollSpeed: TEsScrollSpeed
TEsScrollSpeed = 0..10;

Default: 5
$ ScrollSpeed is the rate at which the text scrolls.
Valid values for ScrollSpeed are from 0 (no movement) to 10 (the fastest movement).
Faster speeds require more system time and might cause other processes (such as
painting) to slow down.
Scroll speeds are processor speed independent (i.e., a ScrollSpeed setting of 5 causes the
text to scroll at the same rate on a 25 MHz 486 as it does with a ScrollSpeed setting of 5 on
a 200 MHz Pentium).

EsMarque TEsScrollingMarquee 69
70 Chapter 8: Scrolling Marquee
Chapter 9: Menu Button
The Essentials menu button displays a drop-down menu when it is pressed (clicked). The
component looks just like a standard button except that it has a down arrow graphic.
When the button is pressed, the attached menu drops down to allow selection.

To add a menu button to your form, use the icon on the Essentials tab to drop on a
menu button component. Here is an example menu button before it is pressed:

and after:

The menu can also be displayed to the side:

71
TEsMenuButton Component
The TEsMenuButton component is derived from the TEsBase class and inherits its
properties, events, and methods. For descriptions of the inherited properties, see
“TEsBase Class” on page 94.
The menu portion of the TEsMenuButton is the same as any TPopupMenu. You place a
TPopupMenu component on the form, add menu items to it, associate events with each
menu item, and then associate the popup menu with the TEsMenuButton by assigning
the menu to the PopupMenu property.

Example
This example creates a menu similar to the one shown on page 71.
Create a new project, add components, and set the property values as indicated in the
following table:

Component Property Value


TPopupMenu
TEsMenuButto Caption 'File Menu'
n
PopupMenu PopupMenu1

Invoke the menu editor by double-clicking on the TPopupMenu component. Add


several menu items (you can use the ones shown on page 71). In an actual application,
you would associate methods with each of the menu items in the same way it is done for a
standard menu.
Run the application. When you press the menu button, the menu you created is
displayed below the menu button. It should look something like this:

72 Chapter 9: Menu Button


If you would rather have the menu displayed to the right of the menu button, change the
MenuPosition property to mpRight.
This example is in the EXMENU project in the \ESSENCE\EXAMPLES\DELPHI
directory.

Hierarchy
TCustomControl
(VCL)

TEsBase
(EsBase)

TCustomMenuButton
(EsMenuBtn)

TEsMenuButton
(EsMenuBtn)

Properties
# Caption
EsLabelInfo
# MenuPosition
# ShowGlyph
Version

EsMenuBtn TEsMenuButton Component 73


Reference Section
Caption property
property Caption : TCaption

$ Caption is the text string that is displayed on the menu button.

MenuPosition property
property MenuPosition : TEsMenuPosition
TEsMenuPosition = (mpBelow, mpRight);

$ MenuPosition determines where the popup menu is displayed.


The possible values for MenuPosition are:
mpBelow The popup menu is below the button and even with the
left side of the button.

mpRight The popup menu is at the right of the button and even
with the top of the button.

ShowGlyph property
property ShowGlyph : Boolean

Default: true
$ ShowGlyph determines whether an arrow bitmap is displayed to the right of the caption
on the menu button.
If ShowGlyph is true, a down arrow (if MenuPosition is mpBelow) or right arrow (if
MenuPosition is mpRight) is drawn to the right of the Caption on the menu button. If
ShowGlyph is false, no arrow bitmap is drawn and the Caption is in the center of the
button.
If Caption is empty, a down arrow or right arrow is drawn by itself at the center of the
control.
See also: Caption, MenuPosition

74 Chapter 9: Menu Button


Chapter 10: Number Edit
The Essentials number edit takes the display and editing of numeric data one step
further: it provides a drop-down calculator to help you calculate the number. When you
perform a calculation on the calculator, the result is inserted into the number edit’s
display.

To add a number edit to your form, use the icon on the Essentials tab to drop on a
number edit component. It looks something like this:

After the calculator is invoked using the button at the right of the number edit field, it
looks like this:

When you press the = button, the result is inserted into the number edit and the popup
calculator disappears.
You can customize the colors used in the calculator to your needs. You can set any of the
colors individually to the desired color, or you can choose a color scheme for all of the
calculator colors. A color scheme is a pre-defined set of coordinated colors.
See “Chapter 2: Calculator” on page 21 for more information on the use of the popup
calculator.

75
TEsNumberEdit Component
The TEsNumberEdit component is derived from the TEsEdPopup class and inherits its
properties, events, and methods. For descriptions of the inherited properties, see
“TEsEdPopup Class” on page 104.

Example
This example uses a number edit field and displays the entered value in a label.
Create a new project, add components, and set the property values as indicated in the
following table:

Component Property Value


TEsNumberEdi
t
TLabel Caption '0'
TButton Caption 'OK'

Position the TLabel beside the TEsNumberEdit. Click on the TEsNumberEdit to select it.
Double-click on the OnExit event in the Events tab of the Object Inspector to add the
following event handler:
procedure TForm1.EsNumberEdit1Exit(Sender : TObject);
begin
Label1.Caption := FloatToStr(EsNumberEdit1.AsFloat);
end;

Compile and run the project. It should look something like this:

Click on the down arrow on the right of the number edit to see the drop-down
calculator. Perform a calculation. For the OnExit event to fire, the number edit field must
lose the focus. Pressing Tab or clicking on the button accomplishes this. The button is
there simply so that the focus has somewhere to go.
This example is in the EXNUMED project in the \ESSENCE\EXAMPLES\DELPHI
directory.

76 Chapter 10: Number Edit


Hierarchy
TCustomEdit
(VCL)

TEsEdPopup
(EsEdPop)

TEsCustomNumberEdit
(EsEdCalc)

TEsNumberEdit
(EsEdCalc)

Properties
# AllowIncDec
# AsFloat !
# AsInteger !
# AsString !
EsLabelInfo
# PopupCalcColors
# PopupCalcFont
# PopupCalcHeight
# PopupCalcWidth
Version

EsEdCalc TEsNumberEdit Component 77


Reference Section
AllowIncDec property
property AllowIncDec : Boolean

Default: false
$ AllowIncDec determines whether the numeric edit can be incremented and
decremented using the + and - keys.
If AllowIncDec is true and you press the + or – key, the current value in the numeric edit
is incremented or decremented by one.
% Caution: If AllowIncDec is true, you cannot type a negative number in the numeric edit.
To type a negative number, you normally type the minus sign and then the number.
However, when AllowIncDec is true, the minus sign is interpreted as a decrement of the
current value and the new decremented value is displayed. Of course, you can still enter a
negative number using the popup calculator.

AsFloat run-time property


property AsFloat : Double

$ AsFloat is the value of the numeric edit field as a floating-point number.


AsFloat is used to retrieve the current value as a floating-point value. If it is not a floating-
point value, it is converted to a Double and then returned.

AsInteger run-time property


property AsInteger : LongInt

$ AsInteger is the value of the numeric edit field as an integer.


If AsInteger is used to retrieve the current value and it is not a whole number, it is
converted to an integer and then returned.

AsString run-time property


property AsString : string

$ AsString is the value of the edit field as a string.


When assigning a value to the numeric edit field using AsString, the string must represent
a valid numeric value or an exception is raised.

78 Chapter 10: Number Edit


PopupCalcColors property
property PopupCalcColors : TEsCalcColors

$ PopupCalcColors determines the colors used in the popup calculator.


PopupCalcColors is a TEsCalcColors class that allows you to set all of the popup
calculator colors. The properties of TEsCalcColors are used to set colors for the Display,
DisplayText, EditButtons, FunctionButtons, NumberButtons, and OperatorButtons.
You can set any of these properties individually to the desired color.
Alternatively, you can choose a color scheme for all of the popup calculator colors. A
color scheme is a pre-defined set of coordinated colors that you choose by setting the
ColorScheme property of the TEsCalcColors class.
See “TEsCalcColors Class” on page 98 for more information about the calculator colors.

PopupCalcFont property
property PopupCalcFont : TFont

$ PopupCalcFont is the font used in the popup calculator.

PopupCalcHeight property
property PopupCalcHeight : Integer

Default: 140
$ PopupCalcHeight is the height of the popup calculator.
You can resize the calculator to almost any size. The buttons are automatically resized to
maintain the proper position and size ratio.

PopupCalcWidth property
property PopupCalcWidth : Integer

Default: 200
$ PopupCalcWidth is the width of the popup calculator.
You can resize the calculator to almost any size. The buttons are automatically resized to
maintain the proper position and size ratio.

EsEdCalc TEsNumberEdit Component 79


TEsDbNumberEdit Component
The TEsDbNumberEdit component is the data-aware version of the TEsNumberEdit.
This means that the TEsDbNumberEdit can be connected to a data source and edit the
contents of numeric fields in the data source.
TEsDbNumberEdit is a direct descendant of the TEsCustomNumberEdit class and
inherits all of its properties, events, and methods. For descriptions of the properties,
events, and methods, see “TEsNumberEdit Component” on page 76.

Example
This example shows how to use a TEsDbNumberEdit component. It is basically the same
as using a TEsNumberEdit except that the DataSource and DataField properties must be
set.
Create a new project, add components, and set the property values as indicated in the
following table:

Component Property Value


TTable DatabaseNa "DBDEMOS"
me
TableName "CUSTOMER.DB
F"
Active true
TDataSource DataSet Table1

TDBNavigator DataSource DataSource1

TEsDbNumberEd DataSource DataSource1


it
DataField TaxRate

Compile and run the project. It will look something like this:

The tax rate for the current record is displayed and can be edited using a convenient
drop-down calculator.

80 Chapter 10: Number Edit


This example is in the EXDBNU project in the \ESSENCE\EXAMPLES\DELPHI
directory.

Hierarchy
TCustomEdit
(VCL)

TEsEdPopup
(EsEdPop)

TEsCustomNumberEdit
(EsEdCalc)

TEsDbNumberEdit
(EsDbEd)

Methods
AllowIncDec
AsFloat
AsInteger
AsString
# DataField
# DataSource
EsLabelInfo
# Field !
PopupCalcColors
PopupCalcFont
PopupCalcHeight
PopupCalcWidth
Version

EsDbEd TEsDbNumberEdit Component 81


Reference Section
DataField property
property DataField : string

$ DataField identifies the field (in the data source component) from which the number
edit field component displays data.

DataSource property
property DataSource : TDataSource

$ DataSource specifies the data source component where the number edit field obtains the
data to display.

Field run-time read-only property


property Field : TField

$ Field returns the TField object to which the number edit field component is linked.
Use the Field object to change the value of the data in the field programmatically.
For example, to set the value of an integer field to 123, you could use:
EsDbNumberEdit1.Field.AsInteger := 123;

82 Chapter 10: Number Edit


Chapter 11: Roll Up
The Essentials roll up is a non-visual component that allows you to “roll up” a form.
What actually happens is that the form’s size is changed in increments down to the height
of the caption. The process is reversed to restore the form to its original state.

To make your form roll up, use the icon on the Essentials tab to drop on a roll up
component. This example form:

looks like this when it is rolled up:

83
TEsRollUp Component
The TEsRollUp component is derived from Delphi’s TComponent and inherits its
properties, events, and methods. For descriptions of the inherited properties, events, and
methods, see the Delphi documentation.

Example
This example shows you how to create a “roll up” form.
Drop a TEsRollUp component on a new or existing form. If you use an existing form
with components already on it, it is easier to see how the roll up works, but a new, blank
form works fine too. Toggle the RolledUp property back and forth between false and true
to see the roll up action.
Set the HookForm property to true and run the project. The form will look something
like the pictures on page 83.
If you click on the minimize button, the form rolls up. Click the maximize button to roll
it back down (restore the form to its original size). If you click twice on the minimize
button, the form minimizes as normal. If you click twice on the maximize button, the
form maximizes as normal.
This example is in the EXDBNU project in the \ESSENCE\EXAMPLES\DELPHI
directory.

Hierarchy
TComponent
(VCL)

TEsCustomRollUp
(EsRollUp)

TEsRollUp
(EsRollUp)

Properties
# Animate # HookForm # RolledUp
# AnimateSpeed # MinHeight # Version

Events
# OnRollDown # OnRollUp

84 Chapter 11: Roll Up


Reference Section
Animate property
property Animate : Boolean

Default: true
$ Animate determines whether the form is rolled up and down by steps or all at once.
If Animate is true (the default), the form is rolled up and down by steps to give the
impression that the form is shrinking or expanding. If Animate is false, the size of the
form is simply changed from full size to the height of the caption or the MinHeight value.
See also: MinHeight

AnimateSpeed property
property AnimateSpeed : TEsAnimateSpeed
TEsAnimateSpeed = 0..10;

Default: 8
$ AnimateSpeed determines how fast the form rolls up or down.
Valid values for AnimateSpeed are 0 (the slowest) to 10 (the fastest).
Animation speeds are processor speed independent, i.e., an AnimateSpeed setting of 5
will cause the form to change size at the same rate on a 25 MHz 486 and a 200 MHz
Pentium.

HookForm property
property HookForm : Boolean

Default: false
$ HookForm determines whether minimize and maximize requests are translated to roll
up and roll down actions.
If HookForm is true, the parent form’s window procedure is hooked, allowing the
TEsRollUp component to “see” messages before the form sees them, and therefore to
intercept a click on the minimize or maximize buttons.
The form’s minimize and maximize buttons then work this way: if the form is rolled
down and the minimize button is clicked, the form is rolled up. If the form is already
rolled up and the minimize button is clicked, the minimize command works normally. If
the form is rolled up and the maximize button is clicked, the form is rolled down. If the
form is already rolled down and the maximize button is clicked, the maximize command
works normally.

EsRollUp TEsRollUp Component 85


HookForm is false by default because in most cases you will probably want to control
rolling up the form from within your application. You can use the RolledUp property to
roll the form up or down whenever necessary.
See also: RolledUp

MinHeight property
property MinHeight : Integer

Default: 0
$ MinHeight determines the minimum client height (in pixels) when the form is rolled up.
A MinHeight of zero means that the form is completely hidden except for the caption
bar. Using larger values for MinHeight allows part of the form to remain visible.

OnRollDown event
property OnRollDown : TNotifyEvent

$ OnRollDown defines an event handler that is called after the form is rolled down
(restored).
OnRollDown can be used to trigger an action in your application when the form is rolled
down. For example, you might want to initialize some data fields to default values each
time the form is rolled down.
See also: RolledUp

OnRollUp event
property OnRollUp : TNotifyEvent

$ OnRollUp defines an event handler that is called after the form is rolled up (shrunken).
OnRollUp can be used to trigger an action in your application when the form is rolled
up. For example, you might need to change the caption of a button to indicate that
pressing it will roll the form down.
See also: RolledUp

RolledUp property
property RolledUp : Boolean

Default: false
$ RolledUp is the state of the form that owns the TEsRollUp component.
If you set RolledUp to true, the form is rolled up. If you set RolledUp to false, the form is
rolled down. You can also use this property to determine the current state of the form.

86 Chapter 11: Roll Up


For example, you could use a single event handler for the OnRollUp and OnRollDown
events if it checks the RolledUp property to determine which state the form is in. The
“Tutorial” on page 12 for an example of how to do this.

Version read-only property


property Version : string

$ Version it the current version of Essentials.


Version is provided so you can identify your Essentials version if you need technical
support.

EsRollUp TEsRollUp Component 87


88 Chapter 11: Roll Up
Chapter 12: Tiled Bitmap
The Essentials tiled bitmap component provides a way to display a bitmap so that it
occupies the complete client area of the control. The bitmap is tiled, much like the
Windows desktop can tile a bitmap, making a very attractive backdrop for forms and
other controls.
TEsTile can work with any bitmap, but for the best results, the bitmap should be
designed so that the top and bottom and the right and left edges match. If they do, the
resulting image looks like a single graphic.

To add a tiled bitmap to your form, use the icon on the Essentials tab to drop on a
tiled bitmap component. To see a tiled bitmap, follow the instructions in the example on
page 90.
Displaying a tiled bitmap as the background of an MDI client form involves a little more
than simply dropping the component on the form and setting a couple of properties. The
EXMDI example project in the \ESSENCE\EXAMPLES\DELPHI directory
demonstrates the extra steps required to make this work.

89
TEsTile Comp
Component
onent
The TEsTile component is derived from Delphi’s TGraphicControl and inherits its
properties, events, and methods. For descriptions of the inherited properties, events, and
methods, see the Delphi documentation.

Example
This example shows how to use a tiled bitmap to fill the client area of a form.
Create a new project, add components, and set the property values as indicated in the
following table:

Component Property Value


TEsTile Align alClient

Double-click on the Bitmap property and load WHEEL.BMP (it is in the


\ESSENCE\EXAMPLES\DELPHI directory). Your form will look something like this:

This example is in the EXTILE project in the \ESSENCE\EXAMPLES\DELPHI


directory.

90 Chapter 12: Tiled Bitmap


Hierarchy
TGraphicControl
(VCL)

TEsCustomTile
(EsTile)

TEsTile
(EsTile)

Properties
# Bitmap
# Version

EsTile TEsTile Component


Component 91
Reference Section
Bitmap property
property Bitmap : TBitmap

$ Bitmap is the bitmap that is tiled within the control’s client area.

Version read-only property


property Version : string

$ Version is the current version of Essentials.


Version is provided so you can identify your Essentials version if you need technical
support.

92 Chapter 12: Tiled Bitmap


Chapter
Chapter 13: Miscellaneous Classes
This chapter describes some classes that are used by many of the Essentials components.
The component descriptions in the previous chapters reference the classes used by each
component.

93
TEsBase Class
TEsBase is the base class for most Essentials components. It implements several key
properties and methods that are used by its descendants.
A very important feature provided by TEsBase is the ability for each control to create an
attached label. An attached label is a label that maintains its relative position when its
associated component is moved. If an attached label is displayed one pixel above and to
the left of the top left corner of a component, it maintains its position one pixel above
and to the left of the component even after the component is moved.
This feature is most useful at design-time where you are moving components to arrange
the look of the form. If the component has an attached label (most of the Essentials
components do), you don’t have to reposition the label each time you move its
associated component.

Hierarchy
TCustomControl
(VCL)

TEsBase
(EsBase)

Properties
# AttachedLabel
# EsLabelInfo
# Version

94 Chapter
Chapter 13: Miscellaneous Classes
Reference Section
AttachedLabel read-only property
property AttachedLabel : TEsAttachedLabel

$ AttachedLabel provides access to the TEsAttachedLabel component.


An attached label is a specialized descendant of the TEsLabel component. It is normally
accessed only at design time, but this property makes it possible to alter the attached label
at run time if necessary.
The TEsAttachedLabel class is an immediate descendant of the TEsLabel, and inherits all
of its properties and methods. See “TEsLabel Component” on page 61 for more
information.

EsLabelInfo property
property EsLabelInfo : TEsLabelInfo

$ EsLabelInfo provides access to the status of the attached label.


EsLabelInfo groups the Visible, OffsetX, and OffsetY properties that determine whether
the attached label is visible and where it is positioned. See “TEsLabelInfo Class” on page
96 for more information.

Version read-only property


property Version : string

$ Version is the current version of Essentials.


Version is provided so you can identify your Essentials version if you need technical
support.

EsBase TEsBase Class 95


TEsLabelInfo Class
TEsLabelInfo encapsulates the properties associated with the attached label for
components that publish the EsLabelInfo property (i.e., TEsCalculator, TEsCalendar,
TEsColorComboBox, TEsDateEdit, TEsDbDateEdit, TEsMenuButton,
TEsNumberEdit, and TEsDbNumberEdit). TEsLabelInfo provides properties that allow
you to determine whether the attached label is visible and where it is positioned.

Hierarchy
TPersistent
(VCL)

TEsLabelInfo
(EsBase)

Properties
# OffsetX
# OffsetY
# Visible

96 Chapter
Chapter 13: Miscellaneous Classes
Reference Section
OffsetX property
property OffsetX: Integer

Default: 0
$ OffsetX determines the horizontal position of an attached label relative to the left edge of
its associated component.
Initial positioning of the attached label is done at design-time using the mouse. This
property is provided to allow for fine tuning the label’s position when you need to do
more precise positioning than you can do with a mouse.
If OffsetX is positive, the left edge of the attached label is positioned OffsetX pixels to the
right of the left edge of the associated component. If OffsetX is negative, the left edge of
the attached label is positioned OffsetX pixels to the left of the left edge of the associated
component.

OffsetY property
property OffsetY: Integer

Default: 0
$ OffsetY determines the vertical position of an attached label relative to the top of its
associated component.
Initial positioning of the attached label is done at design-time using the mouse. This
property is provided to allow for fine tuning the label’s position when you need to do
more precise positioning than you can do with a mouse.
If OffsetY is positive, the top edge of the attached label is positioned OffsetY pixels below
the top edge of the associated component. If OffsetY is negative, the top edge of the
attached label is positioned OffsetY pixels above the top edge of the associated
component.

Visible property
property Visible : Boolean

Default: false
$ Visible determines whether the attached label is displayed.
To reduce the amount of resources used, Visible defaults to false so that the attached label
is not created. Set Visible to true when the associated component requires an attached
label.

EsBase TEsLabelInfo Class 97


TEsCalcColors Class
TEsCalcColors encapsulates the TColor properties used by the TEsCalculator
component. Its primary purpose is to group the color properties so they can be found
and edited in one area of the Delphi Object Inspector. The properties of TEsCalcColors
that are used to set colors are:

Display DisplayText
default = clWindow default = clWindowText

DisabledMemoryButtons EditButtons
default = clGray default = clMaroon

MemoryButtons FunctionButtons
default = clRed default = clNavy

NumberButtons OperatorButtons
default = clBlue default = clRed

The TEsCalcColors class also implements pre-defined sets of coordinated colors for a
calculator (see the ColorScheme property).

Hierarchy
TPersistent
(VCL)

TEsCalcColors
(EsCalc)

Properties
# ColorScheme
# DisabledMemoryButtons
# Display
# DisplayText
# EditButtons
# FunctionButtons
# Memory Buttons
# NumberButtons
# OperatorButtons

98 Chapter
Chapter 13: Miscellaneous Classes
Reference Section
Section
ColorScheme property
property ColorScheme : TEsCalcColorScheme
TEsCalcColorScheme = (csCustom, csWindows, csDark, csOcean, csPlain);

Default: csWindows
$ ColorScheme is a pre-defined set of colors for the calculator.
ColorScheme allows you to choose a pre-defined set of coordinated colors for all of the
calculator color properties. If you change any of the color properties individually,
ColorScheme changes to csCustom. For example, if you change the EditButtons value,
ColorScheme is changed to csCustom.

DisabledMemoryButtons property
property DisabledMemoryButtons : TColor

Default: clGray
$ DisabledMemoryButtons is the color of the memory buttons when they are disabled.
See also: MemoryButtons

Display property
property Display : TColor

Default: clWindow
$ Display is the background color of the calculator’s display area.
See also: DisplayText

DisplayText property
property DisplayText : TColor

Default: clWindowText
$ DisplayText is the color of the text in the calculator’s display area.
See also: Display

EsCalc TEsCalcColors Class 99


EditButtons property
property EditButtons : TColor

Default: clMaroon
$ EditButtons is the color of the calculator’s edit buttons.
The edit buttons are the C (clear), CE (clear entry), and Back (backspace) buttons.

FunctionButtons property
property FunctionButtons : TColor

Default: clNavy
$ FunctionButtons is the color of the calculator’s function buttons.
The function buttons are the +/-, 1/x, %, and Sqrt buttons.

MemoryButtons property
property MemoryButtons : TColor

Default: clRed
$ MemoryButtons is the color of the calculator’s memory buttons.
The memory buttons are the MC (memory clear), MR (memory recall), MS (memory
store), M+ (memory add), and M- (memory subtract) buttons.

NumberButtons property
property NumberButtons : TColor

Default: clBlue
$ NumberButtons is the color of the calculator’s number buttons.
The number buttons are the 0 through 9 and decimal point (.) buttons.

OperatorButtons property
property OperatorButtons : TColor

Default: clRed
$ OperatorButtons is the color of the calculator’s operator buttons.
The operator buttons are the +, -, *, and / buttons.

100 Chapter
Chapter 13: Miscellaneous Classes
TEsCalColors Class
TEsCalColors encapsulates the TColor properties used by the TEsCalendar component.
Its primary purpose is to group the color properties so they can be found and edited in
one area of the Delphi Object Inspector. The properties of TEsCalColors that are used to
set colors are:

MonthAndYear DayNames
default = clBlue default = clMaroon

ActiveDay Days
default = clRed default = clBlack

Weekend InactiveDays
default = clRed default = clGray

The TEsCalColors class also implements pre-defined sets of coordinated colors for a
calendar (see the ColorScheme property).

Hierarchy
TPersistent
(VCL)

TEsCalColors
(EsCal)

Properties
# ActiveDay
# ColorScheme
# DayNames
# Days
# InactiveDays
# MonthAndYear
# Weekend

EsCal TEsCalColors Class 101


Reference Section
ActiveDay property
property ActiveDay : TColor

Default: clRed
$ ActiveDay is the color of the selected day.

ColorScheme property
property ColorScheme : TEsCalColorScheme
TEsCalColorScheme = (csCustom, csWindows, csGold, csOcean, csRose);

Default: csWindows
$ ColorScheme is a pre-defined set of colors for the calendar.
ColorScheme allows you to choose a pre-defined set of coordinated colors for all of the
calendar color properties. If you change any of the color properties individually,
ColorScheme changes to csCustom.

DayNames property
property DayNames : TColor

Default: clMaroon
$ DayNames is the color of the names of the days.

Days property
property Days : TColor

Default: clBlack
$ Days is the color of the day numbers.

InactiveDays property
property InactiveDays : TColor

Default: clGray
$ InactiveDays is the color of the day numbers in the previous and next months (if shown).

102 Chapter
Chapter 13: Miscellaneous Classes
MonthAndYear property
property MonthAndYear : TColor

Default: clBlue
$ MonthAndYear is the color of the month and year displayed at the top of the calendar.

Weekend property
property Weekend : TColor

Default: clRed
$ Weekend is the color of the day numbers for weekends.

EsCal TEsCalColors Class 103


TEsEdPopup Class
TEsEdPopup class is the base class for the Essentials date and number edit controls. It
adds basic support for implementing a popup window (calendar or calculator in
Essentials) and adds support for an associated label like the TEsBase class does for most
other Essentials components.
TEsEdPopup also adds a small button at the right side of the edit control that is used by
descendants to invoke the popup window. For example, this date edit shows the button:

Hierarchy
TCustomEdit
(VCL)

TEsEdPopup
(EsEdPop)

Properties
# AttachedLabel
# EsLabelInfo
# ShowButton
# Version

104 Chapter
Chapter 13: Miscellaneous Classes
Reference Section
AttachedLabel read-only property
property AttachedLabel : TEsAttachedLabel

$ AttachedLabel provides access to the TEsAttachedLabel component.


An attached label is a specialized descendant of the TEsLabel component. It is normally
accessed only at design time, but this property makes it possible to alter the attached label
at run time if necessary.
The TEsAttachedLabel class is a immediate descendant of the TEsLabel, and inherits all
of its properties and methods. See “TEsLabel Component” on page 61 for more
information.

EsLabelInfo property
property EsLabelInfo : TEsLabelInfo

$ EsLabel provides access to the status of the attached label.


EsLabelInfo groups the Visible, OffsetX, and OffsetY properties that determine whether
the attached label is visible and where it is positioned. See “TEsLabelInfo Class” on page
96 for more information.

ShowButton property
property ShowButton: Boolean

Default: true
$ ShowButton determines whether the popup button is displayed.
If ShowButton is true, a small button is displayed at the right side of an edit control that is
used by descendants to invoke a popup window.

Version read-only property


property Version : string

$ Version is the current version of Essentials.


Version is provided so you can identify your Essentials version if you need technical
support.

EsEdPop TEsEdPopup Class 105


TEsCustomSettings Class
TEsCustomSettings encapsulates the color, highlight, and shadow properties used by the
TEsLabel component and its descendants. Its primary purpose is to group these
properties so they can be found and edited in one area of the Delphi Object Inspector.

Hierarchy
TPersistent
(VCL)

TEsCustomSettings
(EsLabel)

Properties
# GraduateFromColor # HighlightDirection # ShadowDirection
# GraduateStyle # HighlightStyle # ShadowStyle
# HighlightColor # ShadowColor
# HighlightDepth # ShadowDepth

Methods
# Assign
# BeginUpdate
# EndUpdate

106 Chapter
Chapter 13: Miscellaneous Classes
Reference Section
Assign virtual method
procedure Assign(Source : TPersistent);

$ Assign transfers all property values from the Source to the instance of the class making
the call.
If Source is not of the type TEsCustomSettings, an exception is raised.

BeginUpdate method
procedure BeginUpdate;

$ BeginUpdate indicates the beginning of a set of updates to the custom settings.


Call BeginUpdate before you make changes to the custom settings to prevent the control
from updating itself until all changes are complete. Then call EndUpdate when you are
finished. This prevents the notifications normally associated with changing a single
property until after all of the properties are changed.
The following example uses a try-finally block to ensure that the EndUpdate method is
always called.
BeginUpdate;
try
{change some TEsCustomSettings properties}
finally
EndUpdate;
end;

If you forget to call EndUpdate, no notification of the property changes is made and the
label is not painted properly.
See also: EndUpdate

EndUpdate method
procedure EndUpdate;

$ EndUpdate indicates the end of a set of updates to the custom settings.


See also: BeginUpdate

EsLabel TEsCustomSettings Class 107


GraduateFromColor property
property GraduateFromColor : TColor

Default: clGray
$ GraduateFromColor is the starting color for text painted using graduated colors.
If GraduateStyle is gsHorizontal or gsVertical, GraduateFromColor is used as the “from”
color. The “to” color is the font color. For example, if you set GraduateFromColor to
clRed and Font.Color to clBlack, the text is displayed using a gradient of colors from
black to red.
See also: GraduateStyle

GraduateStyle property
property GraduateStyle : TEsGraduateStyle
TEsGraduateStyle = (gsNone, gsHorizontal, gsVertical);

Default: gsNone
$ GraduateStyle determines whether the text is painted using graduated colors.
The possible values for GraduateStyle are:
gsNone no gradient is used
gsHorizont the gradient is painted from left to right
al
gsVertical the gradient is painted from top to bottom

See also: GraduateFromColor

HighlightColor property
property HighlightColor : TColor

Default: clWhite
$ HighlightColor is the color for the text highlight.
A text highlight is drawn when HighlightDepth is greater than zero. The position of the
highlight is determined by HighlightDirection.
See also: HighlightDepth, HighlightDirection

108 Chapter
Chapter 13: Miscellaneous Classes
HighlightDepth property
property HighlightDepth : TEsDepth
TEsDepth = 0..255;

Default: 1
$ HighlightDepth is the size of the highlight.
If HighlightStyle is ssExtrude or ssGraduated, HighlightDepth specifies the depth of the
highlight. If HighlightStyle is ssPlain, HighlightDepth specifies the distance from the text
where the highlight is drawn.
See also: HighlightStyle

HighlightDirection property
property HighlightDirection : TEsShadeDirection
TEsShadeDirection = (sdNone, sdUp, sdUpRight, sdRight, sdDownRight,
sdDown,
sdDownLeft, sdLeft, sdUpLeft);

Default: sdUpLeft
$ HighlightDirection is the direction in which the highlight is drawn.
If HighlightDirection is sdNone, no highlight is drawn.

HighlightStyle property
property HighlightStyle : TEsShadeStyle
TEsShadeStyle = (ssPlain, ssExtrude, ssGraduated);

Default: ssPlain
$ HighlightStyle is the type of highlight.
The possible values for HighlightStyle are:
ssPlain a standard highlight using the highlight color

ssExtrude the highlight is drawn using a color extrusion method


(the text is drawn repeatedly, each time in a
slightly different position)

ssGraduat the highlight is drawn using graduated colors


ed starting with the highlight color and ending with the
font color

EsLabel TEsCustomSettings Class 109


ShadowColor property
property ShadowColor : TColor

Default: clBlack
$ ShadowColor is the color for the text shadow.

ShadowDepth property
property ShadowDepth : TEsDepth
TEsDepth = 0..255;

Default: 1
$ ShadowDepth is the size of the shadow.
If ShadowStyle is ssExtrude or ssGraduated, ShadowDepth specifies the depth of the
shadow. If ShadowStyle is ssPlain, ShadowDepth specifies the distance from the text
where the shadow is drawn.

ShadowDirection property
property ShadowDirection : TEsShadeDirection
TEsShadeDirection = (sdNone, sdUp, sdUpRight, sdRight, sdDownRight,
sdDown,
sdDownLeft, sdLeft, sdUpLeft);

Default: sdDownRight
$ ShadowDirection is the direction in which the shadow is drawn.
If ShadowDirection is sdNone, no shadow is drawn.

ShadowStyle property
property ShadowStyle : TEsShadeStyle
TEsShadeStyle = (ssPlain, ssExtrude, ssGraduated);

Default: ssPlain
$ ShadowStyle is the type of shadow.
The possible values for ShadowStyle are:
ssPlain a standard shadow using the shadow color

ssExtrude the shadow is drawn using a color extrusion method


(the text is drawn repeatedly, each time in a
slightly different position)

ssGraduat the shadow is drawn using graduated colors starting


ed with the shadow color and ending with the font
color

110 Chapter
Chapter 13: Miscellaneous Classes
Index
Calculator (continued)
#
display background color 91
" symbol 12
display text 22
# symbol 12
edit buttons color 92
! symbol 12
function buttons color 92
% symbol 13
functions 15
A hide memory buttons 16
Active 60 inverse 16
ActiveDay 94 keystroke equivalents 16
AllowIncDec (TEsDateEdit) 39 memory 15
AllowIncDec (TEsNumberEdit) 70 memory buttons 22
Animate 77 memory buttons color 92
AnimateSpeed 77 memory contents 20
Appearance 55 number buttons color 92
AsFloat 70 operator buttons color 92
AsInteger 70 paste from clipboard 21
Assign 99 percent 16
AsString 70 press button 21
Attached label reciprocal 16
color combo box 34 result value 22
definition of 2, 86 sign change 16
horizontal position 89 square root 16
vertical position 89 text color 91
visible 89 Calendar
AttachedLabel (TEsBase) 87 active day color 94
AttachedLabel (TEsEdPopup) 97 color scheme 94
B colors 27
BeginUpdate 99 current date 27
Behavior 60 date format 27
Bitmap 84 day name 27
Bounce, marquee 60 day names color 94
Button pressed event 21 day number color 94
definition of 23
C inactive day color 94
Calculator keystrokes 24
color scheme 91 month and year 28
colors 20 month/year color 95
copy to clipboard 20 next month 28
definition of 15 previous month 28
disabled memory buttons 91 today button 29

Index 111
Calendar (continued) D
week starting day 29 Data aware
weekend color 95 date edit 42
Caption 66 number edit 72
Clipboard Data source
copy to 20 date edit 44
paste from 21 number edit 74
Color combo box DataField (TEsDbDateEdit) 44
attached label 34 DataField (TEsDbNumberEdit) 74
definition of 31 DataSource (TEsDbDateEdit) 44
selected color 34 DataSource (TEsDbNumberEdit) 74
version 34 Date (calendar)
ColorBands 48 change event 28
Colors current 27
calculator 20, 91 format 27
calculator disabled memory buttons 91 Date (TEsCalendar) 27
calculator display background 91 Date (TEsDateEdit) 39
calculator edit buttons 92 Date edit
calculator function buttons 92 calendar colors 40
calculator memory buttons 92 calendar height 40
calculator number buttons 92 calendar width 41
calculator operator buttons 92 date format 39
calculator text 91 date value 39
calendar 27, 94 definition of 35
calendar active day 94 get event 39
calendar day names 94 increment/decrement 39
calendar day numbers 94 required fields 41
calendar inactive days 94 set event 40
calendar month/year 95 today’s date 41
calendar weekends 95 Date edit (data aware)
gradient 48 data field 44
label 55 data source 44
popup calculator 71 definition of 42
popup calendar 40 field object 44
selected 34 DateFormat 27
Colors (TEsCalculator) 20 DayNames 94
Colors (TEsCalendar) 27 DayNameWidth 27
ColorScheme (TEsCalcColors) 91 Days 94
ColorScheme (TEsCalColors) 94 Decrement
ColorScheme (TEsLabel) 55 date 39
Component installation 4 number 70
CopyToClipboard 20 Direction (TEsGradient) 48
CustomSettings 56 Direction, scrolling marquee 61
Cycle, marquee 60 Directory for installation 4
DisabledMemoryButtons 91
Display 91
DisplayText 91

112 Index
E Increment
EditButtons 92 date 39
E-mail 14 number 70
EndUpdate 99 Installation 4
EsLabelInfo (TEsBase) 87 Invert function 16
EsLabelInfo (TEsColorComboBox) 34 L
EsLabelInfo (TEsEdPopup) 97 Label
Events appearance 55
button pressed 21 color scheme 55
date change 28 definition of 49
get date 39 end updates 99
roll down 78 from color 100
roll up 78 graduated text 100
scroll cycle 60 highlight color 100
set date 40 highlight depth 101
F highlight direction 101
Field (TEsDbDateEdit) 44 highlight style 101
Field (TEsDbNumberEdit) 74 property editor 51
Floating-point number 70 shadow color 102
FormatDate 39 shadow depth 102
FromColor 48 shadow direction 102
FunctionButtons 92 shadow style 102
start updates 99
G style 56
Glyph 66
style manager 51
Gradient
version 56
color bands 48
word wrap 56
definition of 45
direction 48 M
ending color 48 Maximize form 77
starting color 48 Memory (TEsCalculator) 20
version 48 Memory functions 15
GraduateFromColor 100 MemoryButtons 92
GraduateStyle 100 Menu button
bitmap 66
H caption 66
Hardware requirements 3
definition of 63
Help
glyph 66
installation 5
position 66
on-line 13
MenuPosition 66
Highlight 56
MinHeight 78
HighlightColor 100
Minimize form 77
HighlightDepth 101
Month
HighlightDirection 101
display 28
HighlightStyle 101
next 28
HookForm 77
previous 28
I MonthAndYear 95
InactiveDays 94

Index 113
N PopupCalcHeight 71
Naming conventions 13 PopupCalColors 40
Number edit PopupCalcWidth 71
definition of 67 PopupCalFont 40
floating point 70 PopupCalHeight 40
increment/decrement 70 PopupCalWidth 41
integer 70 Position, attached label 89
popup calculator colors 71 PressButton 21
popup calculator font 71 Program group 4
popup calculator height 71 Program icons 4
popup calculator width 71 R
string 70 Reciprocal function 16
Number edit (data aware) RequiredFields 41
data field 74 Requirements, hardware and software 3
data source 74 Roll up
definition of 72 animate 77
field object 74 animate speed 77
NumberButtons 92 definition of 75
O hook form 77
OffsetX 89 minimum height 78
OffsetY 89 roll down event 78
OnButtonPressed 21 roll up event 78
OnChange 28 state 78
OnCycle 60 version 79
OnGetDate 39 RolledUp 78
OnRollDown 78 S
OnRollUp 78 ScrollDirection 61
OnSetDate 40 Scrolling marquee
OperatorButtons 92 activate 60
P behavior 60
PasteFromClipboard 21 cycle event 60
Percent function 16 definition of 57
Popup direction 61
attached label 97 speed 61
button 97 ScrollSpeed 61
version 97 SelectedColor 34
Popup calculator Setup 4
colors 71 Shadow 56
font 71 ShadowColor 102
height 71 ShadowDepth 102
width 71 ShadowDirection 102
Popup calendar ShadowStyle 102
colors 40 ShowButton 97
height 40 ShowColorNames 34
width 41 ShowDate 28
PopupCalcColors 71 ShowGlyph 66
PopupCalcFont 71 ShowInactive 28

114 Index
ShowMemoryButtons 22 TEsGraduateStyle 100
ShowToday 29 TEsLabel 53
Sign change function 16 TEsLabelInfo 88
Software requirements 3 TEsMenuButton 64
Speed, scrolling marquee 61 TEsMenuPosition 66
Square root 16 TEsNumberEdit 68
Support 14 TEsRequiredField 41
Symbols TEsRollUp 76
" symbol 12 TEsScrollDirection 61
# symbol 12 TEsScrollingMarquee 58
! symbol 12 TEsScrollSpeed 61
% symbol 13 TEsShadeDirection 101, 102
TEsShadeStyle 101, 102
T
TEsTile 82
TButtonPressedEvent 21
Text 22
TDateChangeEvent 28
TGradDirection 48
Technical support 14
Tiled bitmap
TEsAnimateSpeed 77
definition of 81
TEsAppearance 55
graphic 84
TEsBaseClass 86
version 84
TEsBehaviors 60
ToColor 48
TEsCalcColors 90
Today button 29
TEsCalcColorScheme 91
TodayString 41
TEsCalColors 93
Tutorial 7
TEsCalColorScheme 94
TEsCalculator 18 V
TEsCalculatorButton 21 Value 22
TEsCalendar 25 Version (TEsBase) 87
TEsColorBand 48 Version (TEsColorComboBox) 34
TEsColorComboBox 32 Version (TEsEdPopup) 97
TEsColorScheme 55 Version (TEsGradient) 48
TEsCustomSettings 98 Version (TEsLabel) 56
TEsDateEdit 37 Version (TEsRollUp) 79
TEsDateFormat 27 Version (TEsTile) 84
TEsDayNameWidth 27 Visible 89
TEsDayType 29
W
TEsDbDateEdit 42
Weekend 95
TEsDbNumberEdit 72
WeekStarts 29
TEsDepth 101, 102
WordWrap 56
TEsEdPopup 96
TEsGetDateEvent 39 Y
TEsGradient 46 Year 28

Index 115
116 Index
NOTES
NOTES
i
ii

You might also like