home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / IOC / DRAG3 / DMSAMP3.HPP < prev    next >
Text File  |  1994-10-14  |  6KB  |  123 lines

  1. #include <iframe.hpp>
  2. #include <ititle.hpp>
  3. #include <icnr.hpp>
  4. #include <idmhndlr.hpp>
  5.  
  6. #include "dmsamp3.h"
  7.  
  8. class MyWindow;
  9.  
  10.  
  11. class Customer : public IContainerObject {
  12. /*******************************************************************************
  13. * Objects of this class are used to show direct manipulation support for       *
  14. * containers.  Instances of this object are created to allow demonstrations    *
  15. * of moves and copies of this object between intra-process containers.         *
  16. *******************************************************************************/
  17. public:
  18. friend class IContainerColumn;
  19. friend class MyWindow;
  20.  
  21. /*-------------------------- Constructors/Destructor ---------------------------
  22. | Objects of this class are constructed by providing the following:            |
  23. |   o A reference to a customer object (a copy constructor)                    |
  24. |   o A IString for the icon text, an icon resource id, an IString for the     |
  25. |     customer name, address, and phone number, and a pointer to a MyWindow    |
  26. |     object                                                                   |
  27. ------------------------------------------------------------------------------*/
  28.   Customer  ( const Customer &cnrobj );
  29.  
  30.   Customer  ( const IString  &iconText,
  31.               unsigned long  iconID,
  32.               const IString  &name,
  33.               const IString  &address,
  34.               const IString  &phone,
  35.               MyWindow       *window );
  36.  
  37.   ~Customer ( ) {};
  38.  
  39. /*-------------------------------- Accessors -----------------------------------
  40. | Instances of the Customer class have attributes that can be accessed by the  |
  41. | following functions:                                                         |
  42. |   name       - Returns the customer name                                     |
  43. |   address    - Returns the customer address.                                 |
  44. |   phone      - Returns the customer phone number.                            |
  45. |   setName    - Sets the customer name.                                       |
  46. |   setAddress - Sets the customer address.                                    |
  47. |   setPhone   - Sets the customer phone number.                               |
  48. ------------------------------------------------------------------------------*/
  49.   IString name    ( ) const  { return this->strName; }
  50.   IString address ( ) const  { return this->strAddress; }
  51.   IString phone   ( ) const  { return this->strPhone; }
  52.  
  53.   void setName    ( const IString &name )     { this->strName = name; }
  54.   void setAddress ( const IString &address )  { this->strAddress = address; }
  55.   void setPhone   ( const IString &phone )    { this->strPhone = phone; }
  56.  
  57. /*-------------------------------- Overrides -----------------------------------
  58. | The following function overrides the objectCopy function defined in the      |
  59. | base IContainerObject class:                                                 |
  60. |  objectCopy - Called when it is necessary to make a copy of the Customer     |
  61. |               object.  This is invoked when IContainerControl::copyObjectTo  |
  62. |               is called.                                                     |
  63. ------------------------------------------------------------------------------*/
  64.   IContainerObject* objectCopy( );
  65.  
  66. private:
  67.   IString   strName,
  68.             strAddress,
  69.             strPhone;
  70.   MyWindow  *myWin;
  71. };
  72.  
  73.  
  74. class MyWindow : public IFrameWindow {
  75. /*******************************************************************************
  76. * This is the common base class for the demo source window class, MySourceWin, *
  77. * and the demo target window class, MyTargetWin.                               *
  78. *******************************************************************************/
  79. friend class Customer;
  80.  
  81. public:
  82. /*-------------------------- Constructor/Destructor ----------------------------
  83. | Objects of this class are constructed by providing the following:            |
  84. |   o A window ID                                                              |
  85. ------------------------------------------------------------------------------*/
  86.   MyWindow  ( unsigned long windowId );
  87.   ~MyWindow ( ) {};
  88.  
  89. protected:
  90.   IContainerControl *cnrCtl;
  91.   Customer          *car,
  92.                     *space,
  93.                     *bolt,
  94.                     *starfleet;
  95.   IResourceLibrary  reslib;
  96. };
  97.  
  98.  
  99. class MySourceWin : public MyWindow {
  100. /*******************************************************************************
  101. * This is the demo source window class.                                        *
  102. *******************************************************************************/
  103. public:
  104. /*------------------------------ Constructor -----------------------------------
  105. | Objects of this class are constructed by providing the following:            |
  106. |   o A window ID                                                              |
  107. ------------------------------------------------------------------------------*/
  108.   MySourceWin ( unsigned long windowId );
  109. };
  110.  
  111. class MyTargetWin : public MyWindow {
  112. /*******************************************************************************
  113. * This is the demo source window class.                                        *
  114. *******************************************************************************/
  115. public:
  116. /*------------------------------ Constructor -----------------------------------
  117. | Objects of this class are constructed by providing the following:            |
  118. |   o A window ID                                                              |
  119. ------------------------------------------------------------------------------*/
  120.   MyTargetWin ( unsigned long windowId );
  121. };
  122.  
  123.