MMWHEEL.INT 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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 MMWheel;
  26. {$I COMPILER.INC}
  27. interface
  28. uses
  29. {$IFDEF WIN32}
  30. Windows,
  31. {$ELSE}
  32. WinTypes,
  33. WinProcs,
  34. {$ENDIF}
  35. Messages,
  36. Classes,
  37. SysUtils,
  38. Controls,
  39. ExtCtrls,
  40. Graphics,
  41. Menus,
  42. MMObj,
  43. MMScale;
  44. type
  45. EMMWheelError = class(Exception);
  46. TMMFocusAction = (faHandleColor,faFrameRect,faAll);
  47. TMMHandleStyle = (hsEllipse,hsOwnerDraw);
  48. TMMDrawHandleEvent = procedure(Sender : TObject; Canvas : TCanvas; Rect : TRect;
  49. Origin : TPoint; Focused : Boolean) of object;
  50. const
  51. defMinValue = 0;
  52. defMaxValue = 10;
  53. defValue = 0;
  54. defStartAngle = 225;
  55. defEndAngle = 315;
  56. defWidth = 100;
  57. defHeight = 100;
  58. defAutoSize = True;
  59. defHandleColor = clMaroon;
  60. defFocusedColor = clRed;
  61. defUpDown = False;
  62. defScrollSize = 160;
  63. defLineStep = 1;
  64. defPageStep = 2;
  65. defFocusAction = faAll;
  66. defHandleStyle = hsEllipse;
  67. defRadius = 0;
  68. defHandleSize = 4;
  69. defHandleMargin = 4;
  70. defFrameSpace = 4;
  71. defScaleMargin = 3;
  72. type
  73. {-- TMMCustomWheel ---------------------------------------------------}
  74. TMMCustomWheel = class(TMMCustomControl)
  75. public
  76. constructor Create(AOwner : TComponent); override;
  77. destructor Destroy; override;
  78. protected
  79. property TabStop default True;
  80. property AutoSize : Boolean read FAutoSize write SetAutoSize;
  81. property BackBmp : TBitmap read FBackBmp write SetBackBmp;
  82. property MinValue : Integer read FMinValue write SetMinValue default defMinValue;
  83. property MaxValue : Integer read FMaxValue write SetMaxValue default defMaxValue;
  84. property Value : Integer read FValue write SetValue default defValue;
  85. property StartAngle : Integer read FStartAngle write SetStartAngle default defStartAngle;
  86. property EndAngle : Integer read FEndAngle write SetEndAngle default defEndAngle;
  87. property HandleColor : TColor read FHandleColor write SetHandleColor default defHandleColor;
  88. property FocusedColor: TColor read FFocusedColor write SetFocusedColor default defFocusedColor;
  89. property UpDown : Boolean read FUpDown write FUpDown default defUpDown;
  90. property ScrollSize : Integer index 0 read FScrollSize write SetScrollParam default defScrollSize;
  91. property LineStep : Integer index 1 read FLineStep write SetScrollParam default defLineStep;
  92. property PageStep : Integer index 2 read FPageStep write SetScrollParam default defPageStep;
  93. property FocusAction : TMMFocusAction read FFocusAction write SetFocusAction default defFocusAction;
  94. property Scale : TMMScale read FScale write SetScale;
  95. property Radius : Integer read GetRadius write SetRadius default defRadius;
  96. property HandleStyle : TMMHandleStyle read FHandleStyle write SetHandleStyle default defHandleStyle;
  97. property HandleSize : Integer read FHandleSize write SetHandleSize default defHandleSize;
  98. property HandleMargin: Integer read FHandleMargin write SetHandleMargin default defHandleMargin;
  99. property FrameSpace : Integer read FFrameSpace write SetFrameSpace default defFrameSpace;
  100. property ScaleMargin : Integer read FScaleMargin write SetScaleMargin default defScaleMargin;
  101. property OnChange : TNotifyEvent read FOnChange write FOnChange;
  102. property OnDrawHandle: TMMDrawHandleEvent read FOnDrawHandle write FOnDrawHandle;
  103. end;
  104. {-- TMMWheel ---------------------------------------------------------}
  105. TMMWheel = class(TMMCustomWheel)
  106. published
  107. property OnEnter;
  108. property OnExit;
  109. property OnKeyDown;
  110. property OnKeyPress;
  111. property OnKeyUp;
  112. property OnChange;
  113. property OnDrawHandle;
  114. property Bevel;
  115. property Visible;
  116. property Color;
  117. property Enabled;
  118. property ParentShowHint;
  119. property PopupMenu;
  120. property ShowHint;
  121. property TabStop;
  122. property TabOrder;
  123. property Width;
  124. property Height;
  125. property AutoSize;
  126. property BackBmp;
  127. property MinValue;
  128. property MaxValue;
  129. property Value;
  130. property StartAngle;
  131. property EndAngle;
  132. property HandleColor;
  133. property FocusedColor;
  134. property UpDown;
  135. property ScrollSize;
  136. property LineStep;
  137. property PageStep;
  138. property FocusAction;
  139. property Scale;
  140. property Radius;
  141. property HandleStyle;
  142. property HandleSize;
  143. property HandleMargin;
  144. property FrameSpace;
  145. property ScaleMargin;
  146. end;
  147. {=========================================================================}
  148. implementation