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>bopen() screen function</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  BOPEN()                                                    Screen Function
 Purpose..: Open a box on screen
-------------------------------------------------------------------------------
 Syntax...: bOpen( <nTR>, <nLC>, <nBR>, <nRC>, <cClr>,
                  [<bOpen>], [<bShadow>], [<uFrame>] ) --> NIL

 Arguments: <nTR>          = top row.
            <nLC>          = left column.
            <nBR>          = bottom row.
            <nRC>          = right column.
            <cClr>         = box color string.
            [<bOpen()>]    = code block used as a opening method.
                             You can set the delay rate, the lower
                             the number the faster the opening.

            bOpen Translate Directive as found in FW_BOX.CH
            ---------------------------------------------------------
            FW_BOX.CH         Description
            ---------------------------------------------------------
            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
            ---------------------------------------------------------
            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
            ---------------------------------------------------------

            [<nDelay>]     = cycle delay for opening the box.
                             A small number, say, 1 will open a
                             box fast whereas a high number,
                             say, 60 will result in a slower opening.
            [<bShadow>]    = code block used to define a shadow.
                             The corners are taken from the window
                             definition.
            [<uFrame>]     = parameter that can take a pre-defined
                             frame type or a custom frame type. To use a
                             custom frame type, see the section titled
                             Creating Custom Frames.

                             The table below lists the pre-defined
                             frame types that can be passed.

             Frame Type Manifest Constants as found in FW_BOX.CH
             --------------------------------------------------
             Value  FW_BOX.CH    Description
             --------------------------------------------------
             1     B_SSSS       single line box
             2     B_DDDD       double line box
             3     B_SDSD       NS-single EW-double
             4     B_DSDS       NS-double EW-single
             5     B_SSDD       NE-single SW-double
             6     B_SDDS       NW-double SE-single
             7     B_DSSD       NW-double SE-single
             8     B_DDSS       NE-double SW-single
             9     B_THICK      thick solid
            10     B_LIGHT      shaded light
            11     B_MEDIUM     shaded medium
            12     B_HEAVY      shaded heavy
            13     B_NONE       spaces - DEFAULT
            --------------------------------------------------

 Returns..: NIL

 Remark...: Opens a box, restoring the previous screen and color
            attributes. Opens with an optional method, shadow and frame.

            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 bOpen(), along with bClose(), 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(), 5 )
 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(), 5 )
 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 bClose(), as
            a junior version of wHowOpen(). The similarities are
            apparent.

See Also: bClose() wHowOpen()

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