home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IMENU.INL
< prev
next >
Wrap
Text File
|
1993-10-22
|
4KB
|
104 lines
#ifndef _IMENU_INL_
#define _IMENU_INL_ 0
/*******************************************************************************
* FILE NAME: imenu.inl *
* *
* DESCRIPTION: *
* This file contains the definition of the inline functions for the *
* class(es) declared in imenu.hpp. *
* *
* 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. *
* *
*******************************************************************************/
#ifndef _IMENU_
#undef _IMENU_INL_
#define _IMENU_INL_ 1
#include <imenu.hpp>
#endif
#ifndef _IMNITEM_
#include <imnitem.hpp>
#endif
#ifndef _IRESLIB_
#include <ireslib.hpp>
#endif
#if _IMENU_INL_
#define inline
#endif
inline void IMenu :: setDefaultStyle( const IMenu::Style& newDefault)
/***************************************************************/
/* Replace the default style for new objects. */
/***************************************************************/
{
currentDefaultStyle = newDefault;
}
/*------------------------------------------------------------------------------
Test for style.
------------------------------------------------------------------------------*/
inline IBase::Boolean IMenu::isVerticalFlip ( ) const
{
return (style() & verticalFlip.asUnsignedLong()) ? true : false;
}
/*------------------------------------------------------------------------------
Have the cursor point to the first element
------------------------------------------------------------------------------*/
inline IBase::Boolean IMenu::Cursor :: setToFirst ()
{
lCurrent = 0;
return true;
}
/*------------------------------------------------------------------------------
Have the cursor point to the previous element
------------------------------------------------------------------------------*/
inline IBase::Boolean IMenu::Cursor :: setToPrevious ()
{
--lCurrent;
return (lCurrent < 0) ? false : true;
}
/*------------------------------------------------------------------------------
Invalidate the cursor
------------------------------------------------------------------------------*/
inline IBase::Boolean IMenu::Cursor :: isValid () const
{
return (lCurrent < 0) ? false : true;
}
/*------------------------------------------------------------------------------
Invalidate the cursor
------------------------------------------------------------------------------*/
inline void IMenu::Cursor :: invalidate ()
{
lCurrent = -1L;
}
/*------------------------------------------------------------------------------
Get menu item at cursor position.
------------------------------------------------------------------------------*/
inline IMenuItem IMenu::elementAt ( const Cursor& cursor ) const
{
return cursor.pMenu->menuItem(cursor.pMenu->menuItemId(cursor));
}
/*------------------------------------------------------------------------------
Remove submenu at cursor position.
------------------------------------------------------------------------------*/
inline IMenu& IMenu::removeSubmenuAt ( Cursor& cursor )
{
return cursor.pMenu->removeSubmenu(menuItemId(cursor));
}
#endif // _IMENU_INL_