home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / IMENU.INL < prev    next >
Text File  |  1993-10-22  |  4KB  |  104 lines

  1. #ifndef _IMENU_INL_
  2. #define _IMENU_INL_ 0
  3. /*******************************************************************************
  4. * FILE NAME: imenu.inl                                                         *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the definition of the inline functions for the          *
  8. *   class(es) declared in imenu.hpp.                                           *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   Licensed Materials - Property of IBM                                       *
  12. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  13. *   All Rights Reserved                                                        *
  14. *   US Government Users Restricted Rights - Use, duplication, or               *
  15. *   disclosure                                                                 *
  16. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  17. *                                                                              *
  18. *******************************************************************************/
  19. #ifndef _IMENU_
  20.   #undef  _IMENU_INL_
  21.   #define _IMENU_INL_ 1
  22.   #include <imenu.hpp>
  23. #endif
  24.  
  25. #ifndef _IMNITEM_
  26.  #include <imnitem.hpp>
  27. #endif
  28. #ifndef _IRESLIB_
  29.   #include <ireslib.hpp>
  30. #endif
  31. #if _IMENU_INL_
  32.   #define inline
  33. #endif
  34.  
  35. inline void  IMenu :: setDefaultStyle( const IMenu::Style& newDefault)
  36. /***************************************************************/
  37. /* Replace the default style for new  objects.                 */
  38. /***************************************************************/
  39. {
  40.   currentDefaultStyle = newDefault;
  41. }
  42.  
  43.  
  44. /*------------------------------------------------------------------------------
  45.    Test for style.
  46. ------------------------------------------------------------------------------*/
  47.  
  48. inline IBase::Boolean IMenu::isVerticalFlip ( ) const
  49. {
  50.    return (style() & verticalFlip.asUnsignedLong()) ? true : false;
  51. }
  52.  
  53. /*------------------------------------------------------------------------------
  54.   Have the cursor point to the first element
  55. ------------------------------------------------------------------------------*/
  56. inline IBase::Boolean IMenu::Cursor :: setToFirst ()
  57. {
  58.   lCurrent = 0;
  59.   return true;
  60. }
  61.  
  62. /*------------------------------------------------------------------------------
  63.   Have the cursor point to the previous element
  64. ------------------------------------------------------------------------------*/
  65. inline IBase::Boolean IMenu::Cursor :: setToPrevious ()
  66. {
  67.   --lCurrent;
  68.   return (lCurrent < 0) ? false : true;
  69. }
  70.  
  71. /*------------------------------------------------------------------------------
  72.   Invalidate the cursor
  73. ------------------------------------------------------------------------------*/
  74. inline IBase::Boolean IMenu::Cursor :: isValid () const
  75. {
  76.   return (lCurrent < 0) ? false : true;
  77. }
  78.  
  79. /*------------------------------------------------------------------------------
  80.   Invalidate the cursor
  81. ------------------------------------------------------------------------------*/
  82. inline void IMenu::Cursor :: invalidate ()
  83. {
  84.   lCurrent = -1L;
  85. }
  86.  
  87. /*------------------------------------------------------------------------------
  88.   Get menu item at cursor position.
  89. ------------------------------------------------------------------------------*/
  90. inline IMenuItem IMenu::elementAt ( const Cursor& cursor ) const
  91. {
  92.    return cursor.pMenu->menuItem(cursor.pMenu->menuItemId(cursor));
  93. }
  94.  
  95. /*------------------------------------------------------------------------------
  96.   Remove submenu at cursor position.
  97. ------------------------------------------------------------------------------*/
  98. inline IMenu& IMenu::removeSubmenuAt ( Cursor&           cursor   )
  99. {
  100.    return cursor.pMenu->removeSubmenu(menuItemId(cursor));
  101. }
  102.  
  103. #endif // _IMENU_INL_
  104.