home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / b / baswiz19.zip / BW$BAS.ZIP / WCOLLAPS.BAS < prev    next >
BASIC Source File  |  1993-01-29  |  2KB  |  47 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |        BASWIZ  Copyright (c) 1990-1993  Thomas G. Hanlin III         |
  4. '   |                                                                      |
  5. '   |                      The BASIC Wizard's Library                      |
  6. '   |                                                                      |
  7. '   +----------------------------------------------------------------------+
  8.  
  9.    DECLARE SUB WClose (BYVAL Handle%)
  10.    DECLARE SUB WGetPlace (BYVAL Handle%, Row%, Column%)
  11.    DECLARE SUB WGetSize (BYVAL Handle%, Rows%, Columns%)
  12.    DECLARE SUB WPlace (BYVAL Handle%, BYVAL Row%, BYVAL Column%)
  13.    DECLARE SUB WSize (BYVAL Handle%, BYVAL Rows%, BYVAL Columns%)
  14.    DECLARE SUB WUpdate ()
  15.  
  16.    DEFINT A-Z
  17.  
  18. SUB WCollapse (Handle)
  19.    WGetPlace Handle, Row, Col
  20.    WGetSize Handle, High, Wide
  21.    EndHigh = 1: EndWide = 1
  22.    EndRow = Row + High \ 2
  23.    EndCol = Col + Wide \ 2
  24.    DO
  25.       WSize Handle, High, Wide
  26.       WPlace Handle, Row, Col
  27.       WUpdate
  28.       IF Row < EndRow THEN
  29.          Row = Row + 1
  30.          High = High - 2
  31.          IF High < EndHigh THEN High = EndHigh
  32.       END IF
  33.       IF Col < EndCol THEN
  34.          Col = Col + 1
  35.          Wide = Wide - 2
  36.          IF Wide < EndWide THEN Wide = EndWide
  37.       END IF
  38.       IF Col < EndCol THEN
  39.          Col = Col + 1
  40.          Wide = Wide - 2
  41.          IF Wide < EndWide THEN Wide = EndWide
  42.       END IF
  43.    LOOP UNTIL Row = EndRow AND Col = EndCol
  44.    WClose Handle
  45.    WUpdate
  46. END SUB
  47.