home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / SAMPLES / ICLUI / DRAG4 / DMSAMP3.HPP < prev    next >
Text File  |  1993-10-15  |  6KB  |  128 lines

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