home *** CD-ROM | disk | FTP | other *** search
- DEMONSTRATION OF GRAPHING CAPABILITIES
-
- This program demonstrates the functions supplied with Windows for C
- for drawing bar graphs in text modes.
-
- The cursor controls used in "demo_wn" are available here. To read
- more of this file, scroll or page the window down.
-
- Four function keys are operative:
-
- F1 places this file in the full-screen window.
-
- F2 draws a vertical bar graph.
-
- F3 draws a horizontal bar graph.
-
- F10 exits.
-
- Source code is supplied on the diskette for this demonstration
- program.
-
- The graphing routine illustrate the versatile, non-obvious ways in
- which window functions can assist software development. Both the
- axes and bars are drawn by defining windows of the appropriated size
- and location. The axes and bars are filled with reverse-video spaces.
-
- The window that draws the bars is declared within v_bar(). The bar
- size, location, attribute, and border are supplied as parameters in
- the call. The bars for the graph are drawn by changing the size and
- location parameters between each call to v_bar().
-
- Vertical text could be written next to the vertical axis by placing a
- window there that is one space wide, with word wrap enabled. A call
- to v_st() would then automatically write the string in a vertical
- format. Note that the window would not need to be "set" on the
- screen by set_wn() but simply declared with the proper location and
- dimensions.
-
- This program uses logical attributes. Attributes LNORMAL and
- LREVERSE are used. If you wanted to change the colors that this
- program displays on color monitors, you would simply need to change
- the colors defined for these logical attributes and recompile the
- program.
-
- For additional information, refer to the reference text for v_bar(),
- and v_axes(), and the source code for this demonstration program,
- dem_grph.c.
-
-