MMLEDS.INT 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. {========================================================================}
  2. {= (c) 1995-98 SwiftSoft Ronald Dittrich =}
  3. {========================================================================}
  4. {= All Rights Reserved =}
  5. {========================================================================}
  6. {= D 01099 Dresden = Tel.: +0351-8012255 =}
  7. {= Loewenstr.7a = info@swiftsoft.de =}
  8. {========================================================================}
  9. {= Actual versions on http://www.swiftsoft.de/mmtools.html =}
  10. {========================================================================}
  11. {= This code is for reference purposes only and may not be copied or =}
  12. {= distributed in any format electronic or otherwise except one copy =}
  13. {= for backup purposes. =}
  14. {= =}
  15. {= No Delphi Component Kit or Component individually or in a collection=}
  16. {= subclassed or otherwise from the code in this unit, or associated =}
  17. {= .pas, .dfm, .dcu, .asm or .obj files may be sold or distributed =}
  18. {= without express permission from SwiftSoft. =}
  19. {= =}
  20. {= For more licence informations please refer to the associated =}
  21. {= HelpFile. =}
  22. {========================================================================}
  23. {= $Date: 20.01.1998 - 18:00:00 $ =}
  24. {========================================================================}
  25. Unit MMLEDS;
  26. {$I COMPILER.INC}
  27. interface
  28. uses
  29. {$IFDEF WIN32}
  30. Windows,
  31. {$ELSE}
  32. WinTypes,
  33. WinProcs,
  34. {$ENDIF}
  35. SysUtils,
  36. Messages,
  37. Classes,
  38. Graphics,
  39. Controls,
  40. Forms,
  41. Dialogs,
  42. ExtCtrls,
  43. Buttons,
  44. DsgnIntf,
  45. MMObj,
  46. MMUtils,
  47. MMString,
  48. MMSpin;
  49. type
  50. TMMLEDType =(ltDigit, ltPeriod, ltColon, ltMinus);
  51. TMMLEDSize =(ls06x07,ls07x11,ls08x13,ls11x19,ls13x20,ls13x21,ls15x24,
  52. ls15x25,ls17x29,ls18x25,ls19x33,ls21x37,ls23x41);
  53. {-- TMMLED -----------------------------------------------------------}
  54. TMMLED = class(TMMGraphicControl)
  55. public
  56. constructor Create(AOwner: TComponent); override;
  57. published
  58. { Events }
  59. property OnClick;
  60. property OnDblClick;
  61. property OnMouseDown;
  62. property OnMouseMove;
  63. property OnMouseUp;
  64. property Bevel;
  65. property Color default clGreen;
  66. property ParentShowHint;
  67. property ShowHint;
  68. property Visible;
  69. property Enabled: Boolean read FEnabled write SetEnabled default True;
  70. property Height default 8;
  71. property Width default 16;
  72. property LEDColor: TColor read FLEDColor write setLEDColor default clLime;
  73. end;
  74. {-- TMMLEDMode -------------------------------------------------------}
  75. TMMLEDMode = class(TMMGraphicControl)
  76. public
  77. constructor Create (AOwner: TComponent); override;
  78. destructor Destroy; override;
  79. published
  80. { Events }
  81. property OnClick;
  82. property OnDblClick;
  83. property OnMouseDown;
  84. property OnMouseMove;
  85. property OnMouseUp;
  86. property ParentShowHint;
  87. property ParentColor;
  88. property ShowHint;
  89. property Visible;
  90. property Color;
  91. property Width default 27;
  92. property Height default 11;
  93. property DrawInactive: Boolean read FDrawInactive write SetDrawInactive default True;
  94. property Enabled: Boolean read GetEnabled write SetEnabled default True;
  95. property Mode: TMMMode read FMode write SetMode default mMono;
  96. property LEDColor: TColor read FLEDColor write SetLEDColor default clLime;
  97. property InactiveColor: TColor read FInactiveColor write SetInactiveColor default clGreen;
  98. end;
  99. {-- TMMCustomLEDDigit ------------------------------------------------}
  100. TMMCustomLEDDigit = class(TMMGraphicControl);
  101. {-- TMMLEDDigit ------------------------------------------------------}
  102. TMMLEDDigit = class(TMMCustomLEDDigit)
  103. public
  104. constructor Create (AOwner: TComponent); override;
  105. destructor Destroy; override;
  106. procedure Increase;
  107. procedure Decrease;
  108. published
  109. { Events }
  110. property OnClick;
  111. property OnDblClick;
  112. property OnMouseDown;
  113. property OnMouseMove;
  114. property OnMouseUp;
  115. property OnRollForward: TNotifyEvent read FOnRollForward write FOnRollForward;
  116. property OnRollBackward: TNotifyEvent read FOnRollBackward write FOnRollBackward;
  117. property ParentShowHint;
  118. property ParentColor;
  119. property ShowHint;
  120. property Visible;
  121. property Color;
  122. property Width default 11;
  123. property Height default 21;
  124. property Enabled: Boolean read GetEnabled write SetEnabled default True;
  125. property MinValue: integer read FMinValue write SetMinValue default 0;
  126. property MaxValue: integer read FMaxValue write SetMaxValue default 9;
  127. property Value: Longint read FValue write SetValue default 0;
  128. property DrawInactive: Boolean read FDrawInactive write SetDrawInactive default True;
  129. property ZeroBlank: Boolean read FZeroBlank write SetZeroBlank default False;
  130. property InactiveColor: TColor read FInactiveColor write SetInactiveColor default clGreen;
  131. property LEDColor: TColor read FLEDColor write SetLEDColor default clLime;
  132. property DigitSize: TMMLEDSize read FSize write SetSize default ls13X21;
  133. property DisplayType: TMMLEDType read FType write SetType default ltDigit;
  134. property CascadeValues: Boolean read FCascade write SetCascade default False;
  135. property Connect: TMMCustomLEDDigit read FConnect write SetConnect;
  136. end;
  137. {-- TMMLEDDigitConnectEditor ----------------------------------------}
  138. TMMLEDDigitConnectEditor = class(TComponentProperty)
  139. public
  140. procedure GetValues(Proc: TGetStrProc); override;
  141. end;
  142. {-- TMMLEDPanel ------------------------------------------------------}
  143. TMMLEDPanel = class(TMMCustomPanel)
  144. public
  145. constructor Create (aOwner: TComponent); override;
  146. destructor Destroy; override;
  147. published
  148. { Events }
  149. property OnClick;
  150. property OnDblClick;
  151. property OnMouseDown;
  152. property OnMouseMove;
  153. property OnMouseUp;
  154. property OnResize;
  155. property OnChange: TNotifyEvent read FOnChange write FOnChange;
  156. property Bevel;
  157. property ParentShowHint;
  158. property ParentColor;
  159. property ShowHint;
  160. property Visible;
  161. property Color default clBlack;
  162. property DrawInactive: Boolean read FDrawInactive write SetDrawInactive default True;
  163. property Enabled: Boolean read GetEnabled write SetEnabled default True;
  164. property LEDColor: TColor read FLEDColor write SetLEDColor default clLime;
  165. property InactiveColor: TColor read FInactiveColor write SetInactiveColor default clGreen;
  166. property NumDigits: integer read FNumDigits write SetNumDigits default 2;
  167. property DigitSize: TMMLEDSize read FSize write SetSize default ls13X21;
  168. property LEDSpace: integer read FLEDSpace write SetLEDSpace default 1;
  169. property MaxValue: LongInt read FMaxValue write SetMaxValue default 0;
  170. property MinValue: LongInt read FMinValue write SetMinValue default 100;
  171. property TabOrder;
  172. property TabStop;
  173. property ZeroBlank: Boolean read FZeroBlank write SetZeroBlank default False;
  174. property Value: Longint read FValue write SetValue default 0;
  175. end;
  176. {-- TMMLEDSpin -------------------------------------------------------}
  177. TMMLEDSpin = class(TMMWinControl)
  178. public
  179. constructor Create(AOwner: TComponent); override;
  180. destructor Destroy; override;
  181. property Button: TMMSpinButton read FButton write FButton;
  182. published
  183. { Events }
  184. property OnClick;
  185. property OnDblClick;
  186. property OnMouseDown;
  187. property OnMouseMove;
  188. property OnMouseUp;
  189. property OnChange: TNotifyEvent read FOnChange write FOnChange;
  190. property OnDownClick: TNotifyEvent read FOnDownClick write FOnDownClick;
  191. property OnUpClick: TNotifyEvent read FOnUpClick write FOnUpClick;
  192. property Bevel: TMMBevel read GetLEDBevel write SetLEDBevel;
  193. property ParentShowHint;
  194. property ShowHint;
  195. property Visible;
  196. property Color: TColor read GetColor write SetColor default clBlack;
  197. property DrawInactive: Boolean read GetDrawInactive write SetDrawInactive default True;
  198. property Enabled: Boolean read GetEnabled write SetEnabled;
  199. property LEDColor: TColor read GetLEDColor write SetLEDColor;
  200. property InactiveColor: TColor read GetInactiveColor write SetInactiveColor;
  201. property NumDigits: integer read GetNumDigits write SetNumDigits;
  202. property DigitSize: TMMLEDSize read GetSize write SetSize;
  203. property LEDSpace: integer read GetLEDSpace write SetLEDSpace;
  204. property Space: integer read FSpace write SetSpace default 2;
  205. property TabStop: Boolean read GetTabStop write setTabStop default True;
  206. property TabOrder;
  207. property Increment: Longint read GetIncrement write SetIncrement;
  208. property ZeroBlank: Boolean read GetZeroBlank write SetZeroBlank;
  209. property MaxValue: LongInt read GetMaxValue write SetMaxValue;
  210. property MinValue: LongInt read GetMinValue write SetMinValue;
  211. property Value: Longint read GetValue write SetValue;
  212. property DownGlyph: TBitmap read GetDownGlyph write SetDownGlyph;
  213. property DownNumGlyphs: TNumGlyphs read GetDownNumGlyphs write SetDownNumGlyphs;
  214. property UpGlyph: TBitmap read GetUpGlyph write SetUpGlyph;
  215. property UpNumGlyphs: TNumGlyphs read GetUpNumGlyphs write SetUpNumGlyphs;
  216. property ButtonFace: Boolean read GetButtonFace write SetButtonFace;
  217. property MiddleButton: Boolean read GetMiddleButton write SetMiddleButton;
  218. property SpinBevel: TMMBevel read GetSpinBevel write SetSpinBevel;
  219. end;
  220. implementation