xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

DispBox()

Displays a box on the screen.

Syntax

DispBox( <nTop>, <nLeft>, <nBottom>, <nRight>, ;
        [<cnBoxString>] , [<cColor>] ) --> NIL

Arguments

<nTop> and <nLeft>
Numeric values indicating the screen coordinates for the upper left corner of the DispBox() output.
<nBottom> and <nRight>
Numeric values indicating the screen coordinates for the lower right corner of the DispBox() output.
<cnBoxString>
The appearance of the box to display can either be specified as numeric 1 (single line box), numeric 2 (double line box), or 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 <cnBoxString> are available in the BOX.CH #include file.

Pre-defined box strings for DispBox()
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

If no <cnBoxString> is specified, a single-line box is drawn.

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

Return

The return value is always NIL.

Description

The function DispBox() displays a box on the screen as specified with <cnBoxString>, using the standard color of SetColor() or <cColor>, if specified.

If a character string is used for <cnBoxString>, the first eight characters define the border of the box in clockwise direction, beginning with the upper left corner. An optional ninth 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 a subsequent DispOut() call starts displaying in the upper left corner of the box area.

Info

See also:@...BOX, @...CLEAR, @...TO, Scroll(), SetColor()
Category: Screen functions
Header:box.ch
Source:rtl\box.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

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

   #include "Box.ch"

   PROCEDURE Main
      CLS
      DispBox( 10,10,20,50, "AbCdEfGhi", "W+/R" )

      Inkey(0)

      DispBox( 10,10,20,50, B_DOUBLE + Space(1) )
      DispOut( "Using #define constant" )

      @ MaxRow(),0
   RETURN

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