home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / oclsrc15.zip / OCL / Include / OContainer.hpp < prev    next >
C/C++ Source or Header  |  1996-02-06  |  5KB  |  139 lines

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1995
  3. // All Rights Reserved
  4. // OContainer.hpp
  5.  
  6. /*
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  * 1. Redistributions of source code must retain the above copyright
  11.  *    notice, this list of conditions and the following disclaimer.
  12.  * 2. Neither the name Cubus nor the name Team OCL may be used to
  13.  *    endorse or promote products derived from this software
  14.  *    without specific prior written permission.
  15.  * 3. See OCL.INF for a detailed copyright notice.
  16.  *
  17.  *              THIS SOFTWARE IS PROVIDED ``AS IS'' AND
  18.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  21.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27.  * SUCH DAMAGE.
  28.  */
  29.  
  30. // $Header: E:/Projects/OCL/Include/rcs/OContainer.hpp 1.14 1996/01/16 10:12:17 B.STEIN Release B.STEIN $
  31.  
  32. #ifndef OCONTAINER_INCLUDED
  33.   #define OCONTAINER_INCLUDED
  34.  
  35.  
  36. #ifndef OCONTAINERBASE_INCLUDED
  37.   #include <OContainerBase.hpp>
  38. #endif
  39.  
  40.  
  41. // CID_LEFTCOLTITLEWND     column title (left)
  42. // CID_RIGHTCOLTITLEWND    right column title
  43. // CID_BLANKBOX            blank box at bottom right
  44. // CID_HSCROLL             horizontal scroll bar
  45. // CID_RIGHTHSCROLL        right horz scroll bar
  46. // CID_CNRTITLEWND         Container title window
  47. // CID_LEFTDVWND           Left Details View window
  48. // CID_RIGHTDVWND          Right Details View window
  49. // CID_VSCROLL             vertical scroll bar
  50. // CID_MLE                 MLE window for direct edit
  51. // CA_CONTAINERTITLE 
  52. // CA_TITLESEPARATOR 
  53. // CA_TITLELEFT 
  54. // CA_TITLERIGHT 
  55. // CA_TITLECENTER 
  56. // CA_OWNERDRAW 
  57. // CA_DETAILSVIEWTITLES 
  58. // CA_ORDEREDTARGETEMPH 
  59. // CA_MIXEDTARGETEMPH 
  60. // CA_DRAWBITMAP 
  61. // CA_DRAWICON 
  62. // CA_TITLEREADONLY 
  63. // CA_OWNERPAINTBACKGROUND 
  64. // CA_TREELINE 
  65. // CCS_EXTENDSEL 
  66. // CCS_MULTIPLESEL 
  67. // CCS_SINGLESEL 
  68. // CCS_AUTOPOSITION 
  69. // CCS_VERIFYPOINTERS 
  70. // CCS_READONLY 
  71. // CCS_MINIRECORDCORE 
  72. // CV_TREE 
  73. // CV_TEXT 
  74. // CV_NAME 
  75. // CV_ICON 
  76. // CV_DETAIL 
  77. // CV_FLOW 
  78. // CV_MINI
  79.  
  80.  
  81.  
  82. // Template class T is your container record class
  83. // OContainer<MyRecord> means that your container holds
  84. // MyRecord objects instead of RECORDCORE structs
  85.  
  86. // Template class R is either RECORDCORE or MINIRECORDCORE
  87. // depending on your cnrStyle
  88.  
  89. template <class T, class R>
  90. class OContainer
  91.   : public OContainerBase
  92. {
  93.  public:
  94.  
  95.    OContainer        (const ULONG id,             // id of the container (must be unique!)
  96.                       const HWND Parent,          // becomes parent AND owner of the container
  97.                       const ULONG cnrStyle,       // container style
  98.                       const ULONG initViewStyle); // default view style
  99.  
  100.    OContainer        (const ULONG id,             // id of the container (must be unique!)
  101.                       const OFrame& Parent,       // becomes parent AND owner of the container
  102.                       const ULONG cnrStyle,       // container style
  103.                       const ULONG initViewStyle); // default view style
  104.  
  105.    OContainer        (const ULONG id,             // id of the container (must be unique!)
  106.                       const pOFrame Parent,       // becomes parent AND owner of the container
  107.                       const ULONG cnrStyle,       // container style
  108.                       const ULONG initViewStyle); // default view style
  109.  
  110.    virtual
  111.       ~OContainer    ();
  112.  
  113.    virtual
  114.       PSZ isOfType   () const;
  115.  
  116.    virtual BOOL
  117.       setupDetails   () = 0,         // sets up details view colums
  118.       setupItems     () = 0;         // inserts all records
  119.  
  120.    T
  121.       *allocRecords  (ULONG records) const,
  122.       *queryRecord   (T* root,
  123.                       ULONG flag  = CMA_FIRST,
  124.                       ULONG order = CMA_ITEMORDER) const,
  125.       *queryEmphasis (T* record   = (T*)CMA_FIRST,
  126.                       ULONG flag  = CRA_SELECTED) const,
  127.       *querySelected (T* record   = (T*)CMA_FIRST) const;
  128. };
  129.  
  130.  
  131. #ifdef __OCL_RESOLVE_TEMPLATES__
  132.   #include <OContainer.inl>
  133. #endif
  134.  
  135.  
  136. #endif // OCONTAINER_INCLUDED
  137.  
  138. // end of source
  139.