Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_settextwindow() set up text window</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _settextwindow()        Set up text window

 #include   <graph.h>

 void far _settextwindow(r1, c1, r2, c2 );
  short r1, c1;     Upper-left corner of window
  short r2, c2;     Lower-right corner of window

    _settextwindow() uses text row and column coordinates to specify a
    window where all text output to the screen is displayed. The points
    (r1, c1) and (r2, c2) mark the upper-left and lower-right corners of
    a rectangle defining the window.

         Notes:     _settextwindow() affects text only, not images. Use
                    _setcliprgn() or _setviewport() for images. The row
                    and column values are based on character locations
                    displaced from the upper-left screen corner ( row 0,
                    column 0).

                    The number of rows and columns depend on the
                    available display hardware and the selected video
                    mode. These values are accessible at run time by
                    examining the numtextrows and numtextcols members of
                    the videoconfig structure returned by
                    _getvideoconfig(). It is possible to convert from
                    image pixel coordinates to text coordinates (for
                    linking the locations of images and text) using
                    numxpixels and numypixels from _getvideoconfig(). See
                    example for _getviewcoord().

                    Text is output from the top of the window down. When
                    the window is full, the top line scrolls up out of
                    the window. _wrapon() can be used to specify whether
                    text will be truncated at the right window edge, or
                    wrap around and continue on the next line. Text is
                    wrapped on a simple character count basis, with no
                    recognition of word boundaries, etc., as is common in
                    editors.

                    If wrapping is off, the output location of succeeding
                    text must be repositioned to a new line or no text
                    will be visible past the window boundary.

   Portability:     MS-DOS only, true MDPA, CGA, EGA, MCGA, or VGA video
                    compatibles

 -------------------------------- Example ---------------------------------

    This program defines a text window and fills it with wrapping turned
    on, then with wrapping turned off.

           #include <graph.h>

           char wrap_on[] = {"This is scrolling with text wrapping on. "};
           char wrap_off[] = {"No scrolling with wrapping off. "};

           main()
           {
              int i;

              _wrapon( _GWRAPON );
              _settextwindow( 4, 40, 10, 70);
              for ( i = 0; i < 20; i++)
                  _outtext( wrap_on );

              _wrapon( _GWRAPOFF );
              _settextwindow( 14, 40, 20, 70);
              for ( i = 0; i < 20; i++)
                  _outtext( wrap_off );
           }



See Also: _wrapon() _setcliprgn() _setviewport() _getvideoconfig()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson