home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / msdos / lynx / source / doslynx / src / tdosly16.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-25  |  2.2 KB  |  75 lines

  1. //    Copyright (c) 1994, University of Kansas, All Rights Reserved
  2. //
  3. //    Class:        TDosLynx
  4. //    Include File:    tdoslynx.h
  5. //    Purpose:    Application for WWW browser
  6. //    Remarks/Portability/Dependencies/Restrictions:
  7. //    Revision History:
  8. //        04-05-94    created
  9. #define Uses_TScreen
  10. #define Uses_TDisplay
  11. #define Uses_TMouse
  12. #include"tdoslynx.h"
  13.  
  14. void TDosLynx::switchVideo()    {
  15. //    Purpose:    Switch the video mode of the app.
  16. //    Arguments:    void
  17. //    Return Value:    void
  18. //    Remarks/Portability/Dependencies/Restrictions:
  19. //        Depends heavily on TurboVision's functionality.
  20. //        Any bugs will be the result of TurboVision.
  21. //        In this function we should also reposition any views that
  22. //        are not currently displayed correctly after a video switch.
  23. //    Revision History:
  24. //        04-05-94    created
  25.  
  26.     //    Destroy any views that will not reposition
  27.     //    properly.
  28.     remove(THV_heap);
  29.     destroy(THV_heap);
  30.     remove(TDV_disk);
  31.     destroy(TDV_disk);
  32.     remove(TSV_sock);
  33.     destroy(TSV_sock);
  34.  
  35.     //    Attempt to switch the video mode.
  36.     if(B_isLow == True)    {
  37.         setScreenMode(TDisplay::smFont8x8);
  38.         B_isLow = False;
  39.     }
  40.     else    {
  41.         setScreenMode(TDisplay::smCO80);
  42.         B_isLow = True;
  43.     }
  44.  
  45.     //    Now that we have switched modes, there are
  46.     //    our idle views that are not positioned
  47.     //    properly.  Recreate them.
  48.     //    Create a heap view in the lower right corner.
  49.     auto TRect TR_extent = getExtent();
  50.     TR_extent.a.x = TR_extent.b.x - 13;
  51.     TR_extent.a.y = TR_extent.b.y - 1;
  52.     THV_heap = (THeapView *)validView(new THeapView(TR_extent));
  53.     insert(THV_heap);
  54.  
  55.     //    Create a disk view in the lower right corner.
  56.     TR_extent = getExtent();
  57.     TR_extent.a.x = TR_extent.b.x - 26;
  58.     TR_extent.b.x -= 13;
  59.     TR_extent.a.y = TR_extent.b.y - 1;
  60.     TDV_disk = (TDiskView *)validView(new TDiskView(TR_extent));
  61.     insert(TDV_disk);
  62.  
  63.     //    Create socket activity in the lower right corner.
  64.     TR_extent = getExtent();
  65.     TR_extent.a.x = TR_extent.b.x - 39;
  66.     TR_extent.b.x -= 26;
  67.     TR_extent.a.y = TR_extent.b.y - 1;
  68.     TSV_sock = (TSockView *)validView(new TSockView(TR_extent));
  69.     insert(TSV_sock);
  70.  
  71.     //    Lastly, the mouse needs to be told that the
  72.     //    screen size is now different.
  73.     TR_extent = getExtent();
  74.     TMouse::setRange(TR_extent.b.x - 1, TR_extent.b.y - 1);
  75. }