Browse Source

Fixed bug that prevented the PropertyPad from displaying the properties of elements in pads.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2460 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
bb8c9fadf9
  1. 2
      src/Main/Base/Project/Src/Gui/IWorkbenchLayout.cs
  2. 16
      src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyContainer.cs
  3. 9
      src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyPad.cs
  4. 10
      src/Main/Base/Project/Src/Gui/Workbench/DefaultWorkbench.cs
  5. 6
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs

2
src/Main/Base/Project/Src/Gui/IWorkbenchLayout.cs

@ -20,7 +20,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -20,7 +20,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// <summary>
/// The active workbench window.
/// </summary>
IWorkbenchWindow ActiveWorkbenchwindow {
IWorkbenchWindow ActiveWorkbenchWindow {
get;
}

16
src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyContainer.cs

@ -11,6 +11,12 @@ using System.ComponentModel.Design; @@ -11,6 +11,12 @@ using System.ComponentModel.Design;
namespace ICSharpCode.SharpDevelop.Gui
{
/// <summary>
/// A IViewContent or IPadContent can implement this interface to display a set of properties in
/// the property grid when it has focus.
/// One view/pad content instance has to always return the same property container instance
/// and has to change only the properties on that PropertyContainer.
/// </summary>
public interface IHasPropertyContainer
{
PropertyContainer PropertyContainer { get; }
@ -28,6 +34,16 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -28,6 +34,16 @@ namespace ICSharpCode.SharpDevelop.Gui
/// </summary>
public sealed class PropertyContainer
{
/// <summary>
/// Creates a new PropertyContainer instance.
/// This has the side effect of constructing the PropertyPad if necessary.
/// </summary>
public PropertyContainer()
{
PadDescriptor desc = WorkbenchSingleton.Workbench.GetPad(typeof(PropertyPad));
if (desc != null) desc.CreatePad();
}
object selectedObject;
object[] selectedObjects;

9
src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyPad.cs

@ -21,12 +21,6 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -21,12 +21,6 @@ namespace ICSharpCode.SharpDevelop.Gui
{
static PropertyPad instance;
public static PropertyPad Instance {
get {
return instance;
}
}
PropertyContainer activeContainer;
void SetActiveContainer(PropertyContainer pc)
@ -81,6 +75,9 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -81,6 +75,9 @@ namespace ICSharpCode.SharpDevelop.Gui
PropertyGrid grid;
IDesignerHost host;
/// <summary>
/// Gets the underlying property grid. Returns null if the property pad has not yet been created.
/// </summary>
public static PropertyGrid Grid {
get {
if (instance == null)

10
src/Main/Base/Project/Src/Gui/Workbench/DefaultWorkbench.cs

@ -137,7 +137,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -137,7 +137,7 @@ namespace ICSharpCode.SharpDevelop.Gui
if (layout == null) {
this.ActiveWorkbenchWindow = null;
} else {
this.ActiveWorkbenchWindow = layout.ActiveWorkbenchwindow;
this.ActiveWorkbenchWindow = layout.ActiveWorkbenchWindow;
}
}
@ -158,9 +158,11 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -158,9 +158,11 @@ namespace ICSharpCode.SharpDevelop.Gui
activeWorkbenchWindow.ActiveViewContentChanged += OnWorkbenchActiveViewContentChanged;
}
OnWorkbenchActiveViewContentChanged(null, null);
if (ActiveWorkbenchWindowChanged != null) {
ActiveWorkbenchWindowChanged(this, EventArgs.Empty);
}
}
// raise even when activeWorkbenchWindow didn't change because we also use
// ActiveWorkbenchWindowChanged to signal changes in ActiveContent (when switching between pads)
if (ActiveWorkbenchWindowChanged != null) {
ActiveWorkbenchWindowChanged(this, EventArgs.Empty);
}
}
}

6
src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs

@ -33,7 +33,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -33,7 +33,7 @@ namespace ICSharpCode.SharpDevelop.Gui
static bool firstTimeError = true; // TODO: Debug statement only, remove me
#endif
public IWorkbenchWindow ActiveWorkbenchwindow {
public IWorkbenchWindow ActiveWorkbenchWindow {
get {
if (dockPanel == null) {
return null;
@ -253,7 +253,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -253,7 +253,7 @@ namespace ICSharpCode.SharpDevelop.Gui
if (dockPanel != null) {
LockWindowUpdate(wbForm.Handle);
try {
IWorkbenchWindow activeWindow = this.ActiveWorkbenchwindow;
IWorkbenchWindow activeWindow = this.ActiveWorkbenchWindow;
dockPanel.ActiveDocumentChanged -= new EventHandler(ActiveMdiChanged);
DetachPadContents(false);
@ -607,7 +607,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -607,7 +607,7 @@ namespace ICSharpCode.SharpDevelop.Gui
internal void OnActiveWorkbenchWindowChanged(EventArgs e)
{
IWorkbenchWindow newWindow = this.ActiveWorkbenchwindow;
IWorkbenchWindow newWindow = this.ActiveWorkbenchWindow;
if (newWindow == null || newWindow.ActiveViewContent != null) {
if (ActiveWorkbenchWindowChanged != null) {
ActiveWorkbenchWindowChanged(this, e);

Loading…
Cancel
Save