* @note Do not save the maximized/restored state here. We are interested
* in the state of the active frame, and maybe this frame is not active
*/
-void CHexMergeFrame::SavePosition()
+void CHexMergeFrame::SavePosition(bool bSaveActivePane)
{
- if (CWnd *pLeft = m_wndSplitter.GetPane(0,0))
+ if (bSaveActivePane)
{
- GetOptionsMgr()->SaveOption(OPT_ACTIVE_PANE, GetActivePane());
+ if (CWnd* pLeft = m_wndSplitter.GetPane(0, 0))
+ {
+ GetOptionsMgr()->SaveOption(OPT_ACTIVE_PANE, GetActivePane());
+ }
}
}
*/
LRESULT CHexMergeFrame::OnStorePaneSizes(WPARAM wParam, LPARAM lParam)
{
- SavePosition();
+ SavePosition(false);
return 0;
}
// Implementation
private:
- void SavePosition();
+ void SavePosition(bool bSaveActivePane = true);
virtual ~CHexMergeFrame();
void CreateHexWndStatusBar(CStatusBar &, CWnd *);
// Generated message map functions
* @note Do not save the maximized/restored state here. We are interested
* in the state of the active frame, and maybe this frame is not active
*/
-void CImgMergeFrame::SavePosition()
+void CImgMergeFrame::SavePosition(bool bSaveActivePane)
{
CRect rc;
GetWindowRect(&rc);
- GetOptionsMgr()->SaveOption(OPT_ACTIVE_PANE, m_pImgMergeWindow->GetActivePane());
// save the bars layout
// save docking positions and sizes
m_pDockState.SaveState(_T("Settings-ImgMergeFrame"));
// for the dimensions of the diff pane, use the CSizingControlBar save
m_wndLocationBar.SaveState(_T("Settings-ImgMergeFrame"));
+
+ if (bSaveActivePane)
+ GetOptionsMgr()->SaveOption(OPT_ACTIVE_PANE, m_pImgMergeWindow->GetActivePane());
}
void CImgMergeFrame::OnMDIActivate(BOOL bActivate, CWnd* pActivateWnd, CWnd* pDeactivateWnd)
*/
LRESULT CImgMergeFrame::OnStorePaneSizes(WPARAM wParam, LPARAM lParam)
{
- SavePosition();
+ SavePosition(false);
return 0;
}
bool EnsureValidDockState(CDockState& state);
void LoadOptions();
void SaveOptions();
- void SavePosition();
+ void SavePosition(bool bSaveActivePane = true);
virtual ~CImgMergeFrame();
void CreateImgWndStatusBar(CStatusBar &, CWnd *);
// Generated message map functions
nLineIndex = m_pView[0][nPane]->GetCursorPos().y;
}
}
- if (nLineIndex != -1)
- m_pView[0][nPane]->GotoLine(nLineIndex, false, nPane);
+ m_pView[0][nPane]->GotoLine(nLineIndex < 0 ? 0 : nLineIndex, false, nPane);
}
void CMergeDoc::ChangeFile(int nBuffer, const String& path)
* @note Do not save the maximized/restored state here. We are interested
* in the state of the active frame, and maybe this frame is not active
*/
-void CMergeEditFrame::SavePosition()
+void CMergeEditFrame::SavePosition(bool bSaveActivePane)
{
// save the bars layout
// save docking positions and sizes
m_wndLocationBar.SaveState(_T("Settings"));
m_wndDetailBar.SaveState(_T("Settings"));
- for (int iRowParent = 0; iRowParent < m_wndSplitter.GetRowCount(); ++iRowParent)
+ if (bSaveActivePane)
{
- int iRow, iCol;
- auto& splitterWnd = static_cast<CMergeEditSplitterView *>(m_wndSplitter.GetPane(iRowParent, 0))->m_wndSplitter;
- splitterWnd.GetActivePane(&iRow, &iCol);
- if (iRow >= 0 || iCol >= 0)
- GetOptionsMgr()->SaveOption(OPT_ACTIVE_PANE, max(iRow, iCol));
+ for (int iRowParent = 0; iRowParent < m_wndSplitter.GetRowCount(); ++iRowParent)
+ {
+ int iRow, iCol;
+ auto& splitterWnd = static_cast<CMergeEditSplitterView*>(m_wndSplitter.GetPane(iRowParent, 0))->m_wndSplitter;
+ splitterWnd.GetActivePane(&iRow, &iCol);
+ if (iRow >= 0 || iCol >= 0)
+ GetOptionsMgr()->SaveOption(OPT_ACTIVE_PANE, max(iRow, iCol));
+ }
}
}
{
if (nIDEvent == IDT_SAVEPOSITION)
{
- SavePosition();
+ SavePosition(false);
KillTimer(IDT_SAVEPOSITION);
}
else
// Implementation
private:
bool EnsureValidDockState(CDockState& state);
- void SavePosition();
+ void SavePosition(bool bSaveActivePane = true);
virtual ~CMergeEditFrame();
CSplitterWndEx& GetMergeEditSplitterWnd(int iRow)
{ return static_cast<CMergeEditSplitterView *>(m_wndSplitter.GetPane(iRow, 0))->m_wndSplitter; }