home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue31 / cm20 / CM20.ZIP / Demo / cm_hyper.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-12-19  |  894 b   |  46 lines

  1. unit cm_hyper;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, ColMemo;
  8.  
  9. type
  10.   TFrmHyperTextDemo = class(TForm)
  11.     ColorMemo1: TColorMemo;
  12.     Label1: TLabel;
  13.     procedure ColorMemo1HotSpotClick(Sender: TObject; const SRC: String);
  14.   private
  15.     { Private declarations }
  16.   public
  17.     { Public declarations }
  18.   end;
  19.  
  20. var
  21.   FrmHyperTextDemo: TFrmHyperTextDemo;
  22.  
  23. implementation
  24.  
  25. {$R *.DFM}
  26.  
  27.  
  28. procedure TFrmHyperTextDemo.ColorMemo1HotSpotClick(Sender: TObject;
  29.   const SRC: String);
  30. begin
  31.   if SRC='sound' then
  32.     MessageBeep(0)
  33.   else
  34.   if SRC='chapter' then
  35.     ColorMemo1.ScrollBy(0,26)
  36.   else
  37.   if SRC='next line' then
  38.     ColorMemo1.ScrollBy(0,1)
  39.   else
  40.   if SRC='previous line' then
  41.     ColorMemo1.ScrollBy(0,-1)
  42.   else ShowMessage('You'' clicked on "' + SRC + '" hotspot');
  43. end;
  44.  
  45. end.
  46.