home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ocl_con2.zip / ocl_con2.hpp < prev    next >
C/C++ Source or Header  |  1997-11-02  |  1KB  |  46 lines

  1. // Stéphane Charette, charette@writeme.com
  2. // IBM Open Class Library Custom Drawing Container Sample
  3. // (using Visual Age C++ v3.0 with OS/2 v4.0)
  4. // 1997Nov02
  5.  
  6. // OCL includes
  7. #include <icnrcol.hpp>  // IContainerColumn
  8. #include <icnrdihd.hpp> // ICnrDrawHandler
  9. #include <icnrctl.hpp>  // IContainerControl
  10. #include <icnrobj.hpp>  // IContainerObject
  11. #include <iframe.hpp>   // IFrameWindow
  12.  
  13. // class definition
  14. class MyApplicationClass :    // inherits from...
  15.    public IFrameWindow,       // ...basic frame window...
  16.    protected ICnrDrawHandler  // ...and container draw handler
  17. {
  18.    public:
  19.       // instance variables
  20.       IContainerControl container;
  21.       IContainerColumn  col1;
  22.       IContainerColumn  col2;
  23.       // class constructor/destructor
  24.       MyApplicationClass( void );
  25.       virtual ~MyApplicationClass( void );
  26.       // inherited method from ICnrDrawHandler
  27.       drawDetailsItem( ICnrDrawItemEvent &event );
  28.  
  29.    // imbeded class used as objects for the container
  30.    class MyCnrObject :  // inherits from...
  31.       public IContainerObject // ...container object
  32.    {
  33.       public:
  34.          IString first_name;
  35.          IString last_name;
  36.          long colour;
  37.          // constructor
  38.          MyCnrObject( char *first, char *last, long clr ) :
  39.             first_name( first ),
  40.             last_name(  last  ),
  41.             colour(     clr   )
  42.             {return;}
  43.    };
  44. };
  45.  
  46.