home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 3.ddi / OWLINC.ZIP / WINDOW.H < prev   
Encoding:
C/C++ Source or Header  |  1992-06-10  |  3.4 KB  |  116 lines

  1. // ObjectWindows - (C) Copyright 1992 by Borland International
  2.  
  3. #ifndef __WINDOW_H
  4. #define __WINDOW_H
  5.  
  6. // WINDOW.H
  7. // Defines type TWindow. This defines the basic behavior of all windows
  8. //
  9.  
  10. #ifndef __WINDOBJ_H
  11. #include <windobj.h>
  12. #endif
  13.  
  14. #ifndef __SCROLLER_H
  15. #include <scroller.h>
  16. #endif
  17.  
  18. #pragma option -Vo-
  19. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  20. #pragma option -po-
  21. #endif
  22.  
  23.   /* TWindow creation attributes */
  24. struct _CLASSTYPE TWindowAttr { // _CLASSTYPE needed by BC++ 2.0
  25.     DWORD Style;
  26.     DWORD ExStyle;
  27.     int X, Y, W, H;
  28.     LPSTR Menu;  // Menu name
  29.     int Id ;     // Child identifier
  30.     LPSTR Param;
  31.  };
  32.  
  33.  
  34. /* Window Class */
  35.  
  36. _CLASSDEF(TWindow)
  37.  
  38. class _EXPORT TWindow : public TWindowsObject
  39. {
  40. public:
  41.     TWindowAttr  Attr;
  42.     PTScroller Scroller;
  43.     HWND FocusChildHandle;
  44.  
  45.     TWindow(PTWindowsObject AParent, LPSTR ATitle, PTModule AModule = NULL);
  46.     TWindow(HWND AnHWindow, PTModule AModule = NULL);
  47.     virtual ~TWindow();
  48.  
  49.     virtual BOOL AssignMenu(LPSTR MenuName);
  50.     virtual BOOL AssignMenu(int MenuId);
  51.     virtual BOOL Create();
  52.     virtual void ActivationResponse(WORD Activated, BOOL IsIconified);
  53.  
  54.     virtual classType        isA() const
  55.     { return windowClass; }
  56.     virtual Pchar nameOf() const
  57.     { return "TWindow"; }
  58.  
  59.     static PTStreamable build();
  60.  
  61. protected:
  62.     virtual LPSTR GetClassName()
  63.         { return "OWLWindow31"; }
  64.     virtual void GetWindowClass(WNDCLASS _FAR & AWndClass);
  65.     virtual void SetupWindow();
  66.  
  67.     virtual void WMCreate(RTMessage Msg) = [WM_FIRST + WM_CREATE];
  68.     virtual void WMMDIActivate(RTMessage Msg) =
  69.                  [WM_FIRST + WM_MDIACTIVATE];
  70.     virtual void WMHScroll(RTMessage Msg) = [WM_FIRST + WM_HSCROLL];
  71.     virtual void WMVScroll(RTMessage Msg) = [WM_FIRST + WM_VSCROLL];
  72.     virtual void WMPaint(RTMessage Msg) = [WM_FIRST + WM_PAINT];
  73. #if defined(WIN31)
  74.     // windows 3.1 interface
  75.     virtual void Paint(HDC PaintDC, PAINTSTRUCT _FAR & PaintInfo);
  76. #endif
  77. #if defined(WIN30)
  78.     // windows 3.0 interface
  79.     virtual void Paint(HDC_30 PaintDC, PAINTSTRUCT _FAR & PaintInfo);
  80. #endif
  81. #if (defined(WIN30) || defined(WIN31)) && !(defined(WIN30) && defined(WIN31))
  82.     // this function is never called. it is used to pad the vtable so that
  83.     // exactly two Paint(...) definitions are always present.
  84.     virtual void Paint(void *, void *) { };
  85. #endif
  86.     virtual void WMSize(RTMessage Msg) = [WM_FIRST + WM_SIZE];
  87.     virtual void WMMove(RTMessage Msg) = [WM_FIRST + WM_MOVE];
  88.     virtual void WMLButtonDown(RTMessage Msg) = [WM_FIRST + WM_LBUTTONDOWN];
  89.  
  90.     TWindow(StreamableInit) : TWindowsObject(streamableInit) {};
  91.     virtual void write (Ropstream os);
  92.     virtual Pvoid read (Ripstream is);
  93.  
  94. private:
  95.     virtual const Pchar streamableName() const
  96.         { return "TWindow"; }
  97.  
  98. };     // end of Window class
  99.  
  100. inline Ripstream operator >> ( Ripstream is, RTWindow cl )
  101.     { return is >> (RTStreamable)cl; }
  102. inline Ripstream operator >> ( Ripstream is, RPTWindow cl )
  103.     { return is >> (RPvoid)cl; }
  104.  
  105. inline Ropstream operator << ( Ropstream os, RTWindow cl )
  106.     { return os << (RTStreamable)cl; }
  107. inline Ropstream operator << ( Ropstream os, PTWindow cl )
  108.     { return os << (PTStreamable)cl; }
  109.  
  110. #pragma option -Vo.
  111. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  112. #pragma option -po.
  113. #endif
  114.  
  115. #endif // ifdef _WINDOW_H
  116.