home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 11.ddi / OWLSRC.PAK / MENUDESC.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  1.3 KB  |  58 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows - (C) Copyright 1991, 1993 by Borland International
  3. //   source\owl\menudesc.cpp
  4. //   Implementation of class TMenuDescr
  5. //----------------------------------------------------------------------------
  6. #pragma hdrignore SECTION
  7. #include <owl\owlpch.h>
  8. #include <owl\framewin.h>
  9.  
  10. #if !defined(SECTION) || SECTION == 1
  11.  
  12. TMenuDescr::TMenuDescr()
  13. {
  14.   Id = 0;
  15.   Module = ::Module;
  16.   for (int i = 0; i < NumGroups; i++)
  17.     GroupCount[i] = 0;
  18. }
  19.  
  20. TMenuDescr::TMenuDescr(TResId id,
  21.                        int fg, int eg, int cg, int og, int wg, int hg,
  22.                        TModule* module) {
  23.   Id = id;
  24.   Module = module;
  25.   GroupCount[FileGroup] = fg;
  26.   GroupCount[EditGroup] = eg;
  27.   GroupCount[ContainerGroup] = cg;
  28.   GroupCount[ObjectGroup] = og;
  29.   GroupCount[WindowGroup] = wg;
  30.   GroupCount[HelpGroup] = hg;
  31. }
  32.  
  33. #endif
  34. #if !defined(SECTION) || SECTION == 2
  35.  
  36. ipstream&
  37. operator >>(ipstream& is, TMenuDescr& m)
  38. {
  39.   is >> m.Id;
  40.   is >> m.Module;
  41.   for (int i = 0; i < TMenuDescr::NumGroups; i++)
  42.     is >> m.GroupCount[i];
  43.   return is;
  44. }
  45.  
  46. opstream&
  47. operator <<(opstream& os, const TMenuDescr& m)
  48. {
  49.   os << m.Id;
  50.   os << m.Module;
  51.   for (int i = 0; i < TMenuDescr::NumGroups; i++)
  52.     os << m.GroupCount[i];
  53.   return os;
  54. }
  55.  
  56.  
  57. #endif
  58.