home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
ISUBMENU.INL
< prev
next >
Wrap
Text File
|
1993-10-22
|
5KB
|
127 lines
#ifndef _ISUBMENU_INL_
#define _ISUBMENU_INL_ 0
/*******************************************************************************
* FILE NAME: isubmenu.inl *
* *
* DESCRIPTION: *
* This file contains the definition of the inline functions for the *
* class(es) declared in isubmenu.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 _ISUBMENU_
#undef _ISUBMENU_INL_
#define _ISUBMENU_INL_ 1
#include <isubmenu.hpp>
#endif
#ifndef _IEXCEPT_
#include <iexcept.hpp>
#endif
#ifndef _IMNITEM_
#include <imnitem.hpp>
#endif
#ifndef _IRESLIB_
#include <ireslib.hpp>
#endif
#if _ISUBMENU_INL_
#define inline
#endif
/*------------------------------------------------------------------------------
Constructor.
------------------------------------------------------------------------------*/
inline ISubmenu :: ISubmenu(const IWindowHandle& submenuHandle)
: hwndHandle(submenuHandle), pItemList(0)
{}
/*------------------------------------------------------------------------------
Add bitmap menu-item from .rc
------------------------------------------------------------------------------*/
inline ISubmenu& ISubmenu :: addBitmap ( unsigned long itemId,
unsigned long newItemBitmapResId )
{
return addBitmap(itemId, IResourceId(newItemBitmapResId));
}
/*------------------------------------------------------------------------------
Have the cursor point to the first element
------------------------------------------------------------------------------*/
inline IBase::Boolean ISubmenu::Cursor :: setToFirst ()
{
lCurrent = 0;
return true;
}
/*------------------------------------------------------------------------------
Have the cursor point to the previous element
------------------------------------------------------------------------------*/
inline IBase::Boolean ISubmenu::Cursor :: setToPrevious ()
{
--lCurrent;
return (lCurrent < 0) ? false : true;
}
/*------------------------------------------------------------------------------
Have the cursor point to the last element
------------------------------------------------------------------------------*/
inline IBase::Boolean ISubmenu::Cursor :: setToLast ()
{
lCurrent = pSubmenu->numberOfItems() - 1;
return (lCurrent < 0) ? false : true;
}
/*------------------------------------------------------------------------------
Invalidate the cursor
------------------------------------------------------------------------------*/
inline IBase::Boolean ISubmenu::Cursor :: isValid () const
{
return (lCurrent < 0) ? false : true;
}
/*------------------------------------------------------------------------------
Invalidate the cursor
------------------------------------------------------------------------------*/
inline void ISubmenu::Cursor :: invalidate ()
{
lCurrent = -1L;
}
/*------------------------------------------------------------------------------
Get menu item at cursor position.
------------------------------------------------------------------------------*/
inline IMenuItem ISubmenu::elementAt ( const Cursor& cursor ) const
{
return cursor.pSubmenu->menuItem(cursor.pSubmenu->menuItemId(cursor));
}
/*------------------------------------------------------------------------------
Delete menu item at cursor position.
------------------------------------------------------------------------------*/
inline ISubmenu& ISubmenu::deleteAt ( Cursor& cursor )
{
return cursor.pSubmenu->deleteItem(cursor.pSubmenu->menuItemId(cursor));
}
/*------------------------------------------------------------------------------
Remove submenu at cursor position.
------------------------------------------------------------------------------*/
inline ISubmenu& ISubmenu::removeSubmenuAt ( Cursor& cursor )
{
return cursor.pSubmenu->removeSubmenu(menuItemId(cursor));
}
#endif // _ISUBMENU_INL_