void CMainFrame::OnClose() { //store the toolbar positions CDockState dockState; CString szToolbarPositionsKey; szToolbarPositionsKey.LoadString( IDS_TOOLBARKEY ); GetDockState( dockState ); dockState.SaveState( szToolbarPositionsKey ); CMDIFrameWnd::OnClose(); }
LRESULT CInPlaceFrame::OnBarState(WPARAM wParam, LPARAM lParam) { if (lParam == -1) return 0L; if (wParam == 0) { GetDockState(theApp.GetDockState(RD_EMBEDDED)); ASSERT(m_pMainFrame != NULL); m_pMainFrame->GetDockState(theApp.GetDockState(RD_EMBEDDED, FALSE)); } else { SetDockState(theApp.GetDockState(RD_EMBEDDED)); m_pMainFrame->SetDockState(theApp.GetDockState(RD_EMBEDDED, FALSE)); } return 0L; }
/** * @brief Save coordinates of the frame, splitters, and bars * * @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 CChildFrame::SavePosition() { CRect rc; CWnd* pLeft = m_wndSplitter.GetPane(0,0); if (pLeft != NULL) { pLeft->GetWindowRect(&rc); theApp.WriteProfileInt(_T("Settings"), _T("WLeft"), rc.Width()); } // save the bars layout // save docking positions and sizes CDockState m_pDockState; GetDockState(m_pDockState); m_pDockState.SaveState(_T("Settings")); // for the dimensions of the diff pane, use the CSizingControlBar save m_wndLocationBar.SaveState(_T("Settings")); m_wndDetailBar.SaveState(_T("Settings")); }
/** * @brief Save coordinates of the frame, splitters, and bars * * @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() { // save the bars layout // save docking positions and sizes CDockState m_pDockState; GetDockState(m_pDockState); m_pDockState.SaveState(_T("Settings")); // for the dimensions of the diff pane, use the CSizingControlBar save m_wndLocationBar.SaveState(_T("Settings")); m_wndDetailBar.SaveState(_T("Settings")); int iRow, iCol; m_wndSplitter.GetActivePane(&iRow, nullptr); if (iRow >= 0) { auto& splitterWnd = static_cast<CMergeEditSplitterView *>(m_wndSplitter.GetPane(iRow, 0))->m_wndSplitter; splitterWnd.GetActivePane(&iRow, &iCol); if (iRow >= 0 || iCol >= 0) GetOptionsMgr()->SaveOption(OPT_ACTIVE_PANE, max(iRow, iCol)); } }