home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / SAMPLES / ICLUI / HELLO6 / AHELLOW6.HPP < prev    next >
Text File  |  1993-05-12  |  10KB  |  139 lines

  1. #ifndef AHELLOWINDOW_HPP
  2. #define AHELLOWINDOW_HPP
  3. /******************************************************************************/
  4. /* HELLO WORLD SAMPLE PROGRAM - Version 6: Class Header (AHELLOW6.HPP)        */
  5. /*                                                                            */
  6. /* COPYRIGHT: Copyright (C) International Business Machines Corp., 1992,1993. */
  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. #include <iframe.hpp>           //Include IFrameWindow Class Header
  20. #include <icmdhdr.hpp>          //Include ICommandEvent & ICommandHandler     v3
  21. #include <ihelphdr.hpp>         //Include IHelpHandler                        v5
  22. #include <imenuhdr.hpp>         //Include IMenuHandler                        v6
  23. #include <iselhdr.hpp>          //Include ISelectHandler                      v5
  24. #include "atimehdr.hpp"         //Include ATimerHandler                       v6
  25.  
  26. class ATextDialog;              //Define the ATextDialog Class                v4
  27. class AEarthWindow;             //Define the AEarthWindow Class               v5
  28. class IInfoArea;                //Define the IInfoArea Class                  v6
  29. class IMenuBar;                 //Define the IMenuBar Class                   v6
  30. class IHelpWindow;              //Define the IHelpWindow Class                v6
  31. class ISplitCanvas;             //Define the ISplitCanvas Class               v6
  32. class IListBox;                 //Define the IListBox Class                   v6
  33. class IStaticText;              //Define the IStaticText Class                v6
  34.  
  35. //**************************************************************************
  36. // Class:   AHelloWindow                                                   *
  37. //                                                                         *
  38. // Purpose: Main Window for C++ Hello World sample application             *
  39. //          It is a subclass of IFrameWindow, ICommandHandler,             *  v3
  40. //          ISelectHandler (Processing List Box Selection) and             *  v5
  41. //          ATimeHandler (Processing of Time Events)                       *  v6
  42. //                                                                         *
  43. //**************************************************************************
  44. class AHelloWindow : public IFrameWindow,
  45.                      public ICommandHandler,                                //v3
  46.                      public ISelectHandler,                                 //v5
  47.                      public ATimeHandler                                    //v6
  48. {
  49.   public:                               //Define the Public Information
  50.     AHelloWindow(unsigned long windowId); //Constructor for this class
  51.     virtual ~AHelloWindow();            //Virtual Destructor for this class
  52.     virtual int     speed();            //Return Demo Speed                   v6
  53.     virtual Boolean setSpeed(int value);//Set Demo Speed                      v6
  54.  
  55.   protected:                            //Define Protected Member             v3
  56.     virtual Boolean setupButtons();     //Setup Buttons                       v4
  57.     virtual Boolean setupClient();      //Setup Client Window                 v5
  58.     virtual Boolean setupHelp();        //Setup Help                           .
  59.     virtual Boolean setupInfoArea() ;   //Setup Information Area               .
  60.     virtual Boolean setupMenuBar();     //Setup Menu Bar                       .
  61.     virtual Boolean setupStatusArea();  //Setup Status Area                   v5
  62.  
  63.     virtual Boolean selected(IControlEvent& evt);                           //v5
  64.     Boolean command(ICommandEvent& cmdEvent);                               //v3
  65.     virtual Boolean setLeftAlignment(); //Process Left Alignment              v6
  66.     virtual Boolean setCenterAlignment();//Process Center Alignment            .
  67.     virtual Boolean setRightAlignment();//Process Right Alignment             v6
  68.     virtual Boolean setText(const char* text);//Set Text using String         v5
  69.     virtual Boolean setText(const IResourceId& text);//Set Text via Resource  v6
  70.     virtual Boolean openFile();         //Process OpenFile                     .
  71.     virtual Boolean openFont();         //Process OpenFont                     .
  72.     virtual Boolean openText();         //Process OpenText                    v6
  73.  
  74.     virtual Boolean tick(IEvent& evt);  //Send Tick for every WM_TIMER        v6
  75.  
  76.     virtual Boolean startDemo();        //Start Demo                          v6
  77.     virtual Boolean stopDemo();         //Stop Demo                            .
  78.     virtual Boolean nextDemoCode();     //Execute the next Demo Code          v6
  79.  
  80.     virtual Boolean openColor();        //Open Color Window                   v6
  81.     virtual Boolean openSpeed();        //Open Demo Speed Window              v6
  82.  
  83.     virtual Boolean readProfile();      //Read Profile                        v6
  84.     virtual Boolean updateProfile();    //Update Profile                      v6
  85.  
  86.   private:                              //Define Private Information
  87.     IStaticText   * hello;              //Hello contains "Hello, World" text
  88.     IInfoArea     * infoArea;           //Define an Information Area          v2
  89.                                         //  Control to create an information   .
  90.                                         //  area beneath the client area      v2
  91.     IStaticText   * statusLine;         //Status Line at top of client window v3
  92.     IMenuBar      * menuBar;            //Define Menu Bar                     v3
  93.     ATextDialog   * textDialog;         //Define Text Dialog                  v4
  94.     IPushButton   * leftButton;           //Define Left Button                 .
  95.     IPushButton   * centerButton;         //Define Center Button               .
  96.     IPushButton   * rightButton;          //Define Right Button               v4
  97.     IHelpWindow   * help;               //Define Help Window                  v5
  98.     AEarthWindow  * earthWindow;        //Define earthWindow                  v5
  99.     ISplitCanvas  * clientWindow;       //Define canvas as a Split Canvas     v5
  100.     ISplitCanvas  * helloCanvas;        //Define hello canvas                 v5
  101.     IListBox      * listBox;            //Define ListBox                      v5
  102.     ISplitCanvas  * statusCanvas;       //Define status canvas                v6
  103.     IStaticText   * time;               //Current Time                        v6
  104.     IStaticText   * date;               //Current Date                        v6
  105.     IString         filename;           //Name of File for Input/Output        .
  106.     int             demoIndex;          //Demo Index                           .
  107.     Boolean         demo;               //Demo Flag                            .
  108.     int             demoTicks;          //Number of Ticks for each Demo        .
  109.     int             demoCount;          //Counter for Timer                   v6
  110. };
  111.  
  112. //**************************************************************************  v6
  113. // Class:   AMenuHandler                                                   *   .
  114. //                                                                         *   .
  115. // Purpose: Subclass of IMenuHandler so that the a PopUp Menu can be       *   .
  116. //          created.                                                       *   .
  117. //                                                                         *   .
  118. //**************************************************************************   .
  119. class AMenuHandler: public IMenuHandler//                                      .
  120. {                                       //                                     .
  121.   protected:                            //Define Protected Member              .
  122.     Boolean makePopUpMenu(IMenuEvent& menuEvent);                           //v6
  123. };                                                                          //v6
  124.  
  125. //**************************************************************************  v5
  126. // Class:   AHelpHandler                                                   *   .
  127. //                                                                         *   .
  128. // Purpose: Subclass of IHelpHandler so that the correct keys help         *   .
  129. //          panel can be displayed when keys help is requested.            *   .
  130. //                                                                         *   .
  131. //**************************************************************************   .
  132. class AHelpHandler: public IHelpHandler//                                      .
  133. {                                       //                                     .
  134.   protected:                            //Define Protected Member              .
  135.     virtual Boolean                     //                                     .
  136.       keysHelpId(IEvent& evt);          //Override this function               .
  137. };                                                                          //v5
  138. #endif
  139.