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 = 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 FormGraphics_Load(object sender, EventArgs e) { gridFormats.BeginUpdate(); gridFormats.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g(this, "FormatNum"), 80); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "OpenGL"), 60); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Windowed"), 80); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Bitmapped"), 80); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Palette"), 75); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Accelerated"), 80); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Buffered"), 75); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "ColorBits"), 75); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "DepthBits"), 75); gridFormats.Columns.Add(col); gridFormats.EndUpdate(); if (Environment.OSVersion.Platform == PlatformID.Unix) //Force simple mode on Unix systems. { MsgBox.Show(this, "Linux users must use simple graphics mode."); radio3DChart.Enabled = false; group3DToothChart.Enabled = false; return; } ComputerPref computerPref = ComputerPrefs.GetForLocalComputer(); if (computerPref.GraphicsSimple) { radioSimpleChart.Checked = true; group3DToothChart.Enabled = false; } else { radio3DChart.Checked = true; } checkHardwareAccel.Checked = computerPref.GraphicsUseHardware; checkDoubleBuffering.Checked = computerPref.GraphicsDoubleBuffering; selectedFormatNum = computerPref.PreferredPixelFormatNum; textSelected.Text = selectedFormatNum.ToString(); RefreshFormats(); }
private void FormImagingSetup_Load(object sender, System.EventArgs e) { comboType.Items.Add("B"); comboType.Items.Add("D"); textDoc.Text = PrefB.GetInt("ScannerCompression").ToString(); slider.MinVal = PrefB.GetInt("ImageWindowingMin"); slider.MaxVal = PrefB.GetInt("ImageWindowingMax"); computerPrefs = ComputerPrefs.GetForLocalComputer(); upDownPort.Value = computerPrefs.SensorPort; comboType.Text = computerPrefs.SensorType; checkBinned.Checked = computerPrefs.SensorBinned; int exposureLevelVal = computerPrefs.SensorExposure; if (exposureLevelVal < (int)upDownExposure.Minimum || exposureLevelVal > (int)upDownExposure.Maximum) { exposureLevelVal = (int)upDownExposure.Minimum; //Play it safe with the default exposure. } upDownExposure.Value = exposureLevelVal; }