home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 22 / CD_ASCQ_22_0695.iso / win / prg / hotmap / ressav.pas < prev    next >
Pascal/Delphi Source File  |  1995-03-26  |  2KB  |  84 lines

  1. unit Ressav;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, VBXCtrl, Hotmap, StdCtrls, Pict;
  8.  
  9. type
  10.   TfrResSav = class(TForm)
  11.     HotMap1: THotMap;
  12.     Memo1: TMemo;
  13.     Edit1: TEdit;
  14.     Edit2: TEdit;
  15.     Label1: TLabel;
  16.     Label2: TLabel;
  17.     BiPict1: TBiPict;
  18.     procedure FormCreate(Sender: TObject);
  19.     procedure FormShow(Sender: TObject);
  20.     procedure HotMap1RegionMouseDown(Sender: TObject;
  21.       var RegionNum: Single; var Button: Integer);
  22.   private
  23.     { Private declarations }
  24.   public
  25.     { Public declarations }
  26.   end;
  27.  
  28. var
  29.   frResSav: TfrResSav;
  30.  
  31. implementation
  32.  
  33. {$R *.DFM}
  34.  
  35. procedure TfrResSav.FormCreate(Sender: TObject);
  36.     var     DtFl:     TVBString;
  37. begin
  38.     Memo1.Text := 'HotMap saves Windows resources. ';
  39.     Memo1.Text := Memo1.Text + 'In this demo ONE HotMap ';
  40.     Memo1.Text := Memo1.Text + 'control replaces 21 Command ';
  41.     Memo1.Text := Memo1.Text + 'Buttons. That saves you Windows ';
  42.     Memo1.Text := Memo1.Text + 'resources and memory. HotMap control ';
  43.     Memo1.Text := Memo1.Text + 'recognizes different mouse buttons. ';
  44.     Memo1.Text := Memo1.Text + 'Click any button and Enjoy.';
  45.  
  46.     DtFl    := 'TOOLS.HMD';
  47.     HotMap1.DataFile := DtFl;
  48.     HotMap1.Action := 4;
  49. {    DtFl    := 'USAMAP.BMP';
  50.     HotMap1.BmpName := DtFl;}
  51. end;
  52.  
  53. procedure TfrResSav.FormShow(Sender: TObject);
  54. begin
  55.     HotMap1.FillType := 3;
  56.     HotMap1.MouseCursor := BiPict1.Picture;
  57.     HotMap1.MouseHotX := 31;
  58.     HotMap1.MouseHotY := 11;
  59. end;
  60.  
  61. procedure TfrResSav.HotMap1RegionMouseDown(Sender: TObject;
  62.   var RegionNum: Single; var Button: Integer);
  63.   var Rn:    Integer;
  64. begin
  65.  
  66.        Rn := Round(RegionNum);
  67.        If Rn > 0 Then
  68.         Edit1.Text := IntToStr(Rn)
  69.        Else
  70.         Edit1.Text := '';
  71.  
  72.        Case Button of
  73.         0:
  74.             Edit2.Text := 'Left';
  75.         1:
  76.             Edit2.Text := 'Right';
  77.         2:
  78.             Edit2.Text := 'Middle';
  79.     end;
  80.  
  81. end;
  82.  
  83. end.
  84.