Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Grumpfish Library 3.2 - <b>shadowbox()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
SHADOWBOX()

    Sometimes you just want a no-nonsense box with a transparent shadow.
    No explosions, no nothing.  For those special times when less is
    more, here is SHADOWBOX():

    SHADOWBOX(<top>, <left>, <bottom>, <right>
              [, <type>, <title>, <crossbar>, <color>])

    Required Parameters

    <top>, <left>, <bottom>, <right> are integers representing the box
    coordinates.

    Optional Parameters

    <type> is an integer numeric between 1 and 6, and represents the
    type of box desired. The choices are the same as for the other box
    functions.  If you do not pass this parameter, a double line box
    will be used.

    <title> is a character string to be used as the box title.  It will
    be centered and framed on the top row of the box.

    <crossbar> is a variable of any type.  It affects the display of the
    box title. If you pass this parameter, the title will be centered on
    the row below the top row of the box, and a horizontal line (or
    crossbar) will be drawn on the row beneath that.  If you do not pass
    this parameter, the title will be centered and framed on the top row
    of the box.

    The <color> parameter is available in the Clipper 5 version.  This
    is a character string indicating the color in which to display the
    box.  If not specified, the box will be drawn in the current color.

    Return Value

    SHADOWBOX() returns a character string, which contains the
    coordinates of the box, followed by the contents of that area of the
    screen prior to the box being drawn.  For example, an exploding box
    drawn at coordinates 0, 0, 24, 79 would return the string containing
    CHR(0) + CHR(0) + CHR(24) + CHR(79), followed by the contents of
    SAVESCREEN(0,0,24,79). This character string can be used by
    ByeByeBox() to redisplay that portion of the screen.

    Note that under Clipper 5, this function returns a five element
    array rather than a concatenated character string.  The structure
    of this array is { <top>, <left>, <bottom>, <right>, <contents>}.
    This makes performance brisker when using BYEBYEBOX().

    Sample usage

    mDATE = CTOD("")   && beats using ("  /  /  ")     
    buffer = SHADOWBOX(11, 21, 13, 58, 2, 'Date Entry')
    @ 12, 23 SAY 'Enter the starting date:'            
    @ 12, 48 GET mDATE PICTURE '@D'                    
    READ                                               
    ByeByeBox(buffer)                                  

    Clipper 5 Notes

    Because there are now eight parameters, a user-defined command
    is provided for your ease of use.  The syntax for the UDC is:

    SHADOWBOX  [BUFFER <buffer>] [TOP <top>] [LEFT <left>] ;
               [BOTTOM <bottom>] [RIGHT <right>] [TYPE <type>] ;
               [TITLE <title>] [CROSSBAR <crossbar>] [COLOR <color>]

    The BUFFER clause can be used if you want to save the contents of
    the underlying screen.  This can later be used with the
    ByeByeBox() function. (Thanks to Matt Amis for the suggestion.)
    Note that if you wish to use this user-defined command syntax,
    you must #include "grump.ch" at the top of your file.  The following
    is an example of its use.

    #include "grump.ch"                                               
                                                                      
    function test                                                     
    local xx                                                          
    @ 0, 0, maxrow(), maxcol() box replicate("*", 9) color "w/r"      
    shadowbox buffer xx top 10 left 10 bottom 12 right 69 color 'w/rb'
    inkey(0)                                                          
    byebyebox(xx)                                                     
    return nil                                                        

See Also: BYEBYEBOX() EXBOX() POPBOX() SHRBOX()

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