Source code of Windows XP (NT5)
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.

145 lines
3.9 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. FTMan
  5. File Name:
  6. MainFrm.h
  7. Abstract:
  8. The definition of class CMainFrame. It is the MFC main frame class for this application
  9. Author:
  10. Cristian Teodorescu October 20, 1998
  11. Notes:
  12. Revision History:
  13. --*/
  14. /////////////////////////////////////////////////////////////////////////////
  15. #if !defined(AFX_MAINFRM_H__B83DFFFF_6873_11D2_A297_00A0C9063765__INCLUDED_)
  16. #define AFX_MAINFRM_H__B83DFFFF_6873_11D2_A297_00A0C9063765__INCLUDED_
  17. #if _MSC_VER > 1000
  18. #pragma once
  19. #endif // _MSC_VER > 1000
  20. #include "FTManDef.h"
  21. class CFTTreeView;
  22. class CFTListView;
  23. class CItemData;
  24. class CMainFrame : public CFrameWnd
  25. {
  26. protected: // create from serialization only
  27. CMainFrame();
  28. DECLARE_DYNCREATE(CMainFrame)
  29. // Attributes
  30. protected:
  31. CSplitterWnd m_wndSplitter;
  32. public:
  33. // Enables auto refresh of both views on WM_ACTIVATEAPP
  34. BOOL m_bEnableAutoRefresh;
  35. // Did some auto refresh request come while the auto refresh flag was disabled?
  36. BOOL m_bAutoRefreshRequested;
  37. // Operations
  38. public:
  39. // Overrides
  40. // ClassWizard generated virtual function overrides
  41. //{{AFX_VIRTUAL(CMainFrame)
  42. public:
  43. virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
  44. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  45. virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
  46. //}}AFX_VIRTUAL
  47. // Implementation
  48. public:
  49. virtual ~CMainFrame();
  50. CFTTreeView* GetLeftPane();
  51. CFTListView* GetRightPane();
  52. CStatusBar* GetStatusBar() { return &m_wndStatusBar; };
  53. // Refreshes the content of both views by keeping ( when possible ) the expanded and
  54. // selected items.
  55. // It is also possible to change the selected items and to add some expanded items
  56. BOOL RefreshAll(
  57. CItemIDSet* psetAddTreeExpandedItems = NULL,
  58. CItemIDSet* psetTreeSelectedItems = NULL,
  59. CItemIDSet* psetListSelectedItems = NULL );
  60. #ifdef _DEBUG
  61. virtual void AssertValid() const;
  62. virtual void Dump(CDumpContext& dc) const;
  63. #endif
  64. protected: // control bar embedded members
  65. CStatusBar m_wndStatusBar;
  66. CToolBar m_wndToolBar;
  67. UINT_PTR m_unTimer;
  68. // Generated message map functions
  69. protected:
  70. //{{AFX_MSG(CMainFrame)
  71. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  72. afx_msg void OnViewToggle();
  73. afx_msg void OnViewRefresh();
  74. afx_msg void OnActivateApp(BOOL bActive, HTASK hTask);
  75. afx_msg void OnDestroy();
  76. afx_msg void OnTimer(UINT nIDEvent);
  77. //}}AFX_MSG
  78. afx_msg void OnUpdateViewStyles(CCmdUI* pCmdUI);
  79. afx_msg void OnViewStyle(UINT nCommandID);
  80. DECLARE_MESSAGE_MAP()
  81. };
  82. /////////////////////////////////////////////////////////////////////////////////////////////
  83. // Global functions related to CMainFrame
  84. // Refreshes the content of both views of the mainframe by keeping ( when possible )
  85. // the expanded and selected items.
  86. // It is also possible to change the selected items and to add some expanded items
  87. BOOL AfxRefreshAll(
  88. CItemIDSet* psetAddTreeExpandedItems = NULL,
  89. CItemIDSet* psetTreeSelectedItems = NULL,
  90. CItemIDSet* psetListSelectedItems = NULL );
  91. // Enables / Disables the auto refresh of both views of the mainframe on WM_ACTIVATEAPP
  92. BOOL AfxEnableAutoRefresh( BOOL bEnable = TRUE );
  93. // Class AutoRefresh - a easier way to disable / enable the auto-refresh flag inside a code block
  94. // On constructor enables or disables the Auto refresh flag
  95. // On destructor restores the old Auto refresh flag
  96. class CAutoRefresh
  97. {
  98. public:
  99. CAutoRefresh( BOOL bEnable = FALSE ) { m_bPrevious = AfxEnableAutoRefresh(bEnable); };
  100. ~CAutoRefresh() { AfxEnableAutoRefresh( m_bPrevious ); };
  101. protected:
  102. BOOL m_bPrevious;
  103. };
  104. /////////////////////////////////////////////////////////////////////////////
  105. //{{AFX_INSERT_LOCATION}}
  106. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  107. #endif // !defined(AFX_MAINFRM_H__B83DFFFF_6873_11D2_A297_00A0C9063765__INCLUDED_)
  108.