home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / OWLINC.PAK / FLOATFRA.H < prev    next >
C/C++ Source or Header  |  1995-08-29  |  2KB  |  64 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // (C) Copyright 1992, 1994 by Borland International, All Rights Reserved
  4. //
  5. //   Class TFloatingFrame.
  6. //----------------------------------------------------------------------------
  7. #if !defined(OWL_FLOATFRA_H)
  8. #define OWL_FLOATFRA_H
  9.  
  10. #if !defined(OWL_FRAMEWIN_H)
  11. # include <owl/framewin.h>
  12. #endif
  13. #if !defined(OWL_TINYCAPT_H)
  14. # include <owl/tinycapt.h>
  15. #endif
  16.  
  17. //
  18. //  class TFloatingFrame
  19. //  ----- --------------
  20. //
  21. //  implements a floating frame (owned popup frame w/ tiny caption)
  22. //
  23. //  if there is a client window then the floating frame shrinks to fit
  24. //  the client window leaving room for margins on the left, top, right, and
  25. //  bottom
  26. //
  27. //  if there is a client window then the floating palette expects the window
  28. //  to paint its own background (and hence does nothing in response to the
  29. //  WM_ERASEBKGND). if there is no client window then the floating palette
  30. //  erases the client area background using COLOR_BTNFACE
  31. //
  32. class _OWLCLASS TFloatingFrame : public TFrameWindow, public TTinyCaption {
  33.   public:
  34.     TFloatingFrame(TWindow*        parent,
  35.                    char*           title = 0,
  36.                    TWindow*        clientWnd = 0,
  37.                    bool            shrinkToClient = false,
  38.                    int             captionHeight = DefaultCaptionHeight,
  39.                    bool            popupPalette = false,
  40.                    TModule*        module = 0);
  41.     
  42.     void    SetMargins(const TSize& margin) {Margin = margin;}
  43.  
  44.     enum {DefaultCaptionHeight = 58};
  45.  
  46.   protected:
  47.     TEventStatus  DoNCHitTest(TPoint& screenPt, uint& evRes);
  48.  
  49.     LRESULT EvCommand(uint id, HWND hWndCtl, uint notifyCode);
  50.     void    EvSysCommand(uint cmdType, TPoint& p);
  51.     uint    EvNCCalcSize(bool calcValidRects, NCCALCSIZE_PARAMS far& calcSize);
  52.     void    EvNCPaint();
  53.     uint    EvNCHitTest(TPoint& screenPt);
  54.  
  55.   private:
  56.     TSize   Margin;  // left and right, top and bottom
  57.     bool    FloatingPaletteEnabled;
  58.  
  59.   DECLARE_RESPONSE_TABLE(TFloatingFrame);
  60.   DECLARE_STREAMABLE(_OWLCLASS, TFloatingFrame, 1);
  61. };
  62.  
  63. #endif  // OWL_FLOATFRA_H
  64.