OSDN Git Service

Merge pull request #93 from GreyMerlin/master
[winmerge-jp/winmerge-jp.git] / Src / ChildFrm.h
1 /////////////////////////////////////////////////////////////////////////////
2 //    WinMerge:  an interactive diff/merge utility
3 //    Copyright (C) 1997  Dean P. Grimm
4 //
5 //    This program is free software; you can redistribute it and/or modify
6 //    it under the terms of the GNU General Public License as published by
7 //    the Free Software Foundation; either version 2 of the License, or
8 //    (at your option) any later version.
9 //
10 //    This program is distributed in the hope that it will be useful,
11 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
12 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 //    GNU General Public License for more details.
14 //
15 //    You should have received a copy of the GNU General Public License
16 //    along with this program; if not, write to the Free Software
17 //    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //
19 /////////////////////////////////////////////////////////////////////////////
20 /** 
21  * @file  ChildFrm.h
22  *
23  * @brief interface of the CChildFrame class
24  *
25  */
26 #pragma once
27
28 #include "SplitterWndEx.h"
29 #include "MergeEditSplitterView.h"
30 #include "MergeStatusBar.h"
31 #include "EditorFilepathBar.h"
32 #include "DiffViewBar.h"
33 #include "LocationBar.h"
34
35 class CMergeDoc;
36
37 /** 
38  * @brief Frame class for file compare, handles panes, statusbar etc.
39  */
40 class CChildFrame : public CMDIChildWnd
41 {
42         DECLARE_DYNCREATE(CChildFrame)
43 public:
44         CChildFrame();
45
46 // Operations
47 public:
48         void UpdateResources();
49         void CloseNow();
50         IHeaderBar * GetHeaderInterface();
51         void SetSharedMenu(HMENU hMenu) { m_hMenuShared = hMenu; };
52         CMergeDoc * GetMergeDoc() { return m_pMergeDoc; }
53         void SetLastCompareResult(int nResult);
54
55         void UpdateAutoPaneResize();
56         void UpdateSplitter();
57         CSplitterWndEx& GetSplitter() { return m_wndSplitter; };
58
59 // Attributes
60 protected:
61         CSplitterWndEx m_wndSplitter;
62         CEditorFilePathBar m_wndFilePathBar;
63         CDiffViewBar m_wndDetailBar;
64         CMergeEditSplitterView *m_pwndDetailMergeEditSplitterView;
65         CMergeStatusBar m_wndStatusBar;
66         CLocationBar m_wndLocationBar;
67
68 // Overrides
69 public:
70         // ClassWizard generated virtual function overrides
71         //{{AFX_VIRTUAL(CChildFrame)
72         public:
73         virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
74         virtual void ActivateFrame(int nCmdShow = -1);
75         virtual BOOL DestroyWindow();
76         protected:
77         //}}AFX_VIRTUAL
78
79 // Implementation
80 private:
81         BOOL EnsureValidDockState(CDockState& state);
82         void SavePosition();
83         virtual ~CChildFrame();
84         CSplitterWndEx& GetMergeEditSplitterWnd(int iRow)
85         { return static_cast<CMergeEditSplitterView *>(m_wndSplitter.GetPane(iRow, 0))->m_wndSplitter; }
86
87 // Generated message map functions
88 private:
89         int m_nLastSplitPos[2];
90         void UpdateHeaderSizes();
91         BOOL m_bActivated;
92         CMergeDoc * m_pMergeDoc;
93         HICON m_hIdentical;
94         HICON m_hDifferent;
95
96         //{{AFX_MSG(CChildFrame)
97         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
98         afx_msg void OnClose();
99         afx_msg void OnTimer(UINT_PTR nIDEvent);
100         afx_msg void OnMDIActivate(BOOL bActivate, CWnd* pActivateWnd, CWnd* pDeactivateWnd);
101         afx_msg void OnViewSplitVertically();
102         afx_msg void OnUpdateViewSplitVertically(CCmdUI* pCmdUI);
103         afx_msg LRESULT OnStorePaneSizes(WPARAM wParam, LPARAM lParam);
104         afx_msg void OnSize(UINT nType, int cx, int cy);
105         afx_msg void OnIdleUpdateCmdUI();
106         afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
107         //}}AFX_MSG
108         DECLARE_MESSAGE_MAP()
109 };