xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

@...BOX

Displays a box on the screen.

Syntax

@ <nTop>, <nLeft>, <nBottom>, <nRight> BOX <cBoxString> ;
                                    [COLOR <cColor>]

Arguments

<nTop> and <nLeft>
Numeric values indicating the screen coordinates for the upper left corner of the @...BOX output.
<nBottom> and <nRight>
Numeric values indicating the screen coordinates for the lower right corner of the @...BOX output.
<cBoxString>
The appearance of the box to display is as a character string holding up to nine characters. The first eight characters define the border of the box while the ninth character is used to fill the box. #define constants to be used for <cBoxString> are available in the BOX.CH #include file.

Pre-defined box strings for @...BOX
ConstantDescription
B_SINGLESingle-line box
B_DOUBLEDouble-line box
B_SINGLE_DOUBLESingle-line top, double-line sides
B_DOUBLE_SINGLEDouble-line top, single-line sides

<cColor>
An optional SetColor() compliant color string can be specified to draw the box. It defaults to the standard color of SetColor().

Description

The @...BOX command displays a box on the screen as specified with <cBoxString>, using the standard color of SetColor() or <cColor>, if specified.

The first eight characters of the string <cBoxString> define the border of the box in clockwise direction, beginning with the upper left corner. An optional nineth character fills the area inside the box. Alternatively, a single character can be passed which is used to draw the entire box border.

When the box is completely drawn, the cursor is positioned at the coordinates <nTop>+1 and <nLeft>+1, so that Row() and Col() can be used to start displaying text in the upper left corner of the box area.

Info

See also:@...CLEAR, @...SAY, @...TO, DispBox(), Scroll()
Category: Output commands
Header:box.ch
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example demonstrates how characters are used to draw a box.
// Alphabetic characters define <cBoxString> instead of characters
// holding graphic signs.

   #include "Box.ch"

   PROCEDURE Main
      CLS
      @ 10, 10, 20, 50 BOX "AbCdEfGhi" COLOR "W+/R"

      Inkey(0)

      @ 10, 10, 20, 50 BOX B_DOUBLE + Space(1)
      @ Row(), Col() SAY "Using #define constant"

      @ MaxRow()-1, 0
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe