[Monodevelop-patches-list] r395 - src/Main/Base/Gui/Dialogs/Wizard

commit-watcher at sevenl.net commit-watcher at sevenl.net
Tue Jan 6 18:03:13 EST 2004


Author: jluke
Date: 2004-01-06 18:03:13 -0500 (Tue, 06 Jan 2004)
New Revision: 395

Modified:
   src/Main/Base/Gui/Dialogs/Wizard/CurrentPanelPanel.cs
   src/Main/Base/Gui/Dialogs/Wizard/IWizardPanel.cs
   src/Main/Base/Gui/Dialogs/Wizard/WizardDialog.cs
Log:
make this a Dialog instead of a window
show MessageDialog on exit and exit when done


Modified: src/Main/Base/Gui/Dialogs/Wizard/CurrentPanelPanel.cs
===================================================================
--- src/Main/Base/Gui/Dialogs/Wizard/CurrentPanelPanel.cs	2004-01-06 22:54:04 UTC (rev 394)
+++ src/Main/Base/Gui/Dialogs/Wizard/CurrentPanelPanel.cs	2004-01-06 23:03:13 UTC (rev 395)
@@ -10,8 +10,9 @@
 using System.Drawing;
 using System.Drawing.Drawing2D;
 using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
+using Gtk;
+using Gdk;
+using Pango;
 using System.Xml;
 
 using ICSharpCode.Core.Services;
@@ -22,8 +23,8 @@
 
 namespace ICSharpCode.SharpDevelop.Gui.Dialogs
 {
-	public class CurrentPanelPanel : Gtk.DrawingArea
-	{/*
+	public class CurrentPanelPanel : DrawingArea
+	{
 		WizardDialog wizard;
 		Pixbuf backGround = null;
 		
@@ -36,8 +37,9 @@
 
 			this.wizard = wizard;
 			//backGround = resourceService.GetBitmap("GeneralWizardBackground");
-			RequestSize = new Size(wizard.Width - 220, 30);
-		}
+			//RequestSize = new Size (wizard.Width - 220, 30);
+		}
+		/*
 		
 		protected override void OnPaintBackground(PaintEventArgs pe)
 		{

Modified: src/Main/Base/Gui/Dialogs/Wizard/IWizardPanel.cs
===================================================================
--- src/Main/Base/Gui/Dialogs/Wizard/IWizardPanel.cs	2004-01-06 22:54:04 UTC (rev 394)
+++ src/Main/Base/Gui/Dialogs/Wizard/IWizardPanel.cs	2004-01-06 23:03:13 UTC (rev 395)
@@ -8,7 +8,7 @@
 using System;
 using System.Collections;
 using System.CodeDom.Compiler;
-using System.Windows.Forms;
+using Gtk;
 
 using ICSharpCode.Core.AddIns;
 using ICSharpCode.Core.AddIns.Codons;

Modified: src/Main/Base/Gui/Dialogs/Wizard/WizardDialog.cs
===================================================================
--- src/Main/Base/Gui/Dialogs/Wizard/WizardDialog.cs	2004-01-06 22:54:04 UTC (rev 394)
+++ src/Main/Base/Gui/Dialogs/Wizard/WizardDialog.cs	2004-01-06 23:03:13 UTC (rev 395)
@@ -5,13 +5,10 @@
 //     <version value="$version"/>
 // </file>
 
-using System;
-using System.Diagnostics;
+using System;
 using System.Drawing;
-using System.Drawing.Drawing2D;
+using System.Diagnostics;
 using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
 using System.Xml;
 
 using ICSharpCode.Core.Services;
@@ -19,21 +16,21 @@
 
 using ICSharpCode.Core.Properties;
 using ICSharpCode.Core.AddIns.Codons;
-
+using Gtk;
 namespace ICSharpCode.SharpDevelop.Gui.Dialogs
 {
 	/// <summary>
 	/// TreeView options are used, when more options will be edited (for something like
 	/// IDE Options + Plugin Options)
 	/// </summary>
-	public class WizardDialog : Gtk.Window
+	public class WizardDialog : Dialog
 	{
 		StatusPanel       statusPanel  = null;
 		//CurrentPanelPanel curPanel     = null;
 		
 		Gtk.Frame             dialogPanel  = new Gtk.Frame();
 
-		DialogResult DialogResult;
+		ResponseType ResponseType;
 		
 		/// <remarks>
 		/// On this stack the indices of the previous active wizard panels. This
@@ -201,10 +198,12 @@
 			
 		}
 		
-		public WizardDialog(string title, object customizer, string treePath) : base ("-")
+		public WizardDialog (string title, object customizer, string treePath)
 		{
 			IAddInTreeNode node = AddInTreeSingleton.AddInTree.GetTreeNode(treePath);
-			this.Title = title;
+			this.Title = title;
+			this.BorderWidth = 6;
+			this.HasSeparator = false;
 			
 			if (node != null) {
 				AddNodes(customizer, node.BuildChildItems(this));
@@ -225,8 +224,9 @@
 			panel.IsLastPanel = false;
 			ShowNextPanelEvent(sender, e);
 			panel.IsLastPanel = isLast;
-			this.Hide ();
-			Gtk.Application.Quit ();
+			this.Hide ();
+			ShowMustRestart ();
+			Application.Quit ();
 			
 		}
 		
@@ -235,15 +235,15 @@
 			int nextID = GetSuccessorNumber(this.ActivePanelNumber);
 			Debug.Assert(nextID < wizardPanels.Count && nextID >= 0);
 
-			Console.WriteLine ("Inside ShowNextPanelEvent");
-			//if (!CurrentWizardPane.ReceiveDialogMessage(DialogMessage.Next)) {
+			//Console.WriteLine ("Inside ShowNextPanelEvent");
+			//if (!CurrentWizardPane.ReceiveDialogMessage(ResponseType.Next)) {
 			//	return;
 			//}
-			CurrentWizardPane.ReceiveDialogMessage (DialogMessage.Next);
+			//CurrentWizardPane.ReceiveDialogMessage (ResponseType.Next);
 			Console.WriteLine ("Past ReceiveDialogMessage call");
 			idStack.Push(activePanelNumber);
 			ActivatePanel(nextID);
-			CurrentWizardPane.ReceiveDialogMessage(DialogMessage.Activated);
+			//CurrentWizardPane.ReceiveDialogMessage(ResponseType.Activated);
 		}
 		
 		void ShowPrevPanelEvent(object sender, EventArgs e)
@@ -262,7 +262,9 @@
 					return;
 				}
 			}
-			//DialogResult = DialogResult.OK;
+			ResponseType = ResponseType.Ok;
+			//ShowMustRestart ();
+			//Application.Quit ();
 		}
 		
 		void CancelEvent(object sender, EventArgs e)
@@ -272,7 +274,9 @@
 					return;
 				}
 			}
-			DialogResult = DialogResult.Cancel;
+			ResponseType = ResponseType.Cancel;
+			ShowMustRestart ();
+			Application.Quit ();
 		}
 		
 		void HelpEvent(object sender, EventArgs e)
@@ -287,25 +291,12 @@
 			ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
 		
 			dialogPanel.Shadow = Gtk.ShadowType.None;
+		
+			//this.GdkWindow.SkipPagerHint = true;
+			//this.GdkWindow.SkipTaskbarHint = true;
+			this.WindowPosition = WindowPosition.Center;
+			this.SetDefaultSize (640, 440);
 		
-			//ShowInTaskbar = false;
-			//StartPosition   = FormStartPosition.CenterScreen;
-			//FormBorderStyle = FormBorderStyle.FixedDialog;
-			//MinimizeBox = MaximizeBox = false;
-			//Icon   = null;
-			//ClientSize = new Size(640, 440);
-			RequestSize = new Size (640, 440);
-			
-			//FIXME: label1 stuff.
-			/*label1.Size        = new Size(Width - 4, 1);
-			label1.BorderStyle = BorderStyle.Fixed3D;
-			label1.Location    = new Point(2, 404 - 2);
-			label1.Anchor = AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Left;
-			Controls.Add(label1);*/
-		
-			Gtk.HButtonBox buttonbox = new Gtk.HButtonBox ();
-			buttonbox.Layout = Gtk.ButtonBoxStyle.End;
-		
 			//backButton = new Gtk.Button (resourceService.GetString ("Global.BackButtonText"));
 			backButton = new ImageButton(Gtk.Stock.GoBack,resourceService.GetString ("Global.BackButtonText"));
 			backButton.Clicked   += new EventHandler(ShowPrevPanelEvent);
@@ -322,36 +313,28 @@
 			cancelButton = new ImageButton(Gtk.Stock.Cancel,resourceService.GetString("Global.CancelButtonText"));
 			cancelButton.Clicked   += new EventHandler(CancelEvent);
 		
-			buttonbox.PackStart (backButton);
-			buttonbox.PackStart (nextButton);
-			buttonbox.PackStart (finishButton);
-			buttonbox.PackStart (cancelButton);
-			buttonbox.Spacing = 5;
-			buttonbox.Homogeneous = true;
-		
+			this.ActionArea.PackStart (backButton);
+			this.ActionArea.PackStart (nextButton);
+			this.ActionArea.PackStart (finishButton);
+			this.ActionArea.PackStart (cancelButton);
+			
 //			helpButton.Text = resourceService.GetString("Global.HelpButtonText");
-//			helpButton.Location = new Point(buttonXStart + 4 * (buttonSize + 4), buttonYLoc);
-//			helpButton.ClientSize     = new Size(buttonSize, 26);
-//			helpButton.Click   += new EventHandler(HelpEvent);
-//			helpButton.FlatStyle = FlatStyle.System;
-//			helpButton.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
-//			Controls.Add(helpButton);
+//			helpButton.Clicked += new EventHandler (HelpEvent);
+//			this.ActionArea.Add(helpButton);
 			
-			Gtk.HBox topbox = new Gtk.HBox (false, 2);
-			
-			statusPanel = new StatusPanel(this);
-			
-			topbox.PackStart (statusPanel, false, false, 2);
-			
+			Gtk.HBox topbox = new Gtk.HBox (false, 2);			
+			statusPanel = new StatusPanel(this);			
+			topbox.PackStart (statusPanel, false, false, 2);			
 			topbox.PackStart (dialogPanel);
 
-			Gtk.VBox mainbox = new Gtk.VBox (false, 2);
-			mainbox.PackStart (topbox);
-			mainbox.PackStart (buttonbox, false, false, 2);
-			mainbox.BorderWidth = 5;
-			mainbox.Spacing = 5;
-
-			this.Add (mainbox);
+			this.VBox.PackStart (topbox);
+		}
+		
+		private void ShowMustRestart ()
+		{
+			MessageDialog md = new MessageDialog (this, DialogFlags.Modal | DialogFlags.DestroyWithParent, MessageType.Info, ButtonsType.Ok, "You must restart MonoDevelop now.");
+			md.Run ();
+			md.Hide ();
 		}
 	}
 }




More information about the Monodevelop-patches-list mailing list