public void OkDialog() { var helper = new MessageBoxHelper(this); if (rbQValue01.Checked) { Settings.QValueCutoff = 0.01f; } if (rbQValueCustom.Checked) { var qValueCutoff = double.NaN; if (!string.IsNullOrEmpty(txtQValueCustom.Text) && !helper.ValidateDecimalTextBox(txtQValueCustom, 0, 1, out qValueCutoff)) { return; } else { Settings.QValueCutoff = (float)qValueCutoff; } } Settings.YScaleFactor = IntLabeledValue.GetValue(cmbCountMultiple, Settings.YScaleFactor); Settings.TargetType = IntLabeledValue.GetValue(cmbTargetType, Settings.TargetType); Settings.ShowAtLeastN = cbShowAtLeastN.Checked; Settings.ShowSelection = cbShowSelection.Checked; Settings.ShowMean = cbShowMeanStd.Checked; Settings.ShowLegend = cbShowLegend.Checked; Settings.RepCount = tbAtLeastN.Value; Settings.FontSize = GraphFontSize.GetFontSize(cmbFontSize).PointSize; DialogResult = DialogResult.OK; }
private void AreaCvToolbarSettings_Load(object sender, EventArgs e) { var enabled = _graphSummary.DocumentUIContainer.DocumentUI.Settings.PeptideSettings.Integration.PeakScoringModel.IsTrained && AreaGraphController.PointsType == PointsTypePeakArea.targets; if (enabled) { textQValueCutoff.Text = ValueOrEmpty(Settings.Default.AreaCVQValueCutoff); } textCvCutoff.Text = Settings.Default.AreaCVCVCutoff.ToString(LocalizationHelper.CurrentCulture); checkShowCvCutoff.Checked = Settings.Default.AreaCVShowCVCutoff; checkShowMedian.Checked = Settings.Default.AreaCVShowMedianCV; checkBoxDecimalCvs.Checked = _showDecimals = Settings.Default.AreaCVShowDecimals; labelMaxCvPercent.Visible = labelCvCutoffPercent.Visible = !Settings.Default.AreaCVShowDecimals; textMaxFrequency.Text = ValueOrEmpty(Settings.Default.AreaCVMaxFrequency); textMaximumCv.Text = ValueOrEmpty(Settings.Default.AreaCVMaxCV); textMinLog10.Text = ValueOrEmpty(Settings.Default.AreaCVMinLog10Area); textMaxLog10.Text = ValueOrEmpty(Settings.Default.AreaCVMaxLog10Area); GraphFontSize.PopulateCombo(comboFontSize, Settings.Default.AreaFontSize); var is2DHistogram = _graphSummary.Type == GraphTypeSummary.histogram2d; textMinLog10.Visible = textMaxLog10.Visible = labelMinLog10.Visible = labelMaxLog10.Visible = is2DHistogram; textMaxFrequency.Visible = labelMaxFrequency.Visible = !is2DHistogram; if (is2DHistogram) { textMinLog10.Location = new Point(textMaxFrequency.Location.X, textMinLog10.Location.Y); textMaxLog10.Location = new Point(textMaxFrequency.Location.X, textMaxLog10.Location.Y); labelMinLog10.Location = new Point(labelMaxFrequency.Location.X, labelMinLog10.Location.Y); labelMaxLog10.Location = new Point(labelMaxFrequency.Location.X, labelMaxLog10.Location.Y); } }
private void DetectionToolbarProperties_Load(object sender, EventArgs e) { IntLabeledValue.PopulateCombo(cmbTargetType, Settings.TargetType); IntLabeledValue.PopulateCombo(cmbCountMultiple, Settings.YScaleFactor); txtQValueCustom.Text = Settings.QValueCutoff.ToString(LocalizationHelper.CurrentCulture); switch (Settings.QValueCutoff) { case 0.01f: rbQValue01.Select(); break; default: rbQValueCustom.Select(); break; } cbShowAtLeastN.Checked = Settings.ShowAtLeastN; cbShowSelection.Checked = Settings.ShowSelection; cbShowMeanStd.Checked = Settings.ShowMean; cbShowLegend.Checked = Settings.ShowLegend; GraphFontSize.PopulateCombo(cmbFontSize, Settings.FontSize); if (_graphSummary.DocumentUIContainer.DocumentUI.IsLoaded && _graphSummary.DocumentUIContainer.DocumentUI.MeasuredResults.Chromatograms.Count > 0) { tbAtLeastN.Maximum = _graphSummary.DocumentUIContainer.DocumentUI.MeasuredResults.Chromatograms.Count; if (Settings.RepCount < tbAtLeastN.Maximum && Settings.RepCount > tbAtLeastN.Minimum) { tbAtLeastN.Value = Settings.RepCount; } else { tbAtLeastN.Value = tbAtLeastN.Maximum / 2; } } cmbTargetType.Focus(); }
private void btnOk_Click(object sender, EventArgs e) { var helper = new MessageBoxHelper(this); var is2DHistogram = _graphSummary.Type == GraphTypeSummary.histogram2d; double qvalue = double.NaN; if (!string.IsNullOrWhiteSpace(textQValueCutoff.Text) && !helper.ValidateDecimalTextBox(textQValueCutoff, 0.0, 1.0, out qvalue)) { return; } double cvCutoff; if (!helper.ValidateDecimalTextBox(textCvCutoff, 0, null, out cvCutoff)) { return; } var maxFrequency = double.NaN; if (!is2DHistogram) { if (!string.IsNullOrEmpty(textMaxFrequency.Text) && !helper.ValidateDecimalTextBox(textMaxFrequency, 0, null, out maxFrequency)) { return; } } var maxCV = double.NaN; if (!string.IsNullOrEmpty(textMaximumCv.Text) && !helper.ValidateDecimalTextBox(textMaximumCv, 0, null, out maxCV)) { return; } var minLog10Area = double.NaN; var maxLog10Area = double.NaN; if (is2DHistogram) { if (!string.IsNullOrEmpty(textMinLog10.Text) && !helper.ValidateDecimalTextBox(textMinLog10, 0, null, out minLog10Area)) { return; } if (!string.IsNullOrEmpty(textMaxLog10.Text) && !helper.ValidateDecimalTextBox(textMaxLog10, 0, null, out maxLog10Area)) { return; } if (!double.IsNaN(minLog10Area) && !double.IsNaN(maxLog10Area) && minLog10Area >= maxLog10Area) { MessageDlg.Show(this, Resources.AreaCVToolbarProperties_btnOk_Click_The_maximum_log10_area_has_to_be_greater_than_the_minimum_log10_area); return; } } Settings.Default.AreaCVQValueCutoff = qvalue; Settings.Default.AreaCVCVCutoff = cvCutoff; Settings.Default.AreaCVShowCVCutoff = checkShowCvCutoff.Checked; Settings.Default.AreaCVShowMedianCV = checkShowMedian.Checked; var previous = Settings.Default.AreaCVShowDecimals; Settings.Default.AreaCVShowDecimals = checkBoxDecimalCvs.Checked; if (!previous && Settings.Default.AreaCVShowDecimals) { Settings.Default.AreaCVHistogramBinWidth *= 0.01; } else if (previous && !Settings.Default.AreaCVShowDecimals) { Settings.Default.AreaCVHistogramBinWidth *= 100.0; } if (is2DHistogram) { Settings.Default.AreaCVMinLog10Area = minLog10Area; Settings.Default.AreaCVMaxLog10Area = maxLog10Area; } else { Settings.Default.AreaCVMaxFrequency = maxFrequency; } Settings.Default.AreaCVMaxCV = maxCV; Settings.Default.AreaFontSize = GraphFontSize.GetFontSize(comboFontSize).PointSize; DialogResult = DialogResult.OK; }