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

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