Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FreshWin (c) Fresh Technologies - <b>bclose() screen function</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  BCLOSE()                                                   Screen Function
 Purpose..: Close a box and delete it from memory
-------------------------------------------------------------------------------
 Syntax...: bClose( [<bClose( [<nDelay>] )>] ) --> NIL

 Arguments: [<bClose()>]  = code block used as a closing method.
                            You can set the delay rate, the lower
                            the number the faster the opening.

            bClose Translate Directive as found in FW_BOX.CH
            ---------------------------------------------------------
            FW_BOX.CH         Description
            ---------------------------------------------------------
            B_IMPLODEDN( n )  Implode from the top down       delay n
            B_IMPLODEUP( n )  Implode from the bottom up      delay n
            B_IMPLODERT( n )  Implode from right to left      delay n
            B_IMPLODELT( n )  Implode from left to right      delay n
            B_VBLIND( n )     Use a vertical blind effect     delay n
            B_IMPLODE( n )    Implode the window to centre    delay n
            ---------------------------------------------------------
            B_EXPLODEDN( n )  Explode from the top down;      delay n
            B_EXPLODEUP( n )  Explode from the bottom up;     delay n
            B_EXPLODERT( n )  Explode from right to left;     delay n
            B_EXPLODELT( n )  Explode from left to right;     delay n
            B_EXPLODE( n )    Explode the window from center; delay n
            ---------------------------------------------------------

            [<nDelay>]  = cycle delay for shuting the window.
                          A small number, say, 1 will shut a
                          window fast whereas a high number,
                          say, 60 will result in a slower closing.

 Returns..: NIL

 Remark...: Closes a box opened with bOpen() restoring the previous
            screen and color attributes. Closes with an optional method.

            The delay rate is not hardware-related. Rather it is a
            sliding scale to allow you to vary the delay in closing
            or opening. A rate of, say, 30, will be no faster
            on a '486 than it would be on a '286 machine.

 Source...: BOXES.PRG
-------------------------------------------------------------------------------
 Example..: The example uses bClose(), along with bOpen(), to show
            how the functions can be used.

        local n, i, nChoiceO, nChoiceC
        local aOpen := {                                    ;
              "B_EXPLODE     explode window         " , ;
              "B_EXPLODEDN   explode from the top   " , ;
              "B_EXPLODEUP   explode from the bottom" , ;
              "B_EXPLODERT   explode from the right " , ;
              "B_EXPLODELT   explode from the left  "   }
        local  aShut := {                                   ;
              "B_IMPLODE     implode box            " , ;
              "B_IMPLODEDN   implode from the top   " , ;
              "B_IMPLODEUP   implode from the bottom" , ;
              "B_IMPLODERT   implode from the right " , ;
              "B_IMPLODELT   implode from the left  " , ;
              "B_VBLIND      vertical blind close   "   }
        local aOpenIt := {                                    ;
              B_EXPLODE( 60 ) , ;
              B_EXPLODEDN( 60 ) , ;
              B_EXPLODEUP( 60 ) , ;
              B_EXPLODERT( 60 ) , ;
              B_EXPLODELT( 60 )   }
        local  aShutIt := {                                   ;
              B_IMPLODE( 60 )   , ;
              B_IMPLODEDN( 60 ) , ;
              B_IMPLODEUP( 60 ) , ;
              B_IMPLODERT( 60 ) , ;
              B_IMPLODELT( 60 ) , ;
              B_VBLIND( 100 )     }

 bOpen( 4, 7, 22, 70, "W+/BG+", B_EXPLODELT( 60 ), B_SHADOW(), 3 )
 while .t.
    nChoiceC  := ACHOICE(3, 3, 6, 40, aShut)
    if nChoiceC == 0
      bClose()
      return (NIL)
    endif

    nChoiceO  := ACHOICE(3, 3, 6, 40, aOpen)
    if nChoiceO == 0
      bClose()
      return (NIL)
    endif
    bClose( aShutIt[nChoiceC] )
    bOpen( 4, 7, 22, 70, "W+/BG+", aOpenIt[nChoiceO], B_SHADOW(), 3 )
 enddo

 Note.....: You can see that the boxes cannot be addressed
            by name, the boxes do not have features such
            as titles, color choices or text display conveniences.
            You should think of this function, along with bOpen(), as
            a junior version of wHowClose(). The similarities are
            apparent.

See Also: bOpen() wHowClose()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson