Unfilled RectanglesFastgraph includes four functions for drawing unfilled rectangles. The fg_box() function draws an unfilled rectangle in screen space, with regard to the clipping limits, using the current color. The parameters to fg_box() are the same as those for fg_rect(). The depth of the rectangle's edges is one pixel by default, but you can change the depth by calling fg_boxdepth(). The fg_boxdepth() function expects two parameters. The first parameter is the width of the rectangle's left and right sides, while the second is the height of its top and bottom sides. Once you call fg_boxdepth(), fg_box() draws all unfilled rectangles using the depth values specified in the most recent call to fg_boxdepth(). The fg_getxbox() and fg_getybox() functions respectively return the horizontal and vertical box depth settings, as defined in the most recent call to fg_boxdepth(). The world space box-drawing function is fg_boxw(). The fg_boxx() and fg_boxxw() functions are screen space and world space "exclusive or" versions of the box drawing functions. They simplify displaying rubberband boxes (hollow rectangles that move in response to keystrokes or mouse movement) because drawing an object in XOR mode makes it appear, but drawing it again in the same position and in the same color restores what was under the object originally. Given this useful property, here is an outline of what's necessary to draw a rubberband box:
|
 
copyright 2001 Ted Gruber Software, Inc.