home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / swag / mouse.swg / 0002_MOUSPIC1.PAS.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-05-28  |  2.8 KB  |  89 lines

  1. {
  2. >    I'm interested in how to change the default mouse cursor to
  3. > another user defined shape.  if you know how to do that, can you
  4. > please post the source For it?  Thanks in advance.
  5. }
  6.  
  7.  
  8. Uses
  9.   Dos, Graph;
  10.  
  11. Var
  12.    Regs : Registers;
  13.  
  14. Type
  15.    CursorType = Array[0..31] of Word;   { to store the cursor shape }
  16.  
  17.  
  18. { define a cursor shape }
  19. Const HourGlass : CursorType =
  20.  
  21.   { this specific Constant, when used in the Procedure to change the cursor
  22.     shape will change it to an hourglass shaped cursor.  of course you can
  23.     define your own cursor shape to suit your needs.
  24.     the comments beside the hex numbers are what it will look like (binary),
  25.     they help TREMendOUSLY in designing a cursor shape. }
  26.  
  27.  
  28.   { Screen mask : the 0's will show up as the background colour, the 1's
  29.     will show whatever is on the screen at that location }
  30.  
  31.    ($0001,  { 0000000000000001 }
  32.     $0001,  { 0000000000000001 }
  33.     $8003,  { 1000000000000011 }
  34.     $C7C7,  { 1100011111000111 }
  35.     $E38F,  { 1110001110001111 }
  36.     $F11F,  { 1111000100011111 }
  37.     $F83F,  { 1111100000111111 }
  38.     $FC7F,  { 1111110001111111 }
  39.     $F83F,  { 1111100000111111 }
  40.     $F11F,  { 1111000100011111 }
  41.     $E38F,  { 1110001110001111 }
  42.     $C7C7,  { 1100011111000111 }
  43.     $8003,  { 1000000000000011 }
  44.     $0001,  { 0000000000000001 }
  45.     $0001,  { 0000000000000001 }
  46.     $0000,  { 0000000000000000 }
  47.  
  48.   { Cursor mask : the 1's will show up as white (or whatever color you have
  49.     reassigned it to if you have done a SetPalette or SetRGBPalette) }
  50.  
  51.     $0000,  { 0000000000000000 }
  52.     $7FFC,  { 0111111111111100 }
  53.     $2008,  { 0010000000001000 }
  54.     $1010,  { 0001000000010000 }
  55.     $0820,  { 0000100000100000 }
  56.     $0440,  { 0000010001000000 }
  57.     $0280,  { 0000001010000000 }
  58.     $0100,  { 0000000100000000 }
  59.     $0280,  { 0000001010000000 }
  60.     $0440,  { 0000010001000000 }
  61.     $0820,  { 0000100000100000 }
  62.     $1010,  { 0001000000010000 }
  63.     $2008,  { 0010000000001000 }
  64.     $7FFC,  { 0111111111111100 }
  65.     $0000,  { 0000000000000000 }
  66.     $0000); { 0000000000000000 }
  67.  
  68. Procedure SetMouseCursor(HotX, HotY: Integer; Var Pattern : CursorType);
  69. begin
  70.   Regs.AX := 9;    { Function 9 }
  71.   Regs.BX := HotX; { X-ordinate of hot spot }
  72.   Regs.CX := HotY; { Y-ordinate of hot spot }
  73.   { the hot spots are the co-ordinates that will show up as being where
  74.     the mouse is when reading the co-ordinates of the mouse }
  75.   Regs.DX := ofs(Pattern);
  76.   Regs.ES := Seg(Pattern);
  77.   Intr($33, Regs);
  78. end;
  79.  
  80. begin
  81.    { [...initialize the Graphics screen etc...] }
  82.  
  83.    SetMouseCursor(7, 7, HourGlass);
  84.    { this will set the mouse cursor to an hourglass shape With the hot spot
  85.      right in the centre at position 7,7 from the top left of the shape }
  86.  
  87.    { [...continue Program...] }
  88. end.
  89.