MMSCRLR.INT 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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 MMScrlr;
  26. {$I COMPILER.INC}
  27. interface
  28. uses
  29. {$IFDEF WIN32}
  30. Windows,
  31. {$ELSE}
  32. WinTypes,
  33. WinProcs,
  34. {$ENDIF}
  35. SysUtils,
  36. Classes,
  37. Controls,
  38. Graphics,
  39. Forms,
  40. Messages,
  41. MMSystem,
  42. MMObj,
  43. MMUtils,
  44. MMDIBCv,
  45. MMTimer;
  46. type
  47. TMMEndNotifyEvent = procedure(Sender: TObject; var Reset: Boolean) of object;
  48. TMMHorizPos = (hpLeftLeft,hpLeftRight,hpCenter,hpRightLeft,hpRightRight,hpUser);
  49. TMMVertPos = (vpTopTop,vpTopBottom,vpCenter,vpBottomTop,vpBottomBottom,vpUser);
  50. const
  51. defAutoSize = True;
  52. defAlignment = taCenter;
  53. defAutoScroll = False;
  54. defScrollSpeed = 100;
  55. defScrollStepX = 0;
  56. defScrollStepY = 0;
  57. defHorizStart = hpCenter;
  58. defHorizEnd = hpCenter;
  59. defVertStart = vpCenter;
  60. defVertEnd = vpCenter;
  61. defWidth = 100;
  62. defHeight = 100;
  63. type
  64. {-- TMMCustomScroller --------------------------------------------------}
  65. TMMCustomScroller = class(TMMDIBGraphicControl)
  66. public
  67. constructor Create(AOwner: TComponent); override;
  68. destructor Destroy; override;
  69. procedure UpdateScrollPos;
  70. procedure ResetScrollPos;
  71. protected
  72. property OnBeginX: TNotifyEvent read FOnBeginX write FOnBeginX;
  73. property OnBeginY: TNotifyEvent read FOnBeginY write FOnBeginY;
  74. property OnEndX: TMMEndNotifyEvent read FOnEndX write FOnEndX;
  75. property OnEndY: TMMEndNotifyEvent read FOnEndY write FOnEndY;
  76. property OnStep: TNotifyEvent read FOnStep write FOnStep;
  77. property TextHeight: integer read FTextHeight;
  78. property TextWidth: integer read FTextWidth;
  79. property Width default defWidth;
  80. property Height default defHeight;
  81. property AutoSize: Boolean read FAutoSize write SetAutoSize default defAutoSize;
  82. property Text: TStrings read GetText write SetText;
  83. property ScrollPosX: Integer index 0 read FScrollPosX write SetScrollPos stored StoreScrollPos;
  84. property ScrollPosY: Integer index 1 read FScrollPosY write SetScrollPos stored StoreScrollPos;
  85. property Alignment: TAlignment read FAlignment write SetAlignment default defAlignment;
  86. property AutoScroll: Boolean read FAutoScroll write SetAutoScroll default defAutoScroll;
  87. property ScrollSpeed: Integer read FScrollSpeed write SetScrollSpeed default defScrollSpeed;
  88. property ScrollStepX: Integer index 0 read FScrollStepX write SetScrollStep default defScrollStepX;
  89. property ScrollStepY: Integer index 1 read FScrollStepY write SetScrollStep default defScrollStepY;
  90. property StartPosX: Integer index 0 read GetStartPos write SetStartPos stored StoreStartPos;
  91. property StartPosY: Integer index 1 read GetStartPos write SetStartPos stored StoreStartPos;
  92. property EndPosX: Integer index 0 read GetEndPos write SetEndPos stored StoreEndPos;
  93. property EndPosY: Integer index 1 read GetEndPos write SetEndPos stored StoreEndPos;
  94. property HorizStart: TMMHorizPos read FHorizStart write SetHorizStart default defHorizStart;
  95. property HorizEnd: TMMHorizPos read FHorizEnd write SetHorizEnd default defHorizEnd;
  96. property VertStart: TMMVertPos read FVertStart write SetVertStart default defVertStart;
  97. property VertEnd: TMMVertPos read FVertEnd write SetVertEnd default defVertEnd;
  98. end;
  99. {-- TMMScroller --------------------------------------------------------}
  100. TMMScroller = class(TMMCustomScroller)
  101. published
  102. property OnClick;
  103. property OnDblClick;
  104. property OnMouseDown;
  105. property OnMouseMove;
  106. property OnMouseUp;
  107. property OnBeginX;
  108. property OnBeginY;
  109. property OnEndX;
  110. property OnEndY;
  111. property OnStep;
  112. property Bevel;
  113. property UseBackGroundDIB;
  114. property BackGroundDIB;
  115. property PaletteRealize;
  116. property PaletteMapped;
  117. property Left;
  118. property Top;
  119. property Align;
  120. property Width;
  121. property Height;
  122. property Visible;
  123. property Enabled;
  124. property Alignment;
  125. property Font;
  126. property ParentFont;
  127. property AutoSize;
  128. property Text;
  129. property Color;
  130. property ParentColor;
  131. property ShowHint;
  132. property ParentShowHint;
  133. property ScrollPosX;
  134. property ScrollPosY;
  135. property TextHeight;
  136. property TextWidth;
  137. property AutoScroll;
  138. property ScrollSpeed;
  139. property ScrollStepX;
  140. property ScrollStepY;
  141. property StartPosX;
  142. property StartPosY;
  143. property EndPosX;
  144. property EndPosY;
  145. property HorizStart;
  146. property HorizEnd;
  147. property VertStart;
  148. property VertEnd;
  149. end;
  150. implementation