home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IMENUBAR.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
6KB
|
119 lines
#ifndef _IMENUBAR_
#define _IMENUBAR_
/******************************************************************************
* FILE NAME: imenubar.hpp *
* *
* DESCRIPTION: *
* Declaration of the class: *
* IMenuBar - Create a menu-bar for a frame-window. *
* *
* COPYRIGHT: *
* Licensed Materials - Property of IBM *
* (c) Copyright IBM Corporation 1992, 1993 *
* US Government Users Restricted Rights - Use duplication *
* or disclosure restricted by GSA ADP Schedule Contract *
* with IBM Corp. *
* *
*******************************************************************************/
#ifndef _IMENU_
#include <imenu.hpp>
#endif
#ifndef _ICCONST_
#include <icconst.h>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
// Forward declarations for other classes
class IResourceId;
class IFrameWindow;
class IMenuBar : public IMenu {
typedef IMenu
Inherited;
/*******************************************************************************
* The IMenuBar class is used to create a menu bar for a frame window. *
*******************************************************************************/
public:
/*-------------------------------- Style ---------------------------------------
| The following are valid styles for this class: |
| classDefaultStyle - The original default style for this class, which is |
| IMenuBar::empty. |
| empty - The menu will be created with no items. It can be |
| dynamically populated using IMenu and ISubmenu |
| functions. |
| wrapper - The menu bar will be a wrapper for an IFrameWindow |
| menu bar that was previously created using the |
| IFrameWindow::menuBar style. |
| |
| The following functions provide a means of getting and setting the default |
| style for this class: |
| |
| defaultStyle - Returns the current default style. This is the same as |
| classDefaultStyle unless setDefaultStyle has been |
| called. |
| setDefaultStyle - Sets the default style for all subsequent menu items. |
------------------------------------------------------------------------------*/
INESTEDBITFLAGCLASSDEF2(Style, IMenuBar, IWindow, IMenu);
static const Style
classDefaultStyle,
empty,
wrapper;
static Style
defaultStyle ( );
static void
setDefaultStyle ( const Style &aStyle );
/*------------------ Constructor/Destructor ------------------------------------
| Instances of this class can be constructed in the following ways: |
| - By creating a menu bar with a menu resource ID and frame window owner. |
| - By creating an empty menu bar or a wrapper for an IFrameWindow menu |
| bar. The empty and wrapper style flags determine which type of menu is |
| created. |
------------------------------------------------------------------------------*/
IMenuBar ( const IResourceId& menuResId,
IFrameWindow* owner);
IMenuBar ( IFrameWindow* owner,
const Style& style = defaultStyle() );
virtual
~IMenuBar();
/*---------------------- Accessors --------------------------------------------
| The following function switches the menu bar to another menu resource. |
| setMenu - Sets or changes the menu bar to the menu resource ID. |
------------------------------------------------------------------------------*/
IMenuBar
&setMenu ( const IResourceId& menuResId );
private: /*---------------------- Private --------------------------*/
static Style
currentDefaultStyle;
/*------------------- Hidden Functions. -----------------------------------
| The following inherited functions are hidden in this class. |
|-------------------------------------------------------------------------*/
IMenuBar(const IMenuBar&);
IMenuBar &operator=(const IMenuBar&);
};
INESTEDBITFLAGCLASSFUNCS(Style, IMenuBar);
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
/*--------------------------------- Inlines ----------------------------------*/
#ifndef I_NO_INLINES
#include <imenubar.inl>
#endif
#endif /* _IMENUBAR_ */