home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / ioc / lancelot / lgenl.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  6.5 KB  |  211 lines

  1. /******************************************************************************
  2. * .FILE:         lgenl.hpp                                                    *
  3. *                                                                             *
  4. * .DESCRIPTION:  Lancelot Sample Program:              Class Definition       *
  5. *                                                                             *
  6. * .CLASSES:      LPictureVerifyHandler                                        *
  7. *                EmployeeType                                                 *
  8. *                GeneralPage                                                  *
  9. *                                                                             *
  10. * .COPYRIGHT:                                                                 *
  11. *    Licensed Material - Program-Property of IBM                              *
  12. *    (C) Copyright IBM Corp. 1992, 1996 - All Rights Reserved                 *
  13. *                                                                             *
  14. * .DISCLAIMER:                                                                *
  15. *   The following [enclosed] code is sample code created by IBM               *
  16. *   Corporation.  This sample code is not part of any standard IBM product    *
  17. *   and is provided to you solely for the purpose of assisting you in the     *
  18. *   development of your applications.  The code is provided 'AS IS',          *
  19. *   without warranty of any kind.  IBM shall not be liable for any damages    *
  20. *   arising out of your use of the sample code, even if they have been        *
  21. *   advised of the possibility of such damages.                               *
  22. *                                                                             *
  23. * .NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE          *
  24. *                                                                             *
  25. ******************************************************************************/
  26. #ifndef _LGENL_
  27. #define _LGENL_
  28.  
  29. #include <imcelcv.hpp>
  30. #include <istattxt.hpp>
  31. #include <ientryfd.hpp>
  32. #include <iradiobt.hpp>
  33. #include <inotebk.hpp>
  34. #include <icmdhdr.hpp>
  35. #include <istring.hpp>
  36.  
  37. #include "lpagectl.hpp"
  38. #include "ldbase.hpp"
  39.  
  40. //----------------------------------------------------------------------------
  41. // class EmployeeType
  42. //----------------------------------------------------------------------------
  43. class EmployeeType :  public ISetCanvas  // IGroupBox
  44. {
  45.  
  46. public:
  47. // ---------------------- PUBLIC -------------------------------------
  48.  
  49. //----------------------- Contructor/Destructor ------------------------------
  50. // Class EmployeeType:: EmployeeType()
  51. //----------------------------------------------------------------------------
  52.   EmployeeType(IWindow* pParent) ;
  53.   ~EmployeeType();
  54.  
  55. inline EmployeeType& selectReg() {reg.select(); return *this; };
  56. inline EmployeeType& selectMgr() {mgr.select(); return *this; };
  57. inline EmployeeType& selectSup() {sup.select(); return *this;};
  58.  
  59. inline EmployeeType& deselectReg() {reg.deselect(); return *this;};
  60. inline EmployeeType& deselectMgr() {mgr.deselect(); return *this;};
  61. inline EmployeeType& deselectSup() {sup.deselect(); return *this;};
  62.  
  63. inline Boolean
  64.     isRegSelected() { return reg.isSelected();};
  65. inline Boolean
  66.     isMgrSelected() { return mgr.isSelected();};
  67. inline Boolean
  68.     isSupSelected() { return sup.isSelected();};
  69.  
  70. private:
  71. //--------------------------- PRIVATE ----------------------------------------
  72.  
  73. IRadioButton
  74.   reg,
  75.   mgr,
  76.   sup;
  77.  
  78. };
  79.  
  80.  
  81. //----------------------------------------------------------------------------
  82. // Class GeneralPage
  83. //----------------------------------------------------------------------------
  84. class GeneralPage : public IMultiCellCanvas,
  85.                     public ICommandHandler
  86. {
  87.  
  88. public:
  89. //---------------------------------- PUBLIC ----------------------------------
  90.  
  91. friend class QueryGenl;
  92. //----------------------- Contructor/Destructor ------------------------------
  93. // Contructor for GeneralPage()
  94. //----------------------------------------------------------------------------
  95.  
  96.   GeneralPage(IWindow* pParent,
  97.               const IString empNum="");
  98.  
  99.   GeneralPage(IWindow* pParent,
  100.                LQueryData& qd);
  101.  
  102.   ~GeneralPage();
  103.  
  104. //----------------------------------------------------------------------------
  105. // verfiyAndSave - save database data
  106. //----------------------------------------------------------------------------
  107. Boolean
  108.   verifyAndSave( IString& theString,
  109.                  IString& theEntry,
  110.                  const IString saveName="");
  111.  
  112. //----------------------------------------------------------------------------
  113. // setEmployeeData - populate page
  114. //----------------------------------------------------------------------------
  115. GeneralPage&
  116.   setEmployeeData();
  117.  
  118. //----------------------------------------------------------------------------
  119. // getKey - database key
  120. //----------------------------------------------------------------------------
  121. inline IString
  122.   key() {return Key;};
  123.  
  124. //----------------------------------------------------------------------------
  125. // pageSettings() - used to size the notebook
  126. //----------------------------------------------------------------------------
  127. INotebook::PageSettings
  128.   pageSettings();
  129.  
  130.  
  131. protected:
  132. //----------------------- PROTECTED ------------------------------------------
  133.  
  134. Boolean
  135.   command( ICommandEvent& event );
  136.  
  137. GeneralPage
  138.  &handleIt();
  139.  
  140. private:
  141. //------------------------ PRIVATE --------------------------------------------
  142.  
  143. GeneralPage&
  144.   setUp();
  145.  
  146. GeneralPage&
  147.   setCells();              // build multi-cell canvas
  148.  
  149. GeneralPage&
  150.   displayData();
  151.  
  152. LEmployeeData
  153.   employeeData;
  154.  
  155. PageButtons
  156.   pageButtons;
  157.  
  158. IStaticText
  159.   employeeIdText,
  160.   lastNameText,
  161.   middleNameText,
  162.   firstNameText,
  163.   intPhoneText,
  164.   extPhoneText,
  165.   roomText,
  166.   deptText,
  167.   bldgText,
  168.   divText,
  169.   mgrEmpNumText,
  170.   mgrEmpNameText;
  171.  
  172. IEntryField
  173.   employeeId,
  174.   lastName,
  175.   firstName,
  176.   middleInitial,
  177.   intPhone,
  178.   extPhone,
  179.   room,
  180.   building,
  181.   deptName,
  182.   division;
  183.  
  184. EmployeeType
  185.   employeeType;
  186.  
  187. IEntryField
  188.   mgrEmpId,
  189.   mgrName;
  190.  
  191. IString
  192.   Key;               // employee number
  193. INotebook::PageSettings
  194.   thePageSettings;
  195.  
  196. #ifdef IC_MOTIF
  197. LPictureVerifyHandler
  198.   alphaNumericHandler,
  199.   alphaHandler,
  200.   alpha1Handler,
  201.   phoneHandler,
  202.   fullNameHandler,
  203.   lastNameHandler;
  204. #endif
  205.  
  206. Boolean
  207.   isAquery;
  208. };
  209.  
  210. #endif
  211.