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

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