Unit1.pas 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. {========================================================================}
  2. {= (c) 1995-98 SwiftSoft Ronald Dittrich =}
  3. {========================================================================}
  4. {= All Rights Reserved =}
  5. {========================================================================}
  6. {= D 01099 Dresden = Fax.: +49 (0)351-8037944 =}
  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: 12.08.98 - 14:46:49 $ =}
  24. {========================================================================}
  25. unit Unit1;
  26. interface
  27. uses
  28. Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  29. MMBmpLst, MMObj, MMHook, MMFill, MMBmpBtn, MMForm, ExtCtrls, MMPanel,
  30. MMDSPObj, MMWave;
  31. type
  32. TForm1 = class(TForm)
  33. MMBitmapList1: TMMBitmapList;
  34. MMPanelFill1: TMMPanelFill;
  35. MMBitmapButton1: TMMBitmapButton;
  36. MMBitmapButton2: TMMBitmapButton;
  37. MMBitmapButton3: TMMBitmapButton;
  38. MMBitmapButton4: TMMBitmapButton;
  39. MMBitmapButton5: TMMBitmapButton;
  40. MMBitmapButton6: TMMBitmapButton;
  41. MemoryWave1: TMMMemoryWave;
  42. MemoryWave2: TMMMemoryWave;
  43. procedure MMBitmapButton1MouseDown(Sender: TObject;
  44. Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  45. procedure MMBitmapButton6Click(Sender: TObject);
  46. procedure MMBitmapButton6MouseDown(Sender: TObject;
  47. Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  48. procedure MMPanelFill1MouseDown(Sender: TObject; Button: TMouseButton;
  49. Shift: TShiftState; X, Y: Integer);
  50. procedure MMPanelFill1MouseMove(Sender: TObject; Shift: TShiftState; X,
  51. Y: Integer);
  52. procedure MMPanelFill1MouseUp(Sender: TObject; Button: TMouseButton;
  53. Shift: TShiftState; X, Y: Integer);
  54. public
  55. Dragging : Boolean;
  56. DragStart: TPoint;
  57. end;
  58. var
  59. Form1: TForm1;
  60. implementation
  61. {$R *.DFM}
  62. {------------------------------------------------------------------------------}
  63. procedure TForm1.MMBitmapButton1MouseDown(Sender: TObject; Button: TMouseButton;
  64. Shift: TShiftState; X, Y: Integer);
  65. begin
  66. MemoryWave1.PlaySound(pmAsync);
  67. end;
  68. {------------------------------------------------------------------------------}
  69. procedure TForm1.MMBitmapButton6MouseDown(Sender: TObject; Button: TMouseButton;
  70. Shift: TShiftState; X, Y: Integer);
  71. begin
  72. TMMBitmapButton(Sender).Down := True;
  73. TMMBitmapButton(Sender).Update;
  74. MemoryWave2.PlaySound(pmSync);
  75. end;
  76. {------------------------------------------------------------------------------}
  77. procedure TForm1.MMBitmapButton6Click(Sender: TObject);
  78. begin
  79. Close;
  80. end;
  81. {------------------------------------------------------------------------------}
  82. procedure TForm1.MMPanelFill1MouseDown(Sender: TObject; Button: TMouseButton;
  83. Shift: TShiftState; X, Y: Integer);
  84. begin
  85. if (Button = mbLeft) then
  86. begin
  87. Dragging := True;
  88. DragStart := TControl(Sender).ClientToScreen(Point(X,Y));
  89. end;
  90. end;
  91. {------------------------------------------------------------------------------}
  92. procedure TForm1.MMPanelFill1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
  93. var
  94. Diff: TPoint;
  95. begin
  96. if Dragging then
  97. begin
  98. Diff := TControl(Sender).ClientToScreen(Point(X,Y));
  99. Diff := Point(Diff.X-DragStart.X,Diff.Y-DragStart.Y);
  100. SetBounds(Left+Diff.X,Top+Diff.Y,Width,Height);
  101. DragStart.X := DragStart.X+Diff.X;
  102. DragStart.Y := DragStart.Y+Diff.Y;
  103. end;
  104. end;
  105. {------------------------------------------------------------------------------}
  106. procedure TForm1.MMPanelFill1MouseUp(Sender: TObject; Button: TMouseButton;
  107. Shift: TShiftState; X, Y: Integer);
  108. begin
  109. if (Button = mbLeft) then Dragging := False;
  110. end;
  111. end.