home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / ibmcli / idialog.hp_ / IDIALOG.HPP
Encoding:
C/C++ Source or Header  |  1992-10-26  |  6.2 KB  |  123 lines

  1. #ifndef _IDIALOG_
  2. #define _IDIALOG_
  3. /*******************************************************************************
  4. * FILE NAME: idialog.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     IDialog - This class create a dialog window using a resource definition  *
  9. *               dialog template file.                                          *
  10. *                                                                              *
  11. * COPYRIGHT:                                                                   *
  12. *   Licensed Materials - Property of IBM                                       *
  13. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  14. *   All Rights Reserved                                                        *
  15. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  16. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  17. *                                                                              *
  18. *$Log:   R:/IBMCLASS/IBASEAPP/VCS/IDIALOG.HPV  $
  19. // 
  20. //    Rev 1.8   26 Oct 1992 10:48:48   nunn
  21. // Kevin's changes for 10/26
  22.  
  23.       Rev 1.1   25 Oct 1992 00:00:01   kleong
  24.    Miscellaneous improvements.
  25. *******************************************************************************/
  26. #ifndef _IAPPWIN_
  27.    #include <iappwin.hpp>
  28. #endif
  29.  
  30. // Forward declarations for other classes:
  31. class  IDialogWindow;
  32. class  IResourceId;
  33.  
  34. class IDialogWindow : public IApplicationWindow {
  35. /*******************************************************************************
  36. * The IDialogWindow class is used to create a primary, secondary and child     *
  37. * application window with resource definition dialog template file.            *
  38. *                                                                              *
  39. * <2 to 3 paragraphs describing how objects of this class are used>            *
  40. *                                                                              *
  41. * EXAMPLE:                                                                     *
  42. *   <sample code>                                                              *
  43. *******************************************************************************/
  44. typedef IApplicationWindow Inherited;
  45. public:
  46. /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
  47. | There are six ways to construct instances of this class:                     |
  48. |   1. default                                                                 |
  49.       This default constructor is used to create an IDialogWindow object
  50.       without associating to it a dialog resource ID or dialog window
  51.       handle. *** Is this ctor really needed ***
  52. |   2. From unsigned long dialog resource id                                   |
  53. |     This constructor creates a primary window and it assumes that the        |
  54. |     application resource library object is defined in IApplication object    |
  55. |     (see IApplication::setResourceLib function).                             |
  56. |   3. From IResourceId                                                        |
  57. |     This constructor creates a primary window using the resource ID.         |
  58. |   4. From IResourceId and owner                                              |
  59. |     This constructor creates a secondary window using the resource ID.       |
  60. |   5. From IResourceId, parent and owner                                      |
  61. |     This constructor creates a child window using the resource ID.           |
  62. |     The parent and owner must be the same object.                            |
  63. |   6. From IWindowHandle                                                      |
  64. |     This constructor creates an IDialogWindow object from a valid window     |
  65. |     handle of an already created dialog window.                              |
  66. |                                                                              |
  67. ------------------------------------------------------------------------------*/
  68.   IDialogWindow();
  69.   IDialogWindow(unsigned long dialogResId);
  70.   IDialogWindow(const IResourceId& dialogResId);
  71.   IDialogWindow(const IResourceId& dialogResId, const IWindow* owner);
  72.   IDialogWindow(const IResourceId& dialogResId,
  73.                 const IWindow* parent, const IWindow* owner);
  74.   IDialogWindow(IWindowHandle windowHandle);
  75.  
  76. /*-------------------------------- ACCESSORS------------------------------------
  77. | These function provide means of getting and setting the accessible           |
  78. | attributes of instances of this class:                                       |
  79. |   showDialog    - Shows a modeless or modal dialog                           |
  80. |   hideDialog    - Hides a dialog window. Modal dialog is dismissed           |
  81. |                   when hidden.                                               |
  82. |   defaultButton - Returns the default push-button for the dialog window.     |
  83. |   isDimiss      - Queries if the dialog window is dismissed                  |
  84. ------------------------------------------------------------------------------*/
  85. enum State
  86.   {modal, modeless};
  87.  
  88. unsigned long 
  89.   showDialog(State state=modeless);
  90.  
  91. IDialogWindow
  92.   &hideDialog(unsigned long returnId = 0);
  93.  
  94. unsigned long 
  95.   defaultButton() const;
  96.  
  97. Boolean 
  98.   isDismiss() const;
  99.  
  100. /*----------------------------- IMPLEMENTATION ---------------------------------
  101. | There functions provide means to handle events of instances of this class:   |
  102. |   handleEvent        - Overrides to perform dialog window closing operations.|
  103. ------------------------------------------------------------------------------*/
  104. protected:
  105. virtual Boolean 
  106.   handleWindowEvent(IEvent& event);
  107.  
  108. private:
  109. /*--------------------------------- PRIVATE ----------------------------------*/
  110. IDialogWindow(const IDialogWindow&);
  111.  
  112. IDialogWindow
  113.   &operator=(const IDialogWindow&);
  114.  
  115. void 
  116.   createDialog(const IResourceId& resid, const IWindow* pwndParent,
  117.               const IWindow* pwndOwner);
  118.  
  119. State 
  120.   stateCl;
  121. };
  122. #endif /* _IDIALOG_ */
  123.