home *** CD-ROM | disk | FTP | other *** search
/ Chip 1999 March / Chip_1999-03_cd.bin / zkuste / delphi / D / XBALOON.ZIP / Unit1.pas < prev    next >
Pascal/Delphi Source File  |  1999-01-20  |  4KB  |  130 lines

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   {$IFDEF WIN32} Windows, {$ELSE} WinTypes, WinProcs, {$ENDIF}
  7.   Messages, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
  8.   XBaloon, ShellAPI;
  9.  
  10. type
  11.   TForm1 = class(TForm)
  12.     Baloon: TXBaloon;
  13.     Label1: TLabel;
  14.     MailMe: TLabel;
  15.     Label3: TLabel;
  16.     Label4: TLabel;
  17.     Label5: TLabel;
  18.     Label6: TLabel;
  19.     Label7: TLabel;
  20.     procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
  21.       Shift: TShiftState; X, Y: Integer);
  22.     procedure Label5MouseDown(Sender: TObject; Button: TMouseButton;
  23.       Shift: TShiftState; X, Y: Integer);
  24.     procedure Label6MouseDown(Sender: TObject; Button: TMouseButton;
  25.       Shift: TShiftState; X, Y: Integer);
  26.     procedure Label5MouseUp(Sender: TObject; Button: TMouseButton;
  27.       Shift: TShiftState; X, Y: Integer);
  28.     procedure Label4MouseDown(Sender: TObject; Button: TMouseButton;
  29.       Shift: TShiftState; X, Y: Integer);
  30.     procedure MailMeClick(Sender: TObject);
  31.   private
  32.     Point: TPoint;
  33.   public
  34.     { Public declarations }
  35.   end;
  36.  
  37. var
  38.   Form1: TForm1;
  39.  
  40. implementation
  41.  
  42. {$R *.DFM}
  43.  
  44. procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  45.   Shift: TShiftState; X, Y: Integer);
  46. begin
  47.   if Button = mbLeft then
  48.    begin
  49.     Point.X := X;
  50.     Point.Y := Y;
  51.     Point := ClientToScreen(Point);
  52.     Baloon.Font.Style := [];
  53.     Baloon.Font.Name := Font.Name;
  54.     Baloon.Font.Size := 8;
  55.     Baloon.Font.Color := clBlack;
  56.     Baloon.Color := clWhite;
  57.     Baloon.Shape := sRoundRect;
  58.     Baloon.Show(Point, 'Baloon !');
  59.    end;
  60. end;
  61.  
  62. procedure TForm1.Label5MouseDown(Sender: TObject; Button: TMouseButton;
  63.   Shift: TShiftState; X, Y: Integer);
  64. begin
  65.   if Button = mbLeft then
  66.    begin
  67.     Point.X := X + Label5.Left;
  68.     Point.Y := Y + Label5.Top;
  69.     Point := ClientToScreen(Point);
  70.     Baloon.Font.Name := Label5.Font.Name;
  71.     Baloon.Font.Size := Label5.Font.Size;
  72.     Baloon.Font.Style := Label5.Font.Style;
  73.     Baloon.Font.Color := clNavy;
  74.     Baloon.Color := clAqua;
  75.     Baloon.Shape := sRoundRect;
  76.     Baloon.Show(Point, '╥≡Φ ∞≤Σ≡σ÷α Γ εΣφε∞ ≥ατ≤@∩≤±≥ΦδΦ±ⁿ ∩ε ∞ε≡■ Γ π≡ετ≤.@' +
  77.                        '┴≤Σⁿ ∩ε∩≡ε≈φσσ ∞σΣφ√Θ ≥ατ,@ΣδΦφφσσ ß√δ ß√ ∞εΘ ≡α±±Ωατ.');
  78.    end;
  79. end;
  80.  
  81. procedure TForm1.Label6MouseDown(Sender: TObject; Button: TMouseButton;
  82.   Shift: TShiftState; X, Y: Integer);
  83. begin
  84.   if Button = mbLeft then
  85.    begin
  86.     Point.X := X + Label6.Left;
  87.     Point.Y := Y + Label6.Top;
  88.     Point := ClientToScreen(Point);
  89.     Baloon.Font.Name := Label6.Font.Name;
  90.     Baloon.Font.Size := Label6.Font.Size;
  91.     Baloon.Font.Style := Label6.Font.Style;
  92.     Baloon.Color := Label6.Font.Color;
  93.     Baloon.Shape := sRoundRect;
  94.     Baloon.Show(Point, 'Dance with the dead in my dreams@Listen to their hollowed screams@' +
  95.                        'The dead have taken my soul@Temptation''s lost all control');
  96.    end;
  97. end;
  98.  
  99. procedure TForm1.Label5MouseUp(Sender: TObject; Button: TMouseButton;
  100.   Shift: TShiftState; X, Y: Integer);
  101. begin
  102.   Baloon.Hide;
  103. end;
  104.  
  105. procedure TForm1.Label4MouseDown(Sender: TObject; Button: TMouseButton;
  106.   Shift: TShiftState; X, Y: Integer);
  107. begin
  108.   if Button = mbLeft then
  109.    begin
  110.     Point.X := X + Label4.Left;
  111.     Point.Y := Y + Label4.Top;
  112.     Point := ClientToScreen(Point);
  113.     Baloon.Font.Name := Label4.Font.Name;
  114.     Baloon.Font.Size := Label4.Font.Size;
  115.     Baloon.Font.Style := Label4.Font.Style;
  116.     Baloon.Color := Label4.Font.Color;
  117.     Baloon.Shape := sRectangle;
  118.     Baloon.Show(Point, Label4.Caption);
  119.    end;
  120. end;
  121.  
  122. procedure TForm1.MailMeClick(Sender: TObject);
  123. begin
  124.  { And here - small example for executing Web Browser or Mailer. ;-) }
  125.  
  126.   ShellExecute(GetDesktopWindow, 'open', 'mailto:xacker@phreaker.net', nil, nil, SW_SHOWNORMAL);
  127. end;
  128.  
  129. end.
  130.