ilayout.h
上传用户:hzhsqp
上传日期:2007-01-06
资源大小:1600k
文件大小:7k
- /*
- * ilayout.h
- *
- * Interactor layout ancestor 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: ilayout.h,v $
- * Revision 1.17 1999/03/10 03:49:51 robertj
- * More documentation adjustments.
- *
- * Revision 1.16 1999/03/09 08:01:48 robertj
- * Changed comments for doc++ support (more to come).
- *
- * Revision 1.15 1999/02/16 08:08:45 robertj
- * MSVC 6.0 compatibility changes.
- *
- * Revision 1.14 1998/09/23 06:23:50 robertj
- * Added open source copyright license.
- *
- * Revision 1.13 1995/10/14 14:56:20 robertj
- * Added function to update all control values from data pointers.
- *
- * Revision 1.12 1995/08/24 12:34:43 robertj
- * Removed redundant parent parameter for ConstructEnd().
- *
- * Revision 1.11 1995/06/17 11:12:39 robertj
- * Documentation update.
- *
- * Revision 1.10 1995/03/14 12:41:32 robertj
- * Updated documentation to use HTML codes.
- *
- * Revision 1.9 1994/12/21 11:53:05 robertj
- * Documentation and variable normalisation.
- *
- * Revision 1.8 1994/11/19 00:06:02 robertj
- * Removed variable argument list binding for menus and controls.
- *
- * Revision 1.7 1994/10/30 11:46:40 robertj
- * Changed mechanism for doing notification callback functions.
- *
- * Revision 1.6 1994/08/23 11:32:52 robertj
- * Oops
- *
- * Revision 1.5 1994/08/22 00:46:48 robertj
- * Added pragma fro GNU C++ compiler.
- *
- * Revision 1.4 1994/04/03 08:34:18 robertj
- * Added help and focus functionality.
- *
- * Revision 1.3 1994/04/01 14:11:48 robertj
- * Added ConstructEnd for use by PWRC generated code.
- *
- * Revision 1.2 1994/03/07 07:38:19 robertj
- * Major enhancementsacross the board.
- *
- * Revision 1.1 1994/01/13 02:40:30 robertj
- * Initial revision
- *
- */
- #define _PINTERACTORLAYOUT
- #ifdef __GNUC__
- #pragma interface
- #endif
- /**This class defines a user inteface entity that consists of a collection of
- zero or more other interactors. These interactors are expected to be
- descendents of the PControl class. Controls allow information to be
- transferred between the user and the application.
-
- The external and internal layout of an instance of this class is usually
- described using application resources.
-
- This class, while not actually abstract, is usually descended from before
- use. The descendents such as Ref{PDialog} will add more functionality and
- may visually appear different. An interactor layout has no title or border
- as these are usually added by the descendent.
- */
- class PInteractorLayout : public PInteractor
- {
- PCLASSINFO(PInteractorLayout, PInteractor);
- public:
- /**Create a new empty layout. There are no controls contained within the
- layout and it is expected that these are to added manually by the
- application.
- */
- PInteractorLayout(
- PInteractor * parent /// Interactor that owns the layout.
- );
- /**Create a new layout by loading it from a resource. The resource
- description determines the position, dimensions of the layout as well
- as the position, dimensions, title and other options for all of the
- controls in the layout.
- */
- PInteractorLayout(
- PInteractor * parent, /// Interactor that owns the layout.
- PRESOURCE_ID resID /// Resource identifier for loading controls.
- );
- /**Destroy the interactor layout, releasing its data and all of its
- associated controls.
- */
- virtual ~PInteractorLayout();
- /**@name Overrides from class PInteractor */
- /**Set the child interactor that has the focus in the interactor layout.
-
- This interactor is the one that will receive the focus whenever the
- layout itself receives the focus. As a layout does not handle keyboard
- input directly it passes the focus on to a child control within itself.
- */
- virtual void SetFocusInteractor(
- PInteractor * interactor /// Interactor that hash received the focus.
- );
- /**Get the child interactor that has the focus in the interactor layout.
-
- @return
- last interactor in layout with focus.
- */
- virtual PInteractor * GetFocusInteractor() const;
- /**@name New functions for class */
- /**Get the child interactor control with the specifed ID.
- @return
- control with specified ID, or NULL if none present.
- */
- PControl * GetControl(
- PRESOURCE_ID id
- /**Identifier for the control. This was usually the arbitrary, and
- unique, number given to the control specification in the resource
- file.
- */
- );
- /**Update the value sof all controls from their attached value pointers
- using the notification function with the
- #PControl::NotifyUpdate# code. The default function for
- each control type transfers from its internal value pointer (if not
- NULL) to the controls representation.
- */
- void UpdateControls();
- protected:
- /**Complete construction of an interactor layout. This is primarily used
- by the PWRC resource compiler generated code.
-
- As the resource compiler generates the constructor for the layout or
- dialog, it is impossible for the user to add extra construction code
- there. To circumvent this problem, the last thing the generated code
- does is to call the ConstructEnd() function, which the user can
- override and add extra construction code.
-
- The default implementation of this function is platform dependent, for
- example in MS-Windows it initialises list boxes from a resource
- containing their string list values.
-
- Note that when overriding this function, the ancestor version
- {bf must} always be called.
- */
- virtual void ConstructEnd(
- PRESOURCE_ID resID /// Resource identifier for loading controls.
- );
- // Member variables
- /** The last interactor in layout with keyboard focus. */
- PInteractor * focusInteractor;
- #ifdef DOC_PLUS_PLUS
- };
- #endif
- // Class declaration continued in platform specific header file ///////////////