Fixed a problem preventing the plot form getting closed correctly. This did prevent the application from terminating when asked to exit by the operating system (for example at shutdown).
authormoel.mich
Sat, 04 Jun 2011 13:27:11 +0000
changeset 29721504f47aedf
parent 296 414783d1cda9
child 298 96263190189a
Fixed a problem preventing the plot form getting closed correctly. This did prevent the application from terminating when asked to exit by the operating system (for example at shutdown).
GUI/MainForm.cs
     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);