Futurebasic/Language/Reference/def cbox

From Wikibooks, open books for an open world
Jump to navigation Jump to search

DEF <just> BOX Statements[edit | edit source]

DEF <just>BOX[edit | edit source]

Statements[edit | edit source]

✔ Appearance ✔ Standard ✔ Console

Syntax[edit | edit source]

DEF {CBOX|LBOX|RBOX} ({rect | #rectAddr&}, stringVar$)

Description[edit | edit source]

Draws the text in stringVar$ (using the current font, size, style, etc.) within the rectangle specified by rect (which should be an 8-byte variable such as a RECT type) or pointed to by rectAddr&.

No frame is drawn around the rectangle. If the rectangle is not wide enough to contain the entire string, then the string is automatically wrapped around to the next line, at word boundaries.

Each line of text is either Centered, Left-justified or Right-justified within the rectangle, depending on which variant of the statement you use.

No text is ever drawn outside of the rectangle; if the rectangle is not big enough to contain the entire string, then the text is clipped.

Example[edit | edit source]

image res/cd.gif CD Example: DEF jBOX.BAS

FB Lite Behavior[edit | edit source]

When you use the "FB Lite" runtime, the DEF <just>BOX statements switch to the Graphics Window before executing.

Note[edit | edit source]

To draw rectangle-bounded text that will redraw itself automatically (during a window refresh), use a static edit field (see the EDIT FIELD statement).

See Also[edit | edit source]

EDIT FIELD