home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Basic / MAXONB32.DMS / in.adf / Includes.lha / BH / BLib / BusyPointer.bas < prev    next >
Encoding:
BASIC Source File  |  1994-03-16  |  1.8 KB  |  83 lines

  1. ''
  2. '' $Id: BusyPointer.bas,v 1.2 1994/03/07 17:22:19 alex Rel $
  3. ''
  4. '' Common window busy pointer code
  5. ''
  6. '' (c) Copyright 1994 HiSoft
  7. ''
  8.  
  9. 'DIM SHARED tl&(40)
  10. '
  11. 'REM $INCLUDE Exec.bh
  12. 'REM $INCLUDE Intuition.bh
  13. 'REM $INCLUDE Utility.bc
  14.  
  15. CONST busyPointer_sizeof% = 72%    '(16 + 2) * 4
  16.  
  17. SUB allocBusyPointer
  18.     SHARED busyPointer&
  19.     
  20.     IF PEEKW(LIBRARY("intuition.library") + lib_Version%) < 39% AND _
  21.       busyPointer& = NULL& THEN
  22.         busyPointer& = AllocMem&(busyPointer_sizeof%, MEMF_CHIP& OR MEMF_PUBLIC&)
  23.         IF busyPointer& <> NULL& THEN
  24.             'use the TAGLIST statement to initialise the imagery
  25.             TAGLIST busyPointer&, _
  26.               &h00000000, _    'reserved, must be NULL
  27.               &h040007C0, _
  28.               &h000007C0, _
  29.               &h01000380, _
  30.               &h000007E0, _
  31.               &h07C01FF8, _
  32.               &h1FF03FEC, _
  33.               &h3FF87FDE, _
  34.               &h3FF87FBE, _
  35.               &h7FFCFF7F, _
  36.               &h7EFCFFFF, _
  37.               &h7FFCFFFF, _
  38.               &h3FF87FFE, _
  39.               &h3FF87FFE, _
  40.               &h1FF03FFC, _
  41.               &h07C01FF8, _
  42.               &h000007E0, _
  43.               &h00000000    'reserved, must be NULL
  44.         END IF
  45.     END IF
  46. END SUB
  47.  
  48. SUB freeBusyPointer
  49.     SHARED busyPointer&
  50.     
  51.     IF busyPointer& THEN
  52.         FreeMem busyPointer&, busyPointer_sizeof%
  53.         busyPointer& = NULL&
  54.     END IF
  55. END SUB
  56.  
  57. SUB busyPointer(BYVAL win&)
  58.     SHARED busyPointer&
  59.  
  60.     IF PEEKW(LIBRARY("intuition.library") + lib_Version%) >= 39% THEN
  61.         TAGLIST VARPTR(tl&(0)), _
  62.           WA_BusyPointer&, TRUE&, _
  63.           WA_PointerDelay&, TRUE&, _
  64.           TAG_END&
  65.         SetWindowPointerA win&, VARPTR(tl&(0))
  66.     ELSEIF busyPointer& <> NULL& THEN
  67.         SetPointer win&, busyPointer&, 16, 16, -6, 0
  68.     END IF
  69. END SUB
  70.  
  71. SUB normalPointer(BYVAL win&)
  72.     SHARED busyPointer&
  73.  
  74.     IF PEEKW(LIBRARY("intuition.library") + lib_Version%) >= 39% THEN
  75.         TAGLIST VARPTR(tl&(0)), _
  76.           WA_Pointer&, NULL&, _
  77.           TAG_END&
  78.         SetWindowPointerA win&, VARPTR(tl&(0))
  79.     ELSE
  80.         ClearPointer win&
  81.     END IF
  82. END SUB
  83.