home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 1.ddi / CLIB1.ZIP / CURSOR.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  1.5 KB  |  48 lines

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