SpectrumViewerVisualSettings.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. namespace OINA.Extender.Testharness
  2. {
  3. using System;
  4. using System.Drawing;
  5. using System.Windows;
  6. using System.Windows.Forms;
  7. using OINA.Extender.Controls;
  8. using OINA.Extender.Controls.Styles;
  9. /// <summary>
  10. /// SpectrumViewer Visual Settings form
  11. /// </summary>
  12. public partial class SpectrumViewerVisualSettings : Form
  13. {
  14. /// <summary>
  15. /// Gets or sets the color of the included element.
  16. /// </summary>
  17. private static Color SpectrumBackgroundColor
  18. {
  19. get { return ColorConverter.Convert(SpectrumViewerStyle.SpectrumBackgroundColor); }
  20. set { SpectrumViewerStyle.SpectrumBackgroundColor = ColorConverter.Convert(value); }
  21. }
  22. /// <summary>
  23. /// Gets or sets the color of the spectrum text.
  24. /// </summary>
  25. private static Color SpectrumTextColor
  26. {
  27. get { return ColorConverter.Convert(SpectrumViewerStyle.SpectrumLabelTextColor); }
  28. set { SpectrumViewerStyle.SpectrumLabelTextColor = ColorConverter.Convert(value); }
  29. }
  30. /// <summary>
  31. /// Gets or sets the color of Axis Foreground Color.
  32. /// </summary>
  33. private static Color AxisTextColor
  34. {
  35. get { return ColorConverter.Convert(SpectrumViewerStyle.AxisTextColor); }
  36. set { SpectrumViewerStyle.AxisTextColor = ColorConverter.Convert(value); }
  37. }
  38. /// <summary>
  39. /// Gets or sets a value indicating whether axis lines are shown.
  40. /// </summary>
  41. private static bool IsAxisLinesShown
  42. {
  43. get { return SpectrumViewerStyle.IsAxisLineVisible; }
  44. set { SpectrumViewerStyle.IsAxisLineVisible = value; }
  45. }
  46. /// <summary>
  47. /// Gets or sets the color of Axis Tick Brush Color.
  48. /// </summary>
  49. private static Color AxisColor
  50. {
  51. get { return ColorConverter.Convert(SpectrumViewerStyle.AxisColor); }
  52. set { SpectrumViewerStyle.AxisColor = ColorConverter.Convert(value); }
  53. }
  54. /// <summary>
  55. /// Gets or sets the color of Spectrum Visual Fill Color.
  56. /// </summary>
  57. private static Color SpectrumVisualFillColor
  58. {
  59. get { return ColorConverter.Convert(SpectrumViewerStyle.SpectrumVisualFillColor); }
  60. set { SpectrumViewerStyle.SpectrumVisualFillColor = ColorConverter.Convert(value); }
  61. }
  62. /// <summary>
  63. /// Gets or sets the color of Spectrum Label Chrome Border Brush Color.
  64. /// </summary>
  65. private static Color PeakLabelBorderColor
  66. {
  67. get { return ColorConverter.Convert(SpectrumViewerStyle.SpectrumPeakLabelBorderColor); }
  68. set { SpectrumViewerStyle.SpectrumPeakLabelBorderColor = ColorConverter.Convert(value); }
  69. }
  70. /// <summary>
  71. /// Gets or sets the color of Spectrum Label Chrome Background Color.
  72. /// </summary>
  73. private static Color PeakLabelBackgroundColor
  74. {
  75. get { return ColorConverter.Convert(SpectrumViewerStyle.SpectrumPeakLabelBackgroundColor); }
  76. set { SpectrumViewerStyle.SpectrumPeakLabelBackgroundColor = ColorConverter.Convert(value); }
  77. }
  78. /// <summary>
  79. /// Gets or sets the color of Spectrum Label View Foreground Color.
  80. /// </summary>
  81. private static Color PeakLabelTextColor
  82. {
  83. get { return ColorConverter.Convert(SpectrumViewerStyle.SpectrumPeakLabelTextColor); }
  84. set { SpectrumViewerStyle.SpectrumPeakLabelTextColor = ColorConverter.Convert(value); }
  85. }
  86. /// <summary>
  87. /// Gets or sets the color of Main Spectrum Label BackgroundColor.
  88. /// </summary>
  89. private static Color AlternatePeakLabelBackgroundColor
  90. {
  91. get { return ColorConverter.Convert(SpectrumViewerStyle.AlternatePeakLabelBackground); }
  92. set { SpectrumViewerStyle.AlternatePeakLabelBackground = ColorConverter.Convert(value); }
  93. }
  94. /// <summary>
  95. /// Gets or sets the color of Main Spectrum Label ForegroundColor.
  96. /// </summary>
  97. private static Color AlternatePeakLabelTextColor
  98. {
  99. get { return ColorConverter.Convert(SpectrumViewerStyle.AlternatePeakLabelTextColor); }
  100. set { SpectrumViewerStyle.AlternatePeakLabelTextColor = ColorConverter.Convert(value); }
  101. }
  102. /// <summary>
  103. /// Gets or sets the color of the quant results background.
  104. /// </summary>
  105. private static Color QuantResultsBackgroundColor
  106. {
  107. get { return ColorConverter.Convert(SpectrumViewerStyle.QuantResultsBackgroundColor); }
  108. set { SpectrumViewerStyle.QuantResultsBackgroundColor = ColorConverter.Convert(value); }
  109. }
  110. /// <summary>
  111. /// Gets or sets a value indicating whether the quant results is shown.
  112. /// </summary>
  113. private static bool ShowQuantResults
  114. {
  115. get { return SpectrumViewerStyle.ShowQuantResults; }
  116. set { SpectrumViewerStyle.ShowQuantResults = value; }
  117. }
  118. /// <summary>
  119. /// Initializes a new instance of the <see cref="SpectrumViewerVisualSettings"/> class.
  120. /// </summary>
  121. public SpectrumViewerVisualSettings()
  122. {
  123. this.InitializeComponent();
  124. this.InitializeComboBoxes();
  125. this.UpdateCombos();
  126. this.UpdatePanels();
  127. // *** Wire up events here manually or they all get fired when the combos are set with their initial values
  128. this.cbSpectrumBackgroundColor.SelectedValueChanged += this.CbSpectrumBackgroundColor_SelectedValueChanged;
  129. this.cbSpectrumTextColor.SelectedValueChanged += this.CbSpectrumForegroundColor_SelectedValueChanged;
  130. this.cbSpectrumVisualFillColor.SelectedValueChanged += this.CbSpectrumVisualFillColor_SelectedValueChanged;
  131. this.cbPeakLabelBorderColor.SelectedValueChanged += this.CbSpectrumLabelChromeBoderBrushColor_SelectedValueChanged;
  132. this.cbPeakLabelBackgroundColor.SelectedValueChanged += this.CbSpectrumLabelChromeBackgroundColor_SelectedValueChanged;
  133. this.cbPeakLabelTextColor.SelectedValueChanged += this.CbSpectrumLabelViewForegroundColor_SelectedValueChanged;
  134. this.cbAlternatePeakLabelBackgroundColor.SelectedValueChanged += this.CbAlternatePeakLabelBackgroundColor_SelectedValueChanged;
  135. this.cbAlternatePeakLabelTextColor.SelectedValueChanged += this.CbAlternatePeakLabelTextColor_SelectedValueChanged;
  136. this.cbAxisMinorTickLength.SelectedValueChanged += this.CbAxisMinorTickLength_SelectedValueChanged;
  137. this.cbAxisMajorThickLength.SelectedValueChanged += this.CbAxisMajorThickLength_SelectedValueChanged;
  138. this.cbAxisFontSize.SelectedValueChanged += this.CbAxisFontSize_SelectedValueChanged;
  139. this.cbAxisLabelMargin.SelectedValueChanged += this.CbAxisLabelMargin_SelectedValueChanged;
  140. this.cbAxisLineThickness.SelectedValueChanged += this.CbAxisLineThickness_SelectedValueChanged;
  141. this.cbAxisSubMinorTickLength.SelectedValueChanged += this.CbAxisSubMinorTickLength_SelectedValueChanged;
  142. this.cbAxisColor.SelectedValueChanged += this.CbAxisTickBrushColor_SelectedValueChanged;
  143. this.cbShowAxisLines.CheckedChanged += this.CbShowAxisLines_CheckedChanged;
  144. this.cbAxisTextColor.SelectedValueChanged += this.CbAxisForegroundColor_SelectedValueChanged;
  145. this.cbQuantResultsBackgroundColor.SelectedValueChanged += this.CbQuantResultsBackgroundColor_SelectedValueChanged;
  146. this.cbQuantResultsBackgroundOpacity.SelectedValueChanged += this.CbQuantResultsBackgroundOpacity_SelectedValueChanged;
  147. this.cbQuantResultsFormat.SelectedValueChanged += this.CbQuantResultsFormat_SelectedValueChanged;
  148. this.cbQuantResultsCategory.SelectedValueChanged += this.CbQuantResultsCategory_SelectedValueChanged;
  149. this.cbShowQuantResults.CheckedChanged += this.CbShowQuantResults_CheckedChanged;
  150. }
  151. /// <summary>
  152. /// Update combo boxs
  153. /// </summary>
  154. public void InitializeComboBoxes()
  155. {
  156. this.cbSpectrumBackgroundColor.DataSource = ColorConverter.GetSystemDrawingColors();
  157. this.cbSpectrumTextColor.DataSource = ColorConverter.GetSystemDrawingColors();
  158. this.cbSpectrumVisualFillColor.DataSource = ColorConverter.GetSystemDrawingColors();
  159. this.cbPeakLabelBorderColor.DataSource = ColorConverter.GetSystemDrawingColors();
  160. this.cbPeakLabelBackgroundColor.DataSource = ColorConverter.GetSystemDrawingColors();
  161. this.cbPeakLabelTextColor.DataSource = ColorConverter.GetSystemDrawingColors();
  162. this.cbAlternatePeakLabelBackgroundColor.DataSource = ColorConverter.GetSystemDrawingColors();
  163. this.cbAlternatePeakLabelTextColor.DataSource = ColorConverter.GetSystemDrawingColors();
  164. this.cbAxisTextColor.DataSource = ColorConverter.GetSystemDrawingColors();
  165. this.cbAxisColor.DataSource = ColorConverter.GetSystemDrawingColors();
  166. this.cbAxisFontSize.DataSource = new[] { 8d, 10d, 12d, 14d, 16d };
  167. this.cbAxisLabelMargin.DataSource = new[] { new Thickness(1, 0, 1, 0), new Thickness(2, 0, 2, 0), new Thickness(3, 0, 3, 0) };
  168. this.cbAxisMajorThickLength.DataSource = new[] { 4d, 6d, 8d };
  169. this.cbAxisLineThickness.DataSource = new[] { 0.5d, 1d, 2d };
  170. this.cbAxisSubMinorTickLength.DataSource = new[] { 1d, 3d, 5d };
  171. this.cbAxisMinorTickLength.DataSource = new[] { 3d, 4.5d, 6d };
  172. this.cbShowAxisLines.Checked = IsAxisLinesShown;
  173. this.cbQuantResultsBackgroundColor.DataSource = ColorConverter.GetSystemDrawingColors();
  174. this.cbQuantResultsBackgroundOpacity.DataSource = new[] { 0.25, 0.5, 0.75, 1.0 };
  175. this.cbQuantResultsFormat.DataSource = new[] { QuantResultFormat.Table, QuantResultFormat.Histogram };
  176. this.cbQuantResultsCategory.DataSource = new[] { QuantResultCategory.WeightPercent, QuantResultCategory.AtomicPercent, QuantResultCategory.OxidePercent };
  177. this.cbShowQuantResults.Checked = ShowQuantResults;
  178. }
  179. /// <summary>
  180. /// Updates the colour panels
  181. /// </summary>
  182. private void UpdatePanels()
  183. {
  184. this.spectrumBackgroundColorPanel.BackColor = SpectrumBackgroundColor;
  185. this.spectrumTextColorPanel.BackColor = SpectrumTextColor;
  186. this.axisForegroundColorPanel.BackColor = AxisTextColor;
  187. this.axisTickBrushColorPanel.BackColor = AxisColor;
  188. this.spectrumVisualFillColorPanel.BackColor = SpectrumVisualFillColor;
  189. this.spectrumLabelChromeBorderBrushColorPanel.BackColor = PeakLabelBorderColor;
  190. this.spectrumLabelChromeBackgroundColorPanel.BackColor = PeakLabelBackgroundColor;
  191. this.spectrumLabelViewForegroundColorPanel.BackColor = PeakLabelTextColor;
  192. this.alternatePeakLabelBackgroundColorPanel.BackColor = AlternatePeakLabelBackgroundColor;
  193. this.alternatePeakLabelTextColorPanel.BackColor = AlternatePeakLabelTextColor;
  194. this.quantResultsBackgroundColorPanel.BackColor = QuantResultsBackgroundColor;
  195. }
  196. /// <summary>
  197. /// Updates the combos to the set values
  198. /// </summary>
  199. private void UpdateCombos()
  200. {
  201. ColorConverter.PickColourComboItem(this.cbSpectrumBackgroundColor, SpectrumBackgroundColor);
  202. ColorConverter.PickColourComboItem(this.cbSpectrumTextColor, SpectrumTextColor);
  203. ColorConverter.PickColourComboItem(this.cbSpectrumVisualFillColor, SpectrumVisualFillColor);
  204. ColorConverter.PickColourComboItem(this.cbPeakLabelBorderColor, PeakLabelBorderColor);
  205. ColorConverter.PickColourComboItem(this.cbPeakLabelBackgroundColor, PeakLabelBackgroundColor);
  206. ColorConverter.PickColourComboItem(this.cbPeakLabelTextColor, PeakLabelTextColor);
  207. ColorConverter.PickColourComboItem(this.cbAlternatePeakLabelBackgroundColor, AlternatePeakLabelBackgroundColor);
  208. ColorConverter.PickColourComboItem(this.cbAlternatePeakLabelTextColor, AlternatePeakLabelTextColor);
  209. ColorConverter.PickColourComboItem(this.cbAxisTextColor, AxisTextColor);
  210. ColorConverter.PickColourComboItem(this.cbAxisColor, AxisColor);
  211. ColorConverter.PickColourComboItem(this.cbQuantResultsBackgroundColor, QuantResultsBackgroundColor);
  212. this.cbAxisMajorThickLength.SelectedItem = SpectrumViewerStyle.AxisMajorTickLength;
  213. this.cbAxisMinorTickLength.SelectedItem = SpectrumViewerStyle.AxisMinorTickLength;
  214. this.cbAxisSubMinorTickLength.SelectedItem = SpectrumViewerStyle.AxisSubMinorTickLength;
  215. this.cbAxisFontSize.SelectedItem = SpectrumViewerStyle.AxisFontSize;
  216. this.cbAxisLabelMargin.SelectedItem = SpectrumViewerStyle.AxisLabelMargin;
  217. this.cbAxisLineThickness.SelectedItem = SpectrumViewerStyle.AxisLineThickness;
  218. this.cbShowAxisLines.Checked = SpectrumViewerStyle.IsAxisLineVisible;
  219. this.cbQuantResultsBackgroundOpacity.SelectedItem = SpectrumViewerStyle.QuantResultsBackgroundOpacity;
  220. this.cbQuantResultsFormat.SelectedItem = SpectrumViewerStyle.QuantResultsFormat;
  221. this.cbQuantResultsCategory.SelectedItem = SpectrumViewerStyle.QuantResultsCategory;
  222. this.cbShowQuantResults.Checked = SpectrumViewerStyle.ShowQuantResults;
  223. }
  224. /// <summary>
  225. /// Handles the SelectedValueChanged event of the CbSpectrumBackgroundColor control.
  226. /// </summary>
  227. /// <param name="sender">The source of the event.</param>
  228. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  229. private void CbSpectrumBackgroundColor_SelectedValueChanged(object sender, EventArgs e)
  230. {
  231. if (this.cbSpectrumBackgroundColor.SelectedValue != null)
  232. {
  233. SpectrumBackgroundColor = (Color)this.cbSpectrumBackgroundColor.SelectedValue;
  234. this.UpdatePanels();
  235. }
  236. }
  237. /// <summary>
  238. /// Handles the SelectedValueChanged event of the CbSpectrumForegroundColor control.
  239. /// </summary>
  240. /// <param name="sender">The source of the event.</param>
  241. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  242. private void CbSpectrumForegroundColor_SelectedValueChanged(object sender, EventArgs e)
  243. {
  244. if (this.cbSpectrumTextColor.SelectedValue != null)
  245. {
  246. SpectrumTextColor = (Color)this.cbSpectrumTextColor.SelectedValue;
  247. this.UpdatePanels();
  248. }
  249. }
  250. /// <summary>
  251. /// Handles the SelectedValueChanged event of the CbAxisForegroundColor control.
  252. /// </summary>
  253. /// <param name="sender">The source of the event.</param>
  254. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  255. private void CbAxisForegroundColor_SelectedValueChanged(object sender, EventArgs e)
  256. {
  257. if (this.cbAxisTextColor.SelectedValue != null)
  258. {
  259. AxisTextColor = (Color)this.cbAxisTextColor.SelectedValue;
  260. this.UpdatePanels();
  261. }
  262. }
  263. /// <summary>
  264. /// Handles the SelectedValueChanged event of the CbAxisTickBrushColor control.
  265. /// </summary>
  266. /// <param name="sender">The source of the event.</param>
  267. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  268. private void CbAxisTickBrushColor_SelectedValueChanged(object sender, EventArgs e)
  269. {
  270. if (this.cbAxisColor.SelectedValue != null)
  271. {
  272. AxisColor = (Color)this.cbAxisColor.SelectedValue;
  273. this.UpdatePanels();
  274. }
  275. }
  276. /// <summary>
  277. /// Handles the SelectedValueChanged event of the CbSpectrumVisualFillColor control.
  278. /// </summary>
  279. /// <param name="sender">The source of the event.</param>
  280. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  281. private void CbSpectrumVisualFillColor_SelectedValueChanged(object sender, EventArgs e)
  282. {
  283. if (this.cbSpectrumVisualFillColor.SelectedValue != null)
  284. {
  285. SpectrumVisualFillColor = (Color)this.cbSpectrumVisualFillColor.SelectedValue;
  286. this.UpdatePanels();
  287. }
  288. }
  289. /// <summary>
  290. /// Handles the SelectedValueChanged event of the CbSpectrumLabelChromeBoderBrushColor control.
  291. /// </summary>
  292. /// <param name="sender">The source of the event.</param>
  293. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  294. private void CbSpectrumLabelChromeBoderBrushColor_SelectedValueChanged(object sender, EventArgs e)
  295. {
  296. if (this.cbPeakLabelBorderColor.SelectedValue != null)
  297. {
  298. PeakLabelBorderColor = (Color)this.cbPeakLabelBorderColor.SelectedValue;
  299. this.UpdatePanels();
  300. }
  301. }
  302. /// <summary>
  303. /// Handles the SelectedValueChanged event of the CbSpectrumLabelChromeBackgroundColor control.
  304. /// </summary>
  305. /// <param name="sender">The source of the event.</param>
  306. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  307. private void CbSpectrumLabelChromeBackgroundColor_SelectedValueChanged(object sender, EventArgs e)
  308. {
  309. if (this.cbPeakLabelBackgroundColor.SelectedValue != null)
  310. {
  311. PeakLabelBackgroundColor = (Color)this.cbPeakLabelBackgroundColor.SelectedValue;
  312. this.UpdatePanels();
  313. }
  314. }
  315. /// <summary>
  316. /// Handles the SelectedValueChanged event of the CbSpectrumLabelViewForegroundColor control.
  317. /// </summary>
  318. /// <param name="sender">The source of the event.</param>
  319. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  320. private void CbSpectrumLabelViewForegroundColor_SelectedValueChanged(object sender, EventArgs e)
  321. {
  322. if (this.cbPeakLabelTextColor.SelectedValue != null)
  323. {
  324. PeakLabelTextColor = (Color)this.cbPeakLabelTextColor.SelectedValue;
  325. this.UpdatePanels();
  326. }
  327. }
  328. /// <summary>
  329. /// Handles the SelectedValueChanged event of the CbAlternatePeakLabelBackgroundColor control.
  330. /// </summary>
  331. /// <param name="sender">The source of the event.</param>
  332. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  333. private void CbAlternatePeakLabelBackgroundColor_SelectedValueChanged(object sender, EventArgs e)
  334. {
  335. if (this.cbAlternatePeakLabelBackgroundColor.SelectedValue != null)
  336. {
  337. AlternatePeakLabelBackgroundColor = (Color)this.cbAlternatePeakLabelBackgroundColor.SelectedValue;
  338. this.UpdatePanels();
  339. }
  340. }
  341. /// <summary>
  342. /// Handles the SelectedValueChanged event of the CbAlternatePeakLabelTextColor control.
  343. /// </summary>
  344. /// <param name="sender">The source of the event.</param>
  345. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  346. private void CbAlternatePeakLabelTextColor_SelectedValueChanged(object sender, EventArgs e)
  347. {
  348. if (this.cbAlternatePeakLabelTextColor.SelectedValue != null)
  349. {
  350. AlternatePeakLabelTextColor = (Color)this.cbAlternatePeakLabelTextColor.SelectedValue;
  351. this.UpdatePanels();
  352. }
  353. }
  354. /// <summary>
  355. /// Handles the SelectedValueChanged event of the CbComparisonSpectrum14Color control.
  356. /// </summary>
  357. /// <param name="sender">The source of the event.</param>
  358. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  359. private void CbAxisFontSize_SelectedValueChanged(object sender, EventArgs e)
  360. {
  361. if (this.cbAxisFontSize.SelectedValue != null)
  362. {
  363. SpectrumViewerStyle.AxisFontSize = (double)this.cbAxisFontSize.SelectedValue;
  364. }
  365. }
  366. /// <summary>
  367. /// Handles the btResetStyle button event.
  368. /// </summary>
  369. /// <param name="sender">The source of the event.</param>
  370. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  371. private void BtResetStyle_Click(object sender, EventArgs e)
  372. {
  373. SpectrumViewerStyle.ResetStyles();
  374. this.UpdatePanels();
  375. this.UpdateCombos();
  376. }
  377. /// <summary>
  378. /// Handles the SelectedValueChanged event of the CbComparisonSpectrum14Color control.
  379. /// </summary>
  380. /// <param name="sender">The source of the event.</param>
  381. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  382. private void CbAxisLabelMargin_SelectedValueChanged(object sender, EventArgs e)
  383. {
  384. if (this.cbAxisLabelMargin.SelectedValue != null)
  385. {
  386. SpectrumViewerStyle.AxisLabelMargin = (Thickness)this.cbAxisLabelMargin.SelectedValue;
  387. }
  388. }
  389. /// <summary>
  390. /// Handles the SelectedValueChanged event of the CbComparisonSpectrum14Color control.
  391. /// </summary>
  392. /// <param name="sender">The source of the event.</param>
  393. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  394. private void CbAxisMajorThickLength_SelectedValueChanged(object sender, EventArgs e)
  395. {
  396. if (this.cbAxisMajorThickLength.SelectedValue != null)
  397. {
  398. SpectrumViewerStyle.AxisMajorTickLength = (double)this.cbAxisMajorThickLength.SelectedValue;
  399. }
  400. }
  401. /// <summary>
  402. /// Handles the SelectedValueChanged event of the CbComparisonSpectrum14Color control.
  403. /// </summary>
  404. /// <param name="sender">The source of the event.</param>
  405. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  406. private void CbAxisMinorTickLength_SelectedValueChanged(object sender, EventArgs e)
  407. {
  408. if (this.cbAxisMinorTickLength.SelectedValue != null)
  409. {
  410. SpectrumViewerStyle.AxisMinorTickLength = (double)this.cbAxisMinorTickLength.SelectedValue;
  411. }
  412. }
  413. /// <summary>
  414. /// Handles the SelectedValueChanged event of the CbComparisonSpectrum14Color control.
  415. /// </summary>
  416. /// <param name="sender">The source of the event.</param>
  417. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  418. private void CbAxisSubMinorTickLength_SelectedValueChanged(object sender, EventArgs e)
  419. {
  420. if (this.cbAxisSubMinorTickLength.SelectedValue != null)
  421. {
  422. SpectrumViewerStyle.AxisSubMinorTickLength = (double)this.cbAxisSubMinorTickLength.SelectedValue;
  423. }
  424. }
  425. /// <summary>
  426. /// Handles the SelectedValueChanged event of the CbComparisonSpectrum14Color control.
  427. /// </summary>
  428. /// <param name="sender">The source of the event.</param>
  429. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  430. private void CbAxisLineThickness_SelectedValueChanged(object sender, EventArgs e)
  431. {
  432. if (this.cbAxisLineThickness.SelectedValue != null)
  433. {
  434. SpectrumViewerStyle.AxisLineThickness = (double)this.cbAxisLineThickness.SelectedValue;
  435. }
  436. }
  437. /// <summary>
  438. /// Handles the CheckedChanged event of the cbShowAxisLines control.
  439. /// </summary>
  440. /// <param name="sender">The source of the event.</param>
  441. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  442. private void CbShowAxisLines_CheckedChanged(object sender, EventArgs e)
  443. {
  444. IsAxisLinesShown = this.cbShowAxisLines.Checked;
  445. }
  446. /// <summary>
  447. /// Handles the SelectedValueChanged event of the CbQuantResultsBackgroundColor control.
  448. /// </summary>
  449. /// <param name="sender">The source of the event.</param>
  450. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  451. private void CbQuantResultsBackgroundColor_SelectedValueChanged(object sender, EventArgs e)
  452. {
  453. if (this.cbQuantResultsBackgroundColor.SelectedValue != null)
  454. {
  455. QuantResultsBackgroundColor = (Color)this.cbQuantResultsBackgroundColor.SelectedValue;
  456. this.UpdatePanels();
  457. }
  458. }
  459. /// <summary>
  460. /// Handles the SelectedValueChanged event of the CbQuantResultsBackgroundOpacity control.
  461. /// </summary>
  462. /// <param name="sender">The source of the event.</param>
  463. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  464. private void CbQuantResultsBackgroundOpacity_SelectedValueChanged(object sender, EventArgs e)
  465. {
  466. if (this.cbQuantResultsBackgroundOpacity.SelectedValue != null)
  467. {
  468. SpectrumViewerStyle.QuantResultsBackgroundOpacity = (double)this.cbQuantResultsBackgroundOpacity.SelectedValue;
  469. }
  470. }
  471. /// <summary>
  472. /// Handles the SelectedValueChanged event of the CbQuantResultsFormat control.
  473. /// </summary>
  474. /// <param name="sender">The source of the event.</param>
  475. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  476. private void CbQuantResultsFormat_SelectedValueChanged(object sender, EventArgs e)
  477. {
  478. if (this.cbQuantResultsFormat.SelectedValue != null)
  479. {
  480. SpectrumViewerStyle.QuantResultsFormat = (QuantResultFormat)this.cbQuantResultsFormat.SelectedValue;
  481. }
  482. }
  483. /// <summary>
  484. /// Handles the SelectedValueChanged event of the CbQuantResultsCategory control.
  485. /// </summary>
  486. /// <param name="sender">The source of the event.</param>
  487. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  488. private void CbQuantResultsCategory_SelectedValueChanged(object sender, EventArgs e)
  489. {
  490. if (this.cbQuantResultsCategory.SelectedValue != null)
  491. {
  492. SpectrumViewerStyle.QuantResultsCategory = (QuantResultCategory)this.cbQuantResultsCategory.SelectedValue;
  493. }
  494. }
  495. /// <summary>
  496. /// Handles the CheckedChanged event of the CbShowQuantResults control.
  497. /// </summary>
  498. /// <param name="sender">The source of the event.</param>
  499. /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
  500. private void CbShowQuantResults_CheckedChanged(object sender, EventArgs e)
  501. {
  502. ShowQuantResults = this.cbShowQuantResults.Checked;
  503. }
  504. }
  505. }