// (9) //============================================================================== void CMainFrame::OnFileOptions() { COptionsDialog dlg; dlg.m_nDefaulNumberOfCopies = g_TheArchive.m_nDefaultCopies; if( g_TheArchive.m_pCompressor != NULL ) { dlg.m_sCompressionUtility = g_TheArchive.m_pCompressor->m_strName; dlg.m_sCompressorPath = g_TheArchive.m_pCompressor->m_strExePath; } //------------------------------- int result = dlg.DoModal(); //------------------------------- if (result==IDOK) { g_TheArchive.m_pCompressor->m_strName = dlg.m_sCompressionUtility; g_TheArchive.m_pCompressor->m_strExePath = dlg.m_sCompressorPath; g_TheArchive.m_nDefaultCopies = dlg.m_nDefaulNumberOfCopies; g_TheArchive.saveOptions(); } }
CAviApp::Initialize(PDATA2COMPRESS_ROUTINE pRoutineAddress,LPVOID pParam) { //Stop read and send thread if(!m_htReadThread) StartCapture(); Stop(); m_pCompressRoutine = pRoutineAddress; //set pointer to compress routine m_pParent = pParam; //set sender pointer AFX_MANAGE_STATE(AfxGetStaticModuleState()); COptionsDialog * dlgOptions = new COptionsDialog(this); if(dlgOptions->DoModal()!=IDOK) { delete dlgOptions; return TRUE; } delete dlgOptions; return FALSE; }
void CMainWindow::on_actOptions_triggered(bool) { COptionsDialog *optionsDialog = new COptionsDialog(this); optionsDialog->setPlayPauseButton(settings->value("playPauseButton", Qt::Key_B).toInt()); optionsDialog->setSpeechLanguage(settings->value("speechLanguage", "fr").toString()); if(optionsDialog->exec() == QDialog::Accepted) { settings->setValue("playPauseButton", optionsDialog->getPlayPauseButton()); settings->setValue("speechLanguage", optionsDialog->getSpeechLanguage()); } delete optionsDialog; }
int CMainFrame::ShowOptions(int iPageID = -1) { COptionsPageGeneral pgGeneral; COptionsPageRendering pgRendering; COptionsPageTools pgTools; COptionsPageDirectories pgDirectories; COptionsDialog dlg; dlg.AddPage(&pgGeneral); dlg.AddPage(&pgRendering); dlg.AddPage(&pgTools); dlg.AddPage(&pgDirectories); if (iPageID == ID_OPTIONS_TOOLS) dlg.SetInitialPage(&pgTools); return dlg.DoModal(); }
Boolean CMainForm::OnGameOptions(EventPtr pEvent, Boolean& bHandled) { COptionsDialog frmPrefs; frmPrefs.DoModal(); return true; }