home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 19.ddi / OWLINC.PAK / TINYCAPT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  3.4 KB  |  94 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows - (C) Copyright 1991, 1993 by Borland International
  3. //   include\owl\tinycapt.h
  4. //----------------------------------------------------------------------------
  5. #if !defined(__OWL_TINYCAPT_H)
  6. #define __OWL_TINYCAPT_H
  7.  
  8. #if !defined(__OWL_WINDOW_H)
  9.   #include <owl\window.h>
  10. #endif
  11. class _OWLCLASS TFont;
  12.  
  13. //
  14. //  class TTinyCaption
  15. //  ----- ------------
  16. //
  17. class _OWLCLASS TTinyCaption : public virtual TWindow {
  18.   protected:
  19.     TTinyCaption();
  20.    ~TTinyCaption();
  21.  
  22.     //
  23.     // Pass closeBox=TRUE to replace SystemMenu box with a box that will 
  24.     // close window when clicked
  25.     // Used for floating palettes, etc.
  26.     //
  27.     void        EnableTinyCaption(int ch=45, BOOL closeBox=FALSE);
  28.  
  29.     //
  30.     // Controller class must handle events that call these mixin handlers
  31.     //
  32.     TEventStatus DoNCHitTest(TPoint& screenPt, UINT& evRes);
  33.     TEventStatus DoNCPaint();
  34.     TEventStatus DoNCCalcSize(BOOL calcValidRects, 
  35.                               NCCALCSIZE_PARAMS far& calcSize, UINT& evRes);
  36.     TEventStatus DoNCLButtonDown(UINT hitTest, TPoint& screenPt);
  37.     TEventStatus DoMouseMove(UINT hitTest, TPoint& screenPt);
  38.     TEventStatus DoLButtonUp(UINT hitTest, TPoint& screenPt);
  39.     TEventStatus DoNCActivate(BOOL active, BOOL& evRes);
  40.     TEventStatus DoCommand(UINT id, HWND hWndCtl, UINT notifyCode, LRESULT& evRes);
  41.     TEventStatus DoSysCommand(UINT cmdType, TPoint& p);
  42.  
  43.   protected:
  44.     //
  45.     // Cache system metrics 
  46.     //
  47.     TSize    Border; // Thin frame border size for dividers
  48.     TSize    Frame;  // Actual Left and Right, Top and Bottom frame size
  49.  
  50.     BOOL     CloseBox;      // True for special close box
  51.     BOOL     TCEnabled;
  52.     int      CaptionHeight;
  53.     TFont*   CaptionFont;   // Tiny font for caption bar
  54.     UINT     DownHit;       // Mouse down hit test result
  55.     BOOL     IsPressed;     // Is a button currently pressed
  56.     BOOL     WaitingForSysCmd;
  57.  
  58.     void        PaintButton(TDC& dc, TRect& boxRect, BOOL pressed);
  59.     void        PaintCloseBox(TDC& dc, TRect& boxRect, BOOL pressed);
  60.     void        PaintSysBox(TDC& dc, TRect& boxRect, BOOL pressed);
  61.     void        PaintMinBox(TDC& dc, TRect& boxRect, BOOL pressed);
  62.     void        PaintMaxBox(TDC& dc, TRect& boxRect, BOOL pressed);
  63.     void        PaintCaption(BOOL active);
  64.     void        DoSysMenu();
  65.  
  66.     TRect       GetCaptionRect();  // Get caption area for hit test or paint
  67.     TRect       GetSysBoxRect();   // Same for close box
  68.     TRect       GetMinBoxRect();
  69.     TRect       GetMaxBoxRect();
  70.  
  71.   protected:
  72.     UINT        EvNCHitTest(TPoint& screenPt);
  73.     void        EvNCPaint();
  74.     UINT        EvNCCalcSize(BOOL calcValidRects, NCCALCSIZE_PARAMS far& calcSize);
  75.     void        EvNCLButtonDown(UINT hitTest, TPoint& screenPt);
  76.     void        EvMouseMove(UINT hitTest, TPoint& screenPt);
  77.     void        EvLButtonUp(UINT hitTest, TPoint& screenPt);
  78.     BOOL        EvNCActivate(BOOL active);
  79.     LRESULT     EvCommand(UINT id, HWND hWndCtl, UINT notifyCode);
  80.     void        EvSysCommand(UINT cmdType, TPoint& p);
  81.  
  82.   private:
  83.     //
  84.     // hidden to prevent accidental copying or assignment
  85.     //
  86.     TTinyCaption(const TTinyCaption&);
  87.     TTinyCaption& operator =(const TTinyCaption&);
  88.  
  89.   DECLARE_RESPONSE_TABLE(TTinyCaption);
  90.   DECLARE_STREAMABLE(_OWLCLASS, TTinyCaption, 1);
  91. };
  92.  
  93. #endif  // __OWL_TINYCAPT_H
  94.