xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

WBox()

Draws a frame around the current window.

Syntax

WBox( [<cBoxChars>|<nBoxType>] ) --> nWindowID

Arguments

<cBoxChars>|
The appearance of the frame display can be specified as a character string holding up to nine characters. The first eight characters define the border of the frame while the ninth character is used to fill it. #define constants to be used for <cBoxChars> are available in the BOX.CH #include file.

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

<nBoxType>
Alternatively, a numeric value in the range from 0 to 15 can be used to select predefined frames. The values 0-3 and 8-11 draw a frame that clears the window, while 4-7 and 12-15 draw a frame without clearing the window.

Return

The function returns the window ID of the window where the frame is drawn, or -1 if the window is too small for drawing a frame.

Info

See also:SetClearB(), WOpen(), WSelect(), WFormat()
Category: CT:Window , Windows (text mode)
Header:Box.ch
Source:ct\ctwin.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example displays all 16 predefined frame types. To see the
// difference between windows (not) clearing the screen, the
// entire screen is filled with dots using DispBox().

   PROCEDURE Main
      LOCAL nT := 2, nL := 2, nH := 10, nW := 6
      LOCAL i

      SET COLOR TO W+/B
      CLS
      Dispbox( 0, 0, MaxRow(), MaxCol(), "........." )

      FOR i:=0 TO 15
         IF i == 8
            nT += 15
            nL := 2
         ENDIF

         nWin := WOpen( nT, nL, nT+nH, nL+nW )
         WSelect( nWin )

         SET COLOR TO W+/B
         WBox( i )

         SET COLOR TO GR+/B

         SayDown( "WBox " + Str(i,2), 0, 1, 2 )

         nL += nW+2
      NEXT
   RETURN

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