[Monodevelop-patches-list] r2278 - trunk/MonoDevelop/Unused/Gdl
John Luke <jluke@cfl.rr.com>
jluke at mono-cvs.ximian.com
Mon Feb 28 17:25:46 EST 2005
Author: jluke
Date: 2005-02-28 17:25:46 -0500 (Mon, 28 Feb 2005)
New Revision: 2278
Added:
trunk/MonoDevelop/Unused/Gdl/DockBarButton.cs
Modified:
trunk/MonoDevelop/Unused/Gdl/ChangeLog
trunk/MonoDevelop/Unused/Gdl/DockBar.cs
trunk/MonoDevelop/Unused/Gdl/DockItem.cs
trunk/MonoDevelop/Unused/Gdl/DockItemGrip.cs
trunk/MonoDevelop/Unused/Gdl/DockMaster.cs
trunk/MonoDevelop/Unused/Gdl/Makefile
Log:
sort of fix iconify/de-iconify
Modified: trunk/MonoDevelop/Unused/Gdl/ChangeLog
===================================================================
--- trunk/MonoDevelop/Unused/Gdl/ChangeLog 2005-02-28 19:20:57 UTC (rev 2277)
+++ trunk/MonoDevelop/Unused/Gdl/ChangeLog 2005-02-28 22:25:46 UTC (rev 2278)
@@ -1,3 +1,10 @@
+2005-02-28 John Luke <john.luke at gmail.com>
+
+ * DockBarButton.cs: new Button wrapper
+ * DockBar.cs: fix iconfiy/uniconify
+ * DockItem.cs: add item to dockbar on iconify
+ * DockItemGrip.cs: fix warning by adding new to Item prop
+
2005-02-18 John Luke <john.luke at gmail.com>
* Gdl.mdsx
Modified: trunk/MonoDevelop/Unused/Gdl/DockBar.cs
===================================================================
--- trunk/MonoDevelop/Unused/Gdl/DockBar.cs 2005-02-28 19:20:57 UTC (rev 2277)
+++ trunk/MonoDevelop/Unused/Gdl/DockBar.cs 2005-02-28 22:25:46 UTC (rev 2278)
@@ -13,8 +13,7 @@
public DockBar (Dock dock)
{
- Console.WriteLine ("new dockbar");
- master = dock.Master;
+ this.Attach (dock.Master);
}
public DockMaster Master {
@@ -29,11 +28,8 @@
public void AddItem (DockItem item)
{
Console.WriteLine ("adding item to dockbar");
- Button button = new Button ();
- button.Relief = ReliefStyle.None;
- Image image = new Image (item.StockId, IconSize.SmallToolbar);
- button.Add (image);
- button.Clicked += OnDockButtonClicked;
+ DockBarButton button = new DockBarButton (item);
+ button.DockButtonClicked += OnDockButtonClicked;
// check if already there
tooltips.SetTip (button, item.Name, item.Name);
item.DockBar = this;
@@ -44,7 +40,11 @@
public void Attach (DockMaster master)
{
+ if (this.master != null)
+ master.LayoutChanged -= OnLayoutChanged;
+
this.master = master;
+ master.DockBar = this;
master.LayoutChanged += OnLayoutChanged;
}
@@ -72,14 +72,11 @@
void OnDockButtonClicked (object o, EventArgs args)
{
- DockItem item = (DockItem) o; //FIXME: o is a Button
- DockObject controller = item.Master.Controller;
+ DockItem item = ((DockBarButton) o).DockItem;
item.DockBar = null;
- // remove Iconified flag
- item.WidgetFlags &= ~DockObjectFlags.Iconified;
- item.Show ();
+ item.ShowItem ();
this.RemoveItem (item);
- controller.QueueResize ();
+ item.Master.Controller.QueueResize ();
}
}
}
Added: trunk/MonoDevelop/Unused/Gdl/DockBarButton.cs
===================================================================
--- trunk/MonoDevelop/Unused/Gdl/DockBarButton.cs 2005-02-28 19:20:57 UTC (rev 2277)
+++ trunk/MonoDevelop/Unused/Gdl/DockBarButton.cs 2005-02-28 22:25:46 UTC (rev 2278)
@@ -0,0 +1,34 @@
+using System;
+using Gtk;
+
+namespace Gdl
+{
+ public class DockBarButton : Button
+ {
+ DockItem item;
+
+ public event EventHandler DockButtonClicked;
+
+ public DockBarButton (DockItem item)
+ {
+ this.item = item;
+ this.Relief = ReliefStyle.None;
+ Image image = new Image (item.StockId, IconSize.SmallToolbar);
+ this.Add (image);
+ this.Clicked += OnClicked;
+ }
+
+ public DockItem DockItem {
+ get {
+ return item;
+ }
+ }
+
+ private void OnClicked (object sender, EventArgs args)
+ {
+ if (DockButtonClicked != null)
+ DockButtonClicked (this, EventArgs.Empty);
+ }
+ }
+}
+
Modified: trunk/MonoDevelop/Unused/Gdl/DockItem.cs
===================================================================
--- trunk/MonoDevelop/Unused/Gdl/DockItem.cs 2005-02-28 19:20:57 UTC (rev 2277)
+++ trunk/MonoDevelop/Unused/Gdl/DockItem.cs 2005-02-28 22:25:46 UTC (rev 2278)
@@ -18,7 +18,6 @@
private int dragoffX = 0;
private int dragoffY = 0;
private Menu menu = null;
- private DockBar dockBar;
private DockItemGrip grip;
private Button dockButton;
private uint gripSize;
@@ -107,10 +106,10 @@
public DockBar DockBar {
get {
- return dockBar;
+ return Master.DockBar;
}
set {
- dockBar = value;
+ Master.DockBar = value;
}
}
@@ -907,6 +906,7 @@
{
DockObjectFlags |= DockObjectFlags.Iconified;
HideItem ();
+ Master.DockBar.AddItem (this);
}
public void ShowItem ()
Modified: trunk/MonoDevelop/Unused/Gdl/DockItemGrip.cs
===================================================================
--- trunk/MonoDevelop/Unused/Gdl/DockItemGrip.cs 2005-02-28 19:20:57 UTC (rev 2277)
+++ trunk/MonoDevelop/Unused/Gdl/DockItemGrip.cs 2005-02-28 22:25:46 UTC (rev 2278)
@@ -72,7 +72,7 @@
}
}
- public DockItem Item {
+ public new DockItem Item {
get {
return item;
}
Modified: trunk/MonoDevelop/Unused/Gdl/DockMaster.cs
===================================================================
--- trunk/MonoDevelop/Unused/Gdl/DockMaster.cs 2005-02-28 19:20:57 UTC (rev 2277)
+++ trunk/MonoDevelop/Unused/Gdl/DockMaster.cs 2005-02-28 22:25:46 UTC (rev 2278)
@@ -11,6 +11,7 @@
private Hashtable dockObjects = new Hashtable ();
private ArrayList toplevelDocks = new ArrayList ();
private DockObject controller = null;
+ private DockBar dockBar;
private int dockNumber = 1;
private int number = 1;
private string defaultTitle;
@@ -71,6 +72,15 @@
return toplevelDocks;
}
}
+
+ internal DockBar DockBar {
+ get {
+ return dockBar;
+ }
+ set {
+ dockBar = value;
+ }
+ }
protected void ForeachLockUnlock (DockItem item, bool locked)
{
@@ -145,6 +155,7 @@
* (since it should be added to the items model) */
if (!item.IsAutomatic) {
// FIXME: Emit a LayoutChanged event?
+ EmitLayoutChangedEvent ();
}
}
}
@@ -233,7 +244,8 @@
internal void EmitLayoutChangedEvent ()
{
- // FIXME: emit the LayoutChanged event here.
+ if (LayoutChanged != null)
+ LayoutChanged (this, EventArgs.Empty);
}
private void OnItemDetached (object o, DetachedArgs args)
Modified: trunk/MonoDevelop/Unused/Gdl/Makefile
===================================================================
--- trunk/MonoDevelop/Unused/Gdl/Makefile 2005-02-28 19:20:57 UTC (rev 2277)
+++ trunk/MonoDevelop/Unused/Gdl/Makefile 2005-02-28 22:25:46 UTC (rev 2278)
@@ -10,6 +10,7 @@
DockNotebook.cs \
DockRequest.cs \
DockBar.cs \
+ DockBarButton.cs \
DockLayout.cs \
DockPlacement.cs \
DetachedHandler.cs \
@@ -22,7 +23,7 @@
DockPaned.cs \
DockItemBehavior.cs
-all: $(GDL)
+all: $(GDL) $(TEST)
clean:
rm -f $(GDL) $(GDL).mdb
More information about the Monodevelop-patches-list
mailing list