1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
4 | *
|
---|
5 | * This file is part of HeuristicLab.
|
---|
6 | *
|
---|
7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | */
|
---|
20 | #endregion
|
---|
21 |
|
---|
22 | using System.Drawing;
|
---|
23 | using System.Windows.Forms;
|
---|
24 | using HeuristicLab.MainForm;
|
---|
25 | using HeuristicLab.MainForm.WindowsForms;
|
---|
26 |
|
---|
27 | namespace HeuristicLab.Analysis.Views {
|
---|
28 | [View("DataRow Visual Properties")]
|
---|
29 | public partial class DataTableVisualPropertiesControl : UserControl {
|
---|
30 | protected bool SuppressEvents { get; set; }
|
---|
31 |
|
---|
32 | private DataTableVisualProperties content;
|
---|
33 | public DataTableVisualProperties Content {
|
---|
34 | get { return content; }
|
---|
35 | set {
|
---|
36 | bool changed = (value != content);
|
---|
37 | content = value;
|
---|
38 | if (changed) OnContentChanged();
|
---|
39 | }
|
---|
40 | }
|
---|
41 |
|
---|
42 | public DataTableVisualPropertiesControl() {
|
---|
43 | InitializeComponent();
|
---|
44 | }
|
---|
45 |
|
---|
46 | protected virtual void OnContentChanged() {
|
---|
47 | SuppressEvents = true;
|
---|
48 | try {
|
---|
49 | if (Content == null) {
|
---|
50 | titleFontLabel.Text = "( )";
|
---|
51 | axisFontLabel.Text = "( )";
|
---|
52 | titleTextBox.Text = string.Empty;
|
---|
53 |
|
---|
54 | xAxisPrimaryTitleTextBox.Text = string.Empty;
|
---|
55 | xAxisPrimaryMinimumAutoRadioButton.Checked = false;
|
---|
56 | xAxisPrimaryMinimumFixedRadioButton.Checked = false;
|
---|
57 | xAxisPrimaryMinimumFixedTextBox.Text = string.Empty;
|
---|
58 | xAxisPrimaryMaximumAutoRadioButton.Checked = false;
|
---|
59 | xAxisPrimaryMaximumFixedRadioButton.Checked = false;
|
---|
60 | xAxisPrimaryMaximumFixedTextBox.Text = string.Empty;
|
---|
61 | xAxisSecondaryTitleTextBox.Text = string.Empty;
|
---|
62 | xAxisSecondaryMinimumAutoRadioButton.Checked = false;
|
---|
63 | xAxisSecondaryMinimumFixedRadioButton.Checked = false;
|
---|
64 | xAxisSecondaryMinimumFixedTextBox.Text = string.Empty;
|
---|
65 | xAxisSecondaryMaximumAutoRadioButton.Checked = false;
|
---|
66 | xAxisSecondaryMaximumFixedRadioButton.Checked = false;
|
---|
67 | xAxisSecondaryMaximumFixedTextBox.Text = string.Empty;
|
---|
68 |
|
---|
69 | yAxisPrimaryTitleTextBox.Text = string.Empty;
|
---|
70 | yAxisPrimaryMinimumAutoRadioButton.Checked = false;
|
---|
71 | yAxisPrimaryMinimumFixedRadioButton.Checked = false;
|
---|
72 | yAxisPrimaryMinimumFixedTextBox.Text = string.Empty;
|
---|
73 | yAxisPrimaryMaximumAutoRadioButton.Checked = false;
|
---|
74 | yAxisPrimaryMaximumFixedRadioButton.Checked = false;
|
---|
75 | yAxisPrimaryMaximumFixedTextBox.Text = string.Empty;
|
---|
76 | yAxisSecondaryTitleTextBox.Text = string.Empty;
|
---|
77 | yAxisSecondaryMinimumAutoRadioButton.Checked = false;
|
---|
78 | yAxisSecondaryMinimumFixedRadioButton.Checked = false;
|
---|
79 | yAxisSecondaryMinimumFixedTextBox.Text = string.Empty;
|
---|
80 | yAxisSecondaryMaximumAutoRadioButton.Checked = false;
|
---|
81 | yAxisSecondaryMaximumFixedRadioButton.Checked = false;
|
---|
82 | yAxisSecondaryMaximumFixedTextBox.Text = string.Empty;
|
---|
83 | } else {
|
---|
84 | titleFontLabel.Text = "( " + FormatFont(Content.TitleFont) + " )";
|
---|
85 | axisFontLabel.Text = "( " + FormatFont(Content.AxisTitleFont) + " )";
|
---|
86 | titleTextBox.Text = Content.Title;
|
---|
87 |
|
---|
88 | xAxisPrimaryTitleTextBox.Text = Content.XAxisTitle;
|
---|
89 | xAxisPrimaryMinimumAutoRadioButton.Checked = Content.XAxisMinimumAuto;
|
---|
90 | xAxisPrimaryMinimumFixedRadioButton.Checked = !Content.XAxisMinimumAuto;
|
---|
91 | xAxisPrimaryMinimumFixedTextBox.Text = Content.XAxisMinimumFixedValue.ToString();
|
---|
92 | xAxisPrimaryMaximumAutoRadioButton.Checked = Content.XAxisMaximumAuto;
|
---|
93 | xAxisPrimaryMaximumFixedRadioButton.Checked = !Content.XAxisMaximumAuto;
|
---|
94 | xAxisPrimaryMaximumFixedTextBox.Text = Content.XAxisMaximumFixedValue.ToString();
|
---|
95 | xAxisSecondaryTitleTextBox.Text = Content.SecondXAxisTitle;
|
---|
96 | xAxisSecondaryMinimumAutoRadioButton.Checked = Content.SecondXAxisMinimumAuto;
|
---|
97 | xAxisSecondaryMinimumFixedRadioButton.Checked = !Content.SecondXAxisMinimumAuto;
|
---|
98 | xAxisSecondaryMinimumFixedTextBox.Text = Content.SecondXAxisMinimumFixedValue.ToString();
|
---|
99 | xAxisSecondaryMaximumAutoRadioButton.Checked = Content.SecondXAxisMaximumAuto;
|
---|
100 | xAxisSecondaryMaximumFixedRadioButton.Checked = !Content.SecondXAxisMaximumAuto;
|
---|
101 | xAxisSecondaryMaximumFixedTextBox.Text = Content.SecondXAxisMaximumFixedValue.ToString();
|
---|
102 |
|
---|
103 | yAxisPrimaryTitleTextBox.Text = Content.YAxisTitle;
|
---|
104 | yAxisPrimaryMinimumAutoRadioButton.Checked = Content.YAxisMinimumAuto;
|
---|
105 | yAxisPrimaryMinimumFixedRadioButton.Checked = !Content.YAxisMinimumAuto;
|
---|
106 | yAxisPrimaryMinimumFixedTextBox.Text = Content.YAxisMinimumFixedValue.ToString();
|
---|
107 | yAxisPrimaryMaximumAutoRadioButton.Checked = Content.YAxisMaximumAuto;
|
---|
108 | yAxisPrimaryMaximumFixedRadioButton.Checked = !Content.YAxisMaximumAuto;
|
---|
109 | yAxisPrimaryMaximumFixedTextBox.Text = Content.YAxisMaximumFixedValue.ToString();
|
---|
110 | yAxisSecondaryTitleTextBox.Text = Content.SecondYAxisTitle;
|
---|
111 | yAxisSecondaryMinimumAutoRadioButton.Checked = Content.SecondYAxisMinimumAuto;
|
---|
112 | yAxisSecondaryMinimumFixedRadioButton.Checked = !Content.SecondYAxisMinimumAuto;
|
---|
113 | yAxisSecondaryMinimumFixedTextBox.Text = Content.SecondYAxisMinimumFixedValue.ToString();
|
---|
114 | yAxisSecondaryMaximumAutoRadioButton.Checked = Content.SecondYAxisMaximumAuto;
|
---|
115 | yAxisSecondaryMaximumFixedRadioButton.Checked = !Content.SecondYAxisMaximumAuto;
|
---|
116 | yAxisSecondaryMaximumFixedTextBox.Text = Content.SecondYAxisMaximumFixedValue.ToString();
|
---|
117 | }
|
---|
118 | }
|
---|
119 | finally { SuppressEvents = false; }
|
---|
120 | SetEnabledStateOfControls();
|
---|
121 | }
|
---|
122 |
|
---|
123 | protected virtual void SetEnabledStateOfControls() {
|
---|
124 | axisTabControl.Enabled = Content != null;
|
---|
125 | xAxisPrimaryMinimumFixedTextBox.Enabled = xAxisPrimaryMinimumFixedRadioButton.Checked;
|
---|
126 | xAxisPrimaryMaximumFixedTextBox.Enabled = xAxisPrimaryMaximumFixedRadioButton.Checked;
|
---|
127 | xAxisSecondaryMinimumFixedTextBox.Enabled = xAxisSecondaryMinimumFixedRadioButton.Checked;
|
---|
128 | xAxisSecondaryMaximumFixedTextBox.Enabled = xAxisSecondaryMaximumFixedRadioButton.Checked;
|
---|
129 |
|
---|
130 | yAxisPrimaryMinimumFixedTextBox.Enabled = yAxisPrimaryMinimumFixedRadioButton.Checked;
|
---|
131 | yAxisPrimaryMaximumFixedTextBox.Enabled = yAxisPrimaryMaximumFixedRadioButton.Checked;
|
---|
132 | yAxisSecondaryMinimumFixedTextBox.Enabled = yAxisSecondaryMinimumFixedRadioButton.Checked;
|
---|
133 | yAxisSecondaryMaximumFixedTextBox.Enabled = yAxisSecondaryMaximumFixedRadioButton.Checked;
|
---|
134 | }
|
---|
135 |
|
---|
136 | #region Event Handlers
|
---|
137 | private void yPrimaryTitleTextBox_Validated(object sender, System.EventArgs e) {
|
---|
138 | if (!SuppressEvents && Content != null) {
|
---|
139 | Content.YAxisTitle = yAxisPrimaryTitleTextBox.Text;
|
---|
140 | }
|
---|
141 | }
|
---|
142 |
|
---|
143 | private void ySecondaryTitleTextBox_Validated(object sender, System.EventArgs e) {
|
---|
144 | if (!SuppressEvents && Content != null) {
|
---|
145 | Content.SecondYAxisTitle = yAxisSecondaryTitleTextBox.Text;
|
---|
146 | }
|
---|
147 | }
|
---|
148 |
|
---|
149 | private void xPrimaryTitleTextBox_Validated(object sender, System.EventArgs e) {
|
---|
150 | if (!SuppressEvents && Content != null) {
|
---|
151 | Content.XAxisTitle = xAxisPrimaryTitleTextBox.Text;
|
---|
152 | }
|
---|
153 | }
|
---|
154 |
|
---|
155 | private void xSecondaryTitleTextBox_Validated(object sender, System.EventArgs e) {
|
---|
156 | if (!SuppressEvents && Content != null) {
|
---|
157 | Content.SecondXAxisTitle = xAxisSecondaryTitleTextBox.Text;
|
---|
158 | }
|
---|
159 | }
|
---|
160 |
|
---|
161 | private void xAxisPrimaryMinimumFixedTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
|
---|
162 | if (!SuppressEvents && Content != null) {
|
---|
163 | TextBox tb = (TextBox)sender;
|
---|
164 | double val;
|
---|
165 | if (double.TryParse(tb.Text, out val)) {
|
---|
166 | if (val >= Content.XAxisMaximumFixedValue) {
|
---|
167 | errorProvider.SetError(tb, "Number must be smaller than maximum.");
|
---|
168 | e.Cancel = true;
|
---|
169 | } else {
|
---|
170 | Content.XAxisMinimumFixedValue = val;
|
---|
171 | errorProvider.SetError(tb, string.Empty);
|
---|
172 | }
|
---|
173 | } else {
|
---|
174 | errorProvider.SetError(tb, "Not a valid number.");
|
---|
175 | e.Cancel = true;
|
---|
176 | }
|
---|
177 | }
|
---|
178 | }
|
---|
179 |
|
---|
180 | private void xAxisPrimaryMaximumFixedTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
|
---|
181 | if (!SuppressEvents && Content != null) {
|
---|
182 | TextBox tb = (TextBox)sender;
|
---|
183 | double val;
|
---|
184 | if (double.TryParse(tb.Text, out val)) {
|
---|
185 | if (val <= Content.XAxisMinimumFixedValue) {
|
---|
186 | errorProvider.SetError(tb, "Number must be greater than minimum.");
|
---|
187 | e.Cancel = true;
|
---|
188 | } else {
|
---|
189 | Content.XAxisMaximumFixedValue = val;
|
---|
190 | errorProvider.SetError(tb, string.Empty);
|
---|
191 | }
|
---|
192 | } else {
|
---|
193 | errorProvider.SetError(tb, "Not a valid number.");
|
---|
194 | e.Cancel = true;
|
---|
195 | }
|
---|
196 | }
|
---|
197 | }
|
---|
198 |
|
---|
199 | private void xAxisSecondaryMinimumFixedTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
|
---|
200 | if (!SuppressEvents && Content != null) {
|
---|
201 | TextBox tb = (TextBox)sender;
|
---|
202 | double val;
|
---|
203 | if (double.TryParse(tb.Text, out val)) {
|
---|
204 | if (val >= Content.SecondXAxisMaximumFixedValue) {
|
---|
205 | errorProvider.SetError(tb, "Number must be smaller than maximum.");
|
---|
206 | e.Cancel = true;
|
---|
207 | } else {
|
---|
208 | Content.SecondXAxisMinimumFixedValue = val;
|
---|
209 | errorProvider.SetError(tb, string.Empty);
|
---|
210 | }
|
---|
211 | } else {
|
---|
212 | errorProvider.SetError(tb, "Not a valid number.");
|
---|
213 | e.Cancel = true;
|
---|
214 | }
|
---|
215 | }
|
---|
216 | }
|
---|
217 |
|
---|
218 | private void xAxisSecondaryMaximumFixedTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
|
---|
219 | if (!SuppressEvents && Content != null) {
|
---|
220 | TextBox tb = (TextBox)sender;
|
---|
221 | double val;
|
---|
222 | if (double.TryParse(tb.Text, out val)) {
|
---|
223 | if (val <= Content.SecondXAxisMinimumFixedValue) {
|
---|
224 | errorProvider.SetError(tb, "Number must be greater than minimum.");
|
---|
225 | e.Cancel = true;
|
---|
226 | } else {
|
---|
227 | Content.SecondXAxisMaximumFixedValue = val;
|
---|
228 | errorProvider.SetError(tb, string.Empty);
|
---|
229 | }
|
---|
230 | } else {
|
---|
231 | errorProvider.SetError(tb, "Not a valid number.");
|
---|
232 | e.Cancel = true;
|
---|
233 | }
|
---|
234 | }
|
---|
235 | }
|
---|
236 |
|
---|
237 | private void yAxisPrimaryMinimumFixedTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
|
---|
238 | if (!SuppressEvents && Content != null) {
|
---|
239 | TextBox tb = (TextBox)sender;
|
---|
240 | double val;
|
---|
241 | if (double.TryParse(tb.Text, out val)) {
|
---|
242 | if (val >= Content.YAxisMaximumFixedValue) {
|
---|
243 | errorProvider.SetError(tb, "Number must be smaller than maximum.");
|
---|
244 | e.Cancel = true;
|
---|
245 | } else {
|
---|
246 | Content.YAxisMinimumFixedValue = val;
|
---|
247 | errorProvider.SetError(tb, string.Empty);
|
---|
248 | }
|
---|
249 | } else {
|
---|
250 | errorProvider.SetError(tb, "Not a valid number.");
|
---|
251 | e.Cancel = true;
|
---|
252 | }
|
---|
253 | }
|
---|
254 | }
|
---|
255 |
|
---|
256 | private void yAxisPrimaryMaximumFixedTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
|
---|
257 | if (!SuppressEvents && Content != null) {
|
---|
258 | TextBox tb = (TextBox)sender;
|
---|
259 | double val;
|
---|
260 | if (double.TryParse(tb.Text, out val)) {
|
---|
261 | if (val <= Content.YAxisMinimumFixedValue) {
|
---|
262 | errorProvider.SetError(tb, "Number must be greater than minimum.");
|
---|
263 | e.Cancel = true;
|
---|
264 | } else {
|
---|
265 | Content.YAxisMaximumFixedValue = val;
|
---|
266 | errorProvider.SetError(tb, string.Empty);
|
---|
267 | }
|
---|
268 | } else {
|
---|
269 | errorProvider.SetError(tb, "Not a valid number.");
|
---|
270 | e.Cancel = true;
|
---|
271 | }
|
---|
272 | }
|
---|
273 | }
|
---|
274 |
|
---|
275 | private void yAxisSecondaryMinimumFixedTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
|
---|
276 | if (!SuppressEvents && Content != null) {
|
---|
277 | TextBox tb = (TextBox)sender;
|
---|
278 | double val;
|
---|
279 | if (double.TryParse(tb.Text, out val)) {
|
---|
280 | if (val >= Content.SecondYAxisMaximumFixedValue) {
|
---|
281 | errorProvider.SetError(tb, "Number must be smaller than maximum.");
|
---|
282 | e.Cancel = true;
|
---|
283 | } else {
|
---|
284 | Content.SecondYAxisMinimumFixedValue = val;
|
---|
285 | errorProvider.SetError(tb, string.Empty);
|
---|
286 | }
|
---|
287 | } else {
|
---|
288 | errorProvider.SetError(tb, "Not a valid number.");
|
---|
289 | e.Cancel = true;
|
---|
290 | }
|
---|
291 | }
|
---|
292 | }
|
---|
293 |
|
---|
294 | private void yAxisSecondaryMaximumFixedTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
|
---|
295 | if (!SuppressEvents && Content != null) {
|
---|
296 | TextBox tb = (TextBox)sender;
|
---|
297 | double val;
|
---|
298 | if (double.TryParse(tb.Text, out val)) {
|
---|
299 | if (val <= Content.SecondYAxisMinimumFixedValue) {
|
---|
300 | errorProvider.SetError(tb, "Number must be greater than minimum.");
|
---|
301 | e.Cancel = true;
|
---|
302 | } else {
|
---|
303 | Content.SecondYAxisMaximumFixedValue = val;
|
---|
304 | errorProvider.SetError(tb, string.Empty);
|
---|
305 | }
|
---|
306 | } else {
|
---|
307 | errorProvider.SetError(tb, "Not a valid number.");
|
---|
308 | e.Cancel = true;
|
---|
309 | }
|
---|
310 | }
|
---|
311 | }
|
---|
312 |
|
---|
313 | private void xAxisPrimaryMinimumRadioButton_CheckedChanged(object sender, System.EventArgs e) {
|
---|
314 | if (!SuppressEvents && Content != null) {
|
---|
315 | SuppressEvents = true;
|
---|
316 | try {
|
---|
317 | Content.XAxisMinimumAuto = xAxisPrimaryMinimumAutoRadioButton.Checked;
|
---|
318 | if (Content.XAxisMinimumAuto) xAxisPrimaryMinimumFixedTextBox.Text = double.NaN.ToString();
|
---|
319 | }
|
---|
320 | finally { SuppressEvents = false; }
|
---|
321 | SetEnabledStateOfControls();
|
---|
322 | }
|
---|
323 | }
|
---|
324 |
|
---|
325 | private void xAxisPrimaryMaximumRadioButton_CheckedChanged(object sender, System.EventArgs e) {
|
---|
326 | if (!SuppressEvents && Content != null) {
|
---|
327 | SuppressEvents = true;
|
---|
328 | try {
|
---|
329 | Content.XAxisMaximumAuto = xAxisPrimaryMaximumAutoRadioButton.Checked;
|
---|
330 | if (Content.XAxisMaximumAuto) xAxisPrimaryMaximumFixedTextBox.Text = double.NaN.ToString();
|
---|
331 | }
|
---|
332 | finally { SuppressEvents = false; }
|
---|
333 | SetEnabledStateOfControls();
|
---|
334 | }
|
---|
335 | }
|
---|
336 |
|
---|
337 | private void xAxisSecondaryMinimumRadioButton_CheckedChanged(object sender, System.EventArgs e) {
|
---|
338 | if (!SuppressEvents && Content != null) {
|
---|
339 | SuppressEvents = true;
|
---|
340 | try {
|
---|
341 | Content.SecondXAxisMinimumAuto = xAxisSecondaryMinimumAutoRadioButton.Checked;
|
---|
342 | if (Content.SecondXAxisMinimumAuto) xAxisSecondaryMinimumFixedTextBox.Text = double.NaN.ToString();
|
---|
343 | }
|
---|
344 | finally { SuppressEvents = false; }
|
---|
345 | SetEnabledStateOfControls();
|
---|
346 | }
|
---|
347 | }
|
---|
348 |
|
---|
349 | private void xAxisSecondaryMaximumRadioButton_CheckedChanged(object sender, System.EventArgs e) {
|
---|
350 | if (!SuppressEvents && Content != null) {
|
---|
351 | SuppressEvents = true;
|
---|
352 | try {
|
---|
353 | Content.SecondXAxisMaximumAuto = xAxisSecondaryMaximumAutoRadioButton.Checked;
|
---|
354 | if (Content.SecondXAxisMaximumAuto) xAxisSecondaryMaximumFixedTextBox.Text = double.NaN.ToString();
|
---|
355 | }
|
---|
356 | finally { SuppressEvents = false; }
|
---|
357 | SetEnabledStateOfControls();
|
---|
358 | }
|
---|
359 | }
|
---|
360 |
|
---|
361 | private void yAxisPrimaryMinimumRadioButton_CheckedChanged(object sender, System.EventArgs e) {
|
---|
362 | if (!SuppressEvents && Content != null) {
|
---|
363 | SuppressEvents = true;
|
---|
364 | try {
|
---|
365 | Content.YAxisMinimumAuto = yAxisPrimaryMinimumAutoRadioButton.Checked;
|
---|
366 | if (Content.YAxisMinimumAuto) yAxisPrimaryMinimumFixedTextBox.Text = double.NaN.ToString();
|
---|
367 | }
|
---|
368 | finally { SuppressEvents = false; }
|
---|
369 | SetEnabledStateOfControls();
|
---|
370 | }
|
---|
371 | }
|
---|
372 |
|
---|
373 | private void yAxisPrimaryMaximumRadioButton_CheckedChanged(object sender, System.EventArgs e) {
|
---|
374 | if (!SuppressEvents && Content != null) {
|
---|
375 | SuppressEvents = true;
|
---|
376 | try {
|
---|
377 | Content.YAxisMaximumAuto = yAxisPrimaryMaximumAutoRadioButton.Checked;
|
---|
378 | if (Content.YAxisMaximumAuto) yAxisPrimaryMaximumFixedTextBox.Text = double.NaN.ToString();
|
---|
379 | }
|
---|
380 | finally { SuppressEvents = false; }
|
---|
381 | SetEnabledStateOfControls();
|
---|
382 | }
|
---|
383 | }
|
---|
384 |
|
---|
385 | private void yAxisSecondaryMinimumRadioButton_CheckedChanged(object sender, System.EventArgs e) {
|
---|
386 | if (!SuppressEvents && Content != null) {
|
---|
387 | SuppressEvents = true;
|
---|
388 | try {
|
---|
389 | Content.SecondYAxisMinimumAuto = yAxisSecondaryMinimumAutoRadioButton.Checked;
|
---|
390 | if (Content.SecondYAxisMinimumAuto) yAxisSecondaryMinimumFixedTextBox.Text = double.NaN.ToString();
|
---|
391 | }
|
---|
392 | finally { SuppressEvents = false; }
|
---|
393 | SetEnabledStateOfControls();
|
---|
394 | }
|
---|
395 | }
|
---|
396 |
|
---|
397 | private void yAxisSecondaryMaximumRadioButton_CheckedChanged(object sender, System.EventArgs e) {
|
---|
398 | if (!SuppressEvents && Content != null) {
|
---|
399 | SuppressEvents = true;
|
---|
400 | try {
|
---|
401 | Content.SecondYAxisMaximumAuto = yAxisSecondaryMaximumAutoRadioButton.Checked;
|
---|
402 | if (Content.SecondYAxisMaximumAuto) yAxisSecondaryMaximumFixedTextBox.Text = double.NaN.ToString();
|
---|
403 | }
|
---|
404 | finally { SuppressEvents = false; }
|
---|
405 | SetEnabledStateOfControls();
|
---|
406 | }
|
---|
407 | }
|
---|
408 |
|
---|
409 | private void titleFontButton_Click(object sender, System.EventArgs e) {
|
---|
410 | titleFontDialog.Font = Content.TitleFont;
|
---|
411 | titleFontDialog.Color = Content.TitleColor;
|
---|
412 | if (titleFontDialog.ShowDialog() == DialogResult.OK) {
|
---|
413 | Content.TitleFont = titleFontDialog.Font;
|
---|
414 | Content.TitleColor = titleFontDialog.Color;
|
---|
415 | titleFontLabel.Text = "( " + FormatFont(Content.TitleFont) + " )";
|
---|
416 | }
|
---|
417 | }
|
---|
418 |
|
---|
419 | private void axisFontButton_Click(object sender, System.EventArgs e) {
|
---|
420 | axisFontDialog.Font = Content.AxisTitleFont;
|
---|
421 | axisFontDialog.Color = Content.AxisTitleColor;
|
---|
422 | if (axisFontDialog.ShowDialog() == DialogResult.OK) {
|
---|
423 | Content.AxisTitleFont = axisFontDialog.Font;
|
---|
424 | Content.AxisTitleColor = axisFontDialog.Color;
|
---|
425 | axisFontLabel.Text = "( " + FormatFont(Content.AxisTitleFont) + " )";
|
---|
426 | }
|
---|
427 | }
|
---|
428 |
|
---|
429 | private void titleTextBox_Validated(object sender, System.EventArgs e) {
|
---|
430 | if (!SuppressEvents && Content != null) {
|
---|
431 | Content.Title = titleTextBox.Text;
|
---|
432 | }
|
---|
433 | }
|
---|
434 | #endregion
|
---|
435 |
|
---|
436 | private string FormatFont(Font f) {
|
---|
437 | if (f == null) return string.Empty;
|
---|
438 | else return f.Name + ", " + f.SizeInPoints.ToString() + "pt, " + f.Style.ToString();
|
---|
439 | }
|
---|
440 | }
|
---|
441 | }
|
---|