home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / imnitem.inl < prev    next >
Encoding:
Text File  |  1996-02-22  |  5.3 KB  |  216 lines

  1. #ifndef _IMNITEM_INL_
  2. #define _IMNITEM_INL_ 0
  3. /*******************************************************************************
  4. * FILE NAME: imnitem.inl                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the definition of the inline functions for the          *
  8. *   classes declared in imnitem.hpp.                                           *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *******************************************************************************/
  18. #ifndef _IMNITEM_
  19.   #undef  _IMNITEM_INL_
  20.   #define _IMNITEM_INL_ 1
  21.   #include <imnitem.hpp>
  22. #endif
  23.  
  24. #include <ireslib.hpp>
  25. #include <istring.hpp>
  26. #if _IMNITEM_INL_
  27.   #define inline
  28. #endif
  29.  
  30.  
  31. inline IMenuItem& IMenuItem :: setSelectable(Boolean state)
  32. {
  33.    if (!state)
  34.      afStyle |= unavailable.asUnsignedLong();
  35.    else
  36.      afStyle &= ~unavailable.asUnsignedLong();
  37.    return *this;
  38. }
  39.  
  40.  
  41. #ifndef IC_MOTIFWIN_FLAGNOP
  42. inline IMenuItem& IMenuItem :: setNoDismiss(Boolean)
  43. {
  44.    return *this;
  45. }
  46.  
  47. inline IMenuItem& IMenuItem :: setFramed(Boolean)
  48. {
  49.    return *this;
  50. }
  51. #endif  // IC_MOTIFWIN_FLAGNOP
  52.  
  53. inline IMenuItem& IMenuItem :: setChecked(Boolean state)
  54. {
  55.    if (state)
  56.      afAttribute |= checked.asUnsignedLong();
  57.    else
  58.      afAttribute &= ~checked.asUnsignedLong();
  59.    return *this;
  60. }
  61.  
  62. inline IMenuItem& IMenuItem :: setDisabled(Boolean state)
  63. {
  64.    if (state)
  65.      afAttribute |= disabled.asUnsignedLong();
  66.    else
  67.      afAttribute &= ~disabled.asUnsignedLong();
  68.    return *this;
  69. }
  70.  
  71. inline IMenuItem& IMenuItem :: setHighlighted(Boolean state)
  72. {
  73.    if (state)
  74.      afAttribute |= highlighted.asUnsignedLong();
  75.    else
  76.      afAttribute &= ~highlighted.asUnsignedLong();
  77.    return *this;
  78. }
  79.  
  80. inline IBase::Boolean IMenuItem :: isSelectable() const
  81. {
  82.    return !(afStyle & unavailable.asUnsignedLong());
  83. }
  84.  
  85. inline IBase::Boolean IMenuItem :: isDrawItem() const
  86. {
  87.    return ((IBase::Boolean)(afStyle & drawItem.asUnsignedLong()));
  88. }
  89.  
  90. inline IBase::Boolean IMenuItem :: isSeparator() const
  91. {
  92.    return ((IBase::Boolean)(afStyle & separator.asUnsignedLong()));
  93. }
  94.  
  95. inline IBase::Boolean IMenuItem :: isText() const
  96. {
  97.    return ((IBase::Boolean)(afExtendedStyle & textItem.asExtendedUnsignedLong()));
  98. }
  99.  
  100. inline IBase::Boolean IMenuItem :: isBitmap() const
  101. {
  102.    return ((IBase::Boolean)(afStyle & bitmapItem.asUnsignedLong()));
  103. }
  104.  
  105. inline IBase::Boolean IMenuItem :: isSubmenu() const
  106. {
  107.    return ((IBase::Boolean)(afStyle & submenu.asUnsignedLong()));
  108. }
  109.  
  110. inline IBase::Boolean IMenuItem :: isNoDismiss() const
  111. {
  112.    return false;
  113. }
  114.  
  115. inline IBase::Boolean IMenuItem :: isFramed() const
  116. {
  117.    return false;
  118. }
  119.  
  120. inline IBase::Boolean IMenuItem :: isChecked() const
  121. {
  122.    return ((IBase::Boolean)(afAttribute & checked.asUnsignedLong()));
  123. }
  124.  
  125. inline IBase::Boolean IMenuItem :: isDisabled() const
  126. {
  127.    return ((IBase::Boolean)(afAttribute & disabled.asUnsignedLong()));
  128. }
  129.  
  130. inline IBase::Boolean IMenuItem :: isHighlighted() const
  131. {
  132.    return ((IBase::Boolean)(afAttribute & highlighted.asUnsignedLong()));
  133. }
  134.  
  135. inline IMenuItem&  IMenuItem :: setBitmap(unsigned long bitmapResId)
  136. {
  137.   return(setBitmap(IResourceId(bitmapResId)));
  138. }
  139.  
  140. inline IMenuItem& IMenuItem::setIndex ( unsigned long index)
  141. {
  142.   iPosition = index;
  143.   return *this;
  144. }
  145.  
  146. inline unsigned long  IMenuItem::id() const
  147. {
  148.     return itemId;
  149. }
  150.  
  151. inline unsigned long IMenuItem::index  ( ) const
  152. {
  153.     return iPosition;
  154. }
  155.  
  156. inline IMenuHandle IMenuItem::submenuHandle( ) const
  157. {
  158.     return hwndSubmenu;
  159. }
  160.  
  161. inline unsigned long IMenuItem:: style( ) const
  162. {
  163.   return afStyle;
  164. }
  165.  
  166. inline unsigned long IMenuItem:: extendedStyle( ) const
  167. {
  168.   return afExtendedStyle;
  169. }
  170.  
  171. inline unsigned long IMenuItem::attribute ( ) const
  172. {
  173.   return afAttribute;
  174. }
  175.  
  176. inline unsigned long IMenuItem::helpId ( ) const
  177. {
  178.   return afHelpId;
  179. }
  180.  
  181. inline IString IMenuItem::text( ) const
  182. {
  183.   return strClItemText;
  184. }
  185.  
  186. inline IBitmapHandle IMenuItem::bitmap ( ) const
  187. {
  188.   return hBitmapHandle;
  189. }
  190.  
  191. inline IMenuItem& IMenuItem::setStyle( unsigned long newStyle )
  192. {
  193.   afStyle = newStyle;
  194.   return *this;
  195. }
  196.  
  197. inline IMenuItem& IMenuItem::setExtendedStyle( unsigned long newExtStyle )
  198. {
  199.   afExtendedStyle = newExtStyle;
  200.   return *this;
  201. }
  202.  
  203. inline IMenuItem& IMenuItem::setAttribute( unsigned long newAttribute )
  204. {
  205.   afAttribute = newAttribute;
  206.   return *this;
  207. }
  208.  
  209. inline IMenuItem& IMenuItem::setHelpId( unsigned long newHelpTopicId )
  210. {
  211.   afHelpId = newHelpTopicId;
  212.   return *this;
  213. }
  214.  
  215. #endif // _IMNITEM_INL_
  216.