home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ibmodf.zip / CUSTOMER.ZIP / CUSTVIEW.HPP < prev    next >
Text File  |  1995-06-19  |  7KB  |  147 lines

  1. #ifndef _CUSTVIEW_
  2. #define _CUSTVIEW_
  3.  
  4. /*******************************************************************************
  5. * FILE NAME: CUSTVIEW.hpp                                                      *
  6. *                                                                              *
  7. * DESCRIPTION:                                                                 *
  8. *   This file contains the declaration(s) of the class(es):                    *
  9. *     MyCustomerView - Class representing an OpenDoc view (frame + facet) which*
  10. *                    takes the form of a panel or dialog full of controls.     *
  11. *                    This class behaves in most case like a UICL ICanvas.      *
  12. *     MySecondaryCustomerView - Class representing an 2nd OpenDoc view         *
  13. *                    (frame + facet) of the same model object.                 *
  14. *                                                                              *
  15. * COPYRIGHT:                                                                   *
  16. *   Licensed Materials - Property of IBM                                       *
  17. *   (C) Copyright IBM Corporation 1994                                         *
  18. *   All Rights Reserved                                                        *
  19. *   US Government Users Restricted Rights - Use, duplication, or               *
  20. *   disclosure                                                                 *
  21. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  22. *                                                                              *
  23. ******************************************************************************   */
  24.  
  25. // ----- UICL Includes -----
  26. #include <oformv.hpp>    //always first (achieve proper definition of "true", "false", etc.)
  27.  
  28. #include <iconnect.hpp>
  29. #include <irect.hpp>
  30. #include <ientryfd.hpp>
  31. #include <ispinnum.hpp>
  32. #include <ilistbox.hpp>
  33. #include <imcelcv.hpp>
  34. #include <istattxt.hpp>
  35.  
  36. //------ Local includes -------
  37. #include <icust.hpp>
  38. #include <icompany.hpp>
  39. #include <iadd.hpp>
  40. #include <custmodl.hpp>
  41.  
  42. // ----- OpenDoc Includes (if this part deals with OpenDoc directly anywhere) -----
  43.  
  44.  
  45. // Forward declarations for other classes:
  46. class IResourceId;
  47.  
  48.  
  49. /*----------------------------------------------------------------------------  */
  50. /* Align classes on four byte boundary.                                         */
  51. /*----------------------------------------------------------------------------  */
  52. #pragma pack(4)
  53.  
  54. class MyCustomerView : public ODFFormView {
  55. /*******************************************************************************
  56. * Class representing an view onto a CustomerModel object                       *
  57. *******************************************************************************/
  58. public:
  59.    typedef ODFFormView Inherited;
  60.  
  61. /*-----------------------Constructor -------------------------------------------
  62. | Constructor                                                                  |
  63. ------------------------------------------------------------------------------*/
  64.   MyCustomerView (unsigned long windowId,
  65.               CustomerModel *model,
  66.               const ISize &initialSize = ISize(),
  67.               const Style &style = defaultStyle ( ) );
  68.   virtual  ~MyCustomerView();
  69.  
  70.   virtual CustomerModel *model();
  71.   virtual MyCustomerView &makeConnections();
  72.  
  73. /*-----------------------View Connection to Model Object------------------------
  74. | Methods in this view which respond to model and view changes.                |
  75. ------------------------------------------------------------------------------*/
  76.    virtual void customerNameEFChanged();
  77.    virtual void customerNameChanged();
  78.  
  79.    virtual void balanceEFChanged();
  80.    virtual void balanceChanged();
  81.  
  82.    virtual MyCustomerView &drawView();
  83.  
  84.  
  85. /*--------------------------------- Private ----------------------------------  */
  86. private:
  87.    MyCustomerView(const MyCustomerView &);
  88.    MyCustomerView &operator =(const MyCustomerView &);
  89.  
  90.    IEntryField *customerNameEF, *balanceEF;
  91.    IModelViewSynchConnection *customerNameConn, *balanceConn;
  92. }; // MyCustomerView
  93.  
  94.  
  95. class MySecondaryCustomerView : public ODFFormView {
  96. /*******************************************************************************
  97. * Class representing an view onto a CustomerModel object                       *
  98. *******************************************************************************/
  99. public:
  100.    typedef ODFFormView Inherited;
  101.  
  102. /*-----------------------Constructor -------------------------------------------
  103. | Constructor                                                                  |
  104. ------------------------------------------------------------------------------*/
  105.   MySecondaryCustomerView (unsigned long windowId,
  106.                        CustomerModel *model,
  107.                        const ISize &initialSize = ISize(),
  108.                        const Style &style = defaultStyle ( ) );
  109.   virtual  ~MySecondaryCustomerView();
  110.  
  111.   virtual CustomerModel *model();
  112.   virtual MySecondaryCustomerView &makeConnections();
  113.  
  114. /*-----------------------View Connection to Model Object------------------------
  115. | Methods in this view which respond to model and view changes.                |
  116. ------------------------------------------------------------------------------*/
  117.    virtual void customerNameEFChanged();
  118.    virtual void customerNameChanged();
  119.  
  120.    virtual void customerStateLBChanged();
  121.    virtual void customerStateChanged();
  122.  
  123.    virtual void companyEFChanged();
  124.    virtual void companyChanged();
  125.  
  126.  
  127.  
  128. /*--------------------------------- Private ----------------------------------  */
  129. private:
  130.    MySecondaryCustomerView(const MySecondaryCustomerView &);
  131.    MySecondaryCustomerView &operator =(const MySecondaryCustomerView &);
  132.  
  133.    IMultiCellCanvas  *multiCell;
  134.    IEntryField customerNameEF;  //note in this view we use "solid" control objects
  135.    IEntryField companyEF;
  136.    IListBox stateListBox;
  137.    IStaticText        custLabel, companyLabel, stateLabel;
  138.    IModelViewSynchConnection *customerNameConn, *companyConn, *stateConn;
  139.  
  140. }; // MySecondaryCustomerView
  141.  
  142. /*----------------------------------------------------------------------------  */
  143. /* Resume compiler default packing.                                             */
  144. /*----------------------------------------------------------------------------  */
  145. #pragma pack()
  146. #endif /* _CUSTVIEW_ */
  147.