[Monodevelop-patches-list] r494 - in trunk/MonoDevelop: data/resources data/resources/glade src/Main/Base src/Main/Base/Commands src/Main/Base/Gui/Dialogs

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Fri Jan 16 00:17:44 EST 2004


Author: tberman
Date: 2004-01-16 00:17:44 -0500 (Fri, 16 Jan 2004)
New Revision: 494

Added:
   trunk/MonoDevelop/data/resources/glade/
   trunk/MonoDevelop/data/resources/glade/Base.glade
   trunk/MonoDevelop/data/resources/glade/Base.gladep
Modified:
   trunk/MonoDevelop/src/Main/Base/Commands/ToolsCommands.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/TreeViewOptions.cs
   trunk/MonoDevelop/src/Main/Base/Makefile
Log:
glade'd the TreeViewOptions dialog



Property changes on: trunk/MonoDevelop/data/resources/glade
___________________________________________________________________
Name: svn:ignore
   + *.bak


Added: trunk/MonoDevelop/data/resources/glade/Base.glade
===================================================================
--- trunk/MonoDevelop/data/resources/glade/Base.glade	2004-01-15 23:36:58 UTC (rev 493)
+++ trunk/MonoDevelop/data/resources/glade/Base.glade	2004-01-16 05:17:44 UTC (rev 494)
@@ -0,0 +1,199 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+<requires lib="gnome"/>
+
+<widget class="GtkDialog" id="TreeViewOptionDialog">
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">dialog1</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">False</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="has_separator">True</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="MainBox">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="ActionArea">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+	  <child>
+	    <widget class="GtkButton" id="cancelbutton">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-cancel</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="response_id">-6</property>
+	      <signal name="clicked" handler="CancelEvent" last_modification_time="Thu, 15 Jan 2004 07:06:35 GMT"/>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkButton" id="okbutton">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-ok</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="response_id">-5</property>
+	      <signal name="clicked" handler="AcceptEvent" last_modification_time="Thu, 15 Jan 2004 07:06:24 GMT"/>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkHBox" id="DisplayBox">
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">0</property>
+
+	  <child>
+	    <widget class="GtkTreeView" id="TreeView">
+	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="headers_visible">False</property>
+	      <property name="rules_hint">False</property>
+	      <property name="reorderable">False</property>
+	      <property name="enable_search">True</property>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkVBox" id="optionPanel">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkLabel" id="optionTitle">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">label3</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkNotebook" id="mainBook">
+		  <property name="visible">True</property>
+		  <property name="show_tabs">False</property>
+		  <property name="show_border">False</property>
+		  <property name="tab_pos">GTK_POS_TOP</property>
+		  <property name="scrollable">False</property>
+		  <property name="enable_popup">False</property>
+
+		  <child>
+		    <widget class="GtkFrame" id="frame1">
+		      <property name="visible">True</property>
+		      <property name="label_xalign">0</property>
+		      <property name="label_yalign">0.5</property>
+		      <property name="shadow_type">GTK_SHADOW_NONE</property>
+
+		      <child>
+			<placeholder/>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label5">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">label5</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			</widget>
+			<packing>
+			  <property name="type">label_item</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="tab_expand">False</property>
+		      <property name="tab_fill">True</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label4">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">label4</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0.5</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		    </widget>
+		    <packing>
+		      <property name="type">tab</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+</glade-interface>

Added: trunk/MonoDevelop/data/resources/glade/Base.gladep
===================================================================
--- trunk/MonoDevelop/data/resources/glade/Base.gladep	2004-01-15 23:36:58 UTC (rev 493)
+++ trunk/MonoDevelop/data/resources/glade/Base.gladep	2004-01-16 05:17:44 UTC (rev 494)
@@ -0,0 +1,7 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
+
+<glade-project>
+  <name>Glade</name>
+  <program_name>glade</program_name>
+</glade-project>

Modified: trunk/MonoDevelop/src/Main/Base/Commands/ToolsCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/ToolsCommands.cs	2004-01-15 23:36:58 UTC (rev 493)
+++ trunk/MonoDevelop/src/Main/Base/Commands/ToolsCommands.cs	2004-01-16 05:17:44 UTC (rev 494)
@@ -27,7 +27,7 @@
 			PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
 			TreeViewOptions optionsDialog = new TreeViewOptions((IProperties)propertyService.GetProperty("ICSharpCode.TextEditor.Document.Document.DefaultDocumentAggregatorProperties", new DefaultProperties()),
 			                                                           AddInTreeSingleton.AddInTree.GetTreeNode("/SharpDevelop/Dialogs/OptionsDialog"));
-										   			optionsDialog.ShowAll ();
+			//optionsDialog.ShowAll ();
 			//	optionsDialog.FormBorderStyle = FormBorderStyle.FixedDialog;
 				
 			//	optionsDialog.Owner = (Form)WorkbenchSingleton.Workbench;

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/TreeViewOptions.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/TreeViewOptions.cs	2004-01-15 23:36:58 UTC (rev 493)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/TreeViewOptions.cs	2004-01-16 05:17:44 UTC (rev 494)
@@ -1,347 +1,221 @@
-// <file>
-//     <copyright see="prj:///doc/copyright.txt"/>
-//     <license see="prj:///doc/license.txt"/>
-//     <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
-//     <version value="$version"/>
-// </file>
-
-using System;
-using System.IO;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-using System.Xml;
-
-using ICSharpCode.Core.AddIns;
-using ICSharpCode.Core.Services;
-using ICSharpCode.Core.Properties;
-using ICSharpCode.Core.AddIns.Codons;
-using ICSharpCode.SharpDevelop.Gui.XmlForms;
-
-namespace ICSharpCode.SharpDevelop.Gui.Dialogs
-{
-	/*
-	public class GradientHeaderPanel : Label
-	{
-		public GradientHeaderPanel(int fontSize) : this()
-		{
-			Font = new Font("Tahoma", fontSize);
-		}
-		
-		public GradientHeaderPanel() : base()
-		{
-			ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
-			
-			ResizeRedraw = true;
-			Text = String.Empty;
-		}
-
-		protected override void OnPaintBackground(PaintEventArgs pe)
-		{
-			base.OnPaintBackground(pe);
-			Graphics g = pe.Graphics;
-			
-			g.FillRectangle(new LinearGradientBrush(new Point(0, 0), new Point(Width, Height), 
-			                                        SystemColors.Window, SystemColors.Control),
-							new Rectangle(0, 0, Width, Height));
-		}
-	}*/
-	
-	/// <summary>
-	/// TreeView options are used, when more options will be edited (for something like
-	/// IDE Options + Plugin Options)
-	/// </summary>
-	public class TreeViewOptions : Gtk.Window
-	{
-		//protected GradientHeaderPanel optionsPanelLabel;
-		
-		protected ArrayList OptionPanels          = new ArrayList();
-		
-		protected IProperties properties = null;
-		
-		protected Font plainFont = null;
-		protected Font boldFont  = null;
-
-		Gtk.TreeStore treeStore;
-		Gtk.TreeView  treeView;
-		Gtk.Label     topLabel;
-		Gtk.Button    okButton;
-		Gtk.Button    cancelButton;
-		Gtk.Frame     optionPanel;
-
-		PixbufList    imglist;
-	
-		ResourceService IconService = (ResourceService)ServiceManager.Services.GetService (typeof (IResourceService));
-		StringParserService StringParserService = (StringParserService)ServiceManager.Services.GetService (typeof (StringParserService));
-	
-		public IProperties Properties {
-			get {
-				return properties;
-			}
-		}
-		
-		protected void AcceptEvent(object sender, EventArgs e)
-		{
-			foreach (AbstractOptionPanel pane in OptionPanels) {
-				if (!pane.ReceiveDialogMessage(DialogMessage.OK)) {
-					return;
-				}
-			}
-			Hide ();
-			//DialogResult = DialogResult.OK;
-		}
-		
-		/*protected void ResetImageIndex(TreeNodeCollection nodes)
-		{
-			foreach (TreeNode node in nodes) {
-				if (node.Nodes.Count > 0) {
-					ResetImageIndex(node.Nodes);
-				} else {
-					node.ImageIndex         = 2;
-					node.SelectedImageIndex = 3;
-				}
-			}
-		}*/
-		
-		protected bool b = true;
-		
-		/*protected void BeforeExpandNode(object sender, TreeViewCancelEventArgs e)
-		{
-			if (!b) {
-				return;
-			}
-			b = false;
-			((TreeView)ControlDictionary["optionsTreeView"]).BeginUpdate();
-			// search first leaf node (leaf nodes have no children)
-			TreeNode node = e.Node.FirstNode;
-			while (node.Nodes.Count > 0) {
-				node = node.FirstNode;
-			}
-			((TreeView)ControlDictionary["optionsTreeView"]).CollapseAll();
-			node.EnsureVisible();
-			node.ImageIndex = 3;
-			((TreeView)ControlDictionary["optionsTreeView"]).EndUpdate();
-			SetOptionPanelTo(node);
-			b = true;
-		}*/
-		
-		/*protected void BeforeSelectNode(object sender, TreeViewCancelEventArgs e)
-		{
-			ResetImageIndex(((TreeView)ControlDictionary["optionsTreeView"]).Nodes);
-			if (b) {
-				CollapseOrExpandNode(e.Node);
-			}
-		}*/
-		
-		/*protected void HandleClick(object sender, EventArgs e)
-		{
-			if (((TreeView)ControlDictionary["optionsTreeView"]).GetNodeAt(((TreeView)ControlDictionary["optionsTreeView"]).PointToClient(Control.MousePosition)) == ((TreeView)ControlDictionary["optionsTreeView"]).SelectedNode && b) {
-				CollapseOrExpandNode(((TreeView)ControlDictionary["optionsTreeView"]).SelectedNode);
-			}
-		}*/
-		
-		/*void CollapseOrExpandNode(TreeNode node)
-		{
-			if (node.Nodes.Count > 0) {  // only folders
-				if (node.IsExpanded) {
-					node.Collapse();
-				}  else {
-					node.Expand();			
-				}
-			}
-		}*/
-		
-		protected void SetOptionPanelTo(IDialogPanelDescriptor descriptor)
-		{
-			if (descriptor != null && descriptor.DialogPanel != null) {
-				descriptor.DialogPanel.ReceiveDialogMessage(DialogMessage.Activated);
-				foreach (Gtk.Widget widg in optionPanel.Children) {
-					optionPanel.Remove (widg);
-				}
-				optionPanel.Add (descriptor.DialogPanel.Control);
-				topLabel.Text = descriptor.Label;
-				ShowAll ();
-			}
-		}
-		
-		/*void TreeMouseDown(object sender, MouseEventArgs e)
-		{
-			TreeNode node = ((TreeView)ControlDictionary["optionsTreeView"]).GetNodeAt(((TreeView)ControlDictionary["optionsTreeView"]).PointToClient(Control.MousePosition));
-			if (node != null) {
-				if (node.Nodes.Count == 0) ((TreeView)ControlDictionary["optionsTreeView"]).SelectedNode = node;
-			}
-		}*/
-		
-		protected void AddNodes(object customizer, Gtk.TreeIter iter, ArrayList dialogPanelDescriptors)
-		{
-			foreach (IDialogPanelDescriptor descriptor in dialogPanelDescriptors) {
-				if (descriptor.DialogPanel != null) { // may be null, if it is only a "path"
-					descriptor.DialogPanel.CustomizationObject = customizer;
-					OptionPanels.Add(descriptor.DialogPanel);
-				}
-			
-				Gtk.TreeIter i;
-				if (iter.Equals (Gtk.TreeIter.Zero)) {
-					i = treeStore.AppendValues  (descriptor.Label, descriptor, imglist[2]);
-				} else {
-					i = treeStore.AppendValues(iter, descriptor.Label, descriptor, imglist[2]);
-				}
-				if (descriptor.DialogPanelDescriptors != null) {
-					AddNodes(customizer, i, descriptor.DialogPanelDescriptors);
-				}
-			}
-		}
-		
-		protected void SelectNode(object sender, EventArgs e)
-		{
-			Gtk.TreeModel mdl;
-			Gtk.TreeIter  iter;
-			if (treeView.Selection.GetSelected (out mdl, out iter)) {
-				if (treeStore.IterHasChild (iter)) {
-					Gtk.TreeIter new_iter;
-					treeStore.IterChildren (out new_iter, iter);
-					Gtk.TreePath new_path = treeStore.GetPath (new_iter);
-					treeView.CollapseAll ();
-					treeView.ExpandToPath (new_path);
-					treeView.Selection.SelectPath (new_path);
-				} else {
-					treeStore.Foreach (new Gtk.TreeModelForeachFunc (killArrows));
-					treeStore.SetValue (iter, 2, imglist[3]);
-					SetOptionPanelTo ((IDialogPanelDescriptor)treeStore.GetValue (iter, 1));
-				}
-			}
-			
-			//SetOptionPanelTo(((TreeView)ControlDictionary["optionsTreeView"]).SelectedNode);
-		}
-
-		bool killArrows (Gtk.TreeModel mdl, Gtk.TreePath path, Gtk.TreeIter iter)
-		{
-			treeStore.SetValue (iter, 2, imglist[2]);
-			return false;
-		}
-		
-		protected void InitImageList()
-		{
-			imglist = new PixbufList();
-			imglist.Add(IconService.GetBitmap("Icons.16x16.ClosedFolderBitmap"));
-			imglist.Add(IconService.GetBitmap("Icons.16x16.OpenFolderBitmap"));
-			imglist.Add(IconService.GetBitmap("Icons.16x16.Empty") );
-			imglist.Add(IconService.GetBitmap("Icons.16x16.SelectionArrow"));
-			
-			//((TreeView)ControlDictionary["optionsTreeView"]).ImageList = imglist;
-		}
-		
-		/*protected void ShowOpenFolderIcon(object sender, TreeViewCancelEventArgs e)
-		{
-			if (e.Node.Nodes.Count > 0) {
-				e.Node.ImageIndex = e.Node.SelectedImageIndex = 1;
-			}
-		}*/
-		
-		/*protected void ShowClosedFolderIcon(object sender, TreeViewCancelEventArgs e)
-		{
-			if (e.Node.Nodes.Count > 0) {
-				e.Node.ImageIndex = e.Node.SelectedImageIndex = 0;
-			}
-		}*/
-		
-		public TreeViewOptions(IProperties properties, IAddInTreeNode node) : base ("Options...")
-		{
-			this.properties = properties;
-			
-			this.Title = StringParserService.Parse("${res:Dialog.Options.TreeViewOptions.DialogName}");
-
-			InitImageList ();
-
-			this.InitializeComponent();
-			
-			//plainFont = new Font(((TreeView)ControlDictionary["optionsTreeView"]).Font, FontStyle.Regular);
-			//boldFont  = new Font(((TreeView)ControlDictionary["optionsTreeView"]).Font, FontStyle.Bold);
-			
-			if (node != null) {
-				AddNodes(properties, Gtk.TreeIter.Zero, node.BuildChildItems(this));
-			}
-		}
-		
-		protected void InitializeComponent() 
-		{
-			
-			treeStore = new Gtk.TreeStore (typeof(string), typeof(IDialogPanelDescriptor), typeof (Gdk.Pixbuf));
-			treeView = new Gtk.TreeView (treeStore);
-
-			Gtk.TreeViewColumn column = new Gtk.TreeViewColumn ();
-			column.Title = "items";
-			
-			Gtk.CellRendererPixbuf pix_render = new Gtk.CellRendererPixbuf ();
-			pix_render.PixbufExpanderOpen = imglist[1];
-			pix_render.PixbufExpanderClosed = imglist[0];
-
-			column.PackStart (pix_render, false);
-			column.AddAttribute (pix_render, "pixbuf", 2);
-			Gtk.CellRendererText text_render = new Gtk.CellRendererText ();
-			column.PackStart (text_render, true);
-			column.AddAttribute (text_render, "text", 0);
-			
+// <file>
+//     <copyright see="prj:///doc/copyright.txt"/>
+//     <license see="prj:///doc/license.txt"/>
+//     <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
+//     <version value="$version"/>
+// </file>
+
+using System;
+using System.IO;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Collections;
+using System.ComponentModel;
+using System.Xml;
+
+using ICSharpCode.Core.AddIns;
+using ICSharpCode.Core.Services;
+using ICSharpCode.Core.Properties;
+using ICSharpCode.Core.AddIns.Codons;
+using ICSharpCode.SharpDevelop.Gui.XmlForms;
+
+namespace ICSharpCode.SharpDevelop.Gui.Dialogs
+{
+	/*
+	public class GradientHeaderPanel : Label
+	{
+		public GradientHeaderPanel(int fontSize) : this()
+		{
+			Font = new Font("Tahoma", fontSize);
+		}
+		
+		public GradientHeaderPanel() : base()
+		{
+			ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
 			
+			ResizeRedraw = true;
+			Text = String.Empty;
+		}
+
+		protected override void OnPaintBackground(PaintEventArgs pe)
+		{
+			base.OnPaintBackground(pe);
+			Graphics g = pe.Graphics;
+			
+			g.FillRectangle(new LinearGradientBrush(new Point(0, 0), new Point(Width, Height), 
+			                                        SystemColors.Window, SystemColors.Control),
+							new Rectangle(0, 0, Width, Height));
+		}
+	}*/
+	
+	/// <summary>
+	/// TreeView options are used, when more options will be edited (for something like
+	/// IDE Options + Plugin Options)
+	/// </summary>
+	public class TreeViewOptions
+	{
+		//protected GradientHeaderPanel optionsPanelLabel;
+		
+		protected ArrayList OptionPanels          = new ArrayList();
+		
+		protected IProperties properties = null;
+		
+		protected Font plainFont = null;
+		protected Font boldFont  = null;
+
+		Gtk.TreeStore treeStore;
+		
+		[Glade.Widget] Gtk.TreeView  TreeView;
+		[Glade.Widget] Gtk.Label     optionTitle;
+		[Glade.Widget] Gtk.Button    okbutton;
+		[Glade.Widget] Gtk.Button    cancelbutton;
+		[Glade.Widget] Gtk.Notebook  mainBook;
+		[Glade.Widget] Gtk.Dialog    TreeViewOptionDialog;
+		
+		PixbufList    imglist;
+		
+		ResourceService IconService = (ResourceService)ServiceManager.Services.GetService (typeof (IResourceService));
+		StringParserService StringParserService = (StringParserService)ServiceManager.Services.GetService (typeof (StringParserService));
+		
+		public IProperties Properties {
+			get {
+				return properties;
+			}
+		}
+		
+		protected void AcceptEvent(object sender, EventArgs e)
+		{
+			foreach (AbstractOptionPanel pane in OptionPanels) {
+				if (!pane.ReceiveDialogMessage(DialogMessage.OK)) {
+					return;
+				}
+			}
+			TreeViewOptionDialog.Hide ();
+			//DialogResult = DialogResult.OK;
+		}
+		
+		protected bool b = true;
+		
+		protected void SetOptionPanelTo(IDialogPanelDescriptor descriptor)
+		{
+			if (descriptor != null && descriptor.DialogPanel != null) {
+				descriptor.DialogPanel.ReceiveDialogMessage(DialogMessage.Activated);
+				mainBook.CurrentPage = mainBook.PageNum (descriptor.DialogPanel.Control);
+				optionTitle.Text = descriptor.Label;
+				TreeViewOptionDialog.ShowAll ();
+			}
+		}		
+		
+		protected void AddNodes(object customizer, Gtk.TreeIter iter, ArrayList dialogPanelDescriptors)
+		{
+			foreach (IDialogPanelDescriptor descriptor in dialogPanelDescriptors) {
+				if (descriptor.DialogPanel != null) { // may be null, if it is only a "path"
+					descriptor.DialogPanel.CustomizationObject = customizer;
+					OptionPanels.Add(descriptor.DialogPanel);
+					mainBook.AppendPage (descriptor.DialogPanel.Control, new Gtk.Label ("a"));
+				}
+			
+				Gtk.TreeIter i;
+				if (iter.Equals (Gtk.TreeIter.Zero)) {
+					i = treeStore.AppendValues  (descriptor.Label, descriptor, imglist[2]);
+				} else {
+					i = treeStore.AppendValues(iter, descriptor.Label, descriptor, imglist[2]);
+				
+				}
+				if (descriptor.DialogPanelDescriptors != null) {
+					AddNodes(customizer, i, descriptor.DialogPanelDescriptors);
+				}
+			}
+		}
+		
+		protected void SelectNode(object sender, EventArgs e)
+		{
+			Gtk.TreeModel mdl;
+			Gtk.TreeIter  iter;
+			if (TreeView.Selection.GetSelected (out mdl, out iter)) {
+				if (treeStore.IterHasChild (iter)) {
+					Gtk.TreeIter new_iter;
+					treeStore.IterChildren (out new_iter, iter);
+					Gtk.TreePath new_path = treeStore.GetPath (new_iter);
+					TreeView.CollapseAll ();
+					TreeView.ExpandToPath (new_path);
+					TreeView.Selection.SelectPath (new_path);
+				} else {
+					treeStore.Foreach (new Gtk.TreeModelForeachFunc (killArrows));
+					treeStore.SetValue (iter, 2, imglist[3]);
+					SetOptionPanelTo ((IDialogPanelDescriptor)treeStore.GetValue (iter, 1));
+				}
+			}
+		}
+
+		bool killArrows (Gtk.TreeModel mdl, Gtk.TreePath path, Gtk.TreeIter iter)
+		{
+			treeStore.SetValue (iter, 2, imglist[2]);
+			return false;
+		}
+		
+		protected void InitImageList()
+		{
+			imglist = new PixbufList();
+			imglist.Add(IconService.GetBitmap("Icons.16x16.ClosedFolderBitmap"));
+			imglist.Add(IconService.GetBitmap("Icons.16x16.OpenFolderBitmap"));
+			imglist.Add(IconService.GetBitmap("Icons.16x16.Empty") );
+			imglist.Add(IconService.GetBitmap("Icons.16x16.SelectionArrow"));
+		}
+		
+		public TreeViewOptions(IProperties properties, IAddInTreeNode node)
+		{
+			this.properties = properties;
+			
+			Glade.XML treeViewXml = new Glade.XML (null, "Base.glade", "TreeViewOptionDialog", null);
+			treeViewXml.Autoconnect (this);
+		
+			TreeViewOptionDialog.Title = StringParserService.Parse("${res:Dialog.Options.TreeViewOptions.DialogName}");
+
+			InitImageList ();
+
+			this.InitializeComponent();
+			
+			if (node != null) {
+				AddNodes(properties, Gtk.TreeIter.Zero, node.BuildChildItems(this));
+			}
+			TreeView.GrabFocus ();
+			SelectNode (null, null);
+		}
+		
+		protected void InitializeComponent() 
+		{
+			treeStore = new Gtk.TreeStore (typeof(string), typeof(IDialogPanelDescriptor), typeof (Gdk.Pixbuf));
+			TreeView.Model = treeStore;
+
+			Gtk.TreeViewColumn column = new Gtk.TreeViewColumn ();
+			column.Title = "items";
+			
+			Gtk.CellRendererPixbuf pix_render = new Gtk.CellRendererPixbuf ();
+			pix_render.PixbufExpanderOpen = imglist[1];
+			pix_render.PixbufExpanderClosed = imglist[0];
+
+			column.PackStart (pix_render, false);
+			column.AddAttribute (pix_render, "pixbuf", 2);
+			Gtk.CellRendererText text_render = new Gtk.CellRendererText ();
+			column.PackStart (text_render, true);
+			column.AddAttribute (text_render, "text", 0);
+			
+			
 			Gtk.TreeViewColumn empty = new Gtk.TreeViewColumn ("a", new Gtk.CellRendererText (), "string", 0);
-			treeView.AppendColumn (empty);
+			TreeView.AppendColumn (empty);
 			empty.Visible = false;
-			treeView.ExpanderColumn = empty;
+			TreeView.ExpanderColumn = empty;
 						
-			treeView.AppendColumn (column);
-			treeView.HeadersVisible = false;
-
-			Gtk.VBox mainbox = new Gtk.VBox (false, 2);
-			
-			Gtk.HBox dispbox = new Gtk.HBox (false, 2);
-
-			dispbox.PackStart (treeView);
-
-			Gtk.VBox vbox = new Gtk.VBox (false, 2);
-			
-			topLabel = new Gtk.Label ("");
-			vbox.PackStart (topLabel, false, false, 2);
-
-			optionPanel = new Gtk.Frame ();
-			optionPanel.Shadow = Gtk.ShadowType.None;
-			
-			vbox.PackStart (optionPanel);
-			
-			dispbox.PackStart (vbox);
-
-			mainbox.PackStart (dispbox);
-			
-			Gtk.HButtonBox buttonBox = new Gtk.HButtonBox ();
-			buttonBox.Layout = Gtk.ButtonBoxStyle.End;
-
-			okButton = new Gtk.Button (Gtk.Stock.Ok);
-			cancelButton = new Gtk.Button (Gtk.Stock.Cancel);
-
-			buttonBox.PackStart (okButton);
-			buttonBox.PackStart (cancelButton);
-
-			mainbox.PackStart (buttonBox, false, false, 2);
-
-			this.Add (mainbox);
-
-			okButton.Clicked += new EventHandler (AcceptEvent);
-			cancelButton.Clicked += new EventHandler (CancelEvent);
-			
-			//((TreeView)ControlDictionary["optionsTreeView"]).Click          += new EventHandler(HandleClick);
-			//((TreeView)ControlDictionary["optionsTreeView"]).AfterSelect    += new TreeViewEventHandler(SelectNode);
-			//((TreeView)ControlDictionary["optionsTreeView"]).BeforeSelect   += new TreeViewCancelEventHandler(BeforeSelectNode);
-			treeView.Selection.Changed += new EventHandler (SelectNode);
-			//((TreeView)ControlDictionary["optionsTreeView"]).BeforeExpand   += new TreeViewCancelEventHandler(BeforeExpandNode);
-			//((TreeView)ControlDictionary["optionsTreeView"]).BeforeExpand   += new TreeViewCancelEventHandler(ShowOpenFolderIcon);
-			//((TreeView)ControlDictionary["optionsTreeView"]).BeforeCollapse += new TreeViewCancelEventHandler(ShowClosedFolderIcon);
-			//((TreeView)ControlDictionary["optionsTreeView"]).MouseDown      += new MouseEventHandler(TreeMouseDown);
+			TreeView.AppendColumn (column);
+			TreeView.HeadersVisible = false;
+
+			TreeView.Selection.Changed += new EventHandler (SelectNode);
 		}
 		
 		private void CancelEvent (object o, EventArgs args)
 		{
-			this.Hide ();
-		}
-	}
-}
+			TreeViewOptionDialog.Hide ();
+		}
+	}
+}

Modified: trunk/MonoDevelop/src/Main/Base/Makefile
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Makefile	2004-01-15 23:36:58 UTC (rev 493)
+++ trunk/MonoDevelop/src/Main/Base/Makefile	2004-01-16 05:17:44 UTC (rev 494)
@@ -358,8 +358,10 @@
 		/r:../../../build/bin/ICSharpCode.SharpRefactory.dll /r:../../../build/bin/ICSharpCode.Core.dll \
 		/r:../../../build/bin/ICSharpCode.SharpAssembly.dll /r:System.Windows.Forms.dll \
 		/r:../../../build/bin/MonoDevelop.Gui.dll \
+		/resource:../../../data/resources/glade/Base.glade,Base.glade \
 		/r:System.Data.dll /r:System.Web.Services.dll /define:LINUX \
 		/define:GTK /r:gtk-sharp.dll /r:gdk-sharp.dll /r:glib-sharp.dll \
 		/r:pango-sharp.dll \
 		/r:gtkmozembed-sharp.dll \
+		/r:glade-sharp.dll \
 		$(SOURCES)




More information about the Monodevelop-patches-list mailing list