home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Power Pack / Visual_Basic4_Power_Pack.bin / vb4files / ilib_vb / umultim.pa_ / umultim.pa
Encoding:
Text File  |  1996-11-20  |  3.2 KB  |  125 lines

  1. {
  2. Written by Jan Dekkers and Kevin Adams (c) 1995, 1996. If you are a non
  3. registered client, you may use or alter this demo only for evaluation
  4. purposes.
  5.  
  6. Copyright by SkyLine Tools. All rights reserved.
  7.  
  8. Part of Imagelib VCL/DLL Library.
  9. }
  10.  
  11. unit umultim;
  12.  
  13. {Includes settings to compile in either 16 or 32 bit}
  14. {$I DEFILIB.INC}
  15.  
  16. interface
  17.  
  18. uses
  19. {$IFDEF DEL32}
  20.   Windows,
  21. {$ELSE}
  22.   WinTypes,
  23.   WinProcs,
  24. {$ENDIF}
  25.   DLL95V1,    {ImageLib Dll interface and misc. functions}
  26.   Messages,
  27.   SysUtils,
  28.   Classes,
  29.   Graphics,
  30.   Controls,
  31.   Forms,
  32.   Dialogs,
  33.   StdCtrls,
  34.   Buttons,
  35.   MImaTB,    {PMultiMedia Toolbar VCL component}
  36.   TMultiMP;  {PMultiMedia VCL component}
  37.  
  38.  
  39. type
  40.   TMMForm3 = class(TForm)
  41.     Label1: TLabel;
  42.     CheckBox1: TCheckBox;
  43.     PMultiMedia1: TPMultiMedia;
  44.     MultiMediaToolbar1: TMultiMediaToolbar;
  45.     Label2: TLabel;
  46.     Label3: TLabel;
  47.     Label4: TLabel;
  48.     procedure CheckBox1Click(Sender: TObject);
  49.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  50.     procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
  51.       Shift: TShiftState; X, Y: Integer);
  52.     procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  53.       Y: Integer);
  54.     procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
  55.       Shift: TShiftState; X, Y: Integer);
  56.     procedure FormActivate(Sender: TObject);
  57.   private
  58.     { Private declarations }
  59.     MoveImage  :  boolean;
  60.   public
  61.     { Public declarations }
  62.   end;
  63.  
  64. var
  65.   MMForm3: TMMForm3;
  66.  
  67. implementation
  68.  
  69. {$R *.DFM}
  70. {------------------------------------------------------------------------}
  71.  
  72. procedure TMMForm3.CheckBox1Click(Sender: TObject);
  73. begin
  74.    {Show or hide the toolbar}
  75.    MultiMediaToolbar1.ShowToolBar:=CheckBox1.Checked;
  76. end;
  77. {------------------------------------------------------------------------}
  78.  
  79. procedure TMMForm3.FormClose(Sender: TObject; var Action: TCloseAction);
  80. begin
  81.    MMForm3:=Nil;
  82.    Action:=caFree;
  83. end;
  84. {------------------------------------------------------------------------}
  85.  
  86. procedure TMMForm3.FormMouseDown(Sender: TObject; Button: TMouseButton;
  87.   Shift: TShiftState; X, Y: Integer);
  88. begin
  89.    {If the shift key is down the image can be moved}
  90.    if ssShift in Shift then
  91.      MoveImage:=true
  92.    else
  93.      MoveImage:=false;
  94. end;
  95. {------------------------------------------------------------------------}
  96.  
  97. procedure TMMForm3.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  98.   Y: Integer);
  99. begin
  100. {In case moveimage is true (Shift key down) move the Image}
  101.  if MoveImage then begin
  102.     PMultiMedia1.Top:=Y;
  103.     PMultiMedia1.Left:=X;
  104.  end;
  105.     Label2.Caption:='X ='+IntToStr(X)+'   Y ='+IntToStr(Y);
  106. end;
  107. {------------------------------------------------------------------------}
  108.  
  109. procedure TMMForm3.FormMouseUp(Sender: TObject; Button: TMouseButton;
  110.   Shift: TShiftState; X, Y: Integer);
  111. begin
  112.     {Reset the moveimage indicater}
  113.     MoveImage:=false;
  114. end;
  115. {------------------------------------------------------------------------}
  116.  
  117. procedure TMMForm3.FormActivate(Sender: TObject);
  118. begin
  119.   {On activate show the toolbar}
  120.   MultiMediaToolbar1.ShowToolBar:=true;
  121. end;
  122. {------------------------------------------------------------------------}
  123.  
  124. End.
  125.