[Monodevelop-patches-list] r714 - in trunk/MonoDevelop: data/resources/glade src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Thu Jan 29 13:50:09 EST 2004


Author: dkor
Date: 2004-01-29 13:50:09 -0500 (Thu, 29 Jan 2004)
New Revision: 714

Modified:
   trunk/MonoDevelop/data/resources/glade/Base.glade
   trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/SelectStylePanel.cs
Log:
Glading of Visual Style options panel

Modified: trunk/MonoDevelop/data/resources/glade/Base.glade
===================================================================
--- trunk/MonoDevelop/data/resources/glade/Base.glade	2004-01-29 17:11:40 UTC (rev 713)
+++ trunk/MonoDevelop/data/resources/glade/Base.glade	2004-01-29 18:50:09 UTC (rev 714)
@@ -1267,7 +1267,7 @@
     <widget class="GtkVBox" id="vbox13">
       <property name="visible">True</property>
       <property name="homogeneous">False</property>
-      <property name="spacing">0</property>
+      <property name="spacing">6</property>
 
       <child>
 	<widget class="GtkCheckButton" id="extensionButton">

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/SelectStylePanel.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/SelectStylePanel.cs	2004-01-29 17:11:40 UTC (rev 713)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/IDEOptions/SelectStylePanel.cs	2004-01-29 18:50:09 UTC (rev 714)
@@ -17,6 +17,9 @@
 using ICSharpCode.Core.Services;
 using ICSharpCode.Core.AddIns;
 
+using Gtk;
+using MonoDevelop.Gui;
+
 namespace ICSharpCode.SharpDevelop.Gui.Dialogs.OptionPanels
 {
 	public class SelectStylePanel : AbstractOptionPanel
@@ -30,32 +33,31 @@
 
 		PropertyService PropertyService = (PropertyService)ServiceManager.Services.GetService (typeof (PropertyService));
 
-		Gtk.Menu ambienceMenu;
-		Gtk.CheckButton extensionButton;
-		Gtk.OptionMenu option;
-		
+
+		class SelectStylePanelWidget : GladeWidgetExtract {
+			public Gtk.Menu ambienceMenu;
+			[Glade.Widget] public Gtk.CheckButton extensionButton;
+			[Glade.Widget] public Gtk.OptionMenu option;
+					
+			public SelectStylePanelWidget () : base ("Base.glade", "SelectStylePanel")
+			{
+				ambienceMenu = new Gtk.Menu ();
+				option.Menu = ambienceMenu;
+			}
+		}
+
 		public SelectStylePanel () : base ()
 		{
-			extensionButton = Gtk.CheckButton.NewWithLabel ("Show Extensions in project scout");
-			ambienceMenu = new Gtk.Menu ();
+		}
 
-			option = new Gtk.OptionMenu ();
-			option.Menu = ambienceMenu;
-
-			Gtk.VBox mainbox = new Gtk.VBox (false, 2);
-
-			mainbox.PackStart (extensionButton, false, false, 2);
-			mainbox.PackStart (option, false, false, 2);
-
-			this.Add (mainbox);
-			
-		}
+		SelectStylePanelWidget widget;
 		
 		public override void LoadPanelContents()
 		{
+			Add (widget = new SelectStylePanelWidget ());
+
+			widget.extensionButton.Active  = PropertyService.GetProperty("ICSharpCode.SharpDevelop.Gui.ProjectBrowser.ShowExtensions", true);
 			
-			extensionButton.Active  = PropertyService.GetProperty("ICSharpCode.SharpDevelop.Gui.ProjectBrowser.ShowExtensions", true);
-			
 			IAddInTreeNode treeNode = AddInTreeSingleton.AddInTree.GetTreeNode("/SharpDevelop/Workbench/Ambiences");
 			string active = PropertyService.GetProperty ("SharpDevelop.UI.CurrentAmbience", "CSharp");
 
@@ -63,10 +65,10 @@
 			uint im = 0;
 			foreach (IAddInTreeNode childNode in treeNode.ChildNodes.Values) {
 				Gtk.MenuItem i = Gtk.MenuItem.NewWithLabel (childNode.Codon.ID);
-				ambienceMenu.Append(i);
+				widget.ambienceMenu.Append(i);
 				MenuToValue[i] = childNode.Codon.ID;
 				if (childNode.Codon.ID == active) {
-					option.SetHistory (im);
+					widget.option.SetHistory (im);
 				}
 				im++;
 			}			
@@ -75,8 +77,8 @@
 		
 		public override bool StorePanelContents()
 		{
-			PropertyService.SetProperty("ICSharpCode.SharpDevelop.Gui.ProjectBrowser.ShowExtensions", extensionButton.Active);
-			PropertyService.SetProperty("SharpDevelop.UI.CurrentAmbience", (string)MenuToValue[ambienceMenu.Active]);
+			PropertyService.SetProperty("ICSharpCode.SharpDevelop.Gui.ProjectBrowser.ShowExtensions", widget.extensionButton.Active);
+			PropertyService.SetProperty("SharpDevelop.UI.CurrentAmbience", (string)MenuToValue[widget.ambienceMenu.Active]);
 			return true;
 		}
 	}




More information about the Monodevelop-patches-list mailing list