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

  1. /******************************************************************************
  2. * .FILE:         adialog4.hpp                                                 *
  3. *                                                                             *
  4. * .DESCRIPTION:  Hello World Sample Program Version 4: ATextDialog Class      *
  5. *                                                                             *
  6. * .CLASSES:      ADialogCommandHandler                                        *
  7. *                ATextDialog                                                  *
  8. *                AHellowWindow                                                *
  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 _ADIALOG4_
  27. #define _ADIALOG4_
  28.  
  29. #include <iframe.hpp>
  30. #include <icmdhdr.hpp>
  31. #include <istring.hpp>
  32. #include <imcelcv.hpp>
  33. #include <istattxt.hpp>
  34. #include <ientryfd.hpp>
  35. #include <isetcv.hpp>
  36. #include <ipushbut.hpp>
  37.  
  38. class AHelloWindow;
  39. class ATextDialog;
  40.  
  41. /**************************************************************************
  42. * Class ADialogCommandHandler - Command handler for ADialogWindow class   *
  43. **************************************************************************/
  44. class ADialogCommandHandler : public ICommandHandler
  45. {
  46.   public:
  47. /*---------------------------- Constructor -------------------------------|
  48. | Constructs an object with:                                              |
  49. | 1) A pointer to the TextDialog                                          |
  50. -------------------------------------------------------------------------*/
  51.     ADialogCommandHandler(ATextDialog *dialogFrame);
  52.  
  53. /*----------------------------- Destructor -------------------------------|
  54. | Destructs an object with:                                               |
  55. | 1) No parameters                                                        |
  56. -------------------------------------------------------------------------*/
  57.     virtual
  58.      ~ADialogCommandHandler() { }
  59.  
  60.  
  61.   protected:
  62. /*------------------------ Override Command Function ---------------------|
  63. | The command function is called to handle application command events.    |
  64. |------------------------------------------------------------------------*/
  65.   virtual Boolean
  66.     command(ICommandEvent& cmdEvent);
  67.  
  68.   private:
  69.     ATextDialog
  70.      *frame;
  71. };
  72.  
  73.  
  74. /**************************************************************************
  75. * Class ATextDialog - Dialog Window class that edits  text                *
  76. **************************************************************************/
  77. class ATextDialog : public IFrameWindow
  78. {
  79.   public:
  80. /*------------------------------ Constructor -----------------------------|
  81. | Constructs the object with                                              |
  82. | 1) with the editable string and parent window                           |
  83. -------------------------------------------------------------------------*/
  84.     ATextDialog(IString & textString,IWindow * ownerWnd);
  85. /*------------------------------ Destructor ------------------------------|
  86. | Destructs the object with                                               |
  87. | 1) no parameters                                                        |
  88. -------------------------------------------------------------------------*/
  89.     virtual
  90.      ~ATextDialog();
  91.  
  92. /*------------------------------------------------------------------------|
  93. | setTextFromEntryField retrieves the text in the entry field and stores  |
  94. |    it in saveText                                                       |
  95. --------------------------------------------------------------------------*/
  96.     virtual ATextDialog
  97.      &setTextFromEntryField();
  98.  
  99.   private:
  100.     IString
  101.      &saveText;
  102.     IMultiCellCanvas
  103.       clientCanvas;
  104.     IStaticText
  105.       statText;
  106.     IEntryField
  107.       textField;
  108.     ISetCanvas
  109.       buttons;
  110.     IPushButton
  111.       pushButton1,
  112.       pushButton2;
  113.     ADialogCommandHandler
  114.       dialogCommandHandler;
  115.  
  116. /*------------------------------ Operators -------------------------------|
  117. | Operators defined for this class:                                       |
  118. |  =  -- Assignment operator                                              |
  119. -------------------------------------------------------------------------*/
  120.     ATextDialog
  121.       &operator=(const ATextDialog&);
  122. };
  123.  
  124. #endif
  125.