Author: lluis
Date: 2007-03-06 16:42:52 -0500 (Tue, 06 Mar 2007)
New Revision: 73848

Added:
   
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs
   
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs
Removed:
   
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs
Modified:
   trunk/monodevelop/Extras/MonoDevelop.GtkCore/ChangeLog
   trunk/monodevelop/Extras/MonoDevelop.GtkCore/Makefile.am
   
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs
   
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs
   
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs
   
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs
   trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.addin.xml
   trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.mdp
   trunk/monodevelop/Extras/MonoDevelop.GtkCore/lib/libstetic.dll
   trunk/monodevelop/Extras/MonoDevelop.GtkCore/lib/libsteticui.dll
Log:
* MonoDevelop.GtkCore.addin.xml: Register a new toolbox loader. Removed
  old properties pads.
* MonoDevelop.GtkCore.mdp, Makefile.am: Added reference to
  MonoDevelop.DesignerSupport.
* lib/libsteticui.dll, lib/libstetic.dll: Updated from svn module.
* MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
  MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
  MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs,
  MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Integrate Stetic
  widgets in the main toolbox.
* MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Implement
  ICustomPropertyPadProvider and return the Stetic property pad.
* MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs: Renamed.
* MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Fix warning.

Modified: trunk/monodevelop/Extras/MonoDevelop.GtkCore/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.GtkCore/ChangeLog      2007-03-06 
21:32:20 UTC (rev 73847)
+++ trunk/monodevelop/Extras/MonoDevelop.GtkCore/ChangeLog      2007-03-06 
21:42:52 UTC (rev 73848)
@@ -1,3 +1,20 @@
+2007-03-06  Lluis Sanchez Gual <[EMAIL PROTECTED]> 
+
+       * MonoDevelop.GtkCore.addin.xml: Register a new toolbox loader. Removed
+         old properties pads.
+       * MonoDevelop.GtkCore.mdp, Makefile.am: Added reference to
+         MonoDevelop.DesignerSupport.
+       * lib/libsteticui.dll, lib/libstetic.dll: Updated from svn module.
+       * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
+         MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
+         MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs,
+         MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Integrate Stetic
+         widgets in the main toolbox.
+       * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Implement
+         ICustomPropertyPadProvider and return the Stetic property pad.
+       * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs: Renamed.
+       * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Fix warning.
+
 2007-02-20  Lluis Sanchez Gual <[EMAIL PROTECTED]> 
 
        Updated from Stetic module. Includes fix for bug #80864.

Modified: trunk/monodevelop/Extras/MonoDevelop.GtkCore/Makefile.am
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.GtkCore/Makefile.am    2007-03-06 
21:32:20 UTC (rev 73847)
+++ trunk/monodevelop/Extras/MonoDevelop.GtkCore/Makefile.am    2007-03-06 
21:42:52 UTC (rev 73848)
@@ -9,6 +9,7 @@
        $(GTK_SHARP_LIBS) \
        -r:$(top_builddir)/build/AddIns/MonoDevelop.Components.dll \
        -r:$(top_builddir)/build/AddIns/MonoDevelop.Core.Gui.dll \
+       
-r:$(top_builddir)/build/AddIns/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.dll
 \
        -r:$(top_builddir)/build/AddIns/MonoDevelop.Ide.dll \
        -r:$(top_builddir)/build/AddIns/MonoDevelop.Projects.dll \
        -r:$(top_builddir)/build/AddIns/MonoDevelop.Projects.Gui.dll \
@@ -35,10 +36,11 @@
        MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPalettePad.cs \
        MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs \
        MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs \
-       MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs \
        MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs \
        MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs \
        MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs \
+       MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs \
+       MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs \
        MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs \
        MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs \
        MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs \

Modified: 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs
      2007-03-06 21:32:20 UTC (rev 73847)
+++ 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs
      2007-03-06 21:42:52 UTC (rev 73848)
@@ -35,6 +35,7 @@
 using MonoDevelop.Ide.Gui;
 using MonoDevelop.Ide.Commands;
 using MonoDevelop.Components.Commands;
+using MonoDevelop.DesignerSupport.PropertyGrid;
 
 namespace MonoDevelop.GtkCore.GuiBuilder
 {
@@ -208,7 +209,7 @@
                }
        }
        
-       class ActionGroupPage: Gtk.VBox
+       class ActionGroupPage: Gtk.VBox, ICustomPropertyPadProvider
        {
                Stetic.ActionGroupDesigner actionsBox;
                
@@ -217,6 +218,15 @@
                        this.actionsBox = actionsBox;
                }
                
+               Gtk.Widget ICustomPropertyPadProvider.GetCustomPropertyWidget ()
+               {
+                       return PropertiesWidget.Instance;
+               }
+               
+               void ICustomPropertyPadProvider.DisposeCustomPropertyWidget ()
+               {
+               }
+               
                [CommandHandler (EditCommands.Delete)]
                protected void OnDelete ()
                {

Modified: 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs
   2007-03-06 21:32:20 UTC (rev 73847)
+++ 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs
   2007-03-06 21:42:52 UTC (rev 73848)
@@ -154,7 +154,6 @@
                        content.ContentChanged -= new EventHandler 
(OnTextContentChanged);
                        content.DirtyChanged -= new EventHandler 
(OnTextDirtyChanged);
                        IdeApp.Workbench.ActiveDocumentChanged -= new 
EventHandler (OnActiveDocumentChanged);
-                       Gtk.Widget w = content.Control;
                        content.Dispose ();
        
                        // Remove and destroy the contents of the Notebook, 
since the destroy event is

Deleted: 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs
      2007-03-06 21:32:20 UTC (rev 73847)
+++ 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs
      2007-03-06 21:42:52 UTC (rev 73848)
@@ -1,170 +0,0 @@
-//
-// GuiBuilderPropertiesPad.cs
-//
-// Author:
-//   Lluis Sanchez Gual
-//
-// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using Gtk;
-using MonoDevelop.Core;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Ide.Commands;
-
-namespace MonoDevelop.GtkCore.GuiBuilder
-{
-       public class GuiBuilderPropertiesPad: AbstractPadContent
-       {
-               Stetic.WidgetPropertyTree grid;
-               Stetic.SignalsEditor signalsEditor;
-               Gtk.EventBox infoBox;
-               Gtk.Widget widget;
-               Stetic.Wrapper.Action currentAction;
-               Notebook tabs;
-               
-               public GuiBuilderPropertiesPad (): base ("")
-               {
-                       grid = GuiBuilderService.SteticApp.PropertiesWidget;
-                       
-                       DefaultPlacement = 
"MonoDevelop.GtkCore.GuiBuilder.GuiBuilderPalettePad/bottom; right";
-                       
-                       tabs = new Notebook ();
-                       
-                       tabs.AppendPage (grid, new Label 
(GettextCatalog.GetString ("Properties")));
-                       
-                       signalsEditor = 
GuiBuilderService.SteticApp.SignalsWidget;
-                       signalsEditor.SignalActivated += new EventHandler 
(OnSignalActivated);
-                       tabs.AppendPage (signalsEditor, new Label 
(GettextCatalog.GetString ("Signals")));
-                       
-                       infoBox = new Gtk.EventBox ();
-                       tabs.AppendPage (infoBox, new Gtk.Label (""));
-                       
-                       widget = tabs;
-                       
-                       widget.ShowAll ();
-                       infoBox.Hide ();
-                       
-                       tabs.Page = 0;
-               }
-               
-               public override Gtk.Widget Control {
-                       get { return widget; }
-               }
-               
-               void OnSignalActivated (object s, EventArgs a)
-               {
-                       GuiBuilderService.JumpToSignalHandler 
(signalsEditor.SelectedSignal);
-               }
-               
-/*             public object TargetObject { 
-                       get {
-                               return grid.TargetObject;
-                       }
-                       set {
-                               Stetic.Wrapper.Action action = 
Stetic.ObjectWrapper.Lookup (value) as Stetic.Wrapper.Action;
-                               if (action != null) {
-                                       // Don't allow editing of global actions
-                                       if (grid.Project != null && 
grid.Project.ActionGroups.IndexOf (action.ActionGroup) != -1) {
-                                               if (infoBox.Child != null)
-                                                       infoBox.Remove 
(infoBox.Child);
-                                               infoBox.Add 
(CreateGlobalActionInfo (action));
-                                               infoBox.ShowAll ();
-                                               tabs.Page = 2;
-                                               tabs.ShowTabs = false;
-                                               grid.Hide ();
-                                               signalsEditor.Hide ();
-                                               return;
-                                       }
-                               }
-                               
-                               if (!grid.Visible) {
-                                       tabs.ShowTabs = true;
-                                       grid.Show ();
-                                       signalsEditor.Show ();
-                                       tabs.Page = 0;
-                                       infoBox.Hide ();
-                               }
-                                               
-                               grid.TargetObject = value;
-                               signalsEditor.TargetObject = value;
-                       }
-               }
-               
-               Gtk.Widget CreateGlobalActionInfo (Stetic.Wrapper.Action action)
-               {
-                       currentAction = action;
-                       
-                       Gtk.HBox hbox = new Gtk.HBox ();
-                       hbox.BorderWidth = 12;
-                       Gtk.Image img = new Gtk.Image (Gtk.Stock.DialogInfo, 
Gtk.IconSize.Menu);
-                       img.Yalign = 0;
-                       hbox.PackStart (img, false, false, 0);
-                       
-                       Gtk.VBox box = new Gtk.VBox ();
-                       Gtk.Label info = new Gtk.Label 
(GettextCatalog.GetString ("The action '{0}' belongs to the global action group 
'{1}'. To modify it, open the action group file.", action.MenuLabel, 
action.ActionGroup.Name));
-                       info.Xalign = 0;
-                       info.WidthRequest = 200;
-                       info.LineWrap = true;
-                       box.PackStart (info, false, false, 0);
-                       
-                       HBox bb = new HBox ();
-                       Gtk.Button but = new Gtk.Button 
(GettextCatalog.GetString ("Open Action Group"));
-                       but.Clicked += new EventHandler (OnOpenGroup);
-                       bb.PackStart (but, false, false, 0);
-                       box.PackStart (bb, false, false, 12);
-                       
-                       hbox.PackStart (box, true, true, 12);
-                       hbox.ShowAll ();
-                       return hbox;
-               }
-               
-               void OnOpenGroup (object s, EventArgs args)
-               {
-                       Project prj = GetProjectFromDesign 
(currentAction.ActionGroup);
-                       if (prj != null) {
-                               ActionGroupView view = 
GuiBuilderService.OpenActionGroup (prj, currentAction.ActionGroup);
-                               if (view != null)
-                                       view.SelectAction (currentAction);
-                       }
-               }
-
-
-               public static Project GetProjectFromDesign 
(Stetic.Wrapper.ActionGroup group)
-               {
-                       if (IdeApp.ProjectOperations.CurrentOpenCombine == null)
-                               return null;
-                               
-                       foreach (Project prj in 
IdeApp.ProjectOperations.CurrentOpenCombine.GetAllProjects ()) {
-                               GtkDesignInfo info = GtkCoreService.GetGtkInfo 
(prj);
-                               if (info != null && info.GuiBuilderProject != 
null && info.GuiBuilderProject.SteticProject.ActionGroups.IndexOf (group) != -1)
-                                       return prj;
-                       }
-                       return null;
-               }
-*/
-       }
-}

Modified: 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs
    2007-03-06 21:32:20 UTC (rev 73847)
+++ 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs
    2007-03-06 21:42:52 UTC (rev 73848)
@@ -162,9 +162,9 @@
                                defaultLayout = IdeApp.Workbench.CurrentLayout;
                                IdeApp.Workbench.CurrentLayout = 
GuiBuilderLayout;
                                if (!exists) {
-                                       Pad p = IdeApp.Workbench.Pads 
[typeof(GuiBuilderPalettePad)];
+                                       Pad p = IdeApp.Workbench.Pads 
[typeof(MonoDevelop.DesignerSupport.ToolboxPad)];
                                        if (p != null) p.Visible = true;
-                                       p = IdeApp.Workbench.Pads 
[typeof(GuiBuilderPropertiesPad)];
+                                       p = IdeApp.Workbench.Pads 
[typeof(MonoDevelop.DesignerSupport.PropertyPad)];
                                        if (p != null) p.Visible = true;
                                }
                        }

Modified: 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs
       2007-03-06 21:32:20 UTC (rev 73847)
+++ 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs
       2007-03-06 21:42:52 UTC (rev 73848)
@@ -28,6 +28,8 @@
 
 
 using System;
+using System.ComponentModel;
+
 using MonoDevelop.Core;
 using MonoDevelop.Ide.Gui.Content;
 using MonoDevelop.Ide.Gui;
@@ -38,13 +40,15 @@
 using MonoDevelop.Projects;
 using MonoDevelop.Projects.Text;
 using MonoDevelop.Projects.Parser;
+using MonoDevelop.DesignerSupport.Toolbox; 
+using MonoDevelop.DesignerSupport.PropertyGrid;
 
 using Gtk;
 using Gdk;
 
 namespace MonoDevelop.GtkCore.GuiBuilder
 {
-       public class GuiBuilderView : CombinedDesignView
+       public class GuiBuilderView : CombinedDesignView, IToolboxConsumer
        {
                Stetic.WidgetDesigner designer;
                Stetic.ActionGroupDesigner actionsBox;
@@ -96,6 +100,7 @@
                        designer.SignalChanged += OnSignalChanged;
                        designer.ComponentNameChanged += OnComponentNameChanged;
                        designer.RootComponentChanged += OnRootComponentChanged;
+                       designer.ComponentTypesChanged += 
OnComponentTypesChanged;
                        
                        // Designer page
                        designerPage = new DesignerPage (designer);
@@ -160,6 +165,7 @@
                        designer.SignalChanged -= OnSignalChanged;
                        designer.ComponentNameChanged -= OnComponentNameChanged;
                        designer.RootComponentChanged -= OnRootComponentChanged;
+                       designer.ComponentTypesChanged -= 
OnComponentTypesChanged;
                        
                        if (designerPage != null)
                                designerPage = null;
@@ -207,6 +213,11 @@
                        codeBinder.UpdateField (args.Component, args.OldName);
                }
                
+               void OnComponentTypesChanged (object s, EventArgs a)
+               {
+                       ToolboxProvider.Instance.NotifyItemsChanged ();
+               }
+               
                void OnActionshanged (object s, EventArgs args)
                {
                        if (designer != null && !actionsButtonVisible && 
!ErrorMode) {
@@ -332,9 +343,54 @@
                bool ErrorMode {
                        get { return designer.RootComponent == null; }
                }
+               
+               public Stetic.ComponentType[] GetComponentTypes ()
+               {
+                       if (designer != null)
+                               return designer.GetComponentTypes ();
+                       else
+                               return null;
+               }
+               
+               void IToolboxConsumer.ConsumeItem (ItemToolboxNode item)
+               {
+               }
+               
+               //Toolbox service uses this to filter toolbox items.
+               ToolboxItemFilterAttribute[] 
IToolboxConsumer.ToolboxFilterAttributes {
+                       get {
+                               return new ToolboxItemFilterAttribute [] {
+                                       new ToolboxItemFilterAttribute 
("gtk-sharp")
+                               };
+                       }
+               }
+               
+               //Used if ToolboxItemFilterAttribute demands 
ToolboxItemFilterType.Custom
+               //If not expecting it, should just return false
+               bool IToolboxConsumer.CustomFilterSupports (ItemToolboxNode 
item)
+               {
+                       return false;
+               }
+               
+               public void DragItem (ItemToolboxNode item, Gtk.Widget source, 
Gdk.DragContext ctx)
+               {
+                       if (designer != null) {
+                               ComponentToolboxNode node = item as 
ComponentToolboxNode;
+                               if (node != null)
+                                       designer.BeginComponentDrag 
(node.ComponentType, source, ctx);
+                       }
+               }
+
+               Gtk.TargetEntry[] targets = new Gtk.TargetEntry[] {
+                       new Gtk.TargetEntry ("application/x-stetic-widget", 0, 
0)
+               };
+                       
+               public TargetEntry[] DragTargets {
+                       get { return targets; }
+               }
        }
        
-       class DesignerPage: Gtk.EventBox
+       class DesignerPage: Gtk.EventBox, ICustomPropertyPadProvider
        {
                Stetic.WidgetDesigner designer;
                
@@ -343,6 +399,15 @@
                        this.designer = designer;
                }
                
+               Gtk.Widget ICustomPropertyPadProvider.GetCustomPropertyWidget ()
+               {
+                       return PropertiesWidget.Instance;
+               }
+               
+               void ICustomPropertyPadProvider.DisposeCustomPropertyWidget ()
+               {
+               }
+               
                [CommandHandler (EditCommands.Delete)]
                protected void OnDelete ()
                {

Copied: 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs
 (from rev 73458, 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs)
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs
      2007-02-27 12:30:12 UTC (rev 73458)
+++ 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs
     2007-03-06 21:42:52 UTC (rev 73848)
@@ -0,0 +1,211 @@
+//
+// GuiBuilderPropertiesPad.cs
+//
+// Author:
+//   Lluis Sanchez Gual
+//
+// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using Gtk;
+using MonoDevelop.Core;
+using MonoDevelop.Projects;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Ide.Commands;
+
+namespace MonoDevelop.GtkCore.GuiBuilder
+{
+       class PropertiesWidget: Gtk.VBox
+       {
+               public static PropertiesWidget Instance;
+               
+               Stetic.SignalsEditor signalsEditor;
+               
+               static PropertiesWidget ()
+               {
+                       Instance = new PropertiesWidget ();
+               }
+               
+               public PropertiesWidget ()
+               {
+                       Stetic.WidgetPropertyTree grid = 
GuiBuilderService.SteticApp.PropertiesWidget;
+                       
+                       Notebook tabs = new Notebook ();
+                       
+                       tabs.AppendPage (grid, new Label 
(GettextCatalog.GetString ("Properties")));
+                       
+                       signalsEditor = 
GuiBuilderService.SteticApp.SignalsWidget;
+                       signalsEditor.SignalActivated += new EventHandler 
(OnSignalActivated);
+                       tabs.AppendPage (signalsEditor, new Label 
(GettextCatalog.GetString ("Signals")));
+                       
+                       Gtk.EventBox infoBox = new Gtk.EventBox ();
+                       tabs.AppendPage (infoBox, new Gtk.Label (""));
+                       
+                       PackStart (tabs, true, true, 0);
+                       
+                       ShowAll ();
+                       infoBox.Hide ();
+                       
+                       tabs.Page = 0;
+               }
+               
+               void OnSignalActivated (object s, EventArgs a)
+               {
+                       GuiBuilderService.JumpToSignalHandler 
(signalsEditor.SelectedSignal);
+               }
+       }
+       
+/*     public class GuiBuilderPropertiesPad: AbstractPadContent
+       {
+               Stetic.WidgetPropertyTree grid;
+               Stetic.SignalsEditor signalsEditor;
+               Gtk.EventBox infoBox;
+               Gtk.Widget widget;
+               Stetic.Wrapper.Action currentAction;
+               Notebook tabs;
+               
+               public GuiBuilderPropertiesPad (): base ("")
+               {
+                       grid = GuiBuilderService.SteticApp.PropertiesWidget;
+                       
+                       DefaultPlacement = 
"MonoDevelop.GtkCore.GuiBuilder.GuiBuilderPalettePad/bottom; right";
+                       
+                       tabs = new Notebook ();
+                       
+                       tabs.AppendPage (grid, new Label 
(GettextCatalog.GetString ("Properties")));
+                       
+                       signalsEditor = 
GuiBuilderService.SteticApp.SignalsWidget;
+                       signalsEditor.SignalActivated += new EventHandler 
(OnSignalActivated);
+                       tabs.AppendPage (signalsEditor, new Label 
(GettextCatalog.GetString ("Signals")));
+                       
+                       infoBox = new Gtk.EventBox ();
+                       tabs.AppendPage (infoBox, new Gtk.Label (""));
+                       
+                       widget = tabs;
+                       
+                       widget.ShowAll ();
+                       infoBox.Hide ();
+                       
+                       tabs.Page = 0;
+               }
+               
+               public override Gtk.Widget Control {
+                       get { return widget; }
+               }
+               
+               void OnSignalActivated (object s, EventArgs a)
+               {
+                       GuiBuilderService.JumpToSignalHandler 
(signalsEditor.SelectedSignal);
+               }
+               
+               public object TargetObject { 
+                       get {
+                               return grid.TargetObject;
+                       }
+                       set {
+                               Stetic.Wrapper.Action action = 
Stetic.ObjectWrapper.Lookup (value) as Stetic.Wrapper.Action;
+                               if (action != null) {
+                                       // Don't allow editing of global actions
+                                       if (grid.Project != null && 
grid.Project.ActionGroups.IndexOf (action.ActionGroup) != -1) {
+                                               if (infoBox.Child != null)
+                                                       infoBox.Remove 
(infoBox.Child);
+                                               infoBox.Add 
(CreateGlobalActionInfo (action));
+                                               infoBox.ShowAll ();
+                                               tabs.Page = 2;
+                                               tabs.ShowTabs = false;
+                                               grid.Hide ();
+                                               signalsEditor.Hide ();
+                                               return;
+                                       }
+                               }
+                               
+                               if (!grid.Visible) {
+                                       tabs.ShowTabs = true;
+                                       grid.Show ();
+                                       signalsEditor.Show ();
+                                       tabs.Page = 0;
+                                       infoBox.Hide ();
+                               }
+                                               
+                               grid.TargetObject = value;
+                               signalsEditor.TargetObject = value;
+                       }
+               }
+               
+               Gtk.Widget CreateGlobalActionInfo (Stetic.Wrapper.Action action)
+               {
+                       currentAction = action;
+                       
+                       Gtk.HBox hbox = new Gtk.HBox ();
+                       hbox.BorderWidth = 12;
+                       Gtk.Image img = new Gtk.Image (Gtk.Stock.DialogInfo, 
Gtk.IconSize.Menu);
+                       img.Yalign = 0;
+                       hbox.PackStart (img, false, false, 0);
+                       
+                       Gtk.VBox box = new Gtk.VBox ();
+                       Gtk.Label info = new Gtk.Label 
(GettextCatalog.GetString ("The action '{0}' belongs to the global action group 
'{1}'. To modify it, open the action group file.", action.MenuLabel, 
action.ActionGroup.Name));
+                       info.Xalign = 0;
+                       info.WidthRequest = 200;
+                       info.LineWrap = true;
+                       box.PackStart (info, false, false, 0);
+                       
+                       HBox bb = new HBox ();
+                       Gtk.Button but = new Gtk.Button 
(GettextCatalog.GetString ("Open Action Group"));
+                       but.Clicked += new EventHandler (OnOpenGroup);
+                       bb.PackStart (but, false, false, 0);
+                       box.PackStart (bb, false, false, 12);
+                       
+                       hbox.PackStart (box, true, true, 12);
+                       hbox.ShowAll ();
+                       return hbox;
+               }
+               
+               void OnOpenGroup (object s, EventArgs args)
+               {
+                       Project prj = GetProjectFromDesign 
(currentAction.ActionGroup);
+                       if (prj != null) {
+                               ActionGroupView view = 
GuiBuilderService.OpenActionGroup (prj, currentAction.ActionGroup);
+                               if (view != null)
+                                       view.SelectAction (currentAction);
+                       }
+               }
+
+
+               public static Project GetProjectFromDesign 
(Stetic.Wrapper.ActionGroup group)
+               {
+                       if (IdeApp.ProjectOperations.CurrentOpenCombine == null)
+                               return null;
+                               
+                       foreach (Project prj in 
IdeApp.ProjectOperations.CurrentOpenCombine.GetAllProjects ()) {
+                               GtkDesignInfo info = GtkCoreService.GetGtkInfo 
(prj);
+                               if (info != null && info.GuiBuilderProject != 
null && info.GuiBuilderProject.SteticProject.ActionGroups.IndexOf (group) != -1)
+                                       return prj;
+                       }
+                       return null;
+               }
+
+       }
+*/     
+}

Added: 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs
      2007-03-06 21:32:20 UTC (rev 73847)
+++ 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs
      2007-03-06 21:42:52 UTC (rev 73848)
@@ -0,0 +1,78 @@
+
+using System;
+using System.Collections.Generic;
+using MonoDevelop.DesignerSupport.Toolbox;
+using Stetic;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.GtkCore.GuiBuilder
+{
+       public class ToolboxProvider: IToolboxDynamicProvider
+       {
+               internal static ToolboxProvider Instance;
+               
+               public ToolboxProvider ()
+               {
+                       Instance = this;
+               }
+               
+               public IList<ItemToolboxNode> GetDynamicItems (IToolboxConsumer 
consumer)
+               {
+                       GuiBuilderView view = consumer as GuiBuilderView;
+                       if (view == null)
+                               return null;
+                               
+                       ComponentType[] types = view.GetComponentTypes ();
+                       if (types == null)
+                               return null;
+                               
+                       List<ItemToolboxNode> list = new List<ItemToolboxNode> 
();
+                       foreach (ComponentType type in types) {
+                               if (type.Category == "window")
+                                       continue;
+                               ComponentToolboxNode node = new 
ComponentToolboxNode ();
+                               node.Name = type.Description;
+                               node.ComponentType = type;
+                               node.Category = GetCategoryName (type.Category);
+                               node.Icon = type.Icon;
+                               list.Add (node);
+                               list.Sort ();
+                       }
+                       return list;
+               }
+               
+               string GetCategoryName (string cat)
+               {
+                       if (cat == "container")
+                               return GettextCatalog.GetString ("Containers");
+                       else if (cat == "widget")
+                               return GettextCatalog.GetString ("Widgets");
+                       else
+                               return cat;
+               }
+               
+               public void NotifyItemsChanged ()
+               {
+                       if (ItemsChanged != null)
+                               ItemsChanged (this, EventArgs.Empty);
+               }
+               
+               public event EventHandler ItemsChanged;
+       }
+       
+       class ComponentToolboxNode: ItemToolboxNode, IComparable
+       {
+               public ComponentType ComponentType;
+               
+               public int CompareTo (object obj)
+               {
+                       ComponentToolboxNode other = obj as 
ComponentToolboxNode;
+                       if (other == null) return -1;
+                       if (Category == other.Category)
+                               return Name.CompareTo (other.Name);
+                       else
+                               return Category.CompareTo (other.Category);
+               }
+
+       }
+}

Modified: 
trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.addin.xml
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.addin.xml  
2007-03-06 21:32:20 UTC (rev 73847)
+++ trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.addin.xml  
2007-03-06 21:42:52 UTC (rev 73848)
@@ -21,17 +21,16 @@
            <AddIn id="MonoDevelop.Projects" version="0.13.0"/>
            <AddIn id="MonoDevelop.Projects.Gui" version="0.13.0"/>
                <AddIn id="MonoDevelop.Ide" version="0.13.0"/>
+               <AddIn id="MonoDevelop.DesignerSupport" version="0.13.0"/>
        </Dependencies>
        
        <Extension path = "/SharpDevelop/Workbench/Pads">
                <Pad id = "MonoDevelop.GtkCore.GuiBuilder.GuiBuilderPalettePad" 
class = "MonoDevelop.GtkCore.GuiBuilder.GuiBuilderPalettePad" _label="Widgets 
Palette" />
-               <Pad id = 
"MonoDevelop.GtkCore.GuiBuilder.GuiBuilderPropertiesPad" class = 
"MonoDevelop.GtkCore.GuiBuilder.GuiBuilderPropertiesPad" _label="Widget 
Properties"/>
                <Pad id = "MonoDevelop.GtkCore.GuiBuilder.GuiBuilderProjectPad" 
class = "MonoDevelop.GtkCore.GuiBuilder.GuiBuilderProjectPad" _label="Widget 
Tree"/>
        </Extension>
 
        <Extension path = "/SharpDevelop/Workbench/Contexts/Edit">
                <ContextPad id = 
"MonoDevelop.GtkCore.GuiBuilder.GuiBuilderPalettePad" />
-               <ContextPad id = 
"MonoDevelop.GtkCore.GuiBuilder.GuiBuilderPropertiesPad" />
                <ContextPad id = 
"MonoDevelop.GtkCore.GuiBuilder.GuiBuilderProjectPad" />
        </Extension>
        
@@ -156,5 +155,9 @@
        <Extension path = "/SharpDevelop/Workbench/ProjectServiceExtensions">
                <Class class = 
"MonoDevelop.GtkCore.GuiBuilder.GtkProjectServiceExtension"  
insertafter="MidStep"/>
        </Extension>
+       
+       <Extension path = "/MonoDevelop/DesignerSupport/ToolboxProviders">
+               <Class class = "MonoDevelop.GtkCore.GuiBuilder.ToolboxProvider" 
/>
+       </Extension>
 </AddIn>
 

Modified: trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.mdp
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.mdp        
2007-03-06 21:32:20 UTC (rev 73847)
+++ trunk/monodevelop/Extras/MonoDevelop.GtkCore/MonoDevelop.GtkCore.mdp        
2007-03-06 21:42:52 UTC (rev 73848)
@@ -22,7 +22,7 @@
     <File name="./MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPalettePad.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs" 
subtype="Code" buildaction="Compile" />
-    <File name="./MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs" 
subtype="Code" buildaction="Compile" />
+    <File name="./MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs" 
subtype="Code" buildaction="Compile" />
@@ -61,26 +61,28 @@
     <File 
name="./MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./icons/widget.png" subtype="Code" 
buildaction="EmbedAsResource" />
     <File name="./icons/actiongroup.png" subtype="Code" 
buildaction="EmbedAsResource" />
+    <File name="./MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs" 
subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
-    <ProjectReference type="Project" localcopy="True" refto="MonoDevelop.Core" 
/>
-    <ProjectReference type="Project" localcopy="True" 
refto="MonoDevelop.Projects" />
-    <ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, 
Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
-    <ProjectReference type="Project" localcopy="True" refto="MonoDevelop.Ide" 
/>
-    <ProjectReference type="Project" localcopy="True" 
refto="MonoDevelop.Core.Gui" />
-    <ProjectReference type="Gac" localcopy="True" refto="gdk-sharp, 
Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
-    <ProjectReference type="Project" localcopy="True" 
refto="MonoDevelop.Components" />
-    <ProjectReference type="Gac" localcopy="True" refto="glade-sharp, 
Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
-    <ProjectReference type="Gac" localcopy="True" refto="System, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-    <ProjectReference type="Gac" localcopy="True" refto="System.Xml, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-    <ProjectReference type="Assembly" localcopy="True" 
refto="./lib/libstetic.dll" />
-    <ProjectReference type="Assembly" localcopy="True" 
refto="./lib/libsteticui.dll" />
-    <ProjectReference type="Gac" localcopy="True" refto="pango-sharp, 
Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
-    <ProjectReference type="Gac" localcopy="True" refto="atk-sharp, 
Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
-    <ProjectReference type="Gac" localcopy="True" refto="gconf-sharp, 
Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
-    <ProjectReference type="Gac" localcopy="True" refto="gconf-sharp-peditors, 
Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
-    <ProjectReference type="Project" localcopy="True" 
refto="MonoDevelop.Projects.Gui" />
-    <ProjectReference type="Assembly" localcopy="True" 
refto="../../build/bin/Mono.Cecil.dll" />
+    <ProjectReference type="Project" localcopy="False" 
refto="MonoDevelop.Core" />
+    <ProjectReference type="Project" localcopy="False" 
refto="MonoDevelop.Projects" />
+    <ProjectReference type="Gac" localcopy="False" refto="gtk-sharp, 
Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+    <ProjectReference type="Project" localcopy="False" refto="MonoDevelop.Ide" 
/>
+    <ProjectReference type="Project" localcopy="False" 
refto="MonoDevelop.Core.Gui" />
+    <ProjectReference type="Gac" localcopy="False" refto="gdk-sharp, 
Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+    <ProjectReference type="Project" localcopy="False" 
refto="MonoDevelop.Components" />
+    <ProjectReference type="Gac" localcopy="False" refto="glade-sharp, 
Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+    <ProjectReference type="Gac" localcopy="False" refto="System, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+    <ProjectReference type="Gac" localcopy="False" refto="System.Xml, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+    <ProjectReference type="Assembly" localcopy="False" 
refto="./lib/libstetic.dll" />
+    <ProjectReference type="Assembly" localcopy="False" 
refto="./lib/libsteticui.dll" />
+    <ProjectReference type="Gac" localcopy="False" refto="pango-sharp, 
Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+    <ProjectReference type="Gac" localcopy="False" refto="atk-sharp, 
Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+    <ProjectReference type="Gac" localcopy="False" refto="gconf-sharp, 
Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+    <ProjectReference type="Gac" localcopy="False" 
refto="gconf-sharp-peditors, Version=2.4.0.0, Culture=neutral, 
PublicKeyToken=35e10195dab3c99f" />
+    <ProjectReference type="Project" localcopy="False" 
refto="MonoDevelop.Projects.Gui" />
+    <ProjectReference type="Assembly" localcopy="False" 
refto="../../build/bin/Mono.Cecil.dll" />
+    <ProjectReference type="Project" localcopy="False" 
refto="MonoDevelop.DesignerSupport" />
   </References>
   <MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" 
RelativeMakefileName="./Makefile.am" BuildTargetName="" CleanTargetName="" 
SyncReferences="True" IsAutotoolsProject="True" 
RelativeConfigureInPath="../../">
     <BuildFilesVar Sync="True" Name="FILES" />

Modified: trunk/monodevelop/Extras/MonoDevelop.GtkCore/lib/libstetic.dll
===================================================================
(Binary files differ)

Modified: trunk/monodevelop/Extras/MonoDevelop.GtkCore/lib/libsteticui.dll
===================================================================
(Binary files differ)

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to