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

  1. //
  2. // The Fusion Library Interface for DOS
  3. // Version 1.06c
  4. // Copyright (C) 1990, 1991, 1992
  5. // Software Dimensions
  6. //
  7. // MenuControl --> MenuItems --> FusionWindow
  8. //
  9.  
  10. #include "fliwin.h"
  11.  
  12. #ifdef __BCPLUSPLUS__
  13. #pragma hdrstop
  14. #endif
  15.  
  16. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  17. //
  18. // FindNext()
  19. //
  20. // Finds the next available option
  21. //
  22. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  23.  
  24. void MenuManager::FindNext()
  25. {
  26.   RemoveOption();
  27.   int i=SubMenuTrack[CurrentLevel-1]->CurrentOption;
  28.   int j=0;
  29.   MenuItems &Menu=*SubMenuTrack[CurrentLevel-1];
  30.   do i=(i==Menu.NumberOfOptions-1)?0:(++i);
  31.     while ((!*(Menu.Option+i)->Available ||
  32.       !(Menu.Option+i)->Option) &&
  33.       ++j!=Menu.NumberOfOptions);
  34.   MouseInControl=0;
  35.   PlaceOption(i);
  36. }
  37.  
  38. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  39. //
  40. // FindLast()
  41. //
  42. // Finds the last available option
  43. //
  44. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  45.  
  46. void MenuManager::FindLast()
  47. {
  48.   RemoveOption();
  49.   int i=SubMenuTrack[CurrentLevel-1]->CurrentOption;
  50.   int j=0;
  51.   MenuItems &Menu=*SubMenuTrack[CurrentLevel-1];
  52.   do i=(!i)?(Menu.NumberOfOptions-1):(--i);
  53.     while ((!*(Menu.Option+i)->Available ||
  54.       !(Menu.Option+i)->Option) &&
  55.       ++j!=Menu.NumberOfOptions);
  56.   MouseInControl=0;
  57.   PlaceOption(i);
  58. }
  59.  
  60.