Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FUNCky - <b>name:</b> <b>box() - draw a box with optional shadow</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     box() - draw a box with optional shadow
  Usage:    box(<r1>,<c1>,<r2>,<c2>,[<frame>],[<attr>],[<shadow>,<color>])
  Params:   integer <r1> - top row definition
            integer <c1> - left column definition
            integer <r2> - bottom row definition
            integer <c2> - right column  definition
            string <frame> - box frame chars, same definitions as
            Clipper's @ box command - (optional), if left off or
            null (""), then the default characters are used.
            integer <attr> - color to use for the box - (optional),
            if left off or -1, then Clipper's standard color is used.
            integer <shadow> - shadow type specifier - (optional)
            integer <color> - color to use for shadow - (optional)

            The frame chars are characters that define the characters
            to use to draw the box starting from the upper left hand
            corner going clockwise. An optional ninth character can
            be added as the character to use to fill the box. If you
            omit the frame characters, the default frame is single line
            box characters. If you specify a new set of frame characters
            then the default characters become the last defined box
            characters. If you wish to use the default box characters,
            but you need to specify an attribute, you can send a
            null ("") to signify the default characters.

            The shadow type and color are optional, however you may
            not omit just one. You must specify both or none. If
            you specify none, then the default is to not cast a shadow.
            The shadow type is an integer value based on the numbers
            and their locations on the numeric keypad. The following
            values will yield the following shadow types:

                 Shadow Type    -    Displayed Result
                 1              -    lower left
                 2              -    bottom
                 3              -    lower right
                 4              -    left
                 6              -    right
                 7              -    upper left
                 8              -    top
                 9              -    upper right

            The shadow color is based on the standard color notation of
            ((foreground*16)+foreground). The shadow is normally cast
            over the characters that appear under it. Those characters are
            not erased - only their color is changed. The most popular
            color for the shadow is 8 which is dark grey characters on a
            black background. This produces the most realistic results of
            imitating a shadow. other colors may be used however. If you
            want to cast a solid shadow, then simply add 256 to your
            shadow color.

  Returns:  nothing

 ---------------------------------- Example ---------------------------------

                 box(10,10,60,23)
                 * creates a box at row 10, col 10 with the
                 * default frame, and Clipper's foreground color

                 box(10,10,60,23,"",23)
                 * creates a blue on white box

                 box(10,10,60,23,"",23,1,8)
                 * creates a blue on white box with a dark shadow

  Note:     If you create boxes with shadows, remember to save the
            screen that resides in the shadow as well. Also, if you
            are drawing boxes that erase the center of the box with
            spaces, it is much faster to specify the 8 frame
            characters, leaving the ninth character left off so that
            only the frame is drawn. Then use scroll() to clear the
            inside of the box. Note that scroll() is documented in
            FUNCky since it has an added parameter to set the color
            of the cleared area.

  Warning!: If you are using box() to draw boxes into virtual
            pages in memory (screens declared by initscreen() and
            setscreen()), you must make sure that your box coordinates
            fall within the defined coordinates of the screen. Don't
            forget about the shadow if you are using one. Drawing
            a box outside the defined screen area when using setscreen()
            or setpage() can result in memory corruption.


See Also: setattr() print() palette() shift() scroll()

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