MMSPIN.INT 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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 MMSpin;
  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. StdCtrls,
  44. Menus,
  45. Buttons,
  46. MMSystem,
  47. MMObj,
  48. MMUtils,
  49. MMString,
  50. MMButton;
  51. const
  52. InitialPause = 400; { time in ms before first repeat occurs }
  53. RepeatPause = 50; { time in ms between subsequent repeats }
  54. type
  55. TMMTimeBtnState = set of (tbFocusRect, tbAllowTimer, tbDragging);
  56. TMMFocusStyle = (fsNone,fsSolid,fsDot);
  57. TMMOrientation = (orVertical,orHorizontal);
  58. {== TMMTimerSpeedButton ================================================}
  59. TMMTimerSpeedButton = class(TMMSpeedButton)
  60. public
  61. constructor Create(aOwner: TComponent); override;
  62. destructor Destroy; override;
  63. property TimeBtnState: TMMTimeBtnState read FTimeBtnState write FTimeBtnState;
  64. property FocusColor: TColor read FFocusColor write FFocusColor;
  65. property FocusStyle: TMMFocusStyle read FFocusStyle write FFocusStyle default fsSolid;
  66. property Enabled: Boolean read GetEnabled write SetEnabled default True;
  67. property ButtonFace: Boolean read FButtonFace write SetButtonFace default False;
  68. end;
  69. {== TMMCustomSpinButton ===============================================}
  70. TMMCustomSpinButton = class(TMMCustomControl)
  71. public
  72. constructor Create(AOwner: TComponent); override;
  73. destructor Destroy; override;
  74. procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
  75. property UpButton: TMMTimerSpeedButton read FUpButton write FUpButton;
  76. property DownButton: TMMTimerSpeedButton read FDownButton write FDownButton;
  77. property FocusStyle: TMMFocusStyle read FFocusStyle write SetFocusStyle default fsSolid;
  78. protected
  79. property OnChange: TNotifyEvent read FOnChange write FOnChange;
  80. property OnDownClick: TNotifyEvent read FOnDownClick write FOnDownClick;
  81. property OnUpClick: TNotifyEvent read FOnUpClick write FOnUpClick;
  82. { Orientation must be the first }
  83. property Orientation: TMMOrientation read FOrientation write SetOrientation default orVertical;
  84. property DownGlyph: TBitmap read GetDownGlyph write SetDownGlyph;
  85. property DownNumGlyphs: TNumGlyphs read GetDownNumGlyphs write SetDownNumGlyphs;
  86. property Enabled: Boolean read GetEnabled write SetEnabled default True;
  87. property FocusColor: TColor read FFocusColor write SetFocusColor default clBlack;
  88. property FocusControl: TWinControl read FFocusControl write SetFocusControl;
  89. property TabStop default True;
  90. property UpGlyph: TBitmap read GetUpGlyph write SetUpGlyph;
  91. property UpNumGlyphs: TNumGlyphs read GetUpNumGlyphs write SetUpNumGlyphs;
  92. property Width default 21;
  93. property Height default 28;
  94. property ButtonFace: Boolean read FButtonFace write SetButtonFace default False;
  95. property MiddleButton: Boolean read FMiddleButton write SetMiddleButton default False;
  96. property Increment: Longint read FIncrement write SetIncrement default 1;
  97. property MaxValue: LongInt read FMaxValue write SetMaxValue default 0;
  98. property MinValue: LongInt read FMinValue write SetMinValue default 100;
  99. property Value: Longint read FValue write SetValue default 0;
  100. end;
  101. {== TMMCustomSpinButton ===============================================}
  102. TMMSpinButton = class(TMMCustomSpinButton)
  103. published
  104. property OnChange;
  105. property OnDownClick;
  106. property OnUpClick;
  107. property Bevel;
  108. property Orientation;
  109. property DownGlyph;
  110. property DownNumGlyphs;
  111. property DragCursor;
  112. property DragMode;
  113. property Enabled;
  114. property FocusColor;
  115. property FocusControl;
  116. property ParentShowHint;
  117. property PopupMenu;
  118. property ShowHint;
  119. property TabStop;
  120. property TabOrder;
  121. property UpGlyph;
  122. property UpNumGlyphs;
  123. property Visible;
  124. property Width;
  125. property Height;
  126. property ButtonFace;
  127. property MiddleButton;
  128. property Increment;
  129. property MaxValue;
  130. property MinValue;
  131. property Value;
  132. end;
  133. implementation