MMSLIDER.INT 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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 MMSlider;
  26. {$I COMPILER.INC}
  27. interface
  28. uses
  29. {$IFDEF WIN32}
  30. Windows,
  31. {$ELSE}
  32. WinTypes,
  33. WinProcs,
  34. {$ENDIF}
  35. Forms,
  36. SysUtils,
  37. Messages,
  38. Classes,
  39. Graphics,
  40. Controls,
  41. Dialogs,
  42. ExtCtrls,
  43. Menus,
  44. MMObj,
  45. MMUtils,
  46. MMMath,
  47. MMString,
  48. MMScale;
  49. type
  50. TMMOrientation = (orVertical,orHorizontal);
  51. TMMThumbStyle = (tsRect,tsOwnerDraw);
  52. TMMGrooveStyle = (gsRect,gsOwnerDraw);
  53. TMMFocusAction = (faNone, faFocusThumb, faFocusRect, faFocusColor, faAll);
  54. TMMScalePos = (spAboveOrLeft, spBelowOrRight, spBoth);
  55. TMMThumbDrawEvent = procedure(Sender: TObject; aCanvas: TCanvas; aRect: TRect;
  56. Dragged,Focused: Boolean) of object;
  57. TMMGrooveDrawEvent= procedure(Sender: TObject; aCanvas: TCanvas; var aRect: TRect) of object;
  58. {-- TMMCustomSlider ---------------------------------------------------}
  59. TMMCustomSlider = class(TMMCustomControl)
  60. public
  61. constructor Create(AOwner: TComponent); override;
  62. destructor Destroy; override;
  63. protected
  64. property OnChange: TNotifyEvent read FOnChange write FOnChange;
  65. property OnTrack: TNotifyEvent read FOnTrack write FOnTrack;
  66. property OnTrackEnd: TNotifyEvent read FOnTrackEnd write FOnTrackEnd;
  67. property OnDrawThumb: TMMThumbDrawEvent read FOnDrawThumb write FOnDrawThumb;
  68. property OnDrawGroove: TMMGrooveDrawEvent read FOnDrawGroove write FOnDrawGroove;
  69. property TabStop default True;
  70. property Width default 200;
  71. property Height default 40;
  72. property Groove: TMMBevel read FGroove write SetGroove;
  73. property FocusAction: TMMFocusAction read FFocusAction write SetFocusAction default faFocusRect;
  74. property FocusColor: TColor index 0 read FFocusColor write SetColors default clActiveCaption;
  75. property GrooveColor: TColor index 1 read FGrooveColor write SetColors default clBtnFace;
  76. property ThumbColor: TColor index 2 read FThumbColor write SetColors default clBtnFace;
  77. property DisabledColor: TColor index 3 read FDisabledColor write SetColors default clWhite;
  78. property HandCursor: Boolean read FHandCursor write FHandCursor default False;
  79. property ThumbCursor: TCursor read FThumbCursor write FThumbCursor default crDefault;
  80. property MinValue: Integer read FMin write SetMin default 0;
  81. property MaxValue: Integer read FMax write SetMax default 10;
  82. property LineSize: Integer read FLineSize write FLineSize default 1;
  83. property PageSize: Integer read FPageSize write FPageSize default 5;
  84. property Orientation: TMMOrientation read FOrientation write SetOrientation default orHorizontal;
  85. property Position: Integer read GetPosition write SetPosition default 0;
  86. property GrooveSize: Byte read FGrooveSize write SetGrooveSize default 3;
  87. property GrooveStyle: TMMGrooveStyle read FGrooveStyle write SetGrooveStyle default gsRect;
  88. property ThumbWidth: Byte index 0 read FThumbWidth write SetThumbSize default 11;
  89. property ThumbHeight: Byte index 1 read FThumbHeight write SetThumbSize default 23;
  90. property ThumbStyle: TMMThumbStyle read FThumbStyle write SetThumbStyle default tsRect;
  91. property ThumbBorder: Boolean read FThumbBorder write SetThumbBorder default True;
  92. property ScaleDistance: Integer read FScaleDistance write SetScaleDist default 10;
  93. property ScalePosition: TMMScalePos read FScalePos write SetScalePos default spBelowOrRight;
  94. property Scale: TMMScale read FScale write SetScale;
  95. property PicLeft: TBitmap read FPicLeft write SetPicLeft;
  96. property PicRight: TBitmap read FPicRight write SetPicRight;
  97. property Logarithmic: Boolean read FLogMode write SetLogMode default False;
  98. property Sensitivity: Integer read FSensitivity write SetSensitivity default -24;
  99. end;
  100. {-- TMMSlider ---------------------------------------------------------}
  101. TMMSlider = class(TMMCustomSlider)
  102. published
  103. property OnEnter;
  104. property OnExit;
  105. property OnKeyDown;
  106. property OnKeyPress;
  107. property OnKeyUp;
  108. property OnChange;
  109. property OnTrack;
  110. property OnTrackEnd;
  111. property OnDrawThumb;
  112. property OnDrawGroove;
  113. property Align;
  114. property Visible;
  115. property Color;
  116. property Enabled;
  117. property ParentShowHint;
  118. property PopupMenu;
  119. property ShowHint;
  120. property TabStop;
  121. property TabOrder;
  122. property Width;
  123. property Height;
  124. property Bevel;
  125. property Groove;
  126. property FocusAction;
  127. property FocusColor;
  128. property GrooveColor;
  129. property ThumbColor;
  130. property ThumbBorder;
  131. property DisabledColor;
  132. property HandCursor;
  133. property ThumbCursor;
  134. property MinValue;
  135. property MaxValue;
  136. property LineSize;
  137. property PageSize;
  138. property Orientation;
  139. property Position;
  140. property GrooveSize;
  141. property ThumbWidth;
  142. property ThumbHeight;
  143. property ThumbStyle;
  144. property GrooveStyle;
  145. property ScaleDistance;
  146. property ScalePosition;
  147. property Scale;
  148. property PicLeft;
  149. property PicRight;
  150. property Logarithmic;
  151. property Sensitivity;
  152. end;
  153. implementation