WindowManager.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. #ifndef __WINDOWMANAGER_H__
  2. #define __WINDOWMANAGER_H__
  3. #ifndef __AFXTEMPL_H__
  4. #pragma message("Include <afxtempl.h> in your stdafx.h to avoid this message")
  5. //#include <afxtempl.h>
  6. #endif
  7. ////////////////////////////////////////////////////////////////////////////////
  8. // Forward declaration
  9. class CViewManager;
  10. #define CMyMainFrameClass CMainFrame //TODO: Please change the CMainFrame to your main frame
  11. class CMyMainFrameClass;
  12. ///////////////////////////////////////////////////////////
  13. // CDocumentList declaration
  14. class CDocumentList : public CList<CDocument*, CDocument*>
  15. {
  16. public:
  17. // Constuction
  18. CDocumentList(); // To automatically enumerates the documents in a given application
  19. // Destruction
  20. ~CDocumentList(); // To empty and destroy the list when out of scope
  21. // Operations
  22. CDocument* GetNextDocument(); // Gets next document object
  23. // Prevent any copying and assignment of CDocumentList objects
  24. private:
  25. CDocumentList(const CDocumentList&);
  26. const CDocumentList& operator=(const CDocumentList&);
  27. // Implementation
  28. private:
  29. // Keep the current position in the document list
  30. POSITION m_CurPosInDocList;
  31. };
  32. /////////////////////////////////////////////////////////////////////////////
  33. // CWindowDlg dialog
  34. class CWindowDlg : public CDialog
  35. {
  36. // Construction
  37. public:
  38. CWindowDlg(CMDIFrameWnd *pMDIFrame);
  39. // Dialog Data
  40. //{{AFX_DATA(CWindowDlg)
  41. enum { IDD = IDD_WINDOW_MANAGE };
  42. CListBox m_wndList;
  43. //}}AFX_DATA
  44. // Overrides
  45. // ClassWizard generated virtual function overrides
  46. //{{AFX_VIRTUAL(CWindowDlg)
  47. protected:
  48. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  49. //}}AFX_VIRTUAL
  50. // Implementation
  51. protected:
  52. void MDIMessage(UINT uMsg,WPARAM flag);
  53. void FillWindowList(void);
  54. void SelActive(void);
  55. void UpdateButtons(void);
  56. CMDIFrameWnd *m_pMDIFrame;
  57. // Generated message map functions
  58. //{{AFX_MSG(CWindowDlg)
  59. virtual BOOL OnInitDialog();
  60. afx_msg void OnClose();
  61. afx_msg void OnSelChange();
  62. afx_msg void OnSave();
  63. afx_msg void OnActivate();
  64. afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
  65. afx_msg void OnUpdateUI(CCmdUI * pCmdUI);
  66. afx_msg void OnTileHorz();
  67. afx_msg void OnMinimize();
  68. afx_msg void OnTileVert();
  69. afx_msg void OnCascade();
  70. //}}AFX_MSG
  71. DECLARE_MESSAGE_MAP()
  72. };
  73. /////////////////////////////////////////////////////////////////////////////
  74. // CMDIClient window
  75. class CMDIClient : public CWnd
  76. {
  77. // Construction
  78. public:
  79. CMDIClient();
  80. // Attributes
  81. public:
  82. CViewManager* m_pViewManager;
  83. protected:
  84. CString m_strWindows;
  85. HMENU m_hMenuWindow;
  86. CMyMainFrameClass* m_pMDIFrame;
  87. // Full Screen mode support
  88. BOOL m_bToolBarVisible;
  89. BOOL m_bStatusBarVisible;
  90. CRect m_rcMainFrame;
  91. BOOL m_bMaxChild;
  92. CToolBar* m_pwndFullScrnToolBar;
  93. private:
  94. void FullScreenOff();
  95. void FullScreenOn();
  96. CSize m_sizeClient;
  97. BOOL m_bFullScreen; // TRUE for "On" mode, FALSE for "Off"
  98. BOOL m_bFirstTime;
  99. // Operations
  100. public:
  101. void ManageWindows(CMDIFrameWnd *pMDIFrame);
  102. BOOL SubclassMDIClient(CMDIFrameWnd* pMDIFrameWnd,
  103. CViewManager* pViewManager, UINT uID = ID_VIEW_VIEWTAB);
  104. BOOL IsFullScreen() { return m_bFullScreen; }
  105. // Overrides
  106. // ClassWizard generated virtual function overrides
  107. //{{AFX_VIRTUAL(CMDIClient)
  108. public:
  109. virtual BOOL PreTranslateMessage(MSG* pMsg);
  110. //}}AFX_VIRTUAL
  111. // Implementation
  112. public:
  113. void RestoreMainFrameState(UINT nCmdShow);
  114. void SaveMainFrameState();
  115. virtual ~CMDIClient();
  116. protected:
  117. COLORREF m_crBkColor;
  118. // Generated message map functions
  119. protected:
  120. //{{AFX_MSG(CMDIClient)
  121. afx_msg LRESULT OnRefreshMenu(WPARAM wParam,LPARAM lParam);
  122. afx_msg LRESULT OnSetMenu(WPARAM wParam,LPARAM lParam);
  123. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  124. afx_msg void OnSize(UINT nType, int cx, int cy);
  125. afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  126. afx_msg void OnWindowManage();
  127. afx_msg void OnWindowNext();
  128. afx_msg void OnWindowPrevious();
  129. afx_msg void OnTabView();
  130. afx_msg void OnUpdateTabView(CCmdUI* pCmdUI);
  131. afx_msg void OnUpdateWindowManage(CCmdUI* pCmdUI);
  132. //}}AFX_MSG
  133. afx_msg LRESULT OnMDICreate(WPARAM wParam, LPARAM lParam);
  134. afx_msg LRESULT OnMDIDestroy(WPARAM wParam, LPARAM lParam);
  135. DECLARE_MESSAGE_MAP()
  136. };
  137. #endif