T L C D 9 9   R E A D M E

By Jonathan Hosking
V1.81 (12.08.2001)

T A B L E   O F   C O N T E N T S

What is the TLCD99 component?
How to install the TLCD99 component
TLCD99 reference
Revision history
Future ideas
Other components
Contacting me

W H A T   I S   T H E   T L C D 9 9   C O M P O N E N T ?

The TLCD99 component is a new component I have written for Delphi and C++Builder. It simply looks like an LCD display, but there is more to it than you think. It can be fully customised if desired. It has the following features: -

  • Fully customisable source code, which can be edited if necessary.
  • A popup menu can be used with the control.
  • Doesn't require bitmaps to operate. It simply generates the LCD digits.
  • LCD digits can be adjusted in size and space.
  • The display can be updated with an animation effect.
  • Works on Windows 95, NT & 2000. (I have not tested it with Windows 98)
  • Compact size, only occupying 27KB when compiled in Delphi 1! (21KB in Delphi 6!)

The component code was written by modifying some code for my TYearPlanner component. The code works fine on Delphi 1.0, 2.0, 4.0, 5.0, 6.0 and C++Builder 3.0 & 4.0, but I have not tested it with other versions.

You are free to distribute the code, but you may NOT sell it. If you modify the code, you must include me in the acknowledgements. If you do want your ideas or modifications to be incorporated into the latest version, send them to the address at the end of this document.

Thanks to Jean Pierre and Daniel Szasz for their help with the drawing routines and colon support routines.

Thanks to Alan Warriner for implementing double buffering, the animation preview feature, and improving the animation delays.

Thanks to Mike Heydon for implementing the numeric value routines and OnChange event.

H O W   T O   I N S T A L L   T H E   T L C D 9 9   C O M P O N E N T

To unzip the TLCD99 component, assuming [Program Path] is the path to Delphi or C++Builder, follow these steps: -

  1. Unzip the file LCD99.ZIP to any directory, using the directory switch (This is VERY important).
  2. Copy the file LCD99.PAS to the directory [Program Path]\Source\Samples.
  3. If you want documentation, copy the file LCD99.HTM to the directory [Program Path]\Bin, if you are using Delphi 1.0. Otherwise, copy it to the directory [Program Path]\Help.
  4. If you are using Delphi 1.0, copy the files in the 16-Bit directory of this Zip to the directory [Program Path]\Source\Samples. Otherwise, copy the files in the 32-Bit directory of this Zip to the directory [Program Path]\Source\Samples.

You can now install the component into the component library. Follow the procedure for the version of Delphi or C++Builder that you are using.

Delphi 1.0:

  1. Click on Options and then select Install Components.
  2. In the Install Components dialog, click Add. In the next dialog, click Browse and open the file LCD99.PAS.
  3. Click Ok to install the component.

Delphi 2.0:

This procedure should also work with C++Builder 1.0, but I'm not sure.

  1. Click on Component and select Install.
  2. In the Install Components dialog, click Add. In the next dialog, click Browse and open the file LCD99.PAS.
  3. Click Ok to install the component.

Delphi 4.0:

  1. Click on Tools and select Environment Options.
  2. In the next dialog, click on the Library tab and add the full path of the TLCD99 source code to the Library Path edit box. Then click Ok.
  3. Click on Component and select Install Component.
  4. In the Install Component dialog, click on the Into existing package tab. Click on the first Browse button and open the file LCD99.PAS. Then click on the second Browse button and open the file DCLUSR40.DPK. Finally, click Ok to install the component.

Delphi 5.0:

  1. Click on Tools and select Environment Options.
  2. In the next dialog, click on the Library tab and add the full path of the TLCD99 source code to the Library Path edit box. Then click Ok.
  3. Click on Component and select Install Component.
  4. In the Install Component dialog, click on the Into existing package tab. Click on the first Browse button and open the file LCD99.PAS. Then click on the second Browse button and open the file DCLUSR50.DPK. Finally, click Ok to install the component.

Delphi 6.0:

  1. Click on Tools and select Environment Options.
  2. In the next dialog, click on the Library tab and add the full path of the TLCD99 source code to the Library Path edit box. Then click Ok.
  3. Click on Component and select Install Component.
  4. In the Install Component dialog, click on the Into existing package tab. Click on the first Browse button and open the file LCD99.PAS. Then click on the second Browse button and open the file DCLUSR.DPK. Finally, click Ok to install the component.

C++Builder 3.0:

This procedure should also work, with minor modifications, with Delphi 3.0, but I'm not sure.

  1. Click on Tools and select Environment Options.
  2. In the next dialog, click on the Library tab and add the full path of the TLCD99 source code to the Library Path edit box. Then click Ok.
  3. Click on Component and select Install Component.
  4. In the Install Component dialog, click on the Into existing package tab. Click on the first Browse button and open the file LCD99.PAS. Then click on the second Browse button and open the file DCLUSR35.BPK. Finally, click Ok to install the component.

C++Builder 4.0:

This procedure should also work, with minor modifications, with C++Builder 5.0, but I'm not sure.

  1. Click on Tools and select Environment Options.
  2. In the next dialog, click on the Library tab and add the full path of the TLCD99 source code to the Library Path edit box. Then click Ok.
  3. Click on Component and select Install Component.
  4. In the Install Component dialog, click on the Into existing package tab. Click on the first Browse button and open the file LCD99.PAS. Then click on the second Browse button and open the file DCLUSR40.BPK. Finally, click Ok to install the component.
T L C D 9 9   R E F E R E N C E

Remarks:

If your digits do not display correctly, you may have done one of the following: -

  • You may have chosen an unsuitable segment size.
  • You may have chosen an unsuitable gap size for the segments.
  • You may have an inappropriate number of digits for the component size. Try adjusting the size or reducing the number of digits.
  • You may not have enough digits to display the value.
  • You may have chosen unsuitable colours for inactive and active segments.

You can edit the digit data by changing the values in the array LCDDisplayData. The array consists of 38 digit sets, each comprising of 8 segments that can be turned on or off. The first 10 sets are the digits 0 to 9, the next 2 sets are the sign digit and colon, and the last set is the letters of the alphabet. A value of 0 turns a segment off, while a value of 1 turns the segment on. A diagram of the segment layout is included in the source code.

You can edit the animation patterns, if you wish, by changing the values in the variable LCDAnimationData. There are sub-arrays for each animation, each containing a list of segment numbers. The animation of drawn in the order of the segment numbers. Below is a list of the animations: -

  1. Spiral animation.
  2. Up animation.
  3. Down animation.
  4. Right animation.
  5. Left animation.

You can add your own animations if you wish, but you will need to make some modifications. I do not support this, however. If you want your animations in future releases, send the new array list to me.

The animation delay is not entirely accurate at the moment. For example, if you specify a delay of 1000 then the control may take slightly over a second to update. If anyone can find a solution to this, please contact me, but it's not a major problem.

You can use the GetNumericValue function to get the numeric value of the Value property. The SetNumericValue procedure will set the Value property to a numeric value. These routines were designed to avoid using lengthy type conversions, like StrToInt and IntToStr, when using the Value property.

Known problems:

There is currently one known problem with the control, but hopefully it will be fixed in future versions. It is listed below: -

  • The control takes some time to update itself when you are using animations. I have not yet found a solution to this problem, but it is only a minor problem.

Key properties:

  • property About;
    If you set this to abAbout, the component information is shown.
  • property Align;
    Determines how the control is aligned within its parent.
  • property Animation;
    Determines the animation that is used to update the display. Selecting anRandom chooses a random animation per update.
  • property AnimationDelay;
    Specifies the delay in an animation for updating whole the display.
  • property Color;
    Determines the colour of the control.
  • property DigitNum;
    Determines the number of digits that are displayed on the display.
  • property DigitSpacing;
    Determines the amount of space, in pixels, between digits.
  • property DotDisplay;
    If this is set to True, the control looks like a dotted LCD display.
  • property DotSpacing;
    Determines the amount of space, in pixels, between the dots in each segment.
  • property DoubleBuffer;
    If this is set to True, double buffering is enabled.
  • property DragCursor;
    Determines the mouse pointer that is displayed when an object is dragged over the control.
  • property DragMode;
    If this is set to automatic, the control can be dragged and dropped at any time. If this is set to manual, the control can only be dragged when the BeginDrag method is called.
  • property Enabled;
    If this is set to False, the control cannot be used until this is set to true.
  • property GapX;
    This determines how much horizontal space is unused by a segment.
  • property GapY;
    This determines how much vertical space is unused by a segment.
  • property IsPainting;
    Indicates if the control is painting itself.
  • property OffColor;
    This is the colour used for displaying inactive segments.
  • property OnColor;
    This is the colour used for displaying active segments.
  • property PaintDuration;
    Indicates the time spent on painting the control.
  • property ParentShowHint;
    If this is set to True, the parent of the control displays the hints.
  • property PopupMenu;
    If this is set, right clicking the control displays the set popup menu.
  • property Preview;
    If this is set to True, the animations can be previewed at design time.
  • property SegmentSize;
    This determines the size of the segments.
  • property ShowHint;
    If this is set to True, the control displays its own popup hints.
  • property Value;
    Determines the value that is displayed. You can enter any number and create spaces between digits by using space characters.
  • property Visible;
    If this is set to False, the control cannot be seen.

Key events:

  • property OnChange: TLcdChangeProc;
    Occurs when the display value is changed.
  • property OnClick: TNotifyEvent;
    Occurs when the control is selected.
  • property OnDblClick: TNotifyEvent;
    Occurs when the control is double-clicked.
  • property OnDragDrop: TNotifyEvent;
    Occurs when an object being dragged is dropped.
  • property OnDragOver: TNotifyEvent;
    Occurs when an object is dragged over the control.
  • property OnEndDrag: TNotifyEvent;
    Occurs whenever the dragging of an object ends, either by dropping the object or by cancelling the dragging.
  • property OnMouseDown: TNotifyEvent;
    Occurs when a mouse button is pressed with the pointer over the control.
  • property OnMouseMove: TNotifyEvent;
    Occurs when the pointer is moved whilst over the control.
  • property OnMouseUp: TNotifyEvent;
    Occurs when a mouse button that was pressed is released with the pointer over the control.
R E V I S I O N   H I S T O R Y

V1.81 (12.08.2001)

  • Delphi 6.0 is now supported.

V1.8 (15.10.2000)

  • Added an OnChange event, which allows the user to specify what happens when the display value is changed. Thanks to Mike Heydon for the code.
  • Added GetNumericValue and SetNumericValue routines, allowing the user to quickly retrive and set numeric values on the display. Thanks to Mike Heydon for the code.

V1.73 (19.08.2000)

  • Bug Fixed - The digits weren't being displayed correctly due to the bug fix in v1.72.

V1.72 (12.08.2000)

  • Bug Fixed - Decimal points weren't being positioned correctly on the display.

V1.71 (29.07.2000)

  • Added a DotSpacing property, which allows you to control the space between the dots in each segment.

V1.7 (26.07.2000)

  • Added a DotDisplay property, which allows the control to look like a dotted LCD display.

V1.65 (03.06.2000)

  • Bug Fixed - Setting the value to a blank string sometimes caused errors.

V1.64 (01.02.2000)

  • Bug Fixed - In the previous version, the wrong alphabetical characters were displayed.

V1.63 (12.01.2000)

  • Added a DoubleBuffer property for double buffering. Thanks to Alan Warriner for this.
  • Added an IsPainting property to indicate when the control is being painted. Thanks to Alan Warriner for this.
  • Added a PaintDuration property to indicate the painting speed. Thanks to Alan Warriner for this.
  • Added a Preview property to enable the user to preview animations at design time. Thanks to Alan Warriner for this.
  • Improved the animation delays in the animations. Thanks to Alan Warriner for this.

V1.62 (04.09.1999)

  • Delphi 5.0 is now supported!

V1.61 (17.08.1999)

  • Added a message hook to help reduce flickering.

V1.6 (12.08.1999)

  • Added support for the colon. Thanks to Daniel Szasz for providing the original code for this.

V1.5 (07.08.1999)

  • Added GapX, GapY and SegmentSize properties to the control, which control the segment sizes. The ScaleX and ScaleY properties have been removed because of this.
  • Letters of the alphabet and decimal points can now be displayed.
  • Made some improvements to the segment drawing routines.

V1.4 (13.07.1999)

  • Bug Fixed - In the value setting routine, invalid characters were occasionally allowed to slip through unnoticed.
  • Made a few improvements to the animation delays. The delay now takes into account how long the control has spent updating itself, so the delay should be more accurate.

V1.3 (09.07.1999)

  • The control now supports negative numbers. To leave the display blank, you now enter nothing in the value property.
  • Digits can now be separated within the display by using space characters.

V1.2 (28.06.1999)

  • The control now correctly updates itself when a value of û1 is entered.
  • The control is more efficient at updating itself, and the animation delays are more realistic. In previous versions, the delay could vary at times.

V1.1 (26.06.1999)

  • The control now looks a little bit more like a real LCD display. Thanks to Jean Pierre for his help.
  • The control now correctly identifies C++Builder 4.0. In earlier versions I used the wrong compiler version check, meaning that C++Builder 4.0 users would probably have encountered errors.

V1.0 (28.05.1999)

  • Initial release.
F U T U R E   I D E A S

I currently only have one idea for future versions of the TLCD99 component. It is shown below: -

  • Improved animation updating. At the moment I have to disable messages while the control updates, otherwise I can get errors.
O T H E R   C O M P O N E N T S

Below is a list other components that I have written: -

  • TOffice97Balloon û A control that looks and acts like the Office Assistant balloons in Office 97.
  • TOffice97Button û A control that looks and acts like the controls (Buttons, radiobuttons, up buttons and down buttons) that appear in the Office Assistant balloons in Office 97.
  • TYearPlanner û A control that looks like a year planner.
C O N T A C T I N G   M E

I am currently on the Internet. If you have any bug reports, comments, ideas, modifications, etc. then you can Email me at the address given below. You can also go to my web site to find out the latest information on my components.

Email: jonathan@the-hoskings.freeserve.co.uk
WWW: http://www.the-hoskings.freeserve.co.uk/