GUI/MainForm.cs
changeset 297 21504f47aedf
parent 295 a1c06df9928d
child 298 96263190189a
     1.1 --- a/GUI/MainForm.cs	Mon May 23 18:14:25 2011 +0000
     1.2 +++ b/GUI/MainForm.cs	Sat Jun 04 13:27:11 2011 +0000
     1.3 @@ -315,12 +315,17 @@
     1.4              break;
     1.5          }
     1.6        };
     1.7 -      plotForm.Closing += delegate(object sender, CancelEventArgs e) {
     1.8 -        if (plotLocation.Value == 0) {
     1.9 -          showPlot.Value = false;
    1.10 +
    1.11 +      plotForm.FormClosing += delegate(object sender, FormClosingEventArgs e) {
    1.12 +        if (e.CloseReason == CloseReason.UserClosing) {
    1.13 +          // just switch off the plotting when the user closes the form
    1.14 +          if (plotLocation.Value == 0) {
    1.15 +            showPlot.Value = false;
    1.16 +          }
    1.17 +          e.Cancel = true;
    1.18          }
    1.19 -        e.Cancel = true;
    1.20        };
    1.21 +
    1.22        EventHandler moveOrResizePlotForm = delegate(object sender, EventArgs e) {
    1.23          if (plotForm.WindowState != FormWindowState.Minimized) {
    1.24            settings.SetValue("plotForm.Location.X", plotForm.Bounds.X);