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