modaldlg.h
上传用户:hzhsqp
上传日期:2007-01-06
资源大小:1600k
文件大小:6k
- /*
- * modaldlg.h
- *
- * Modal Dialog class
- *
- * Portable Windows Library
- *
- * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * The Original Code is Portable Windows Library.
- *
- * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
- *
- * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
- * All Rights Reserved.
- *
- * Contributor(s): ______________________________________.
- *
- * $Log: modaldlg.h,v $
- * Revision 1.21 1999/03/10 03:49:52 robertj
- * More documentation adjustments.
- *
- * Revision 1.20 1999/03/09 08:01:49 robertj
- * Changed comments for doc++ support (more to come).
- *
- * Revision 1.19 1999/02/16 08:08:46 robertj
- * MSVC 6.0 compatibility changes.
- *
- * Revision 1.18 1998/09/23 06:24:25 robertj
- * Added open source copyright license.
- *
- * Revision 1.17 1995/10/14 15:00:03 robertj
- * Moved standard button code from modal to non-modal dialogs.
- *
- * Revision 1.16 1995/06/17 11:12:45 robertj
- * Documentation update.
- *
- * Revision 1.15 1995/03/14 12:41:50 robertj
- * Updated documentation to use HTML codes.
- *
- * Revision 1.14 1995/01/03 11:39:26 robertj
- * Documentation.
- *
- * Revision 1.13 1994/10/30 11:46:52 robertj
- * Changed mechanism for doing notification callback functions.
- *
- * Revision 1.12 1994/08/23 11:32:52 robertj
- * Oops
- *
- * Revision 1.11 1994/08/22 00:46:48 robertj
- * Added pragma fro GNU C++ compiler.
- *
- * Revision 1.10 1994/06/25 11:55:15 robertj
- * Unix version synchronisation.
- *
- * Revision 1.9 1994/04/03 08:34:18 robertj
- * Added help and focus functionality.
- *
- * Revision 1.8 1994/04/01 14:13:06 robertj
- * Added OnInit function to all modal dialogs.
- *
- * Revision 1.7 1994/03/07 07:38:19 robertj
- * Major enhancementsacross the board.
- *
- * Revision 1.6 1994/01/13 03:36:48 robertj
- * Created intermediate class PInteractorLayout for dialog-ish windows.
- *
- * Revision 1.5 1994/01/03 04:42:23 robertj
- * Mass changes to common container classes and interactors etc etc etc.
- *
- * Revision 1.4 1993/12/01 16:09:05 robertj
- * Windows NT port.
- *
- * Revision 1.3 1993/07/14 12:49:16 robertj
- * Fixed RCS keywords.
- *
- */
- #define _PMODALDIALOG
- #ifdef __GNUC__
- #pragma interface
- #endif
- /**This class is as for PDialog but can be modal. A modal dialog is one that
- will not allow other interactors of the application to operate until it has
- been closed.
- */
- class PModalDialog : public PDialog
- {
- PCLASSINFO(PModalDialog, PDialog);
- public:
- /**Create a new empty dialog. There are no controls contained within the
- dialog and it is expected that these are to added manually by the
- application.
- */
- PModalDialog(
- PInteractor * parent /// Interactor that owns the dialog.
- );
- /**Create a new dialog by loading it from a resource. The resource
- description determines the position, dimensions and title of the dialog
- as well as the position, dimensions, title and other options for all of
- the controls in the dialog.
- */
- PModalDialog(
- PInteractor * parent, /// Interactor that owns the dialog.
- PRESOURCE_ID resID /// Resource identifier for loading controls.
- );
- /**Destroy the dialog, releasing its data and all of its associated
- controls.
- */
- virtual ~PModalDialog();
- /**@name New functions for class */
- /**Execute the dialog in a mode. The dialog has its Ref{OnInit()}
- function called, then the dialog is shown and an event loop is entered.
- All other interactors not owned by this interactor are disabled.
- Note that this function will not exit until the dialog is ended via the
- Ref{EndModal()} function. The value passed into the Ref{EndModal()}
- function as a parameter is the return value of this function.
- @return
- value passed to the Ref{EndModal()} function.
- */
- virtual int RunModal();
- /**End the modal dialog, and pass back the specified value as the return
- value in the Ref{RunModal()} call.
- */
- void EndModal(
- int retVal /// Value to return for the modal dialog.
- );
- protected:
- /**@name Overrides from class PDialog */
- /**Function called when the dialog OK button has been pressed. The default
- behaviour is to end the modal dialog returning TRUE.
- */
- virtual void OnOk();
- /**Function called when the dialog Cancel button has been pressed. The
- default behaviour is to end the modal dialog returning FALSE.
- */
- virtual void OnCancel();
- /**@name New functions for class */
- /**This function is called within the Ref{RunModal()} function before
- the dialog is made visible to allow any initialisation of user fields
- in the dialog.
- */
- virtual void OnInit();
- /**Save the values of controls. This function is generated by the PWRC
- compiler and is called by the default OnInit() function.
- */
- virtual void Save();
- /**Restore values saved with the Sve() function. This function is generated
- by the PWRC compiler and is called by the default OnCancel() function.
- */
- virtual void Restore();
- private:
- void Construct();
- // Common constructor code.
- #ifdef DOC_PLUS_PLUS
- };
- #endif
- // Class declaration continued in platform specific header file ///////////////