Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

141 lines
4.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: childfrm.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // ChildFrm.h : interface of the CChildFrame class
  11. //
  12. /////////////////////////////////////////////////////////////////////////////
  13. #ifndef CHILDFRM_H
  14. #define CHILDFRM_H
  15. #include "statbar.h"
  16. #include "constatbar.h" // for CConsoleStatusBar
  17. class CAMCView;
  18. class CMenuButtonsMgrImpl;
  19. class CChildFrame : public CMDIChildWnd, public CConsoleStatusBar
  20. {
  21. DECLARE_DYNCREATE(CChildFrame)
  22. public:
  23. CChildFrame();
  24. protected: // control bar embedded members
  25. CDockManager<CDockSite> m_DockingManager;
  26. CDockSite m_StatusDockSite;
  27. protected:
  28. CAMCStatusBar m_wndStatusBar;
  29. // Operations
  30. public:
  31. void ToggleStatusBar();
  32. void RenderDockSites();
  33. void SendMinimizeNotification (bool fMinimized) const;
  34. bool SetCreateVisible (bool fCreateVisible);
  35. bool IsCustomizeViewEnabled ();
  36. public:
  37. // CConsoleStatusBar methods
  38. virtual SC ScSetStatusText (LPCTSTR pszText);
  39. //Operations
  40. protected:
  41. // Overrides
  42. // ClassWizard generated virtual function overrides
  43. //{{AFX_VIRTUAL(CChildFrame)
  44. public:
  45. virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_OVERLAPPEDWINDOW, const RECT& rect = rectDefault, CMDIFrameWnd* pParentWnd = NULL, CCreateContext* pContext = NULL);
  46. protected:
  47. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  48. //}}AFX_VIRTUAL
  49. virtual CWnd* GetMessageBar()
  50. { return (&m_wndStatusBar); }
  51. // Implementation
  52. public:
  53. virtual ~CChildFrame();
  54. #ifdef _DEBUG
  55. virtual void AssertValid() const;
  56. virtual void Dump(CDumpContext& dc) const;
  57. #endif
  58. void OnUpdateFrameTitle(BOOL bAddToTitle);
  59. virtual void OnUpdateFrameMenu(BOOL bActive, CWnd* pActivateWnd,
  60. HMENU hMenuAlt);
  61. virtual HACCEL GetDefaultAccelerator();
  62. virtual void ActivateFrame(int nCmdShow = -1);
  63. // Generated message map functions
  64. protected:
  65. //{{AFX_MSG(CChildFrame)
  66. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  67. afx_msg void OnSize(UINT nType, int cx, int cy);
  68. afx_msg void OnDestroy();
  69. afx_msg void OnClose();
  70. afx_msg void OnMDIActivate(BOOL bActivate, CWnd* pActivateWnd, CWnd* pDeactivateWnd);
  71. afx_msg void OnCustomizeView();
  72. afx_msg void OnNcPaint();
  73. afx_msg BOOL OnNcActivate(BOOL bActive);
  74. afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
  75. //}}AFX_MSG
  76. afx_msg void OnMaximizeOrRestore(UINT nId);
  77. afx_msg void OnUpdateCustomizeView(CCmdUI* pCmdUI);
  78. afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam);
  79. afx_msg LRESULT OnGetIcon(WPARAM wParam, LPARAM lParam);
  80. afx_msg LRESULT OnSetMessageString(WPARAM wParam, LPARAM lParam);
  81. public:
  82. afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  83. DECLARE_MESSAGE_MAP()
  84. private:
  85. CAMCView* m_pAMCView;
  86. CString m_strStatusText;
  87. bool m_fDestroyed;
  88. bool m_fCurrentlyMinimized;
  89. bool m_fCurrentlyActive;
  90. bool m_fCreateVisible;
  91. bool m_fChildFrameActive;
  92. bool m_fEmptyAMCView;
  93. std::auto_ptr<CMenuButtonsMgrImpl> m_spMenuButtonsMgr;
  94. protected:
  95. void UpdateStatusText();
  96. HRESULT NotifyCallback (NCLBK_NOTIFY_TYPE event, LONG_PTR arg, LPARAM param) const;
  97. public:
  98. void SetAMCView(CAMCView* pView)
  99. { m_pAMCView = pView; }
  100. CAMCView* GetAMCView() const
  101. { return m_pAMCView; }
  102. void SetChildFrameActive(bool bActive = true) { m_fChildFrameActive = bActive; }
  103. bool IsChildFrameActive() { return m_fChildFrameActive;}
  104. CMenuButtonsMgrImpl* GetMenuButtonsMgr() { return (m_spMenuButtonsMgr.get()) ; }
  105. // this method is for CAMCView::OnDeleteEmptyView()
  106. // to inform the frame not to resist closing - no contents in the view
  107. void SetAMCViewIsEmpty() { m_fEmptyAMCView = true; }
  108. };
  109. #include "childfrm.inl"
  110. #endif /* CHILDFRM_H */
  111. /////////////////////////////////////////////////////////////////////////////