home *** CD-ROM | disk | FTP | other *** search
- #ifndef _IDIALOG_
- #define _IDIALOG_
- /*******************************************************************************
- * FILE NAME: idialog.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * IDialog - This class create a dialog window using a resource definition *
- * dialog template file. *
- * *
- * COPYRIGHT: *
- * Licensed Materials - Property of IBM *
- * (C) Copyright IBM Corporation 1992, 1993 *
- * All Rights Reserved *
- * US Government Users Restricted Rights - Use, duplication, or disclosure *
- * restricted by GSA ADP Schedule Contract with IBM Corp. *
- * *
- *$Log: R:/IBMCLASS/IBASEAPP/VCS/IDIALOG.HPV $
- //
- // Rev 1.8 26 Oct 1992 10:48:48 nunn
- // Kevin's changes for 10/26
-
- Rev 1.1 25 Oct 1992 00:00:01 kleong
- Miscellaneous improvements.
- *******************************************************************************/
- #ifndef _IAPPWIN_
- #include <iappwin.hpp>
- #endif
-
- // Forward declarations for other classes:
- class IDialogWindow;
- class IResourceId;
-
- class IDialogWindow : public IApplicationWindow {
- /*******************************************************************************
- * The IDialogWindow class is used to create a primary, secondary and child *
- * application window with resource definition dialog template file. *
- * *
- * <2 to 3 paragraphs describing how objects of this class are used> *
- * *
- * EXAMPLE: *
- * <sample code> *
- *******************************************************************************/
- typedef IApplicationWindow Inherited;
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There are six ways to construct instances of this class: |
- | 1. default |
- This default constructor is used to create an IDialogWindow object
- without associating to it a dialog resource ID or dialog window
- handle. *** Is this ctor really needed ***
- | 2. From unsigned long dialog resource id |
- | This constructor creates a primary window and it assumes that the |
- | application resource library object is defined in IApplication object |
- | (see IApplication::setResourceLib function). |
- | 3. From IResourceId |
- | This constructor creates a primary window using the resource ID. |
- | 4. From IResourceId and owner |
- | This constructor creates a secondary window using the resource ID. |
- | 5. From IResourceId, parent and owner |
- | This constructor creates a child window using the resource ID. |
- | The parent and owner must be the same object. |
- | 6. From IWindowHandle |
- | This constructor creates an IDialogWindow object from a valid window |
- | handle of an already created dialog window. |
- | |
- ------------------------------------------------------------------------------*/
- IDialogWindow();
- IDialogWindow(unsigned long dialogResId);
- IDialogWindow(const IResourceId& dialogResId);
- IDialogWindow(const IResourceId& dialogResId, const IWindow* owner);
- IDialogWindow(const IResourceId& dialogResId,
- const IWindow* parent, const IWindow* owner);
- IDialogWindow(IWindowHandle windowHandle);
-
- /*-------------------------------- ACCESSORS------------------------------------
- | These function provide means of getting and setting the accessible |
- | attributes of instances of this class: |
- | showDialog - Shows a modeless or modal dialog |
- | hideDialog - Hides a dialog window. Modal dialog is dismissed |
- | when hidden. |
- | defaultButton - Returns the default push-button for the dialog window. |
- | isDimiss - Queries if the dialog window is dismissed |
- ------------------------------------------------------------------------------*/
- enum State
- {modal, modeless};
-
- unsigned long
- showDialog(State state=modeless);
-
- IDialogWindow
- &hideDialog(unsigned long returnId = 0);
-
- unsigned long
- defaultButton() const;
-
- Boolean
- isDismiss() const;
-
- /*----------------------------- IMPLEMENTATION ---------------------------------
- | There functions provide means to handle events of instances of this class: |
- | handleEvent - Overrides to perform dialog window closing operations.|
- ------------------------------------------------------------------------------*/
- protected:
- virtual Boolean
- handleWindowEvent(IEvent& event);
-
- private:
- /*--------------------------------- PRIVATE ----------------------------------*/
- IDialogWindow(const IDialogWindow&);
-
- IDialogWindow
- &operator=(const IDialogWindow&);
-
- void
- createDialog(const IResourceId& resid, const IWindow* pwndParent,
- const IWindow* pwndOwner);
-
- State
- stateCl;
- };
- #endif /* _IDIALOG_ */