home *** CD-ROM | disk | FTP | other *** search
/ Point Programming 1 / PPROG1.ISO / c / fli106c / winindex.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-11  |  1.2 KB  |  63 lines

  1. //
  2. // The Fusion Library Interface for DOS
  3. // Version 1.06c
  4. // Copyright (C) 1990, 1991, 1992
  5. // Software Dimensions
  6. //
  7. // FusionWindow
  8. //
  9.  
  10. #include "fliwin.h"
  11.  
  12. #ifdef __BCPLUSPLUS__
  13. #pragma hdrstop
  14. #endif
  15.  
  16. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  17. //
  18. // IndexCardWindows()
  19. //
  20. // Indexes the windows
  21. //
  22. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  23.  
  24. void FusionWindow::IndexCardWindows()
  25. {
  26.   if (NumberOfWindows<2)
  27.     return;
  28.  
  29.   int CurrentY=1;
  30.   int CurrentHeight=10;
  31.   int CurrentX=0;
  32.   int CurrentWidth=30;
  33.   int OverFactor=0;
  34.  
  35.   for (int i=NumberOfWindows-1;i>=0;i--)
  36.   {
  37.     Windows[i]->X=CurrentX;
  38.     Windows[i]->Y=CurrentY;
  39.     Windows[i]->Width=(CurrentWidth<Windows[i]->MinimumWidth)?Windows[i]->MinimumWidth:CurrentWidth;
  40.     Windows[i]->Height=CurrentHeight;
  41.  
  42.     CurrentY++;
  43.     CurrentX++;
  44.  
  45.     if (CurrentY+CurrentHeight>BlazeClass::WhatHeight()-1)
  46.     {
  47.       OverFactor+=10;
  48.       CurrentX=OverFactor;
  49.       CurrentY=1;
  50.     }
  51.  
  52.     if (CurrentX+CurrentWidth>BlazeClass::WhatWidth())
  53.     {
  54.       OverFactor=0;
  55.       CurrentX=OverFactor;
  56.       CurrentY=1;
  57.     }
  58.   }
  59.  
  60.   RemoveAllMenus();
  61.   RefreshWindows();
  62. }
  63.