home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / INTERNET / WWW / LYNX / SOURCE / SRC0_8A.ZIP / DOSLYNX / SRC / TDOSLY16.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-09  |  2.5 KB  |  93 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. //        08-09-94    Modified to not depend on presence of misc
  26. //                views.
  27.  
  28.     //    Destroy any views that will not reposition
  29.     //    properly.
  30.     if(THV_heap != NULL)    {
  31.         remove(THV_heap);
  32.         destroy(THV_heap);
  33.         THV_heap = (THeapView *)1;
  34.     }
  35.     if(TDV_disk != NULL)    {
  36.         remove(TDV_disk);
  37.         destroy(TDV_disk);
  38.         TDV_disk = (TDiskView *)1;
  39.     }
  40.     if(TSV_sock != NULL)    {
  41.         remove(TSV_sock);
  42.         destroy(TSV_sock);
  43.         TSV_sock = (TSockView *)1;
  44.     }
  45.  
  46.     //    Attempt to switch the video mode.
  47.     if(B_isLow == True)    {
  48.         setScreenMode(TDisplay::smFont8x8);
  49.         B_isLow = False;
  50.     }
  51.     else    {
  52.         setScreenMode(TDisplay::smCO80);
  53.         B_isLow = True;
  54.     }
  55.  
  56.     //    Now that we have switched modes, there are
  57.     //    our idle views that are not positioned
  58.     //    properly.  Recreate them.
  59.     //    Create a heap view in the lower right corner.
  60.     auto TRect TR_extent = getExtent();
  61.  
  62.     if(THV_heap != NULL)    {
  63.         TR_extent.a.x = TR_extent.b.x - 13;
  64.         TR_extent.a.y = TR_extent.b.y - 1;
  65.         THV_heap = (THeapView *)validView(new THeapView(TR_extent));
  66.         insert(THV_heap);
  67.     }
  68.  
  69.     //    Create a disk view in the lower right corner.
  70.     if(TDV_disk != NULL)    {
  71.         TR_extent = getExtent();
  72.         TR_extent.a.x = TR_extent.b.x - 26;
  73.         TR_extent.b.x -= 13;
  74.         TR_extent.a.y = TR_extent.b.y - 1;
  75.         TDV_disk = (TDiskView *)validView(new TDiskView(TR_extent));
  76.         insert(TDV_disk);
  77.     }
  78.  
  79.     //    Create socket activity in the lower right corner.
  80.     if(TSV_sock != NULL)    {
  81.         TR_extent = getExtent();
  82.         TR_extent.a.x = TR_extent.b.x - 39;
  83.         TR_extent.b.x -= 26;
  84.         TR_extent.a.y = TR_extent.b.y - 1;
  85.         TSV_sock = (TSockView *)validView(new TSockView(TR_extent));
  86.         insert(TSV_sock);
  87.     }
  88.  
  89.     //    Lastly, the mouse needs to be told that the
  90.     //    screen size is now different.
  91.     TR_extent = getExtent();
  92.     TMouse::setRange(TR_extent.b.x - 1, TR_extent.b.y - 1);
  93. }