This package contains a Delphi component named TDigits.
It implements a graphic counter like the odometer in your car, with the last
digit(s) scrolling up or down when you increase or decrease the value by 1.
Sample bitmaps are included.
Version 1.0.1

The component is copyright (C) 1996, by Jan Goyvaerts. You may give copies to
others by copying the original, unmodified zip file. You may use this
component in your own projects free of charge as long as those projects are
public domain, freeware or shareware projects.
If you want to use it in a commercial application, please contact the author.
It's not really honest to make big money with someone else's free stuff.
If you have any questions or comments, don't hesitate to send mail to
johnfg@tornado.be
Feel free to visit my home page at http://www.tornado.be/~johnfg/

******

Here's a little information on how to use the component:

First add the TDigits component to the component library.
Then you can select it from the component palette and drop it on your form.

Now you must assign a bitmap to the BmpDigits property. The bitmap must
contain the digits 0 trough 9 and an empty space from left to right, all of
equal width. This is the same method as used by TBitBtn.Glyph, for example.
You can use DIGITS.BMP that comes with the component.

Use the DigitCount property to set the number of digits your counter needs.

If you want a separator between the thousands (e.g.: 1,000,000 instead of
1000000) load the separator bitmap in BmpThousandsSeparator (THOUSAND.BMP)
and then set ShowThousandsSeparator to True. The bitmap's height must be the
same as the one of BmpDigits, but the width is not important.

If your counter needs to support negative values, assign a bitmap to
BmpPosNegSign. The bitmap's left half must be the positive sign (usually an
empty space) and the right half the negative sign. The height must be the
same as BmpDigits. POSNEG.BMP comes with the component.
Now set AllowNegative to True.

You can set the value of the counter by using the Value property.
However, it is much nicer to call the Increase and Decrease methods at run
time because these make the last digit(s) rotate.


Happy programming!
John.


{***********************************************************}
{                                                           }
{        TDigits component                                  }
{                                                           }
{        Copyright (C) 1996, by Jan Goyvaerts               }
{        All rights reserved                                }
{                                                           }
{***********************************************************}

{***********************************************************}
{                                                           }
{        Delphi component unit                              }
{           - TDigits                                       }
{        -> JG page                                         }
{                                                           }
{***********************************************************}

unit Digits;

interface

uses
  WinTypes, WinProcs, Messages, SysUtils, Classes, Graphics, Controls, ExtCtrls, Forms, Menus;

type
  TDigits = class(TGraphicControl)
  private
    ...
  protected
    ScrollPos: Integer;                { Used for making last digit(s) scroll }
    ScrollTimer: TTimer;
    procedure ScrollTimerTick(Sender: TObject);
    procedure Loaded; override;
    procedure AdjustSize;              { Resize the component so the digits fit exactly }
    procedure Paint; override;         { Paint our control }
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    procedure Increase;                { Increase Value by one and make the last digit(s) scroll up }
    procedure Decrease;                { Decrease Value by one and make the last digit(s) scroll down }
  published
    { Can the counter go below zero? }
    property AllowNegative: Boolean read FAllowNegative write SetAllowNegative default False;
    { Automatically resize the component so the digits fit exactly }
    property AutoSize: Boolean read FAutoSize write SetAutoSize default True;
    { Bitmap containing digits 0 trough 9 and the empty space }
    property BmpDigits: TBitmap read FBmpDigits write SetBmpDigits;
    { Bitmap containing minus sign and positive (or no) sign }
    property BmpPosNegSign: TBitmap read FBmpPosNegSign write SetBmpPosNegSign;
    { Bitmap containing the thousands separator bitmap }
    property BmpThousandsSeparator: TBitmap read FBmpThousandsSeparator write SetBmpThousandsSeparator;
    { Number of digits to be displayed }
    property DigitCount: Integer read FDigitCount write SetDigitCount default 6;
    { Number of milliseconds the last digit(s) pause(s) between each step }
    property IncDecSpeed: Integer read FIncDecSpeed write SetIncDecSpeed default 100;
    { Number of steps the last digit(s) make(s) when you call Increase or Decrease }
    property IncDecSteps: Integer read FIncDecSteps write FIncDecSteps default 4;
    { Must leading zeros be shown or replaced by empty spaces? }
    property ShowLeadingZeros: Boolean read FShowLeadingZeros write SetShowLeadingZeros default False;
    { Must the thousands separator be shown? }
    property ShowThousandsSeparator: Boolean read FShowThousandsSeparator write SetShowThousandsSeparator default False;
    { Currently displayed value }
    property Value: Longint read FValue write SetValue default 0;
  published
    { Publishing properties inherited from TGraphicControl }
    property Align;
    property DragMode;
    property ParentShowHint;
    property PopupMenu;
    property ShowHint;
    property Visible;
    property OnClick;
    property OnDblClick;
    property OnDragOver;
    property OnDragDrop;
    property OnEndDrag;
    property OnMouseDown;
    property OnMouseMove;
    property OnMouseUp;
    property Width default 84;
    property Height default 20;
  end;

procedure Register;

implementation

end.
