Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PersistenceOverhaul/HeuristicLab.Analysis.Views/3.3/DataTableVisualPropertiesControl.cs @ 15601

Last change on this file since 15601 was 12012, checked in by ascheibe, 10 years ago

#2212 merged r12008, r12009, r12010 back into trunk

File size: 22.0 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2015 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
22using HeuristicLab.MainForm;
23using HeuristicLab.MainForm.WindowsForms;
24using System.Drawing;
25using System.Windows.Forms;
26
27namespace HeuristicLab.Analysis.Views {
28  [View("DataTable 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      errorProvider.SetIconAlignment(xAxisPrimaryMinimumFixedTextBox, ErrorIconAlignment.MiddleLeft);
45      errorProvider.SetIconAlignment(xAxisPrimaryMaximumFixedTextBox, ErrorIconAlignment.MiddleLeft);
46      errorProvider.SetIconAlignment(xAxisSecondaryMinimumFixedTextBox, ErrorIconAlignment.MiddleLeft);
47      errorProvider.SetIconAlignment(xAxisSecondaryMaximumFixedTextBox, ErrorIconAlignment.MiddleLeft);
48      errorProvider.SetIconAlignment(yAxisPrimaryMinimumFixedTextBox, ErrorIconAlignment.MiddleLeft);
49      errorProvider.SetIconAlignment(yAxisPrimaryMaximumFixedTextBox, ErrorIconAlignment.MiddleLeft);
50      errorProvider.SetIconAlignment(yAxisSecondaryMinimumFixedTextBox, ErrorIconAlignment.MiddleLeft);
51      errorProvider.SetIconAlignment(yAxisSecondaryMaximumFixedTextBox, ErrorIconAlignment.MiddleLeft);
52      errorProvider.SetIconPadding(xAxisPrimaryMinimumFixedTextBox, 2);
53      errorProvider.SetIconPadding(xAxisPrimaryMaximumFixedTextBox, 2);
54      errorProvider.SetIconPadding(xAxisSecondaryMinimumFixedTextBox, 2);
55      errorProvider.SetIconPadding(xAxisSecondaryMaximumFixedTextBox, 2);
56      errorProvider.SetIconPadding(yAxisPrimaryMinimumFixedTextBox, 2);
57      errorProvider.SetIconPadding(yAxisPrimaryMaximumFixedTextBox, 2);
58      errorProvider.SetIconPadding(yAxisSecondaryMinimumFixedTextBox, 2);
59      errorProvider.SetIconPadding(yAxisSecondaryMaximumFixedTextBox, 2);
60    }
61
62    protected virtual void OnContentChanged() {
63      SuppressEvents = true;
64      try {
65        if (Content == null) {
66          titleFontLabel.Text = "( none )";
67          axisFontLabel.Text = "( none )";
68          titleTextBox.Text = string.Empty;
69
70          xAxisPrimaryTitleTextBox.Text = string.Empty;
71          xAxisPrimaryMinimumAutoRadioButton.Checked = false;
72          xAxisPrimaryMinimumFixedRadioButton.Checked = false;
73          xAxisPrimaryMinimumFixedTextBox.Text = string.Empty;
74          xAxisPrimaryMaximumAutoRadioButton.Checked = false;
75          xAxisPrimaryMaximumFixedRadioButton.Checked = false;
76          xAxisPrimaryMaximumFixedTextBox.Text = string.Empty;
77          xAxisPrimaryLogScaleCheckBox.Checked = false;
78          xAxisSecondaryTitleTextBox.Text = string.Empty;
79          xAxisSecondaryMinimumAutoRadioButton.Checked = false;
80          xAxisSecondaryMinimumFixedRadioButton.Checked = false;
81          xAxisSecondaryMinimumFixedTextBox.Text = string.Empty;
82          xAxisSecondaryMaximumAutoRadioButton.Checked = false;
83          xAxisSecondaryMaximumFixedRadioButton.Checked = false;
84          xAxisSecondaryMaximumFixedTextBox.Text = string.Empty;
85          xAxisSecondaryLogScaleCheckBox.Checked = false;
86
87          yAxisPrimaryTitleTextBox.Text = string.Empty;
88          yAxisPrimaryMinimumAutoRadioButton.Checked = false;
89          yAxisPrimaryMinimumFixedRadioButton.Checked = false;
90          yAxisPrimaryMinimumFixedTextBox.Text = string.Empty;
91          yAxisPrimaryMaximumAutoRadioButton.Checked = false;
92          yAxisPrimaryMaximumFixedRadioButton.Checked = false;
93          yAxisPrimaryMaximumFixedTextBox.Text = string.Empty;
94          yAxisPrimaryLogScaleCheckBox.Checked = false;
95          yAxisSecondaryTitleTextBox.Text = string.Empty;
96          yAxisSecondaryMinimumAutoRadioButton.Checked = false;
97          yAxisSecondaryMinimumFixedRadioButton.Checked = false;
98          yAxisSecondaryMinimumFixedTextBox.Text = string.Empty;
99          yAxisSecondaryMaximumAutoRadioButton.Checked = false;
100          yAxisSecondaryMaximumFixedRadioButton.Checked = false;
101          yAxisSecondaryMaximumFixedTextBox.Text = string.Empty;
102          yAxisSecondaryLogScaleCheckBox.Checked = false;
103        } else {
104          titleFontLabel.Text = "( " + FormatFont(Content.TitleFont) + " )";
105          axisFontLabel.Text = "( " + FormatFont(Content.AxisTitleFont) + " )";
106          titleTextBox.Text = Content.Title;
107
108          xAxisPrimaryTitleTextBox.Text = Content.XAxisTitle;
109          xAxisPrimaryMinimumAutoRadioButton.Checked = Content.XAxisMinimumAuto;
110          xAxisPrimaryMinimumFixedRadioButton.Checked = !Content.XAxisMinimumAuto;
111          xAxisPrimaryMinimumFixedTextBox.Text = Content.XAxisMinimumFixedValue.ToString();
112          xAxisPrimaryMaximumAutoRadioButton.Checked = Content.XAxisMaximumAuto;
113          xAxisPrimaryMaximumFixedRadioButton.Checked = !Content.XAxisMaximumAuto;
114          xAxisPrimaryMaximumFixedTextBox.Text = Content.XAxisMaximumFixedValue.ToString();
115          xAxisPrimaryLogScaleCheckBox.Checked = Content.XAxisLogScale;
116          xAxisSecondaryTitleTextBox.Text = Content.SecondXAxisTitle;
117          xAxisSecondaryMinimumAutoRadioButton.Checked = Content.SecondXAxisMinimumAuto;
118          xAxisSecondaryMinimumFixedRadioButton.Checked = !Content.SecondXAxisMinimumAuto;
119          xAxisSecondaryMinimumFixedTextBox.Text = Content.SecondXAxisMinimumFixedValue.ToString();
120          xAxisSecondaryMaximumAutoRadioButton.Checked = Content.SecondXAxisMaximumAuto;
121          xAxisSecondaryMaximumFixedRadioButton.Checked = !Content.SecondXAxisMaximumAuto;
122          xAxisSecondaryMaximumFixedTextBox.Text = Content.SecondXAxisMaximumFixedValue.ToString();
123          xAxisSecondaryLogScaleCheckBox.Checked = Content.SecondXAxisLogScale;
124
125          yAxisPrimaryTitleTextBox.Text = Content.YAxisTitle;
126          yAxisPrimaryMinimumAutoRadioButton.Checked = Content.YAxisMinimumAuto;
127          yAxisPrimaryMinimumFixedRadioButton.Checked = !Content.YAxisMinimumAuto;
128          yAxisPrimaryMinimumFixedTextBox.Text = Content.YAxisMinimumFixedValue.ToString();
129          yAxisPrimaryMaximumAutoRadioButton.Checked = Content.YAxisMaximumAuto;
130          yAxisPrimaryMaximumFixedRadioButton.Checked = !Content.YAxisMaximumAuto;
131          yAxisPrimaryMaximumFixedTextBox.Text = Content.YAxisMaximumFixedValue.ToString();
132          yAxisPrimaryLogScaleCheckBox.Checked = Content.YAxisLogScale;
133          yAxisSecondaryTitleTextBox.Text = Content.SecondYAxisTitle;
134          yAxisSecondaryMinimumAutoRadioButton.Checked = Content.SecondYAxisMinimumAuto;
135          yAxisSecondaryMinimumFixedRadioButton.Checked = !Content.SecondYAxisMinimumAuto;
136          yAxisSecondaryMinimumFixedTextBox.Text = Content.SecondYAxisMinimumFixedValue.ToString();
137          yAxisSecondaryMaximumAutoRadioButton.Checked = Content.SecondYAxisMaximumAuto;
138          yAxisSecondaryMaximumFixedRadioButton.Checked = !Content.SecondYAxisMaximumAuto;
139          yAxisSecondaryMaximumFixedTextBox.Text = Content.SecondYAxisMaximumFixedValue.ToString();
140          yAxisSecondaryLogScaleCheckBox.Checked = Content.SecondYAxisLogScale;
141        }
142      } finally { SuppressEvents = false; }
143      SetEnabledStateOfControls();
144    }
145
146    protected virtual void SetEnabledStateOfControls() {
147      axisTabControl.Enabled = Content != null;
148      xAxisPrimaryMinimumFixedTextBox.Enabled = xAxisPrimaryMinimumFixedRadioButton.Checked;
149      xAxisPrimaryMaximumFixedTextBox.Enabled = xAxisPrimaryMaximumFixedRadioButton.Checked;
150      xAxisSecondaryMinimumFixedTextBox.Enabled = xAxisSecondaryMinimumFixedRadioButton.Checked;
151      xAxisSecondaryMaximumFixedTextBox.Enabled = xAxisSecondaryMaximumFixedRadioButton.Checked;
152
153      yAxisPrimaryMinimumFixedTextBox.Enabled = yAxisPrimaryMinimumFixedRadioButton.Checked;
154      yAxisPrimaryMaximumFixedTextBox.Enabled = yAxisPrimaryMaximumFixedRadioButton.Checked;
155      yAxisSecondaryMinimumFixedTextBox.Enabled = yAxisSecondaryMinimumFixedRadioButton.Checked;
156      yAxisSecondaryMaximumFixedTextBox.Enabled = yAxisSecondaryMaximumFixedRadioButton.Checked;
157    }
158
159    #region Event Handlers
160    private void yPrimaryTitleTextBox_Validated(object sender, System.EventArgs e) {
161      if (!SuppressEvents && Content != null) {
162        Content.YAxisTitle = yAxisPrimaryTitleTextBox.Text;
163      }
164    }
165
166    private void ySecondaryTitleTextBox_Validated(object sender, System.EventArgs e) {
167      if (!SuppressEvents && Content != null) {
168        Content.SecondYAxisTitle = yAxisSecondaryTitleTextBox.Text;
169      }
170    }
171
172    private void xPrimaryTitleTextBox_Validated(object sender, System.EventArgs e) {
173      if (!SuppressEvents && Content != null) {
174        Content.XAxisTitle = xAxisPrimaryTitleTextBox.Text;
175      }
176    }
177
178    private void xSecondaryTitleTextBox_Validated(object sender, System.EventArgs e) {
179      if (!SuppressEvents && Content != null) {
180        Content.SecondXAxisTitle = xAxisSecondaryTitleTextBox.Text;
181      }
182    }
183
184    private void xAxisPrimaryMinimumFixedTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
185      if (!SuppressEvents && Content != null) {
186        TextBox tb = (TextBox)sender;
187        double val;
188        if (double.TryParse(tb.Text, out val)) {
189          if (val >= Content.XAxisMaximumFixedValue) {
190            errorProvider.SetError(tb, "Number must be smaller than maximum.");
191            e.Cancel = true;
192          } else {
193            Content.XAxisMinimumFixedValue = val;
194            errorProvider.SetError(tb, string.Empty);
195          }
196        } else {
197          errorProvider.SetError(tb, "Not a valid number.");
198          e.Cancel = true;
199        }
200      }
201    }
202
203    private void xAxisPrimaryMaximumFixedTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
204      if (!SuppressEvents && Content != null) {
205        TextBox tb = (TextBox)sender;
206        double val;
207        if (double.TryParse(tb.Text, out val)) {
208          if (val <= Content.XAxisMinimumFixedValue) {
209            errorProvider.SetError(tb, "Number must be greater than minimum.");
210            e.Cancel = true;
211          } else {
212            Content.XAxisMaximumFixedValue = val;
213            errorProvider.SetError(tb, string.Empty);
214          }
215        } else {
216          errorProvider.SetError(tb, "Not a valid number.");
217          e.Cancel = true;
218        }
219      }
220    }
221
222    private void xAxisSecondaryMinimumFixedTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
223      if (!SuppressEvents && Content != null) {
224        TextBox tb = (TextBox)sender;
225        double val;
226        if (double.TryParse(tb.Text, out val)) {
227          if (val >= Content.SecondXAxisMaximumFixedValue) {
228            errorProvider.SetError(tb, "Number must be smaller than maximum.");
229            e.Cancel = true;
230          } else {
231            Content.SecondXAxisMinimumFixedValue = val;
232            errorProvider.SetError(tb, string.Empty);
233          }
234        } else {
235          errorProvider.SetError(tb, "Not a valid number.");
236          e.Cancel = true;
237        }
238      }
239    }
240
241    private void xAxisSecondaryMaximumFixedTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
242      if (!SuppressEvents && Content != null) {
243        TextBox tb = (TextBox)sender;
244        double val;
245        if (double.TryParse(tb.Text, out val)) {
246          if (val <= Content.SecondXAxisMinimumFixedValue) {
247            errorProvider.SetError(tb, "Number must be greater than minimum.");
248            e.Cancel = true;
249          } else {
250            Content.SecondXAxisMaximumFixedValue = val;
251            errorProvider.SetError(tb, string.Empty);
252          }
253        } else {
254          errorProvider.SetError(tb, "Not a valid number.");
255          e.Cancel = true;
256        }
257      }
258    }
259
260    private void yAxisPrimaryMinimumFixedTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
261      if (!SuppressEvents && Content != null) {
262        TextBox tb = (TextBox)sender;
263        double val;
264        if (double.TryParse(tb.Text, out val)) {
265          if (val >= Content.YAxisMaximumFixedValue) {
266            errorProvider.SetError(tb, "Number must be smaller than maximum.");
267            e.Cancel = true;
268          } else {
269            Content.YAxisMinimumFixedValue = val;
270            errorProvider.SetError(tb, string.Empty);
271          }
272        } else {
273          errorProvider.SetError(tb, "Not a valid number.");
274          e.Cancel = true;
275        }
276      }
277    }
278
279    private void yAxisPrimaryMaximumFixedTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
280      if (!SuppressEvents && Content != null) {
281        TextBox tb = (TextBox)sender;
282        double val;
283        if (double.TryParse(tb.Text, out val)) {
284          if (val <= Content.YAxisMinimumFixedValue) {
285            errorProvider.SetError(tb, "Number must be greater than minimum.");
286            e.Cancel = true;
287          } else {
288            Content.YAxisMaximumFixedValue = val;
289            errorProvider.SetError(tb, string.Empty);
290          }
291        } else {
292          errorProvider.SetError(tb, "Not a valid number.");
293          e.Cancel = true;
294        }
295      }
296    }
297
298    private void yAxisSecondaryMinimumFixedTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
299      if (!SuppressEvents && Content != null) {
300        TextBox tb = (TextBox)sender;
301        double val;
302        if (double.TryParse(tb.Text, out val)) {
303          if (val >= Content.SecondYAxisMaximumFixedValue) {
304            errorProvider.SetError(tb, "Number must be smaller than maximum.");
305            e.Cancel = true;
306          } else {
307            Content.SecondYAxisMinimumFixedValue = val;
308            errorProvider.SetError(tb, string.Empty);
309          }
310        } else {
311          errorProvider.SetError(tb, "Not a valid number.");
312          e.Cancel = true;
313        }
314      }
315    }
316
317    private void yAxisSecondaryMaximumFixedTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
318      if (!SuppressEvents && Content != null) {
319        TextBox tb = (TextBox)sender;
320        double val;
321        if (double.TryParse(tb.Text, out val)) {
322          if (val <= Content.SecondYAxisMinimumFixedValue) {
323            errorProvider.SetError(tb, "Number must be greater than minimum.");
324            e.Cancel = true;
325          } else {
326            Content.SecondYAxisMaximumFixedValue = val;
327            errorProvider.SetError(tb, string.Empty);
328          }
329        } else {
330          errorProvider.SetError(tb, "Not a valid number.");
331          e.Cancel = true;
332        }
333      }
334    }
335
336    private void xAxisPrimaryMinimumRadioButton_CheckedChanged(object sender, System.EventArgs e) {
337      if (!SuppressEvents && Content != null) {
338        SuppressEvents = true;
339        try {
340          Content.XAxisMinimumAuto = xAxisPrimaryMinimumAutoRadioButton.Checked;
341          if (Content.XAxisMinimumAuto) xAxisPrimaryMinimumFixedTextBox.Text = double.NaN.ToString();
342        } finally { SuppressEvents = false; }
343        SetEnabledStateOfControls();
344      }
345    }
346
347    private void xAxisPrimaryMaximumRadioButton_CheckedChanged(object sender, System.EventArgs e) {
348      if (!SuppressEvents && Content != null) {
349        SuppressEvents = true;
350        try {
351          Content.XAxisMaximumAuto = xAxisPrimaryMaximumAutoRadioButton.Checked;
352          if (Content.XAxisMaximumAuto) xAxisPrimaryMaximumFixedTextBox.Text = double.NaN.ToString();
353        } finally { SuppressEvents = false; }
354        SetEnabledStateOfControls();
355      }
356    }
357
358    private void xAxisSecondaryMinimumRadioButton_CheckedChanged(object sender, System.EventArgs e) {
359      if (!SuppressEvents && Content != null) {
360        SuppressEvents = true;
361        try {
362          Content.SecondXAxisMinimumAuto = xAxisSecondaryMinimumAutoRadioButton.Checked;
363          if (Content.SecondXAxisMinimumAuto) xAxisSecondaryMinimumFixedTextBox.Text = double.NaN.ToString();
364        } finally { SuppressEvents = false; }
365        SetEnabledStateOfControls();
366      }
367    }
368
369    private void xAxisSecondaryMaximumRadioButton_CheckedChanged(object sender, System.EventArgs e) {
370      if (!SuppressEvents && Content != null) {
371        SuppressEvents = true;
372        try {
373          Content.SecondXAxisMaximumAuto = xAxisSecondaryMaximumAutoRadioButton.Checked;
374          if (Content.SecondXAxisMaximumAuto) xAxisSecondaryMaximumFixedTextBox.Text = double.NaN.ToString();
375        } finally { SuppressEvents = false; }
376        SetEnabledStateOfControls();
377      }
378    }
379
380    private void yAxisPrimaryMinimumRadioButton_CheckedChanged(object sender, System.EventArgs e) {
381      if (!SuppressEvents && Content != null) {
382        SuppressEvents = true;
383        try {
384          Content.YAxisMinimumAuto = yAxisPrimaryMinimumAutoRadioButton.Checked;
385          if (Content.YAxisMinimumAuto) yAxisPrimaryMinimumFixedTextBox.Text = double.NaN.ToString();
386        } finally { SuppressEvents = false; }
387        SetEnabledStateOfControls();
388      }
389    }
390
391    private void yAxisPrimaryMaximumRadioButton_CheckedChanged(object sender, System.EventArgs e) {
392      if (!SuppressEvents && Content != null) {
393        SuppressEvents = true;
394        try {
395          Content.YAxisMaximumAuto = yAxisPrimaryMaximumAutoRadioButton.Checked;
396          if (Content.YAxisMaximumAuto) yAxisPrimaryMaximumFixedTextBox.Text = double.NaN.ToString();
397        } finally { SuppressEvents = false; }
398        SetEnabledStateOfControls();
399      }
400    }
401
402    private void yAxisSecondaryMinimumRadioButton_CheckedChanged(object sender, System.EventArgs e) {
403      if (!SuppressEvents && Content != null) {
404        SuppressEvents = true;
405        try {
406          Content.SecondYAxisMinimumAuto = yAxisSecondaryMinimumAutoRadioButton.Checked;
407          if (Content.SecondYAxisMinimumAuto) yAxisSecondaryMinimumFixedTextBox.Text = double.NaN.ToString();
408        } finally { SuppressEvents = false; }
409        SetEnabledStateOfControls();
410      }
411    }
412
413    private void yAxisSecondaryMaximumRadioButton_CheckedChanged(object sender, System.EventArgs e) {
414      if (!SuppressEvents && Content != null) {
415        SuppressEvents = true;
416        try {
417          Content.SecondYAxisMaximumAuto = yAxisSecondaryMaximumAutoRadioButton.Checked;
418          if (Content.SecondYAxisMaximumAuto) yAxisSecondaryMaximumFixedTextBox.Text = double.NaN.ToString();
419        } finally { SuppressEvents = false; }
420        SetEnabledStateOfControls();
421      }
422    }
423
424    private void xAxisPrimaryLogScaleCheckBox_CheckedChanged(object sender, System.EventArgs e) {
425      if (!SuppressEvents && Content != null) {
426        SuppressEvents = true;
427        try {
428          Content.XAxisLogScale = xAxisPrimaryLogScaleCheckBox.Checked;
429        } finally { SuppressEvents = false; }
430      }
431    }
432
433    private void xAxisSecondaryLogScaleCheckBox_CheckedChanged(object sender, System.EventArgs e) {
434      if (!SuppressEvents && Content != null) {
435        SuppressEvents = true;
436        try {
437          Content.SecondXAxisLogScale = xAxisSecondaryLogScaleCheckBox.Checked;
438        } finally { SuppressEvents = false; }
439      }
440    }
441
442    private void yAxisPrimaryLogScaleCheckBox_CheckedChanged(object sender, System.EventArgs e) {
443      if (!SuppressEvents && Content != null) {
444        SuppressEvents = true;
445        try {
446          Content.YAxisLogScale = yAxisPrimaryLogScaleCheckBox.Checked;
447        } finally { SuppressEvents = false; }
448      }
449    }
450
451    private void yAxisSecondaryLogScaleCheckBox_CheckedChanged(object sender, System.EventArgs e) {
452      if (!SuppressEvents && Content != null) {
453        SuppressEvents = true;
454        try {
455          Content.SecondYAxisLogScale = yAxisSecondaryLogScaleCheckBox.Checked;
456        } finally { SuppressEvents = false; }
457      }
458    }
459
460    private void titleFontButton_Click(object sender, System.EventArgs e) {
461      titleFontDialog.Font = Content.TitleFont;
462      titleFontDialog.Color = Content.TitleColor;
463      if (titleFontDialog.ShowDialog() == DialogResult.OK) {
464        Content.TitleFont = titleFontDialog.Font;
465        Content.TitleColor = titleFontDialog.Color;
466        titleFontLabel.Text = "( " + FormatFont(Content.TitleFont) + " )";
467      }
468    }
469
470    private void axisFontButton_Click(object sender, System.EventArgs e) {
471      axisFontDialog.Font = Content.AxisTitleFont;
472      axisFontDialog.Color = Content.AxisTitleColor;
473      if (axisFontDialog.ShowDialog() == DialogResult.OK) {
474        Content.AxisTitleFont = axisFontDialog.Font;
475        Content.AxisTitleColor = axisFontDialog.Color;
476        axisFontLabel.Text = "( " + FormatFont(Content.AxisTitleFont) + " )";
477      }
478    }
479
480    private void titleTextBox_Validated(object sender, System.EventArgs e) {
481      if (!SuppressEvents && Content != null) {
482        Content.Title = titleTextBox.Text;
483      }
484    }
485    #endregion
486
487    private string FormatFont(Font f) {
488      if (f == null) return "default";
489      else return f.Name + ", " + f.SizeInPoints.ToString() + "pt, " + f.Style.ToString();
490    }
491  }
492}
Note: See TracBrowser for help on using the repository browser.