home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / oclsrc15.zip / OCL / Include / OBook.hpp < prev    next >
C/C++ Source or Header  |  1996-08-12  |  4KB  |  134 lines

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1995
  3. // All Rights Reserved
  4. // OBook.hpp  - Notebooks
  5.  
  6.  
  7. /*
  8.  * Redistribution and use in source and binary forms, with or without
  9.  * modification, are permitted provided that the following conditions
  10.  * are met:
  11.  * 1. Redistributions of source code must retain the above copyright
  12.  *    notice, this list of conditions and the following disclaimer.
  13.  * 2. Neither the name Cubus nor the name Team OCL may be used to
  14.  *    endorse or promote products derived from this software
  15.  *    without specific prior written permission.
  16.  * 3. See OCL.INF for a detailed copyright notice.
  17.  *
  18.  *              THIS SOFTWARE IS PROVIDED ``AS IS'' AND
  19.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  20.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  21.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  22.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  23.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  24.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  25.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  26.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  27.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28.  * SUCH DAMAGE.
  29.  */
  30.  
  31.  
  32. // $Header: W:/Projects/OCL/INCLUDE/rcs/OBook.hpp 1.1 1996/08/12 00:01:09 B.STEIN Release $
  33.  
  34. #ifndef OBOOK_INCLUDED
  35.   #define OBOOK_INCLUDED
  36.  
  37.  
  38. #ifndef OFRAME_INCLUDED
  39.   #include <OFrame.hpp>
  40. #endif
  41.  
  42. #ifndef LIST_INCLUDED
  43.   #include <OList.hpp>
  44. #endif
  45.  
  46.  
  47. #ifndef OBOOKPAGE_INCLUDED
  48.   #include <OBookPage.hpp>
  49. #endif
  50.  
  51. // definitions and macros
  52.  
  53. // this is a standard style configuration
  54. // use your own if you want
  55.  
  56. #define NB_STANDARD  (BKS_BACKPAGESBR | BKS_MAJORTABRIGHT | BKS_ROUNDEDTABS | BKS_STATUSTEXTLEFT | \
  57.                       BKS_SPIRALBIND | BKS_TABTEXTLEFT | WS_GROUP | WS_TABSTOP | WS_VISIBLE)
  58.  
  59. #define NB_STANDARD_FRAME (FCF_TASKLIST | FCF_TITLEBAR | FCF_SYSMENU | \
  60.                            FCF_MINBUTTON | FCF_SIZEBORDER | FCF_ICON)
  61.  
  62. typedef OList<OBookPage> pageList;
  63. typedef pageList *ppageList;
  64.  
  65. typedef class OBook *pOBook;
  66.  
  67. class __CPP_EXPORT__ OBook
  68.   : public OFrame
  69. {
  70.  private:  // these private members are strictly for internal use only !!!
  71.  
  72.    HWND     Assoc       (pOBookPage pnbp, PPAGESELECTNOTIFY ppsn);
  73.    ULONG    gSS         (PCSZ szString);
  74.  
  75.    OBook
  76.       &NBError     (PCH msg),
  77.       &sNBP        (PPAGESELECTNOTIFY ppsn),
  78.       &cNbk        (),
  79.       &sP          (pOBookPage pP);
  80.  
  81.  public:
  82.    HWND                 book;      // notebook window handle
  83.    pageList             Pages;     // the pages setups in a List of pages
  84.    ULONG                bStyle;    // Notebook Style
  85.    ULONG                dimCX;     // cx-dimension
  86.    ULONG                dimCY;     // cy-dimension
  87.  
  88. // ctors
  89.  
  90.    OBook                (const ULONG id, 
  91.                          const HWND  Parent = HWND_DESKTOP,
  92.                          const ULONG frameStyle = NB_STANDARD_FRAME);
  93.  
  94.    OBook                (const ULONG id,
  95.                          const OFrame& Parent, 
  96.                          const ULONG frameStyle = NB_STANDARD_FRAME);
  97.  
  98.    OBook                (const ULONG id,
  99.                          const pOFrame Parent, 
  100.                          const ULONG frameStyle = NB_STANDARD_FRAME);
  101.  
  102.    virtual
  103.       ~OBook();
  104.  
  105.    virtual
  106.       PSZ isOfType      () const; 
  107.  
  108.    OBook
  109.      &createBook        (PSZ Text,
  110.                          const ULONG cx, 
  111.                          const ULONG cy, 
  112.                          const ULONG bookStyle),
  113.  
  114.      &setFramePos       (),
  115.  
  116.      &setSizePosFrame   (const HWND behind, 
  117.                          SWP dimensions, 
  118.                          const ULONG flags),
  119.  
  120.      &addPages          (ppageList pagesList),
  121.  
  122.      &setTabDimensions  ();
  123.  
  124.  
  125. // command Handlers
  126.    virtual
  127.       BOOL OCommand     (ULONG msg, MPARAM mp1, MPARAM mp2);
  128. };
  129.  
  130.  
  131. #endif // OBOOK_INCLUDED
  132.  
  133. // end of source
  134.