| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- {========================================================================}
- {= (c) 1995-98 SwiftSoft Ronald Dittrich =}
- {========================================================================}
- {= All Rights Reserved =}
- {========================================================================}
- {= D 01099 Dresden = Tel.: +0351-8012255 =}
- {= Loewenstr.7a = info@swiftsoft.de =}
- {========================================================================}
- {= Actual versions on http://www.swiftsoft.de/mmtools.html =}
- {========================================================================}
- {= This code is for reference purposes only and may not be copied or =}
- {= distributed in any format electronic or otherwise except one copy =}
- {= for backup purposes. =}
- {= =}
- {= No Delphi Component Kit or Component individually or in a collection=}
- {= subclassed or otherwise from the code in this unit, or associated =}
- {= .pas, .dfm, .dcu, .asm or .obj files may be sold or distributed =}
- {= without express permission from SwiftSoft. =}
- {= =}
- {= For more licence informations please refer to the associated =}
- {= HelpFile. =}
- {========================================================================}
- {= $Date: 20.01.1998 - 18:00:00 $ =}
- {========================================================================}
- Unit MMLEDS;
- {$I COMPILER.INC}
- interface
- uses
- {$IFDEF WIN32}
- Windows,
- {$ELSE}
- WinTypes,
- WinProcs,
- {$ENDIF}
- SysUtils,
- Messages,
- Classes,
- Graphics,
- Controls,
- Forms,
- Dialogs,
- ExtCtrls,
- Buttons,
- DsgnIntf,
- MMObj,
- MMUtils,
- MMString,
- MMSpin;
- type
- TMMLEDType =(ltDigit, ltPeriod, ltColon, ltMinus);
- TMMLEDSize =(ls06x07,ls07x11,ls08x13,ls11x19,ls13x20,ls13x21,ls15x24,
- ls15x25,ls17x29,ls18x25,ls19x33,ls21x37,ls23x41);
- {-- TMMLED -----------------------------------------------------------}
- TMMLED = class(TMMGraphicControl)
- public
- constructor Create(AOwner: TComponent); override;
- published
- { Events }
- property OnClick;
- property OnDblClick;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property Bevel;
- property Color default clGreen;
- property ParentShowHint;
- property ShowHint;
- property Visible;
- property Enabled: Boolean read FEnabled write SetEnabled default True;
- property Height default 8;
- property Width default 16;
- property LEDColor: TColor read FLEDColor write setLEDColor default clLime;
- end;
- {-- TMMLEDMode -------------------------------------------------------}
- TMMLEDMode = class(TMMGraphicControl)
- public
- constructor Create (AOwner: TComponent); override;
- destructor Destroy; override;
- published
- { Events }
- property OnClick;
- property OnDblClick;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property ParentShowHint;
- property ParentColor;
- property ShowHint;
- property Visible;
- property Color;
- property Width default 27;
- property Height default 11;
- property DrawInactive: Boolean read FDrawInactive write SetDrawInactive default True;
- property Enabled: Boolean read GetEnabled write SetEnabled default True;
- property Mode: TMMMode read FMode write SetMode default mMono;
- property LEDColor: TColor read FLEDColor write SetLEDColor default clLime;
- property InactiveColor: TColor read FInactiveColor write SetInactiveColor default clGreen;
- end;
- {-- TMMCustomLEDDigit ------------------------------------------------}
- TMMCustomLEDDigit = class(TMMGraphicControl);
- {-- TMMLEDDigit ------------------------------------------------------}
- TMMLEDDigit = class(TMMCustomLEDDigit)
- public
- constructor Create (AOwner: TComponent); override;
- destructor Destroy; override;
- procedure Increase;
- procedure Decrease;
- published
- { Events }
- property OnClick;
- property OnDblClick;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnRollForward: TNotifyEvent read FOnRollForward write FOnRollForward;
- property OnRollBackward: TNotifyEvent read FOnRollBackward write FOnRollBackward;
- property ParentShowHint;
- property ParentColor;
- property ShowHint;
- property Visible;
- property Color;
- property Width default 11;
- property Height default 21;
- property Enabled: Boolean read GetEnabled write SetEnabled default True;
- property MinValue: integer read FMinValue write SetMinValue default 0;
- property MaxValue: integer read FMaxValue write SetMaxValue default 9;
- property Value: Longint read FValue write SetValue default 0;
- property DrawInactive: Boolean read FDrawInactive write SetDrawInactive default True;
- property ZeroBlank: Boolean read FZeroBlank write SetZeroBlank default False;
- property InactiveColor: TColor read FInactiveColor write SetInactiveColor default clGreen;
- property LEDColor: TColor read FLEDColor write SetLEDColor default clLime;
- property DigitSize: TMMLEDSize read FSize write SetSize default ls13X21;
- property DisplayType: TMMLEDType read FType write SetType default ltDigit;
- property CascadeValues: Boolean read FCascade write SetCascade default False;
- property Connect: TMMCustomLEDDigit read FConnect write SetConnect;
- end;
- {-- TMMLEDDigitConnectEditor ----------------------------------------}
- TMMLEDDigitConnectEditor = class(TComponentProperty)
- public
- procedure GetValues(Proc: TGetStrProc); override;
- end;
- {-- TMMLEDPanel ------------------------------------------------------}
- TMMLEDPanel = class(TMMCustomPanel)
- public
- constructor Create (aOwner: TComponent); override;
- destructor Destroy; override;
- published
- { Events }
- property OnClick;
- property OnDblClick;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnResize;
- property OnChange: TNotifyEvent read FOnChange write FOnChange;
- property Bevel;
- property ParentShowHint;
- property ParentColor;
- property ShowHint;
- property Visible;
- property Color default clBlack;
- property DrawInactive: Boolean read FDrawInactive write SetDrawInactive default True;
- property Enabled: Boolean read GetEnabled write SetEnabled default True;
- property LEDColor: TColor read FLEDColor write SetLEDColor default clLime;
- property InactiveColor: TColor read FInactiveColor write SetInactiveColor default clGreen;
- property NumDigits: integer read FNumDigits write SetNumDigits default 2;
- property DigitSize: TMMLEDSize read FSize write SetSize default ls13X21;
- property LEDSpace: integer read FLEDSpace write SetLEDSpace default 1;
- property MaxValue: LongInt read FMaxValue write SetMaxValue default 0;
- property MinValue: LongInt read FMinValue write SetMinValue default 100;
- property TabOrder;
- property TabStop;
- property ZeroBlank: Boolean read FZeroBlank write SetZeroBlank default False;
- property Value: Longint read FValue write SetValue default 0;
- end;
- {-- TMMLEDSpin -------------------------------------------------------}
- TMMLEDSpin = class(TMMWinControl)
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- property Button: TMMSpinButton read FButton write FButton;
- published
- { Events }
- property OnClick;
- property OnDblClick;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnChange: TNotifyEvent read FOnChange write FOnChange;
- property OnDownClick: TNotifyEvent read FOnDownClick write FOnDownClick;
- property OnUpClick: TNotifyEvent read FOnUpClick write FOnUpClick;
- property Bevel: TMMBevel read GetLEDBevel write SetLEDBevel;
- property ParentShowHint;
- property ShowHint;
- property Visible;
- property Color: TColor read GetColor write SetColor default clBlack;
- property DrawInactive: Boolean read GetDrawInactive write SetDrawInactive default True;
- property Enabled: Boolean read GetEnabled write SetEnabled;
- property LEDColor: TColor read GetLEDColor write SetLEDColor;
- property InactiveColor: TColor read GetInactiveColor write SetInactiveColor;
- property NumDigits: integer read GetNumDigits write SetNumDigits;
- property DigitSize: TMMLEDSize read GetSize write SetSize;
- property LEDSpace: integer read GetLEDSpace write SetLEDSpace;
- property Space: integer read FSpace write SetSpace default 2;
- property TabStop: Boolean read GetTabStop write setTabStop default True;
- property TabOrder;
- property Increment: Longint read GetIncrement write SetIncrement;
- property ZeroBlank: Boolean read GetZeroBlank write SetZeroBlank;
- property MaxValue: LongInt read GetMaxValue write SetMaxValue;
- property MinValue: LongInt read GetMinValue write SetMinValue;
- property Value: Longint read GetValue write SetValue;
- property DownGlyph: TBitmap read GetDownGlyph write SetDownGlyph;
- property DownNumGlyphs: TNumGlyphs read GetDownNumGlyphs write SetDownNumGlyphs;
- property UpGlyph: TBitmap read GetUpGlyph write SetUpGlyph;
- property UpNumGlyphs: TNumGlyphs read GetUpNumGlyphs write SetUpNumGlyphs;
- property ButtonFace: Boolean read GetButtonFace write SetButtonFace;
- property MiddleButton: Boolean read GetMiddleButton write SetMiddleButton;
- property SpinBevel: TMMBevel read GetSpinBevel write SetSpinBevel;
- end;
- implementation
|