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

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows - (C) Copyright 1992, 1993 by Borland International
  3. //   include\owl\decframe.h
  4. //----------------------------------------------------------------------------
  5. #if !defined(__OWL_DECFRAME_H)
  6. #define __OWL_DECFRAME_H
  7.  
  8. #if !defined(__OWL_FRAMEWIN_H)
  9.   #include <owl\framewin.h>
  10. #endif
  11. #if !defined(__OWL_LAYOUTWI_H)
  12.   #include <owl\layoutwi.h>
  13. #endif
  14.  
  15. //
  16. //  class TDecoratedFrame
  17. //  ----- ---------------
  18. //
  19. //  automatically positions its client window(you must supply a client window)
  20. //  so that it is the same size as the client rect
  21. //
  22. //  you can add additional decorations like toolbars and status lines
  23. //
  24. class _OWLCLASS TDecoratedFrame : virtual public TFrameWindow, public TLayoutWindow {
  25.   public:
  26.     TDecoratedFrame(TWindow*        parent,
  27.                     const char far* title,
  28.                     TWindow*        clientWnd,
  29.                     BOOL            trackMenuSelection = FALSE,
  30.                     TModule*        module = 0);
  31.  
  32.     enum TLocation {Top = 0x0100,  Bottom = 0x0200,
  33.                     Left = 0x0400, Right = 0x0800};
  34.  
  35.     virtual void  Insert(TWindow& decoration, TLocation = Top);
  36.  
  37.     //
  38.     // override TFrameWindow member function to give decorations an opportunity
  39.     // to do pre-processing (e.g. mnemonic access)
  40.     //
  41.     BOOL      PreProcessMsg(MSG& msg);
  42.     TWindow*  SetClientWindow(TWindow* clientWnd);
  43.  
  44.   protected:
  45.     BOOL   TrackMenuSelection;
  46.     UINT   MenuItemId;
  47.  
  48.     void      SetupWindow();
  49.  
  50.     //
  51.     // automatic showing/hiding of tool bars and status bars
  52.     //
  53.     LRESULT   EvCommand(UINT id, HWND hWndCtl, UINT notifyCode);
  54.     void      EvCommandEnable(TCommandEnabler& ce);
  55.  
  56.     //
  57.     // message response functions
  58.     //
  59.     void      EvMenuSelect(UINT menuItemId, UINT flags, HMENU hMenu);
  60.     void      EvEnterIdle(UINT source, HWND hWndDlg);
  61.     void      EvSize(UINT sizeType, TSize& size) {TLayoutWindow::EvSize(sizeType, size);}
  62.  
  63.   private:
  64.     void      InsertAtTop(TWindow& decoration, TWindow* insertAbove);
  65.     void      InsertAtBottom(TWindow& decoration, TWindow* insertBelow);
  66.     void      InsertAtLeft(TWindow& decoration, TWindow* insertLeftOf);
  67.     void      InsertAtRight(TWindow& decoration, TWindow* insertRightOf);
  68.  
  69.     //
  70.     // hidden to prevent accidental copying or assignment
  71.     //
  72.     TDecoratedFrame(const TDecoratedFrame&);
  73.     TDecoratedFrame& operator =(const TDecoratedFrame&);
  74.  
  75.   DECLARE_RESPONSE_TABLE(TDecoratedFrame);
  76.   DECLARE_STREAMABLE(_OWLCLASS, TDecoratedFrame, 1);
  77. };
  78.  
  79. #endif  // __OWL_DECFRAME_H
  80.