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

  1. /******************************************************************************
  2. * .FILE:         adialog6.cpp                                                 *
  3. *                                                                             *
  4. * .DESCRIPTION:  Hello World Sample Program Version 6: Dialog Implementation  *
  5. *                                                                             *
  6. * .CLASSES:      ATextDialog                                                  *
  7. *                ADialogCommandHandler                                        *
  8. *                AHelloWorld                                                  *
  9. *                                                                             *
  10. * .COPYRIGHT:                                                                 *
  11. *    Licensed Material - Program-Property of IBM                              *
  12. *    (C) Copyright IBM Corp. 1992, 1996 - All Rights Reserved                 *
  13. *                                                                             *
  14. * .DISCLAIMER:                                                                *
  15. *   The following [enclosed] code is sample code created by IBM               *
  16. *   Corporation.  This sample code is not part of any standard IBM product    *
  17. *   and is provided to you solely for the purpose of assisting you in the     *
  18. *   development of your applications.  The code is provided 'AS IS',          *
  19. *   without warranty of any kind.  IBM shall not be liable for any damages    *
  20. *   arising out of your use of the sample code, even if they have been        *
  21. *   advised of the possibility of such damages.                               *
  22. *                                                                             *
  23. * .NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE          *
  24. *                                                                             *
  25. ******************************************************************************/
  26. #ifndef _ADIALOG6_
  27. #define _ADIALOG6_
  28.  
  29. #include <iframe.hpp>
  30. #include <icmdhdr.hpp>
  31. #include <istring.hpp>
  32. #include <imcelcv.hpp>
  33. #include <istattxt.hpp>
  34. #include <icombobx.hpp>
  35. #include <isetcv.hpp>
  36. #include <ipushbut.hpp>
  37.  
  38. //Forward declarations for other classes:
  39.  
  40. class ATextDialog;
  41.  
  42. /**************************************************************************
  43. * Class ADialogCommandHandler - Command handler for ADialogWindow class   *
  44. **************************************************************************/
  45. class ADialogCommandHandler : public ICommandHandler
  46. {
  47.   public:
  48. /*---------------------------- Constructor -------------------------------|
  49. | Constructs an object with:                                              |
  50. | 1) A pointer to the TextDialog                                          |
  51. -------------------------------------------------------------------------*/
  52.     ADialogCommandHandler(ATextDialog *dialogFrame);
  53.  
  54. /*----------------------------- Destructor -------------------------------|
  55. | Destructs an object with:                                               |
  56. | 1) No parameters                                                        |
  57. -------------------------------------------------------------------------*/
  58.     virtual
  59.      ~ADialogCommandHandler() { }
  60.  
  61.  
  62.   protected:
  63. /*------------------------ Override Command Function ---------------------|
  64. | The command function is called to handle application command events.    |
  65. |------------------------------------------------------------------------*/
  66.     virtual Boolean
  67.       command(ICommandEvent& cmdEvent);
  68.  
  69.   private:
  70.     ATextDialog
  71.      *frame;
  72. };
  73.  
  74. /**************************************************************************
  75. * Class  ATextDialog - Dialog Window class for changing "Hello World!!"   *
  76. *   string.                                                               *
  77. **************************************************************************/
  78. class ATextDialog : public IFrameWindow
  79. {
  80.   public:
  81. /*---------------------------- Constructor -------------------------------|
  82. | Constructs an object with:                                              |
  83. | 1) the string to be edited and the parent window                        |
  84. -------------------------------------------------------------------------*/
  85.     ATextDialog(IString & textString, IWindow * ownerWnd);
  86.  
  87. /*---------------------------- Destructor --------------------------------|
  88. | Destructs an object with:                                               |
  89. | 1) no parameters                                                        |
  90. -------------------------------------------------------------------------*/
  91.     virtual
  92.      ~ATextDialog();
  93.  
  94.     virtual ATextDialog
  95.      &setTextFromEntryField();
  96.  
  97.   private:
  98.     IString
  99.      &saveText;
  100.     IMultiCellCanvas
  101.       clientCanvas;
  102.     IStaticText
  103.       statText;
  104.     IComboBox
  105.       textField;
  106.     ISetCanvas
  107.       buttons;
  108.     IPushButton
  109.       pushButton1,
  110.       pushButton2;
  111.     ADialogCommandHandler
  112.       dialogCommandHandler;
  113. };
  114.  
  115. #endif
  116.  
  117.