home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / IOC / HELLO5 / AEARTHW5.HPP < prev    next >
C/C++ Source or Header  |  1995-04-07  |  6KB  |  82 lines

  1. #ifndef _AEARTHW5_
  2. #define _AEARTHW5_
  3. /*****************************************************************************
  4. * HELLO WORLD SAMPLE PROGRAM - Version 5: AEarthWindow Header (aearthw5.hpp) *
  5. *                                                                            *
  6. * COPYRIGHT: Copyright (C) International Business Machines Corp., 1992,1995. *
  7. *                                                                            *
  8. * DISCLAIMER OF WARRANTIES:                                                  *
  9. *   The following [enclosed] code is sample code created by IBM              *
  10. *   Corporation.  This sample code is not part of any standard IBM product   *
  11. *   and is provided to you solely for the purpose of assisting you in the    *
  12. *   development of your applications.  The code is provided "AS IS",         *
  13. *   without warranty of any kind.  IBM shall not be liable for any damages   *
  14. *   arising out of your use of the sample code, even if they have been       *
  15. *   advised of the possibility of such damages.                              *
  16. *****************************************************************************/
  17. // NOTE: WE RECOMMEND USING A FIXED-SPACE FONT TO LOOK AT THE SOURCE.
  18. #ifndef _ISTATTXT_                                                          //V5
  19.   #include <istattxt.hpp>                 //IStaticText class Header          V5
  20. #endif                                                                      //V5
  21. #ifndef _IPAINHDR_                                                          //V5
  22.   #include <ipainhdr.hpp>                 //IPaintHandler class Header        V5
  23. #endif                                                                      //V5
  24.  
  25. /**************************************************************************   V5
  26. * Class:   APaintHandler                                                  *   V5
  27. *                                                                         *   V5
  28. * Purpose: New Paint Handler class that handles requests to repaint       *   V5
  29. *          the static text control containing the graphics of Earth.      *   V5
  30. *                                                                         *   V5
  31. **************************************************************************/ //V5
  32. class APaintHandler : public IPaintHandler {                                //V5
  33. public:                                                                     //V5
  34. virtual ~APaintHandler() { }                                                //V5
  35. protected:                                                                  //V5
  36. /*--------------------- Override paintWindow Function --------------------|   V5
  37. | The paintWindow() function is called to handle repainting of            |   V5
  38. | the static text window containing the graphics of Earth.                |   V5
  39. |------------------------------------------------------------------------*/ //V5
  40. virtual Boolean                                                             //V5
  41.   paintWindow(IPaintEvent&) ;                                               //V5
  42. };                                                                          //V5
  43.  
  44. /**************************************************************************   V5
  45. * Class:   AEarthWindow                                                   *   V5
  46. *                                                                         *   V5
  47. * Purpose: Earth window for the C++ Hello World sample application.       *   V5
  48. *                                                                         *   V5
  49. **************************************************************************/ //V5
  50. class AEarthWindow : public IStaticText                                     //V5
  51. {                                                                           //V5
  52.   public:                                                                   //V5
  53.     AEarthWindow(unsigned long windowId,                                    //V5
  54.                  IWindow * parentownerWindow,                               //V5
  55.                  const IRectangle& rect=IRectangle());                      //V5
  56. virtual ~AEarthWindow();                                                    //V5
  57. /*------------------ Paint the Earth and Stars Functions -----------------|   V5
  58. | These functions are called to draw the Earth and stars in a static      |   V5
  59. | text window.                                                            |   V5
  60. |   paintWorld - Clear the background, draw the Earth and a variable      |   V5
  61. |           number of atmosphere layers, and call paintStars to draw the  |   V5
  62. |           stars.                                                        |   V5
  63. |   paintStars - Draw the stars as graphical points.                      |   V5
  64. |------------------------------------------------------------------------*/ //V5
  65. Boolean                                                                     //V5
  66.     paintWorld(),                                                           //V5
  67.     paintStars();                                                           //V5
  68.  
  69.   private:                                                                  //V5
  70.     int         atmosphereLayers;                                           //V5
  71.     IColor      spaceColor;                                                 //V5
  72.     IColor      globeColor;                                                 //V5
  73.     IColor      starColor;                                                  //V5
  74.     APaintHandler paintHandler;                                             //V5
  75.  
  76.     AEarthWindow(const AEarthWindow&);  //Default copy constructor            V5
  77. AEarthWindow                                                                //V5
  78.     &operator=(const AEarthWindow&);    //Default assignment operator         V5
  79.  
  80. };                                                                          //V5
  81. #endif                                                                      //V5
  82.