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

  1. #ifndef _IWINDOW_INL_
  2. #define _IWINDOW_INL_ 0
  3. /*******************************************************************************
  4. * FILE NAME: iwindow.inl                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the definition of the inline functions for the          *
  8. *   class(es) declared in iwindow.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 _IWINDOW_
  20.   #undef  _IWINDOW_INL_
  21.   #define _IWINDOW_INL_ 1
  22.   #include <iwindow.hpp>
  23. #endif
  24.  
  25.  
  26. #if _IWINDOW_INL_
  27.   #define inline
  28. #endif
  29.  
  30.  
  31. inline IBase::Boolean IWindow ::isAutoDeleteObject ( ) const
  32. {
  33.   return ((ulClState & IWindow::autoDeleteObject) ? true : false);
  34. }
  35.  
  36. inline IBase::Boolean IWindow::isAutoDestroyWindow ( ) const
  37. {
  38.   return ((ulClState & IWindow::autoDestroyWindow) ? true : false);
  39. }
  40.  
  41. inline IBase::Boolean IWindow::deleteIsInProcess ( ) const
  42. {
  43.   return ((ulClState & IWindow::deleteInProcess) ? true : false);
  44. }
  45.  
  46. inline IBase::Boolean IWindow::isPrimaryWindow ( ) const
  47. {
  48.   return ((ulClState & IWindow::primaryWindow) ? true : false);
  49. }
  50.  
  51. inline IWindow& IWindow::setDeleteInProcess ( )
  52. {
  53.   ulClState |= IWindow::deleteInProcess;
  54.   return *this;
  55. }
  56.  
  57. inline IWindow& IWindow::setMinimumSize(const ISize& sizMin)
  58. /**************************************************************/
  59. /* Set the minimum allowable size of the window. In the       */
  60. /* library this only apply to window on a canvas.             */
  61. /**************************************************************/
  62. {
  63.   sizClMin = sizMin;
  64.   setLayoutDistorted(IWindow::minimumSizeChanged, 0);
  65.   return *this;
  66. }
  67.  
  68. inline ISize IWindow::minimumSize() const
  69. /**************************************************************/
  70. /* Returns the minimum allowable size set by the user's class */
  71. /**************************************************************/
  72. {
  73.  if (sizClMin.width()==-1 && sizClMin.height()==-1)
  74.    return calcMinimumSize();
  75.  else
  76.    return ISize(sizClMin);
  77. }
  78.  
  79. inline IWindow& IWindow::defaultProcedure(IEvent& evt)
  80. /***************************************************************/
  81. /* Call the default window procedure.                          */
  82. /***************************************************************/
  83. {
  84.   IEventResult er ( pClDefWinProc(evt.handle(), evt.eventId(),
  85.                                  evt.parameter1(), evt.parameter2()) );
  86.   evt.setResult(er);
  87.   return *this;
  88. }
  89. inline IEventResult IWindow :: sendEvent ( unsigned long   eventId,
  90.                                     const IEventParameter1 &parm1,
  91.                                     const IEventParameter2 &parm2 ) const
  92. /*------------------------------------------------------------------------------
  93.   Construct an IEvent from the arguments and send it to this window.  Return
  94.   the event result.
  95. ------------------------------------------------------------------------------*/
  96. {
  97.    return handle().sendEvent(eventId, parm1, parm2);
  98. }
  99.  
  100.  
  101. /* WindowList key function */
  102. inline unsigned long const& key (IWindow* const& k)
  103. {
  104.   return k->wndhCl;
  105. }
  106.  
  107. #endif // _IWINDOW_INL_
  108.  
  109.