home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 1.ddi / CLIBSRC.ZIP / CURSOR.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.0 KB  |  47 lines

  1. /*-----------------------------------------------------------------------*
  2.  * filename - cursor.c
  3.  *
  4.  * function(s)
  5.  *        setcursortype - sets the text cursor type.
  6.  *-----------------------------------------------------------------------*/
  7.  
  8. /*
  9.  *      C/C++ Run Time Library - Version 5.0
  10.  *
  11.  *      Copyright (c) 1987, 1992 by Borland International
  12.  *      All Rights Reserved.
  13.  *
  14.  */
  15.  
  16.  
  17. #include <conio.h>
  18. #include <_video.h>
  19.  
  20.  
  21. void _setcursortype( int cur_t )
  22.   {
  23.   struct text_info t;
  24.   int start, end;
  25.  
  26.   gettextinfo( &t );
  27.  
  28.   switch( cur_t )
  29.     {
  30.     case _NOCURSOR:
  31.       start = 0x20, end = 0;
  32.       break;
  33.     case _SOLIDCURSOR:
  34.       if( t.screenheight == 43 )  start = 0, end = 8;
  35.       else                        start = 0, end = t.currmode == MONO ? 12 : 7;
  36.       break;
  37.     case _NORMALCURSOR:
  38.       if( t.currmode == MONO )  start = 11, end = 12;
  39.       else                      start = 6,  end = t.screenheight == 43 ? 0 : 7;
  40.     }
  41.  
  42.   _CH = start;
  43.   _CL = end;
  44.   _AH = 1;
  45.   _VideoInt();
  46.   }
  47.