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

  1. #ifndef _AHELLOW3_
  2. #define _AHELLOW3_
  3. /*****************************************************************************
  4. * HELLO WORLD SAMPLE PROGRAM - Version 3: Class Header (ahellow3.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.  
  19. #ifndef _IFRAME_                                                            //V2
  20.   #include <iframe.hpp>         //Include IFrameWindow class header           V2
  21. #endif                                                                      //V2
  22. #ifndef _ISTATTXT_                                                          //V2
  23.   #include <istattxt.hpp>       //Include IStaticText class header            V2
  24. #endif                                                                      //V2
  25. #ifndef _IINFOA_                                                            //V2
  26.   #include <iinfoa.hpp>         //Include IInfoArea class header              V2
  27. #endif                                                                      //V2
  28. #ifndef _IMENUBAR_                                                          //V3
  29.   #include <imenubar.hpp>       //Include IMenuBar class header               V3
  30. #endif                                                                      //V3
  31. #ifndef _ICMDHDR_                                                           //V3
  32.   #include <icmdhdr.hpp>        //Include ICommandHandler class header        V3
  33. #endif                                                                      //V3
  34.  
  35. //Forward declarations for other classes:
  36. class AHelloWindow;                                                         //V3
  37.  
  38. /**************************************************************************   V3
  39. * Class:   ACommandHandler                                                *   V3
  40. *                                                                         *   V3
  41. * Purpose: New Command Handler class that handles commands                *   V3
  42. *          specifically for AHelloWindow class windows.                   *   V3
  43. *                                                                         *   V3
  44. **************************************************************************/ //V3
  45. class ACommandHandler : public ICommandHandler {                            //V3
  46. public:                                                                     //V3
  47.   ACommandHandler(AHelloWindow *helloFrame);                                //V3
  48. virtual ~ACommandHandler() { }                                              //V3
  49.  
  50. protected:                                                                  //V3
  51. /*------------------------ Override Command Function ---------------------|   V3
  52. | The command function is called to handle application command events.    |   V3
  53. |------------------------------------------------------------------------*/ //V3
  54. virtual Boolean                                                             //V3
  55.   command(ICommandEvent& cmdEvent);                                         //V3
  56.  
  57. private:                                                                    //V3
  58.   AHelloWindow *frame;                                                      //V3
  59. };                                                                          //V3
  60.  
  61. /**************************************************************************   V2
  62. * Class:   AHelloWindow                                                   *   V2
  63. *                                                                         *   V2
  64. * Purpose: Main Window class for C++ Hello World sample application.      *   V2
  65. *          It is derived from IFrameWindow class.                         *   V2
  66. *                                                                         *   V2
  67. **************************************************************************/ //V2
  68. class AHelloWindow : public IFrameWindow                                    //V2
  69. {                                                                           //V2
  70. public:                                                                     //V2
  71.     AHelloWindow(unsigned long windowId);                                   //V2
  72. virtual ~AHelloWindow();                    //Destructor for this class       v3
  73.  
  74. /*------------------------ Hello Text Alignment --------------------------|   V3
  75. | The following enumeration type is used to specify the alignment of      |   V3
  76. | text in the hello static text window.                                   |   V3
  77. |------------------------------------------------------------------------*/ //V3
  78.     enum Alignment                                                          //V3
  79.       {                                                                     //V3
  80.       left, center, right                                                   //V3
  81.       };                                                                    //V3
  82. /*---------------------- Hello Static Text Functions ---------------------|   V3
  83. | This function is used to change the hello static text window.           |   V3
  84. |   setAlignment - Align the static text horizontally.  The text is       |   V3
  85. |           always centered vertically by design.                         |   V3
  86. |------------------------------------------------------------------------*/ //V3
  87. virtual AHelloWindow                                                        //V3
  88.    &setAlignment(Alignment alignment);                                      //V3
  89.  
  90.   private:                                                                  //V2
  91.     IMenuBar      menuBar;                                                  //V3
  92.     IStaticText   statusLine;                                               //V3
  93.     IStaticText   hello;                                                    //V2
  94.     IInfoArea     infoArea;                                                 //V2
  95.     ACommandHandler commandHandler;                                         //V3
  96.  
  97.     AHelloWindow(const AHelloWindow&);  //Default copy constructor            V2
  98. AHelloWindow                                                                //V2
  99.     &operator=(const AHelloWindow&);    //Default assignment operator         V2
  100. };                                                                          //V2
  101. #endif                                                                      //V2
  102.