/// <summary> /// From the menu bar, "open" button opens a new GUI window /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void newButton_Click(object sender, EventArgs e) { SpreadsheetGUI newWindow = new SpreadsheetGUI(); int count = SSApplicationContext.getAppContext().RunWindow(newWindow); newWindow.Text = "Spreadsheet " + count; // change spreadsheet title }
/// <summary> /// Runs the GUI /// </summary> public void RunNew() { // Create the window and the controller SpreadsheetGUI spreadsheetGUI = new SpreadsheetGUI(); new Controller(spreadsheetGUI); windowCount++; spreadsheetGUI.FormClosed += (o, e) => { if (--windowCount <= 0) { ExitThread(); } }; spreadsheetGUI.Show(); }
/// <summary> /// Run the form in this application context /// </summary> public void RunNew() { // Creates a window and a controller SpreadsheetGUI window = new SpreadsheetGUI(); new Controller(window); // Add to the count windowCount++; // Check for whether the window has been closed window.FormClosed += (o, e) => { if (--windowCount <= 0) { ExitThread(); } }; // Run the form window.Show(); }