void CBf1View::OnSettingsDialog() { // Create dialog object CSettingsDialog aDlg; // Set data members // emg aDlg.emg_channel = emg_chan; aDlg.emg_sens = emg_sens; aDlg.emg_samp_period = emg_samp_period; // bayesian filter ba_filt.GetSettings(aDlg.bayes_thresh,aDlg.bayes_max, aDlg.bayes_switch,aDlg.bayes_drift); // vibration aDlg.vib_com = vib_com; aDlg.vib_bay_max0 = vib_bay_max0; aDlg.vib_bay_min100 = vib_bay_min100; aDlg.vib_mean_mvc = vib_mean_mvc; aDlg.vib_mean_max0 = vib_mean_max0; aDlg.vib_mean_min100 = vib_mean_min100; // Display the dialog modal, change things if okay if(aDlg.DoModal() == IDOK) { // Close port and stop sampling if these are happening if(bBfOpenandSet) OnBfClose(); if(bSampleTimer) OnSampleStop(); // Make changes // emg emg_chan = aDlg.emg_channel; emg_sens = aDlg.emg_sens; emg_samp_period = aDlg.emg_samp_period; // bayesian filter: create a new filter ba_filt = BayesFilter(aDlg.bayes_thresh,aDlg.bayes_max, aDlg.bayes_switch,aDlg.bayes_drift); // vibration vib_com = aDlg.vib_com; vib_bay_max0 = aDlg.vib_bay_max0; vib_bay_min100 = aDlg.vib_bay_min100; vib_mean_mvc = aDlg.vib_mean_mvc; vib_mean_max0 = aDlg.vib_mean_max0; vib_mean_min100 = aDlg.vib_mean_min100; } // Update the view to show most recent values GetDocument()->UpdateAllViews(NULL); }
int ShowSettingsDialog() { ActionStatus status; RegistryKey key(HKEY_LOCAL_MACHINE, _T("SYSTEM\\CurrentControlSet\\Services\\BazisVirtualCDBus\\Parameters"), 0, true, &status); if (!key.Valid() && (status.GetErrorCode() == AccessDenied)) { TCHAR tsz[MAX_PATH + 2] = {0,}; tsz[0] = '\"'; GetModuleFileName(GetModuleHandle(0), tsz + 1, _countof(tsz) - 1); size_t len = _tcslen(tsz); tsz[len] = '\"'; tsz[len + 1] = 0; return (int)CUACInvokerDialog(tsz).DoModal(); } else { CSettingsDialog dlg; dlg.DoModal(); } return 0; }
void CFileUploaderDialog::OnSysCommand (UINT nID, LPARAM lParam) { if ((nID & 0xFFF0) == IDM_SETTINGS) { CSettingsDialog oDialog; if (IDOK == oDialog.DoModal ()) { // Set WSF/C Home s_WSFCHome = oDialog.s_WSFCHome; // Save WSF/C Home CRegKey regKey; LONG lResult; lResult = regKey.Create (HKEY_CURRENT_USER, _T("Software\\WSO2\\WeSCli\\FlickrUploader")); if (ERROR_SUCCESS == lResult) regKey.SetStringValue (_T("WSFCHome"), s_WSFCHome); } } CDialog::OnSysCommand (nID, lParam); }
// OnEditSettings() // Display settings dialog. void CEventHandlerApp::OnEditSettings() { CSettingsDialog dlgSettings; dlgSettings.DoModal(); }