home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / ibmcli / ipage.hp_ / IPAGE.HPP
Encoding:
C/C++ Source or Header  |  1992-10-26  |  7.8 KB  |  177 lines

  1. #ifndef _IPAGE_
  2.   #define _IPAGE_
  3. /*******************************************************************************
  4. * FILE NAME: i3statbx.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     Ipage  - This class creates and manages the pages of a notebook control. *
  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 disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. * $Log:   R:/IBMCLASS/IBASECTL/VCS/IPAGE.HPV  $
  18. //
  19. //   Rev 1.4   25 Oct 1992 17:05:48   nunn
  20. //changed library name to ICLUI
  21. //
  22. //   Rev 1.3   25 Oct 1992 10:56:00   boezeman
  23. //Add documentation and converted file to skeleton.hpp format.
  24.  
  25.       Rev 1.4   26 Feb 1992 21:17:36   Ken Fichthorn
  26.    Made iNoteBook a friend class.
  27.  
  28.       Rev 1.3   26 Feb 1992 21:17:36   Ken Fichthorn
  29.    Made setPageId method private.
  30.  
  31.       Rev 1.2   30 Oct 1991 20:55:52   Ken Fichthorn
  32.    Palo Alto design changes
  33.  
  34.       Rev 1.1   11 Jul 1991 19:02:08   Mike K. Chan
  35.    Original entry.
  36. *******************************************************************************/
  37. // Forward declarations for other classes:
  38. class   IPage;
  39. class   INoteBook;
  40. class   IResourceId;
  41. class   IWindow;
  42. class   IString;
  43. class   IBitmapHandle;
  44.  
  45.  
  46. #include "ibasetyp.hpp"
  47. #include "ibitflag.hpp"
  48.  
  49. //const unsigned long IC_DEFAULTPAGESTYLE = BKA_AUTOPAGESIZE | BKA_STATUSTEXTON;
  50.  
  51. class IPage {
  52. /*******************************************************************************
  53. * This class creates and manages the pages of a notebook control.              *
  54. *                                                                              *
  55. * EXAMPLE:                                                                     *
  56. * #include <inotebk.hpp>                                                       *
  57. * #include <ipage.hpp>                                                         *
  58. *                                                                              *
  59. * INoteBook *pnbkMyBook;                                                       *
  60. * pnbkMyBook = new INoteBook(ID_MYBOOK, this,                                  *
  61. *                            IRectangle(IPoint(50,15),                         *
  62. *                            ISize(425,225)));                                 *
  63. * pnbkMyBook->setMajorTabSize(ISize(50,23));                                   *
  64. * pnbkMyBook->setMinorTabSize(ISize(90,45));                                   *
  65. * ppageMyPage = new IPage(pnbkMyBook,                                          *
  66. *                         BKA_MAJOR | IC_DEFAULTPAGESTYLE);                    *
  67. * ppageMyPage->setTabText( (CHAR *)"My Tab Text" );                            *
  68. * sprintf(msgstr, (CHAR *)"Status text for page %d", lCount);                  *
  69. * ppageMyPage->setStatusText( msgstr );                                        *
  70. * ppageMyPage->setPageWindow( pviewwinMyWindow);                               *
  71. *******************************************************************************/
  72. friend class INoteBook;
  73.  
  74. public:
  75. INESTEDBITFLAGCLASSDEF0(Style, IPage);
  76. INESTEDBITFLAGCLASSDEF0(Position, IPage);
  77.                                     // style class definition
  78. static const Style
  79.   autoPageSize,
  80.   statusTextOn,
  81.   majorTab,
  82.   minorTab;
  83. static const Position
  84.   firstPage,
  85.   lastPage,
  86.   prevPage,
  87.   nextPage;
  88. static const Style&
  89.   defaultStyle;
  90.  
  91. /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
  92. | There is 1 way to construct instances of this class:                         |
  93. |   1. default                                                                 |
  94. ------------------------------------------------------------------------------*/
  95.   IPage( INoteBook* pnbkNoteBook,
  96.          Style pgs = defaultStyle,
  97.          Position pgpos = lastPage,
  98.          IPage* ppgLocatePage = 0);
  99.  
  100. /*-------------------------------- ASSOCIATION OPERATIONS ----------------------
  101. |   setPageWindow  -  Associates a standard view window with this page of the  |
  102. |                     notebook.  This must be used before this page of the     |
  103. |                     notebook is brought to the top of the notebook           |
  104. |   pageWindow     -  Returns the window associated with this page of the      |
  105. |                     notebook.                                                |
  106. ------------------------------------------------------------------------------*/
  107. void
  108.   setPageWindow ( IWindow* ppgwnd);
  109. IWindow*
  110.   pageWindow    ();
  111.  
  112. /*-------------------------------- STATUS TEXT OPERATIONS ----------------------
  113. |   setStatusText  -  Sets the status line text for this page.                 |
  114. |   statusText     -  Returns the current status text for this page.           |
  115. ------------------------------------------------------------------------------*/
  116. void
  117.   setStatusText( char* pszStatusText);
  118. IString
  119.   statusText();
  120.  
  121. /*-------------------------------- TAB TEXT OPERATIONS -------------------------
  122. |   setTabText  -  Sets the tab text for this page.                            |
  123. |   tabText     -  Returns the current tab text for this page.                 |
  124. ------------------------------------------------------------------------------*/
  125. void
  126.   setTabText( char* pszTabText);
  127. IString
  128.   tabText();
  129.  
  130. /*-------------------------------- TAB BITMAP OPERATIONS -----------------------
  131. |   setTabBitmap - Sets a bitmap on the tab for this page.                     |
  132. |   tabBitmap    - Returns the current tab bitmap for this page.               |
  133. ------------------------------------------------------------------------------*/
  134. void
  135.   setTabBitmap(IBitmapHandle hbm),
  136.   setTabBitmap( IResourceId& resid);
  137. IBitmapHandle
  138.   tabBitmap() const;
  139.  
  140. /*-------------------------------- PAGEID OPERATION ----------------------------
  141. |   pageId  -  Returns the identifier used by the notebook control to identify |
  142. |              each of its pages.                                              |
  143. ------------------------------------------------------------------------------*/
  144. unsigned long
  145.   pageId() const {return ulClPageId;};
  146.  
  147. protected:
  148. static Style
  149.   classDefaultStyle;
  150.  
  151. INoteBook*
  152.   pnbkClNoteBook;       // notebook this page belongs in
  153. unsigned long
  154.   ulClPageId;           // PageId (set by the notebook)
  155. IWindow*
  156.   pwndCl;
  157.  
  158. /*-------------------------------- PAGE OPERATIONS -----------------------------
  159. |   pageStyle     - Returns the style of the page.                             |
  160. |   setPageId     - Sets the identifier used by the notebook control to        |
  161. |                   identify each of its pages.                                |
  162. |   statusTextLen - Returns the length of the status text for this page.       |
  163. |   tabTextLen    - Returns the length of the tab text, if any, for this page. |
  164. ------------------------------------------------------------------------------*/
  165. unsigned long
  166.   ulClPageStyles;
  167. unsigned long
  168.   pageStyle () const { return ulClPageStyles;}
  169. void
  170.   setPageId( unsigned long ulPageIdIn) {ulClPageId = ulPageIdIn;};
  171. unsigned long
  172.   statusTextLen() const,
  173.   tabTextLen() const;
  174.  };
  175.  
  176. #endif  /* _IPAGE_ */
  177.