home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / IOC / LANCELOT / LGENL.HPP < prev    next >
C/C++ Source or Header  |  1995-04-01  |  6KB  |  206 lines

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