home *** CD-ROM | disk | FTP | other *** search
/ The Programmer Disk / The Programmer Disk (Microforum).iso / xpro / qb2 / pro16 / bsetstat.bas < prev    next >
Encoding:
BASIC Source File  |  1992-02-06  |  2.4 KB  |  71 lines

  1. ' BSetStat.Bas
  2. ' Portions Copyright 1987-1990 Microsoft Corp.
  3. DEFINT A-Z
  4. SUB ButtonSetState (handle, state)
  5.  
  6. button = FindButton(handle)
  7. windo = WindowCurrent
  8.  
  9. ' =======================================================================
  10. ' If valid state for the type of button, assign the new state, and re-show
  11. ' =======================================================================
  12.  
  13. IF button > 0 AND windo > 0 THEN
  14.   SELECT CASE GloButton(button).buttonType
  15.         CASE 1
  16.             IF state >= 1 AND state <= 3 THEN
  17.               GloButton(button).state = state
  18.             END IF
  19.         CASE 2, 3
  20.             IF state = 1 OR state = 2 THEN
  21.               GloButton(button).state = state
  22.             END IF
  23.         CASE 4, 5
  24.             IF GloButton(button).buttonType = 5 THEN
  25.               IF state >= 1 AND state <= 3 THEN
  26.                 GloButton(button).state = state
  27.               END IF
  28.             END IF
  29.         CASE 6
  30.             IF state <> GloButton(button).state THEN
  31.               MouseHide
  32.               COLOR 0, 7
  33.               LOCATE GloWindow(windo).row1 _
  34.                     + GloButton(button).row1 - 1 _
  35.                     + GloButton(button).state, _
  36.                     GloWindow(windo).col1 + GloButton(button).col1 - 1
  37.               PRINT CHR$(176);
  38.               GloButton(button).state = state
  39.               LOCATE GloWindow(windo).row1 _
  40.                     + GloButton(button).row1 - 1 _
  41.                     + GloButton(button).state, _
  42.                     GloWindow(windo).col1 + GloButton(button).col1 - 1
  43.               PRINT CHR$(219);
  44.               MouseShow
  45.             END IF
  46.         CASE 7
  47.             IF state <> GloButton(button).state THEN
  48.               MouseHide
  49.               COLOR 0, 7
  50.               LOCATE GloWindow(windo).row1 _
  51.                     + GloButton(button).row1 - 1, _
  52.                     GloWindow(windo).col1 _
  53.                     + GloButton(button).col1 - 1 _
  54.                     + GloButton(button).state
  55.               PRINT CHR$(176);
  56.               GloButton(button).state = state
  57.               LOCATE GloWindow(windo).row1 _
  58.                     + GloButton(button).row1 - 1, _
  59.                     GloWindow(windo).col1 _
  60.                     + GloButton(button).col1 - 1 _
  61.                     + GloButton(button).state
  62.               PRINT CHR$(219);
  63.               MouseShow
  64.             END IF
  65.         CASE ELSE
  66.     END SELECT
  67. END IF
  68.  
  69. ButtonShow handle
  70. END SUB
  71.