From beaf6be617cb913cea6e10207a26ea060064038b Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Sat, 20 Sep 2003 16:02:21 +0000 Subject: [PATCH] Make directory compare Window to remember maximized state --- Src/DirFrame.cpp | 36 +++++++++++++++++++++++++++++------- Src/DirFrame.h | 16 +++++++++++++--- Src/readme.txt | 4 ++++ 3 files changed, 46 insertions(+), 10 deletions(-) diff --git a/Src/DirFrame.cpp b/Src/DirFrame.cpp index bc78ca67a..68ba96ca0 100644 --- a/Src/DirFrame.cpp +++ b/Src/DirFrame.cpp @@ -92,6 +92,9 @@ void CDirFrame::Dump(CDumpContext& dc) const #endif //_DEBUG +/** + * @brief Create statusbar + */ int CDirFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1) @@ -115,18 +118,22 @@ int CDirFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) return 0; } +/** + * @brief Set statusbar text + */ void CDirFrame::SetStatus(LPCTSTR szStatus) { m_wndStatusBar.SetPaneText(0, szStatus); } - +/** + * @brief Restore maximized state of directory compare window + */ void CDirFrame::ActivateFrame(int nCmdShow) { -// Diffstatus is not in this frame -// if (m_wndStatusBar.IsWindowVisible()) -// m_wndStatusBar.SetPaneText(1, _T("")); // clear the diff status - + if (theApp.GetProfileInt(_T("Settings"), _T("DirViewMax"), FALSE)) + nCmdShow = SW_MAXIMIZE; + CMDIChildWnd::ActivateFrame(nCmdShow); } @@ -135,8 +142,10 @@ void CDirFrame::OnUpdateStatusNum(CCmdUI* pCmdUI) pCmdUI->SetText(_T("")); } -// Store callback which we check to see if we're allowed to close -// This keeps us decoupled from the doc +/** + * @brief Store callback which we check to see if we're allowed to close + * This keeps us decoupled from the doc + */ void CDirFrame::SetClosableCallback(bool (*canclose)(void *), void * param) { m_picanclose = canclose; @@ -153,3 +162,16 @@ void CDirFrame::OnClose() CMDIChildWnd::OnClose(); } + +/** + * @brief Save maximized state before destroying window + */ +BOOL CDirFrame::DestroyWindow() +{ + WINDOWPLACEMENT wp; + wp.length = sizeof(WINDOWPLACEMENT); + GetWindowPlacement(&wp); + theApp.WriteProfileInt(_T("Settings"), _T("DirViewMax"), (wp.showCmd == SW_MAXIMIZE)); + + return CMDIChildWnd::DestroyWindow(); +} diff --git a/Src/DirFrame.h b/Src/DirFrame.h index f41ec57eb..5206580e3 100644 --- a/Src/DirFrame.h +++ b/Src/DirFrame.h @@ -17,19 +17,28 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // ///////////////////////////////////////////////////////////////////////////// +/** + * @file DirFrame.h + * + * @brief Declaration file for CDirFrame + * + */ +// RCS ID line follows -- this is updated by CVS +// $Id$ + #if !defined(AFX_DIRFRAME_H__95565903_35C4_11D1_BAA7_00A024706EDC__INCLUDED_) #define AFX_DIRFRAME_H__95565903_35C4_11D1_BAA7_00A024706EDC__INCLUDED_ #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 -// DirFrame.h : header file -// - ///////////////////////////////////////////////////////////////////////////// // CDirFrame frame +/** + * @brief Frame window for Directory Compare window + */ class CDirFrame : public CMDIChildWnd { DECLARE_DYNCREATE(CDirFrame) @@ -50,6 +59,7 @@ public: //{{AFX_VIRTUAL(CDirFrame) public: virtual void ActivateFrame(int nCmdShow = -1); + virtual BOOL DestroyWindow(); //}}AFX_VIRTUAL // Implementation diff --git a/Src/readme.txt b/Src/readme.txt index 60f7982cd..dfea783b3 100644 --- a/Src/readme.txt +++ b/Src/readme.txt @@ -1,3 +1,7 @@ +2003-09-20 Kimmo + Make directory compare Window to remember maximized state + WinMerge: DirFrame.h DirFrame.cpp + 2003-09-20 Laoran Actualizing the GnuC filter *.o -> \.o filter: Merge_GnuC_loose.flt -- 2.11.0