[Monodevelop-patches-list] r1718 - trunk/MonoDevelop/src/Libraries/Gdl

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Tue Jun 8 19:22:58 EDT 2004


Author: tberman
Date: 2004-06-08 19:22:58 -0400 (Tue, 08 Jun 2004)
New Revision: 1718

Added:
   trunk/MonoDevelop/src/Libraries/Gdl/stock-close-12.png
   trunk/MonoDevelop/src/Libraries/Gdl/stock-menu-left-12.png
   trunk/MonoDevelop/src/Libraries/Gdl/stock-menu-right-12.png
Modified:
   trunk/MonoDevelop/src/Libraries/Gdl/Dock.cs
   trunk/MonoDevelop/src/Libraries/Gdl/DockItem.cs
   trunk/MonoDevelop/src/Libraries/Gdl/DockItemGrip.cs
   trunk/MonoDevelop/src/Libraries/Gdl/Stock.cs
Log:
random stuff, the icons show up in the grip, but the text doesnt, it only works with one dockitem right now (potentially due to unported code somewhere), and the grip still needs work.


Modified: trunk/MonoDevelop/src/Libraries/Gdl/Dock.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/Gdl/Dock.cs	2004-06-08 22:11:10 UTC (rev 1717)
+++ trunk/MonoDevelop/src/Libraries/Gdl/Dock.cs	2004-06-08 23:22:58 UTC (rev 1718)
@@ -125,9 +125,13 @@
 		protected override void OnMapped ()
 		{
 			base.OnMapped ();
+			Console.WriteLine ("Mapping");
 			if (this.root != null) {
-				if (this.root.Visible && !this.root.IsMapped)
+				Console.WriteLine ("root.Visible = " + this.root.Visible);
+				if (this.root.Visible && !this.root.IsMapped) {
+					Console.WriteLine ("Mapping root");
 					this.root.Map ();
+				}
 			}
 		}
 		
@@ -151,8 +155,8 @@
 				foreach (DockObject item in this.Master.TopLevelDocks) {
 					if (item == this)
 						continue;
-					Console.WriteLine ("Showing: " + item.Name);
-					item.Show ();
+					if (item.IsAutomatic)
+						item.Show ();
 				}
 			}
 		}
@@ -288,7 +292,9 @@
 		{
 			if (!(requestor is DockItem))
 				return;
+			Console.WriteLine ("requestor is a DockItem");
 			if (position == DockPlacement.Floating) {
+				Console.WriteLine ("Adding a floating dockitem");
 				DockItem item = requestor as DockItem;
 				int x = 0, y = 0, width = -1, height = 01;
 				if (user_data != null && user_data is Gdk.Rectangle) {
@@ -300,18 +306,25 @@
 				}
 				AddFloatingItem (item, x, y, width, height);
 			} else if (this.root != null) {
+				Console.WriteLine ("root was not null, docking to root");
 				this.root.Docking (requestor, position, null);
 				//gdl_dock_set_title (dock /*this*/);
 			} else {
+				Console.WriteLine ("root is null, setting requestor to root");
 				this.root = requestor;
 				this.root.DockObjectFlags &= DockObjectFlags.Attached;
 				this.root.Parent = this;
 				((DockItem)this.root).ShowGrip ();
-				if (this.IsRealized)
+				if (this.IsRealized) {
+					Console.WriteLine ("realizing new root");
 					this.root.Realize ();
+				}
 				if (this.Visible && this.root.Visible) {
-					if (this.IsMapped)
+					Console.WriteLine ("root is visible");
+					if (this.IsMapped) {
+						Console.WriteLine ("mapping new root");
 						this.root.Map ();
+					}
 					this.root.QueueResize ();
 				}
 				//gdl_dock_set_title (dock /*this*/);
@@ -357,8 +370,10 @@
 				return;
 			if (placement == DockPlacement.Floating)
 				AddFloatingItem (item, 0, 0, -1, -1);
-			else
+			else {
+				Console.WriteLine ("about to dock");
 				this.Docking (item, placement, null);
+			}
 		}
 		
 		public void AddFloatingItem (DockItem item, int x, int y, int width, int height)

Modified: trunk/MonoDevelop/src/Libraries/Gdl/DockItem.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/Gdl/DockItem.cs	2004-06-08 22:11:10 UTC (rev 1717)
+++ trunk/MonoDevelop/src/Libraries/Gdl/DockItem.cs	2004-06-08 23:22:58 UTC (rev 1718)
@@ -120,7 +120,7 @@
 		}
 		
 		public bool Locked {
-			get { return !((this.behavior & DockItemBehavior.Locked) != 0); }
+			get { return ((this.behavior & DockItemBehavior.Locked) != 0); }
 			set {
 				DockItemBehavior old_beh = this.behavior;
 				if (value)
@@ -164,7 +164,9 @@
 		}
 		
 		public bool GripShown {
-			get { return (this.HasGrip && !this.Locked && this.grip_shown); }
+			get {
+				return (this.HasGrip && !this.Locked && this.grip_shown);
+			}
 		}
 		
 		public bool CantClose {
@@ -281,6 +283,7 @@
 				child_allocation.Width = allocation.Width - 2 * (border_width + this.Style.XThickness);
 				child_allocation.Height = allocation.Height - 2 * (border_width + this.Style.YThickness);
 				
+				Console.WriteLine (this.GripShown);
 				if (this.GripShown) {
 					Gdk.Rectangle grip_alloc = child_allocation;
 					Gtk.Requisition grip_req = this.grip.SizeRequest ();
@@ -344,7 +347,7 @@
 				this.grip.ParentWindow = this.GdkWindow;
 		}
 		
-		protected override void OnStyleSet (Gtk.Style previous_style)
+		/*protected override void OnStyleSet (Gtk.Style previous_style)
 		{
 			if (this.IsRealized && !this.NoWindow) {
 				this.Style.SetBackground (this.GdkWindow, this.State);
@@ -352,7 +355,7 @@
 					this.GdkWindow.Clear ();
 				}
 			}
-		}
+		}*/
 		
 		protected override bool OnExposeEvent (Gdk.EventExpose evnt)
 		{

Modified: trunk/MonoDevelop/src/Libraries/Gdl/DockItemGrip.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/Gdl/DockItemGrip.cs	2004-06-08 22:11:10 UTC (rev 1717)
+++ trunk/MonoDevelop/src/Libraries/Gdl/DockItemGrip.cs	2004-06-08 23:22:58 UTC (rev 1718)
@@ -218,6 +218,7 @@
 		protected override void OnMapped ()
 		{
 			base.OnMapped ();
+			Console.WriteLine ("Mapping the grip");
 			if (this.title_window != null) {
 				this.title_window.Show ();
 			}
@@ -332,6 +333,9 @@
 					area.Width -= this.icon_pixbuf.Width + 1;
 				}
 				this.EllipsizeLayout (area.Width);
+				Console.WriteLine ("Text: |" + this.title_layout.Text + "|");
+			} else {
+				Console.WriteLine ("title_window was null");
 			}
 		}
 		

Modified: trunk/MonoDevelop/src/Libraries/Gdl/Stock.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/Gdl/Stock.cs	2004-06-08 22:11:10 UTC (rev 1717)
+++ trunk/MonoDevelop/src/Libraries/Gdl/Stock.cs	2004-06-08 23:22:58 UTC (rev 1718)
@@ -1,15 +1,14 @@
-// This file was generated by the Gtk# code generator.
-// Any changes made will be lost if regenerated.
-
 namespace Gdl {
 
 	using System;
 	using System.Collections;
 	using System.Runtime.InteropServices;
+	using Gtk;
 
-#region Autogenerated code
 	public class Stock {
 
+		static Gtk.IconFactory stock = new Gtk.IconFactory ();
+
 		public static string Close {
 			 get { return "gdl-close"; }
 		}
@@ -19,6 +18,30 @@
 		public static string MenuRight {
 			 get { return "gdl-menu-right"; }
 		}
-#endregion
+		
+		static Stock ()
+		{
+			AddIcon ("gdl-close", "stock-close-12.png");
+			AddIcon ("gdl-menu-left", "stock-menu-left-12.png");
+			AddIcon ("gdl-menu-right", "stock-menu-right-12.png");
+			
+			stock.AddDefault ();
+		}
+		
+		static void AddIcon (string stockid, string file)
+		{
+			Gtk.IconSet iconset = stock.Lookup (stockid);
+			
+			if (iconset == null) {
+				iconset = new Gtk.IconSet ();
+				Gdk.Pixbuf img = new Gdk.Pixbuf (file);
+				IconSource source = new IconSource ();
+				source.Size = Gtk.IconSize.Menu;
+				source.SizeWildcarded = true;
+				source.Pixbuf = img;
+				iconset.AddSource (source);
+				stock.Add (stockid, iconset);
+			}
+		}
 	}
 }

Added: trunk/MonoDevelop/src/Libraries/Gdl/stock-close-12.png
===================================================================
(Binary files differ)


Property changes on: trunk/MonoDevelop/src/Libraries/Gdl/stock-close-12.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/MonoDevelop/src/Libraries/Gdl/stock-menu-left-12.png
===================================================================
(Binary files differ)


Property changes on: trunk/MonoDevelop/src/Libraries/Gdl/stock-menu-left-12.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/MonoDevelop/src/Libraries/Gdl/stock-menu-right-12.png
===================================================================
(Binary files differ)


Property changes on: trunk/MonoDevelop/src/Libraries/Gdl/stock-menu-right-12.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream




More information about the Monodevelop-patches-list mailing list