home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / ioc / acdf6 / acdfeat6.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  2.9 KB  |  98 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //                      SAMPLE CODE
  3. //
  4. // FileName: ACDFEat6.hpp
  5. //
  6. // ClassName: AEartWindow
  7. //
  8. // Description: Conversion of the Hello World 5 Sample
  9. //
  10. ///////////////////////////////////////////////////////////////////////////////
  11. #ifndef _AEARTHW6_
  12. #define _AEARTHW6_
  13.  
  14. #ifdef IC_TRACE_DEVELOP
  15.     #include <itrace.hpp>
  16. #else
  17.     #define IFUNCTRACE_DEVELOP()
  18.     #define ITRACE_DEVELOP(x)
  19. #endif
  20.  
  21. // Open Class 2D Drawing Section 
  22. #include <igline.hpp>
  23. #include <igelipse.hpp>
  24. #include <igrect.hpp>
  25. #include <igbundle.hpp>
  26. #include <idrawcv.hpp>
  27. #include <iglist.hpp>
  28. #include <isizehdr.hpp>
  29.  
  30. const int                       //Number of stars in the sky
  31.   stars=13;
  32. const int                       //Number of layers in the atmosphere
  33.   atmosphereLayers=3;
  34.  
  35. class AEarthWindow;
  36. // Class Star -- Draws a star at a specified location
  37.  
  38.  
  39. class Star:public IGLine 
  40. {
  41. public:
  42.                             Star(const IPoint &pt) ;
  43.  
  44.                   Star      &setPoint(const IPoint &pt);
  45. };
  46.  
  47.  
  48.  
  49. // Class AEarthWindowResizeHandler -- A handler to resize the picture 
  50. //  according to the new dimensions of the IDrawingCanvas window.
  51.  
  52. class AEarthWindowResizeHandler: public IResizeHandler
  53. {
  54. public:
  55.                             AEarthWindowResizeHandler (AEarthWindow *aew);
  56.  
  57.      virtual                ~AEarthWindowResizeHandler();
  58.  
  59. protected:
  60. //The windowResize() function is called to handle resizing of
  61. //the IDrawingCanvas text window containing the graphics of Earth.
  62.     virtual     Boolean windowResize(IResizeEvent & evnt);
  63.  
  64. private:
  65.             AEarthWindow    *earthWindow;
  66. };
  67.  
  68. //Class AEarthWindow -- Earth window for the C++ Hello World sample application.
  69.  
  70. class AEarthWindow : public IDrawingCanvas
  71. {                                                                           
  72. public:
  73.                             AEarthWindow(unsigned long windowId,
  74.                                     IWindow * parentownerWindow,                               
  75.                                     const IRectangle& rect=IRectangle());                      
  76.  
  77.     virtual                 ~AEarthWindow();
  78.                         
  79.             Boolean         paintWorld(),
  80.                             paintStars();
  81.  
  82. private:
  83.   AEarthWindow              &operator=(const AEarthWindow&);//Default assignment operator
  84.  
  85.   AEarthWindowResizeHandler earthWindowResizeHandler;
  86.   IColor                    spaceColor,
  87.                             globeColor,
  88.                             starColor;
  89.   Star                      *starlist[stars];
  90.   IGEllipse                 *earthArc[atmosphereLayers+1];
  91.   IGRectangle               space;
  92.   IGList                    graphList,
  93.                             earthGraphicList,
  94.                             starGraphicList;
  95. };
  96. #endif
  97.  
  98.