private void butOK_Click(object sender, System.EventArgs e) { OpenGLWinFormsControl contextTester = new OpenGLWinFormsControl(); try { if (contextTester.TaoInitializeContexts(selectedFormatNum) != selectedFormatNum) { throw new Exception(Lan.g(this, "Could not initialize pixel format ") + selectedFormatNum.ToString() + "."); } } catch (Exception ex) { MessageBox.Show(Lan.g(this, "Please choose a different pixel format, the selected pixel format will not support the 3D tooth chart on this computer: " + ex.Message)); contextTester.Dispose(); return; } contextTester.Dispose(); ComputerPref computerPref = ComputerPrefs.GetForLocalComputer(); computerPref.GraphicsUseHardware = checkHardwareAccel.Checked; computerPref.GraphicsSimple = radioSimpleChart.Checked; computerPref.GraphicsDoubleBuffering = checkDoubleBuffering.Checked; computerPref.PreferredPixelFormatNum = selectedFormatNum; ComputerPrefs.Update(computerPref); DialogResult = DialogResult.OK; }
private void FormToothChartingBig_Load(object sender, EventArgs e) { //ComputerPref computerPref=ComputerPrefs.GetForLocalComputer(); toothChart.UseHardware = ComputerPrefs.LocalComputer.GraphicsUseHardware; toothChart.PreferredPixelFormatNumber = ComputerPrefs.LocalComputer.PreferredPixelFormatNum; toothChart.SetToothNumberingNomenclature((ToothNumberingNomenclature)PrefC.GetInt(PrefName.UseInternationalToothNumbers)); //Must be last preference set, last so that all settings are caried through in the reinitialization this line triggers. if (ComputerPrefs.LocalComputer.GraphicsSimple == DrawingMode.Simple2D) { toothChart.DrawMode = DrawingMode.Simple2D; } else if (ComputerPrefs.LocalComputer.GraphicsSimple == DrawingMode.DirectX) { toothChart.DeviceFormat = new ToothChartDirectX.DirectXDeviceFormat(ComputerPrefs.LocalComputer.DirectXFormat); toothChart.DrawMode = DrawingMode.DirectX; } else { toothChart.DrawMode = DrawingMode.OpenGL; } //The preferred pixel format number changes to the selected pixel format number after a context is chosen. ComputerPrefs.LocalComputer.PreferredPixelFormatNum = toothChart.PreferredPixelFormatNumber; ComputerPrefs.Update(ComputerPrefs.LocalComputer); FillToothChart(); //toothChart.Refresh(); }
private void butOK_Click(object sender, System.EventArgs e) { if (textScanDocQuality.errorProvider1.GetError(textScanDocQuality) != "" || textScanDocResolution.errorProvider1.GetError(textScanDocResolution) != "") { MessageBox.Show(Lan.g(this, "Please fix data entry errors first.")); return; } ComputerPrefs.LocalComputer.ScanDocSelectSource = checkScanDocSelectSource.Checked; ComputerPrefs.LocalComputer.ScanDocShowOptions = radioScanDocShowOptions.Checked; ComputerPrefs.LocalComputer.ScanDocDuplex = checkScanDocDuplex.Checked; ComputerPrefs.LocalComputer.ScanDocGrayscale = checkScanDocGrayscale.Checked; ComputerPrefs.LocalComputer.ScanDocResolution = PIn.Int(textScanDocResolution.Text); ComputerPrefs.LocalComputer.ScanDocQuality = PIn.Byte(textScanDocQuality.Text); //Prefs.UpdateLong(PrefName.ScannerCompression,PIn.Long(textScanDocQuality.Text)); Prefs.UpdateLong(PrefName.ImageWindowingMin, slider.MinVal); Prefs.UpdateLong(PrefName.ImageWindowingMax, slider.MaxVal); //Prefs.UpdateBool(PrefName.ScannerSuppressDialog,checkScanDocShowOptions.Checked); //Prefs.UpdateLong(PrefName.ScannerResolution,PIn.Long(textScanDocResolution.Text)); ComputerPrefs.LocalComputer.SensorType = comboType.Text; ComputerPrefs.LocalComputer.SensorPort = (int)upDownPort.Value; ComputerPrefs.LocalComputer.SensorExposure = (int)upDownExposure.Value; ComputerPrefs.LocalComputer.SensorBinned = checkBinned.Checked; ComputerPrefs.Update(ComputerPrefs.LocalComputer); DataValid.SetInvalid(InvalidType.Prefs); DialogResult = DialogResult.OK; }
private void butOK_Click(object sender, EventArgs e) { if (validNumX.errorProvider1.GetError(validNumX) != "" | validNumY.errorProvider1.GetError(validNumY) != "") { MessageBox.Show(Lan.g(this, "Please fix data entry errors first.")); return; } if (FormOpenDental.IsDashboardVisible && checkTaskListAlwaysShow.Checked && !checkBoxTaskKeepListHidden.Checked && radioRight.Checked) { MsgBox.Show(this, "Tasks cannot be docked to the right when Dashboards are in use."); return; } bool changed = false; if (Prefs.UpdateBool(PrefName.TaskListAlwaysShowsAtBottom, checkTaskListAlwaysShow.Checked) | Prefs.UpdateBool(PrefName.TasksUseRepeating, checkShowLegacyRepeatingTasks.Checked) | Prefs.UpdateBool(PrefName.TasksNewTrackedByUser, checkTasksNewTrackedByUser.Checked) | Prefs.UpdateBool(PrefName.TasksShowOpenTickets, checkShowOpenTickets.Checked) | Prefs.UpdateBool(PrefName.TaskSortApptDateTime, checkTaskSortApptDateTime.Checked) | Prefs.UpdateInt(PrefName.TasksGlobalFilterType, (int)comboGlobalFilter.GetSelected <GlobalTaskFilterType>()) ) { changed = true; } if (ComputerPrefs.LocalComputer.TaskKeepListHidden != checkBoxTaskKeepListHidden.Checked) { ComputerPrefs.LocalComputer.TaskKeepListHidden = checkBoxTaskKeepListHidden.Checked; changed = true; //needed to trigger screen refresh } if (radioBottom.Checked && ComputerPrefs.LocalComputer.TaskDock != 0) { ComputerPrefs.LocalComputer.TaskDock = 0; changed = true; } else if (!radioBottom.Checked && ComputerPrefs.LocalComputer.TaskDock != 1) { ComputerPrefs.LocalComputer.TaskDock = 1; changed = true; } if (ComputerPrefs.LocalComputer.TaskX != PIn.Int(validNumX.Text)) { ComputerPrefs.LocalComputer.TaskX = PIn.Int(validNumX.Text); changed = true; } if (ComputerPrefs.LocalComputer.TaskY != PIn.Int(validNumY.Text)) { ComputerPrefs.LocalComputer.TaskY = PIn.Int(validNumY.Text); changed = true; } if (changed) { DataValid.SetInvalid(InvalidType.Prefs, InvalidType.Computers); ComputerPrefs.Update(ComputerPrefs.LocalComputer); } DialogResult = DialogResult.OK; }
/* * ///<summary>Returns true if the given path is part of the image paths stored in the database list, false otherwise.</summary> * public static bool IsImagePath(string path){ * string imagePaths=PrefC.GetString(PrefName.DocPath"); * return IsImagePath(path,imagePaths); * }*/ private void butOK_Click(object sender, System.EventArgs e) { //remember that user might be using a website or a linux box to store images, therefore must allow forward slashes. if (radioUseFolder.Checked) { if (textLocalPath.Text != "") { if (ImageStore.GetValidPathFromString(textLocalPath.Text) == null) { MsgBox.Show(this, "The path override for this computer is invalid. The folder must exist and must contain all 26 A through Z folders."); return; } } else if (textServerPath.Text != "") { if (ImageStore.GetValidPathFromString(textServerPath.Text) == null) { MsgBox.Show(this, "The path override for this server is invalid. The folder must exist and must contain all 26 A through Z folders."); return; } } else { if (ImageStore.GetValidPathFromString(textDocPath.Text) == null) { MsgBox.Show(this, "The path is invalid. The folder must exist and must contain all 26 A through Z folders."); return; } } } if (Prefs.UpdateBool(PrefName.AtoZfolderUsed, radioUseFolder.Checked) | Prefs.UpdateString(PrefName.DocPath, textDocPath.Text) | Prefs.UpdateString(PrefName.ExportPath, textExportPath.Text) | Prefs.UpdateString(PrefName.LetterMergePath, textLetterMergePath.Text)) { DataValid.SetInvalid(InvalidType.Prefs); } if (ImageStore.LocalAtoZpath != textLocalPath.Text) //if local path changed { ImageStore.LocalAtoZpath = textLocalPath.Text; //ComputerPref compPref=ComputerPrefs.GetForLocalComputer(); ComputerPrefs.LocalComputer.AtoZpath = ImageStore.LocalAtoZpath; ComputerPrefs.Update(ComputerPrefs.LocalComputer); } if (ReplicationServers.GetAtoZpath() != textServerPath.Text) { ReplicationServer server = ReplicationServers.GetForLocalComputer(); server.AtoZpath = textServerPath.Text; ReplicationServers.Update(server); DataValid.SetInvalid(InvalidType.ReplicationServers); } DialogResult = DialogResult.OK; }
private void butOK_Click(object sender, EventArgs e) { if (validNumX.errorProvider1.GetError(validNumX) != "" | validNumY.errorProvider1.GetError(validNumY) != "") { MessageBox.Show(Lan.g(this, "Please fix data entry errors first.")); return; } bool changed = false; if (Prefs.UpdateBool(PrefName.TaskListAlwaysShowsAtBottom, checkTaskListAlwaysShow.Checked) | Prefs.UpdateBool(PrefName.TasksUseRepeating, checkShowLegacyRepeatingTasks.Checked) | Prefs.UpdateBool(PrefName.TasksNewTrackedByUser, checkTasksNewTrackedByUser.Checked) | Prefs.UpdateBool(PrefName.TasksShowOpenTickets, checkShowOpenTickets.Checked) | Prefs.UpdateBool(PrefName.TaskSortApptDateTime, checkTaskSortApptDateTime.Checked) ) { changed = true; } if (ComputerPrefs.LocalComputer.TaskKeepListHidden != checkBoxTaskKeepListHidden.Checked) { ComputerPrefs.LocalComputer.TaskKeepListHidden = checkBoxTaskKeepListHidden.Checked; changed = true; //needed to trigger screen refresh } if (radioBottom.Checked && ComputerPrefs.LocalComputer.TaskDock != 0) { ComputerPrefs.LocalComputer.TaskDock = 0; changed = true; } else if (!radioBottom.Checked && ComputerPrefs.LocalComputer.TaskDock != 1) { ComputerPrefs.LocalComputer.TaskDock = 1; changed = true; } if (ComputerPrefs.LocalComputer.TaskX != PIn.Int(validNumX.Text)) { ComputerPrefs.LocalComputer.TaskX = PIn.Int(validNumX.Text); changed = true; } if (ComputerPrefs.LocalComputer.TaskY != PIn.Int(validNumY.Text)) { ComputerPrefs.LocalComputer.TaskY = PIn.Int(validNumY.Text); changed = true; } if (changed) { DataValid.SetInvalid(InvalidType.Prefs, InvalidType.Computers); ComputerPrefs.Update(ComputerPrefs.LocalComputer); } DialogResult = DialogResult.OK; }
private void FormToothChartingBig_Load(object sender, EventArgs e) { ComputerPref computerPref = ComputerPrefs.GetForLocalComputer(); toothChart.UseHardware = computerPref.GraphicsUseHardware; toothChart.PreferredPixelFormatNumber = computerPref.PreferredPixelFormatNum; toothChart.SimpleMode = computerPref.GraphicsSimple; //Must be last preference set, last so that all //settings are caried through in the reinitialization //this line triggers. //The preferred pixel format number changes to the selected pixel format number after a context is chosen. computerPref.PreferredPixelFormatNum = toothChart.PreferredPixelFormatNumber; ComputerPrefs.Update(computerPref); FillToothChart(); //toothChart.Refresh(); }
private void butOK_Click(object sender, System.EventArgs e) { if (textDoc.errorProvider1.GetError(textDoc) != "") { MessageBox.Show(Lan.g(this, "Please fix data entry errors first.")); return; } Prefs.UpdateInt("ScannerCompression", PIn.PInt(textDoc.Text)); Prefs.UpdateInt("ImageWindowingMin", slider.MinVal); Prefs.UpdateInt("ImageWindowingMax", slider.MaxVal); computerPrefs.SensorType = comboType.Text; computerPrefs.SensorPort = (int)upDownPort.Value; computerPrefs.SensorExposure = (int)upDownExposure.Value; computerPrefs.SensorBinned = checkBinned.Checked; ComputerPrefs.Update(computerPrefs); DataValid.SetInvalid(InvalidTypes.Prefs); DialogResult = DialogResult.OK; }
private void butOK_Click(object sender, System.EventArgs e) { //ComputerPrefCur doesn't change until here, so make the old copy exactly when we need it instead of when the form is created. ComputerPref computerPrefOld = ComputerPrefCur.Copy(); //ComputerPref computerPref=ComputerPrefs.GetForLocalComputer(); if (radioDirectXChart.Checked) { if (!_isRemoteEdit && !TestDirectXFormat(this, selectedDirectXFormat)) { MessageBox.Show(Lan.g(this, "Please choose a different device format, " + "the selected device format will not support the DirectX 3D tooth chart on this computer")); return; } ComputerPrefCur.GraphicsSimple = DrawingMode.DirectX; ComputerPrefCur.DirectXFormat = selectedDirectXFormat; } else if (radioSimpleChart.Checked) { ComputerPrefCur.GraphicsSimple = DrawingMode.Simple2D; } else //OpenGL { OpenGLWinFormsControl contextTester = new OpenGLWinFormsControl(); try { if (!_isRemoteEdit && contextTester.TaoInitializeContexts(selectedFormatNum) != selectedFormatNum) { throw new Exception(Lan.g(this, "Could not initialize pixel format ") + selectedFormatNum.ToString() + "."); } } catch (Exception ex) { MessageBox.Show(Lan.g(this, "Please choose a different pixel format, the selected pixel format will not support the 3D tooth chart on this computer: " + ex.Message)); contextTester.Dispose(); return; } contextTester.Dispose(); ComputerPrefCur.GraphicsUseHardware = checkHardwareAccel.Checked; ComputerPrefCur.GraphicsDoubleBuffering = checkDoubleBuffering.Checked; ComputerPrefCur.PreferredPixelFormatNum = selectedFormatNum; ComputerPrefCur.GraphicsSimple = DrawingMode.OpenGL; } ComputerPrefs.Update(ComputerPrefCur, computerPrefOld); DialogResult = DialogResult.OK; }
private void butOK_Click(object sender, EventArgs e) { if (comboLanguageAndRegion.SelectedIndex == -1) { MsgBox.Show(this, "Select a language and region."); return; } if (Security.IsAuthorized(Permissions.Setup, true)) { //_cultureCur=_listAllCultures[comboLanguageAndRegion.SelectedIndex]; if (Prefs.UpdateString(PrefName.LanguageAndRegion, _listAllCultures[comboLanguageAndRegion.SelectedIndex].Name)) { MsgBox.Show(this, "Program must be restarted for changes to take full effect."); } ComputerPrefs.LocalComputer.NoShowLanguage = checkNoShow.Checked; ComputerPrefs.Update(ComputerPrefs.LocalComputer); } DialogResult = DialogResult.OK; }
private void butOK_Click(object sender, System.EventArgs e) { if (textScanDocQuality.errorProvider1.GetError(textScanDocQuality) != "" || textScanDocResolution.errorProvider1.GetError(textScanDocResolution) != "") { MessageBox.Show(Lan.g(this, "Please fix data entry errors first.")); return; } if (textScanDocQuality.Text == "100" || (radioScanDocUseOptionsBelow.Checked && PIn.Int(textScanDocResolution.Text) > 300)) { if (!MsgBox.Show(this, MsgBoxButtons.YesNo, "With the provided settings the file created may be extremely large. Would you like to continue?")) { return; } } ComputerPrefs.LocalComputer.ScanDocSelectSource = checkScanDocSelectSource.Checked; ComputerPrefs.LocalComputer.ScanDocShowOptions = radioScanDocShowOptions.Checked; ComputerPrefs.LocalComputer.ScanDocDuplex = checkScanDocDuplex.Checked; ComputerPrefs.LocalComputer.ScanDocGrayscale = checkScanDocGrayscale.Checked; ComputerPrefs.LocalComputer.ScanDocResolution = PIn.Int(textScanDocResolution.Text); ComputerPrefs.LocalComputer.ScanDocQuality = PIn.Byte(textScanDocQuality.Text); //Prefs.UpdateLong(PrefName.ScannerCompression,PIn.Long(textScanDocQuality.Text)); Prefs.UpdateLong(PrefName.ImageWindowingMin, slider.MinVal); Prefs.UpdateLong(PrefName.ImageWindowingMax, slider.MaxVal); //Prefs.UpdateBool(PrefName.ScannerSuppressDialog,checkScanDocShowOptions.Checked); //Prefs.UpdateLong(PrefName.ScannerResolution,PIn.Long(textScanDocResolution.Text)); ComputerPrefs.LocalComputer.SensorType = comboType.Text; ComputerPrefs.LocalComputer.SensorPort = (int)upDownPort.Value; ComputerPrefs.LocalComputer.SensorExposure = (int)upDownExposure.Value; ComputerPrefs.LocalComputer.SensorBinned = checkBinned.Checked; ComputerPrefs.Update(ComputerPrefs.LocalComputer); DataValid.SetInvalid(InvalidType.Prefs); if (_scanDocSelectSourceOld != checkScanDocSelectSource.Checked) { SecurityLogs.MakeLogEntry(Permissions.Setup, 0 , Lan.g(this, "Show Select Scanner Window option changed from") + " " + (_scanDocSelectSourceOld?Lan.g(this, "true"):Lan.g(this, "false")) + " " + Lan.g(this, "to") + " " + (checkScanDocSelectSource.Checked?Lan.g(this, "true"):Lan.g(this, "false"))); } DialogResult = DialogResult.OK; }
private void butOK_Click(object sender, System.EventArgs e) { if (textDoc.errorProvider1.GetError(textDoc) != "" || textScanningResolution.errorProvider1.GetError(textScanningResolution) != "") { MessageBox.Show(Lan.g(this, "Please fix data entry errors first.")); return; } Prefs.UpdateLong(PrefName.ScannerCompression, PIn.Long(textDoc.Text)); Prefs.UpdateLong(PrefName.ImageWindowingMin, slider.MinVal); Prefs.UpdateLong(PrefName.ImageWindowingMax, slider.MaxVal); Prefs.UpdateBool(PrefName.ScannerSuppressDialog, checkBoxSuppressScanDialog.Checked); Prefs.UpdateLong(PrefName.ScannerResolution, PIn.Long(textScanningResolution.Text)); ComputerPrefs.LocalComputer.SensorType = comboType.Text; ComputerPrefs.LocalComputer.SensorPort = (int)upDownPort.Value; ComputerPrefs.LocalComputer.SensorExposure = (int)upDownExposure.Value; ComputerPrefs.LocalComputer.SensorBinned = checkBinned.Checked; ComputerPrefs.Update(ComputerPrefs.LocalComputer); DataValid.SetInvalid(InvalidType.Prefs); DialogResult = DialogResult.OK; }
private void butOK_Click(object sender, System.EventArgs e) { if (validNumX.errorProvider1.GetError(validNumX) != "" | validNumY.errorProvider1.GetError(validNumY) != "") { MessageBox.Show(Lan.g(this, "Please fix data entry errors first.")); return; } bool changed = false; if (Prefs.UpdateString(PrefName.MainWindowTitle, textMainWindowTitle.Text) | Prefs.UpdateLong(PrefName.ShowIDinTitleBar, comboShowID.SelectedIndex) | Prefs.UpdateBool(PrefName.TaskListAlwaysShowsAtBottom, checkTaskListAlwaysShow.Checked) | Prefs.UpdateBool(PrefName.TasksCheckOnStartup, checkTasksCheckOnStartup.Checked) | Prefs.UpdateBool(PrefName.TasksNewTrackedByUser, checkTasksNewTrackedByUser.Checked) | Prefs.UpdateBool(PrefName.TasksShowOpenTickets, checkShowOpenTickets.Checked) | Prefs.UpdateBool(PrefName.TitleBarShowSite, checkTitleBarShowSite.Checked) | Prefs.UpdateString(PrefName.WebServiceServerName, textWebServiceServerName.Text) | Prefs.UpdateBool(PrefName.ReportsPPOwriteoffDefaultToProcDate, checkReportsProcDate.Checked) | Prefs.UpdateBool(PrefName.ReportsShowPatNum, checkReportsShowPatNum.Checked) | Prefs.UpdateBool(PrefName.ReportPandIschedProdSubtractsWO, checkReportProdWO.Checked) ) { changed = true; } //task list------------------------------------------------------------------------------------------ if (ComputerPrefs.LocalComputer.TaskKeepListHidden != checkBoxTaskKeepListHidden.Checked) { ComputerPrefs.LocalComputer.TaskKeepListHidden = checkBoxTaskKeepListHidden.Checked; changed = true; //needed to trigger screen refresh } if (radioBottom.Checked && ComputerPrefs.LocalComputer.TaskDock != 0) { ComputerPrefs.LocalComputer.TaskDock = 0; changed = true; } else if (!radioBottom.Checked && ComputerPrefs.LocalComputer.TaskDock != 1) { ComputerPrefs.LocalComputer.TaskDock = 1; changed = true; } if (ComputerPrefs.LocalComputer.TaskX != PIn.Int(validNumX.Text)) { ComputerPrefs.LocalComputer.TaskX = PIn.Int(validNumX.Text); changed = true; } if (ComputerPrefs.LocalComputer.TaskY != PIn.Int(validNumY.Text)) { ComputerPrefs.LocalComputer.TaskY = PIn.Int(validNumY.Text); changed = true; } //end of tasklist section----------------------------------------------------------------------------- if (textSigInterval.Text == "") { if (Prefs.UpdateLong(PrefName.ProcessSigsIntervalInSecs, 0)) { changed = true; } } else { if (Prefs.UpdateLong(PrefName.ProcessSigsIntervalInSecs, PIn.Long(textSigInterval.Text))) { changed = true; } } if (changed) { DataValid.SetInvalid(InvalidType.Prefs, InvalidType.Computers); ComputerPrefs.Update(ComputerPrefs.LocalComputer); } DialogResult = DialogResult.OK; }
private void butOK_Click(object sender, EventArgs e) { ComputerPrefs.LocalComputer.NoShowDecimal = checkNoShow.Checked; ComputerPrefs.Update(ComputerPrefs.LocalComputer); DialogResult = DialogResult.OK; }