/** * \brief Write options and setting to registry. */ void COptions::Save() { m_ExporterList->Save(); AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("Backup"), m_Backup); AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("AutoCompleteValues"), m_AutoCompleteValues); AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("OpenLastFile"), m_OpenLastFile); AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("GridLines"), m_GridLines); AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("ReplaceSpecialChar"), m_ReplaceSpecialChar); AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("ScrollToSelected"), m_ScrollToSelected); AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("DisableSave"), m_DisableSave); AfxGetApp()->WriteProfileString(SETTINGS_KEY, _T("ConfigDir"), m_ConfigDir); AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("TranslateASCII"), m_TranslateASCII); AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("CaseSensSort"), m_SortCaseSensitive); AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("SortOnSave"), m_SortOnSave); AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("LineLength"), m_LineLength); AfxGetApp()->WriteProfileString(SETTINGS_KEY, _T("CiteFormat"), m_CiteFormat); AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("ShowCiteDlg"), m_ShowCiteDlg); AfxGetApp()->WriteProfileString(SETTINGS_KEY, _T("DOIURL"), m_DOIURL); AfxGetApp()->WriteProfileString(SETTINGS_KEY, _T("EditorClass"), m_EditorClassName); AfxGetApp()->WriteProfileString(SETTINGS_KEY, _T("EditorParentClass"), m_EditorParentClass); POSITION p = ((CBibedtApp*)AfxGetApp())->m_Language.GetCurLang(); if (p) { LANG_INFO lang = ((CBibedtApp*)AfxGetApp())->m_Language.GetAt(p); AfxGetApp()->WriteProfileString(SETTINGS_KEY, _T("Language"), lang.path); } AfxGetApp()->WriteProfileString(SETTINGS_KEY, _T("Font.Prop"), m_FontProp); AfxGetApp()->WriteProfileString(SETTINGS_KEY, _T("Font.Mono"), m_FontMono); AfxGetApp()->WriteProfileString(SETTINGS_KEY, _T("Font.Sans"), m_FontSans); // Print AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("MarginLeft"), m_MarginLeft); AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("MarginTop"), m_MarginTop); AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("MarginRight"), m_MarginRight); AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("MarginBottom"), m_MarginBottom); AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("PrintUnits"), m_PrintUnits); // Columns AfxGetApp()->WriteProfileInt(SETTINGS_KEY, _T("ColCount"), m_ColCount); // Quicksearch AfxGetApp()->WriteProfileString(SETTINGS_KEY, _T("QuickSearchFields"), m_QuickSearchFields); // Window placement WriteWindowPlacement(_T(""), m_WindowPlacement); }
/************* * DESCRIPTION: save the position of the window * INPUT: - * OUTPUT: - *************/ void CMainFrame::OnClose() { WINDOWPLACEMENT wp; int cx, cy, n; wp.length = sizeof wp; if (GetWindowPlacement(&wp)) { wp.flags = 0; if (IsZoomed()) wp.flags |= WPF_RESTORETOMAXIMIZED; m_wndSplitterH.GetColumnInfo(0, cx, n); m_wndSplitterV.GetRowInfo(0, cy, n); // and write it to the .INI file WriteWindowPlacement(&wp, &CSize(cx, cy)); } CFrameWnd::OnClose(); }
void CMainFrame::OnClose() { // TO DO : kill all Threads ??? if (m_saveWindowSize) { WINDOWPLACEMENT wp; wp.length = sizeof wp; if (!IsIconic() && !IsZoomed()) if (GetWindowPlacement(&wp)) { wp.flags = 0; int wx = wp.rcNormalPosition.right-wp.rcNormalPosition.left+1; AfxGetApp()->WriteProfileInt("GLView","WinSizeX",wx); int wy = wp.rcNormalPosition.bottom-wp.rcNormalPosition.top+1; AfxGetApp()->WriteProfileInt("GLView","WinSizeY",wy); #if 0 // HG ?? if (IsZoomed()) wp.flags |= WPF_RESTORETOMAXIMIZED; // and write it to the .INI file if (wp.ptMaxPosition.x == wp.rcNormalPosition.top) { // is really maximized wp.showCmd = SW_SHOWMAXIMIZED; } //GetWindowRect else WriteWindowPlacement(&wp); #endif } } // really exectuted on exit CFrameWnd::OnClose(); }