rootmenu.h
上传用户:hzhsqp
上传日期:2007-01-06
资源大小:1600k
文件大小:4k
- /*
- * rootmenu.h
- *
- * Root menu of other menus.
- *
- * 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: rootmenu.h,v $
- * Revision 1.21 1999/03/10 03:49:53 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:28:53 robertj
- * Added open source copyright license.
- *
- * Revision 1.17 1995/03/14 12:42:28 robertj
- * Updated documentation to use HTML codes.
- *
- * Revision 1.16 1995/02/19 04:19:17 robertj
- * Added dynamically linked command processing.
- *
- * Revision 1.15 1995/01/03 09:36:18 robertj
- * Documentation.
- *
- * Revision 1.14 1994/12/12 10:16:23 robertj
- * Restructuring and documentation of container classes.
- * Renaming of some macros for declaring container classes.
- * Added some extra functionality to PString.
- * Added start to 2 byte characters in PString.
- * Fixed incorrect overrides in PCaselessString.
- *
- * Revision 1.13 1994/11/19 00:06:04 robertj
- * Removed variable argument list binding for menus and controls.
- *
- * Revision 1.12 1994/11/01 12:01:28 robertj
- * Changed to notifier.
- *
- * Revision 1.11 1994/08/23 11:32:52 robertj
- * Oops
- *
- * Revision 1.10 1994/08/22 00:46:48 robertj
- * Added pragma fro GNU C++ compiler.
- *
- * Revision 1.9 1994/06/25 11:55:15 robertj
- * Unix version synchronisation.
- *
- * Revision 1.8 1994/01/03 04:42:23 robertj
- * Mass changes to common container classes and interactors etc etc etc.
- *
- * Revision 1.7 1993/12/16 06:20:57 robertj
- * Changes to callback function definition due to GCC.
- *
- * Revision 1.6 1993/12/01 16:09:05 robertj
- * Windows NT port.
- *
- * Revision 1.5 1993/09/27 16:35:25 robertj
- * Capitalised macro.
- *
- * Revision 1.4 1993/08/21 01:50:33 robertj
- * Made Clone() function optional, default will assert if called.
- *
- * Revision 1.3 1993/07/14 12:49:16 robertj
- * Fixed RCS keywords.
- *
- */
- #define _PROOTMENU
- #ifdef __GNUC__
- #pragma interface
- #endif
- /**A class representing a list of sub-menus consistuting a menu bar. The exact
- appearance and location of the root menu is platform dependent.
-
- This is typically a bar of sub-menus. At this time only sub-menus can be
- added to a root menu.
- */
- class PRootMenu : public PSubMenu
- {
- PCLASSINFO(PRootMenu, PSubMenu);
- public:
- /** Create a new top level, and empty, menu bar. */
- PRootMenu();
- /** Load a menu resource and create all menu items and sub-menus. */
- PRootMenu(
- PRESOURCE_ID resID /// Unique identifier for the menu bar resource.
- );
- /** Destroy the menu and all its sub-menus. */
- virtual ~PRootMenu();
- /**@name New functions for class */
- /**Get a menu item given a unique ID. This is usually used when a menu is
- loaded from a resource and you wish to get the menu item from the key
- used in the resource template.
-
- @return
- pointer to menu item, or NULL if no menu item has the key.
- */
- PMenuItem * GetItemFromKey(
- PRESOURCE_ID key
- /**Unique identifier for the menu item within the menu bar and all its
- sub-menus.
- */
- );
- protected:
- // Member variables
- PDICTIONARY(ItemDict, POrdinalKey, PMenuItem);
- /** Hash table lookup for unique menu IDs */
- ItemDict keyedItems;
- friend class PTopLevelWindow;
- friend class PMenuItem;
- #ifdef DOC_PLUS_PLUS
- };
- #endif
- // Class declaration continued in platform specific header file ///////////////