void COptionsDlg::OnResetAll() { if (AfxMessageBox(IDS_OPTS_RESTORE_DEFAULTS, MB_YESNO | MB_DEFBUTTON2) == IDYES) { EndDialog(IDOK); RestoreDefaults(); } }
BOOL CCrossDlg::OnInitDialog() { CToolDlg::OnInitDialog(); m_MixName.LoadString(IDS_CF_MIX_NAME); m_PosEdit.SetPrecision(3); m_PosEdit.SetRange(0, 1); m_PosSpin.SetDelta(.01); m_PosSlider.SetRange(0, SLIDER_RANGE); m_PosSlider.SetPos(SLIDER_RANGE / 2); m_PosSlider.SetDefaultPos(SLIDER_RANGE / 2); m_PosSlider.SetTicFreq(SLIDER_RANGE / 10); m_SecsEdit.SetRange(0, INT_MAX); CString s; for (int i = 0; i < WAVEFORMS; i++) { s.LoadString(CParmRow::GetWaveID(i)); m_Waveform.AddString(s); } RestoreDefaults(); m_PosSlider.SetFocus(); ((CEdit *)m_NameA.GetWindow(GW_CHILD))->SetReadOnly(TRUE); ((CEdit *)m_NameB.GetWindow(GW_CHILD))->SetReadOnly(TRUE); return FALSE; // set the focus to a control }
void CFlashMenuObject::AddProfile(const char *profileName) { if(m_pPlayerProfileManager) { CryFixedStringT<128> sName(profileName); sName = sName.Trim(); // check for invalid chars static const char* invalidChars = "\\/:*?\"<>~|"; if (sName.find_first_of(invalidChars) != CryFixedStringT<128>::npos) { if(m_apFlashMenuScreens[MENUSCREEN_FRONTENDSTART]) { ShowMenuMessage("@ui_menu_PROFILEERROR"); } return; } const char *userName = m_pPlayerProfileManager->GetCurrentUser(); IPlayerProfileManager::EProfileOperationResult result; bool bDone = m_pPlayerProfileManager->CreateProfile(userName,sName.c_str(), false, result); if(bDone) { SelectProfile(sName.c_str(), false, true); RestoreDefaults(); IPlayerProfile *pProfile = m_pPlayerProfileManager->GetCurrentProfile(m_pPlayerProfileManager->GetCurrentUser()); if(!pProfile) return; //reset to default (it's a copy of the current one) g_pGame->GetOptions()->SaveValueToProfile("Singleplayer.LastSavedGame", ""); UpdateProfiles(); if(m_apFlashMenuScreens[MENUSCREEN_FRONTENDSTART]) { m_apFlashMenuScreens[MENUSCREEN_FRONTENDSTART]->Invoke("Root.MainMenu.Profile.gotoProfileMenu"); ShowMenuMessage("@ui_menu_PROFILECREATED"); } } else { if(m_apFlashMenuScreens[MENUSCREEN_FRONTENDSTART]) { ShowMenuMessage("@ui_menu_PROFILEERROR"); } } } }
//######################################################################################################### void NewJournalCreator::on_buttonBox_clicked(QAbstractButton *button) { if(button->text()=="Restore Defaults"){ RestoreDefaults(); } }