home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c005 / 4.ddi / C / SCACTPG.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-08-05  |  1.8 KB  |  57 lines

  1. /**
  2. *
  3. * Name        scactpg -- Display (activate) a video page and use
  4. *                recorded cursor state for that page.
  5. *
  6. * Synopsis    apage = scactpg(page);
  7. *
  8. *        int apage      The video page actually displayed.
  9. *        int page      The page to display (activate).
  10. *
  11. * Description    SCACTPG sets the active display page, i.e., displays the
  12. *        page.  It also sets the cursor size and turns the cursor
  13. *        off or on according to the last recorded cursor state
  14. *        for this page.
  15. *
  16. *        Use SCPAGES to find how many pages are supported by the
  17. *        current device in the current mode.  Use SCPAGE to
  18. *        direct C TOOLS PLUS screen output to a given page,
  19. *        whether it is active (displayed) or not.  Use SCAPAGE to
  20. *        display a page without altering the cursor state.
  21. *
  22. * Returns    apage          The video page actually displayed.
  23. *
  24. * Version    3.0 (C)Copyright Blaise Computing Inc.    1983, 1984, 1986
  25. *
  26. **/
  27.  
  28. #include <bscreen.h>
  29.  
  30. int scactpg(page)
  31. int page;
  32. {
  33.     int device,mode,columns,act_page;
  34.     int old_curpage;
  35.     int row,col,high,low;
  36.  
  37.     old_curpage = b_curpage;          /* Save current page number.    */
  38.     device = scmode(&mode,&columns,&act_page);
  39.     scpage(act_page);              /* Designate former active page */
  40.                       /* as current.              */
  41.     sccurst(&row,&col,&high,&low);    /* Return & record actual       */
  42.                       /* cursor for current page      */
  43.                       /* (which now coincides with    */
  44.                       /* former active page).          */
  45.  
  46.     page = scapage(page);          /* Display new active page.     */
  47.     scpage(page);
  48.     scpgcur(b_curoff [device][page],  /* Set cursor state for new page*/
  49.         b_curtype[device][page].high,
  50.         b_curtype[device][page].low,
  51.         CUR_NO_ADJUST);
  52.  
  53.     scpage(old_curpage);          /* Restore previous current page*/
  54.  
  55.     return(page);
  56. }
  57.