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

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1995
  3. // All Rights Reserved
  4. // OWindow.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: W:/Projects/OCL/Include/rcs/OWindow.hpp 1.50 1996/08/11 23:47:35 B.STEIN Release $
  31.  
  32.  
  33. #ifndef OWINDOW_INCLUDED
  34.    #define OWINDOW_INCLUDED
  35.  
  36.  
  37. #ifndef OAPP_INCLUDED
  38.   #include <OApp.hpp>
  39. #endif
  40.  
  41.  
  42. #ifndef OPMEXCEPTION_INCLUDED
  43.   #include <OPMException.hpp>
  44. #endif
  45.  
  46.  
  47. // messages
  48.  
  49. #define WM_WINDOWENTER  1054
  50. #define WM_WINDOWLEAVE  1055
  51.  
  52. typedef struct _PresParms
  53. {
  54.  COLOR   Fore;
  55.  COLOR   Back;
  56.  CHAR    Font[80];
  57. } PresParms, *pPresParms;
  58.  
  59.  
  60. typedef class OWindow *pOWindow;
  61.  
  62. class __CPP_EXPORT__ OWindow
  63.   : public OCommandHandler
  64. {
  65.  public:
  66.    HWND                 parent;
  67.    HWND                 owner;
  68.    BOOL                 termFlag;
  69.    ULONG                res;
  70.    ULONG                style;
  71.    ULONG                bits;
  72.    OString              winText;
  73.    HPS                  hps;
  74.    RECTL                rcl;
  75.    SWP                  sizepos;
  76.    PresParms            pparms; 
  77.  
  78.    OWindow             (const ULONG id, 
  79.                         const ULONG winstyle, 
  80.                         const ULONG winbits);
  81.  
  82.    virtual
  83.       ~OWindow         ();
  84.  
  85.    virtual
  86.       PSZ isOfType     () const;
  87.  
  88.    OWindow
  89.       &inherit         (const HWND hwndDlg),        // call this in WM_INITDLG when a dialog
  90.       &initReplace     (const ULONG id, SWP& swp),  // the OWindow should replace window id
  91.       &show            (),
  92.       &hide            (),
  93.       &enable          (),
  94.       &disable         (),
  95.       &activate        (),
  96.       &destroy         (),
  97.       &setFocus        (),
  98.       &setParent       (const HWND handle),
  99.       &setOwner        (const HWND handle),
  100.       &cancelClose     (),
  101.       &setForeColor    (COLOR color),
  102.       &setBackColor    (COLOR color),
  103.       &setFont         (PSZ fontnamesize),
  104.       &setPresentation (pPresParms presentation),
  105.       &getPresentation (pPresParms presentation);
  106.  
  107.    COLOR
  108.       getForeColor     (),
  109.       getBackColor     ();
  110.  
  111.    PSZ
  112.       getFont          ();
  113. };
  114.  
  115.  
  116. #endif // OWINDOW_INCLUDED
  117.  
  118. // end of source
  119.