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

  1. /*******************************************************************************
  2. * FILE NAME: lpagectl.hpp                                                      *
  3. *                                                                              *
  4. * DESCRIPTION:                                                                 *
  5. *                                                                              *
  6. * Classes                                                                      *
  7. *    PageButtons                                                               *
  8. *    PageCnrButtons                                                            *
  9. *    PageScrollButtons                                                         *
  10. *    QueryRange                                                                *
  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. *******************************************************************************/
  20. #ifndef _LPAGECTL_
  21. #define _LPAGECTL_
  22.  
  23. #include <isetcv.hpp>    
  24. #include <igraphbt.hpp>  
  25. #include <icheckbx.hpp>  
  26. #include <icombobx.hpp>  
  27. #include <istring.hpp>   
  28. #include <istattxt.hpp>  
  29. #include <imsgbox.hpp>   
  30. #include <imcelcv.hpp>
  31. #include <iselhdr.hpp>   
  32.  
  33. #ifdef IC_MOTIF
  34. #include <ipicvhdr.hpp>
  35. #include <istring.hpp>
  36. #endif
  37.  
  38. class AccountPage;
  39. class SkillPage;
  40. class ProjectPage;
  41. class TasksPage;
  42.  
  43. class AGraphicPushButton : public IGraphicPushButton
  44. {
  45. public:
  46.   AGraphicPushButton( unsigned long windowId,
  47.                        IWindow* parent,
  48.                        IWindow* owner,
  49.                        unsigned long iconid);
  50.  
  51.   ~AGraphicPushButton();
  52.  
  53. protected:
  54.  
  55. inline  virtual
  56.  ISize calcMinimumSize() const {
  57.    return (ISize(40, 40)); }
  58.  };
  59.  
  60. #ifndef IC_MOTIF
  61. class PageButtonsSelectHandler : public ISelectHandler
  62. {
  63. public:
  64.  
  65.     PageButtonsSelectHandler( IMultiCellCanvas* parent );
  66.     ~PageButtonsSelectHandler();
  67.     Boolean
  68.       selected( IControlEvent& event );
  69.  
  70. private:
  71.     IMultiCellCanvas
  72.      *theParentMulticell;
  73. };
  74. #endif
  75.  
  76. class PageCnrButtons : public ISetCanvas
  77. {
  78. public:
  79.  
  80.     PageCnrButtons( unsigned long windowId
  81.                    ,IWindow* parent
  82.                    ,IWindow* owner
  83.                    ,Boolean noChangeButton= false );
  84.  
  85.     ~PageCnrButtons();
  86.  
  87. private:
  88.  
  89. IGraphicPushButton
  90.   *addButton,
  91.   *removeButton,
  92.   *changeButton;
  93.  
  94. };
  95.  
  96. class PageButtons : public ISetCanvas
  97. {
  98. public:
  99.  
  100.     PageButtons( unsigned long windowId
  101.                 ,IMultiCellCanvas* parent
  102.                 ,IMultiCellCanvas* owner
  103.                 ,Boolean noQueryButton = false );
  104.  
  105.     ~PageButtons();
  106.  
  107. private:
  108.  
  109. AGraphicPushButton
  110.   *queryButton,
  111.   *saveButton,
  112.   *undoButton,
  113.   *helpButton;
  114.  
  115. #ifndef IC_MOTIF
  116. ICheckBox
  117.   *gridCheckBox;
  118. PageButtonsSelectHandler
  119.   selectHandler;
  120. #endif
  121. };
  122.  
  123. class PageScrollButtons : public ISetCanvas
  124. {
  125. public:
  126.  
  127.   PageScrollButtons( unsigned long windowId
  128.                     ,IWindow* parent
  129.                     ,IWindow* owner );
  130.  
  131.   ~PageScrollButtons();
  132.  
  133. PageScrollButtons&
  134.     setDisplayText( const char* theStr );
  135.  
  136. private:
  137.  
  138. IStaticText
  139.     weekEndingText;
  140.  
  141. IString
  142.     dateText;
  143.  
  144. AGraphicPushButton
  145.     prevButton,
  146.     nextButton;
  147.  
  148. IString
  149.     displayText;
  150.  
  151. };
  152.  
  153. /******************************************************************************
  154. * Class PageCnrSelHandler - Page container select handler.                    *
  155. ******************************************************************************/
  156. class PageCnrSelHandler : public ISelectHandler
  157. {
  158.    public:
  159. /*------------------------ Constructors/Destructor ----------------------------
  160. | Construct the object given a page.                                          |
  161. -----------------------------------------------------------------------------*/
  162.       PageCnrSelHandler( AccountPage* page );
  163.       PageCnrSelHandler( SkillPage* page );
  164.       PageCnrSelHandler( ProjectPage* page );
  165.       PageCnrSelHandler( TasksPage* page );
  166.      ~PageCnrSelHandler();
  167.  
  168.    protected:
  169.  
  170. /*----------------------------- Event Processing ------------------------------
  171. | Handle and process events:                                                  |
  172. |   selected            - Process select events.                              |
  173. -----------------------------------------------------------------------------*/
  174.       Boolean
  175.          selected( IControlEvent& event );
  176.  
  177.    private:
  178.  
  179.       enum
  180.          PageType { accountPage, skillPage, projectPage, taskPage };
  181.  
  182.       IMultiCellCanvas
  183.         *pPage;
  184.  
  185.       PageType
  186.         pageType;
  187. };
  188.  
  189.  
  190. class QueryRange : public ISetCanvas
  191. {
  192. public:
  193.  
  194.     QueryRange( unsigned long windowId
  195.                ,IWindow* parent
  196.                ,IWindow* owner
  197.                ,unsigned long id);
  198.  
  199.     ~QueryRange();
  200.  
  201. inline IString
  202.     getRange() { return range.text();} ;
  203.  
  204. inline QueryRange&
  205.     setRange(const IString& r ) { range.setText(r); return *this;} ;
  206.  
  207.  
  208. private:
  209.  
  210. IComboBox
  211.     range;
  212.  
  213. };
  214.  
  215. #ifdef IC_MOTIF
  216. class LPictureVerifyHandler : public IPictureVerifyHandler
  217. {
  218. public:
  219. // ---------------------- PUBLIC -------------------------------------
  220.   LPictureVerifyHandler( IWindow* owner,
  221.                          IString pictureString);
  222.   IWindow* owner();
  223.  
  224. protected:
  225.  
  226.   Boolean invalidChange           ( IEditVerifyEvent& event );
  227.  
  228. private:
  229. //--------------------------- PRIVATE ----------------------------------------
  230.   IWindow* pOwner;
  231. };
  232.  
  233. const IString TEST_ALPHA             = IString("*a");
  234. const IString TEST_LETTER            = IString("1a");
  235. const IString TEST_ALPHANUMERIC      = IString("*&");
  236. const IString TEST_DATE              = IString("1-2n '/' 1-2n '/' 2n");
  237. const IString TEST_PHONE             = IString( "3n '-' 3n '-' 4n");
  238. const IString TEST_FULL_NAME         = IString("*a 1w *a" );
  239. const IString TEST_CURRENCY          = IString("*n 0-1p 0-2n");
  240.  
  241. #endif
  242. #endif
  243.