home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / cnr / cdate / developr.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-29  |  2.4 KB  |  107 lines

  1. #ifndef _DEVELOPR_
  2. #define _DEVELOPR_
  3. //************************************************************
  4. // Container Control - Dates and Times as CDATE/CTIME         
  5. //
  6. // Copyright (C) 1994, Law, Leong, Love, Olson, Tsuji.
  7. // Copyright (c) 1997 John Wiley & Sons, Inc. 
  8. // All Rights Reserved.
  9. //************************************************************
  10. #include <iframe.hpp>
  11. #include <icnrctl.hpp>
  12. #include <icnrcol.hpp>
  13. #include <icnrobj.hpp>
  14.  
  15. #pragma pack(4)
  16. struct CDATE    
  17. {
  18.    CDATE(unsigned char  aDay = 10,
  19.          unsigned char  aMonth =1,
  20.          unsigned short aYear  =1950)
  21.       : day(aDay),
  22.         month(aMonth),
  23.         year(aYear) {}
  24.  
  25.    unsigned char   day;   
  26.    unsigned char   month; 
  27.    unsigned short  year;  
  28. };
  29.  
  30. struct CTIME
  31. {
  32.    CTIME(unsigned char anHour = 17,
  33.          unsigned char aMinute = 0,
  34.          unsigned char aSecond = 0)
  35.       : hours(anHour),
  36.         minutes(aMinute),
  37.         seconds(aSecond) {}
  38.  
  39.    unsigned char   hours; 
  40.    unsigned char   minutes; 
  41.    unsigned char   seconds; 
  42.    unsigned char   ucReserved;  
  43. };
  44. #pragma pack()
  45.  
  46. class Developer : public IContainerObject
  47. {
  48.   public:
  49.   Developer   ( IString       name,
  50.                 unsigned long iconId,
  51.                 IString       compuServeId = IString("?"),
  52.                 IString       age = IString("?"),
  53.                 const CDATE&  birthDate =CDATE(),
  54.                 const CTIME&  quittingTime=CTIME())
  55.      : IContainerObject(name, iconId),
  56.        fCompuServeId(compuServeId),
  57.        fAge(age),
  58.        fBirthDate(birthDate),
  59.        fQuittingTime(quittingTime)
  60.  
  61.  {}
  62.  
  63. // Column functions
  64. enum Column 
  65. { kNameColumn, 
  66.   kIconColumn, 
  67.   kCompuServeIdColumn,
  68.   kAgeColumn,
  69.   kBirthDateColumn,
  70.   kQuittingTimeColumn
  71. };
  72. static IContainerColumn
  73.  *createAndOrphanColumnFor ( IContainerControl& container,
  74.                              Column             column);
  75. static void
  76.   createAllColumnsFor      ( IContainerControl&  container);
  77.  
  78. private:
  79.  
  80. IString
  81.   fCompuServeId,
  82.   fAge;
  83. CDATE
  84.   fBirthDate;
  85. CTIME
  86.   fQuittingTime;
  87.  
  88. };
  89.  
  90.  
  91. class DeveloperList : public IFrameWindow {
  92. public:
  93.  
  94.   DeveloperList ( const char* title);
  95.  
  96. IContainerControl
  97.  &container        ( );
  98.  
  99. private:
  100. IContainerControl
  101.   cnrctl;
  102. DeveloperList& operator=(const DeveloperList&);
  103. DeveloperList(const DeveloperList&);
  104. };
  105.  
  106. #endif // _DEVELOPR_
  107.