home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / SAMPLES / ICLUI / DRAG3 / DMSAMP3.HPP < prev    next >
Text File  |  1993-10-08  |  6KB  |  125 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. |   setName    - Sets the customer name.                                       |
  47. |   setAddress - Sets the customer address.                                    |
  48. |   setPhone   - Sets the customer phone number.                               |
  49. ------------------------------------------------------------------------------*/
  50.   IString name    ( ) const  { return this->strName; }
  51.   IString address ( ) const  { return this->strAddress; }
  52.   IString phone   ( ) const  { return this->strPhone; }
  53.  
  54.   void setName    ( const IString &name )     { this->strName = name; }
  55.   void setAddress ( const IString &address )  { this->strAddress = address; }
  56.   void setPhone   ( const IString &phone )    { this->strPhone = phone; }
  57.  
  58. /*-------------------------------- Overrides -----------------------------------
  59. | The following function overrides the objectCopy function defined in the      |
  60. | base IContainerObject class:                                                 |
  61. |  objectCopy - Called when it is necessary to make a copy of the Customer     |
  62. |               object.  This is invoked when IContainerControl::copyObjectTo  |
  63. |               is called.                                                     |
  64. ------------------------------------------------------------------------------*/
  65.   IContainerObject* objectCopy( );
  66.  
  67. private:
  68.   IString   strName,
  69.             strAddress,
  70.             strPhone;
  71.   MyWindow  *myWin;
  72. };
  73.  
  74.  
  75. class MyWindow : public IFrameWindow {
  76. /*******************************************************************************
  77. * This is the common base class for the demo source window class, MySourceWin, *
  78. * and the demo target window class, MyTargetWin.                               *
  79. *******************************************************************************/
  80. friend class Customer;
  81.  
  82. public:
  83. /*-------------------------- Constructor/Destructor ----------------------------
  84. | Objects of this class are constructed by providing the following:            |
  85. |   o A window ID                                                              |
  86. ------------------------------------------------------------------------------*/
  87.   MyWindow  ( unsigned long windowId );
  88.   ~MyWindow ( ) {};
  89.  
  90. protected:
  91.   ICnrHandler       *cnrh;
  92.   IContainerControl *cnrCtl;
  93.   Customer          *car,
  94.                     *space,
  95.                     *bolt,
  96.                     *starfleet;
  97.   IResourceLibrary  reslib;
  98. };
  99.  
  100.  
  101. class MySourceWin : public MyWindow {
  102. /*******************************************************************************
  103. * This is the demo source window class.                                        *
  104. *******************************************************************************/
  105. public:
  106. /*------------------------------ Constructor -----------------------------------
  107. | Objects of this class are constructed by providing the following:            |
  108. |   o A window ID                                                              |
  109. ------------------------------------------------------------------------------*/
  110.   MySourceWin ( unsigned long windowId );
  111. };
  112.  
  113. class MyTargetWin : public MyWindow {
  114. /*******************************************************************************
  115. * This is the demo source window class.                                        *
  116. *******************************************************************************/
  117. public:
  118. /*------------------------------ Constructor -----------------------------------
  119. | Objects of this class are constructed by providing the following:            |
  120. |   o A window ID                                                              |
  121. ------------------------------------------------------------------------------*/
  122.   MyTargetWin ( unsigned long windowId );
  123. };
  124.  
  125.