Browse Source

AutoHide pads are initalized when they are expanded (not when they are first clicked on).

Fixed CompilerMessageView refresh problem.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@351 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 21 years ago
parent
commit
df18fef0d3
  1. 1
      src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs
  2. 58
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs

1
src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs

@ -166,6 +166,7 @@ namespace ICSharpCode.SharpDevelop.Gui
void ClearText(MessageViewCategory category) void ClearText(MessageViewCategory category)
{ {
textEditorControl.Text = ""; textEditorControl.Text = "";
textEditorControl.Refresh();
SelectCategory(category.Category); SelectCategory(category.Category);
} }

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

@ -95,7 +95,6 @@ namespace ICSharpCode.SharpDevelop.Gui
this.dockPanel.ActiveAutoHideContent = null; this.dockPanel.ActiveAutoHideContent = null;
this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.dockPanel.ActiveContentChanged += new EventHandler(DockPanelActiveContentChanged);
LoadLayoutConfiguration(); LoadLayoutConfiguration();
ShowPads(); ShowPads();
@ -134,12 +133,6 @@ namespace ICSharpCode.SharpDevelop.Gui
ShowPad(content); ShowPad(content);
} }
} }
foreach (DockPane pane in dockPanel.Panes) {
PadContentWrapper pad = pane.ActiveContent as PadContentWrapper;
if (pad != null) {
pad.ActivateContent();
}
}
} }
void ShowViewContents() void ShowViewContents()
{ {
@ -148,21 +141,6 @@ namespace ICSharpCode.SharpDevelop.Gui
} }
} }
void DockPanelActiveContentChanged(object sender, EventArgs e)
{
PadContentWrapper padContent = dockPanel.ActiveContent as PadContentWrapper;
if (padContent != null) {
padContent.ActivateContent();
}
}
public void ActivateVisiblePads()
{
foreach (PadContentWrapper content in contentHash.Values) {
if (content.Visible) {
content.ActivateContent();
}
}
}
void LoadLayoutConfiguration() void LoadLayoutConfiguration()
{ {
try { try {
@ -174,7 +152,9 @@ namespace ICSharpCode.SharpDevelop.Gui
} catch { } catch {
// ignore errors loading configuration // ignore errors loading configuration
} }
ActivateVisiblePads(); foreach (PadContentWrapper content in contentHash.Values) {
content.AllowInitialize();
}
} }
void LoadDefaultLayoutConfiguration() void LoadDefaultLayoutConfiguration()
@ -316,7 +296,8 @@ namespace ICSharpCode.SharpDevelop.Gui
class PadContentWrapper : DockContent class PadContentWrapper : DockContent
{ {
PadDescriptor padDescriptor; PadDescriptor padDescriptor;
bool isInitialized = false; bool isInitialized = false;
bool allowInitialize = false;
public IPadContent PadContent { public IPadContent PadContent {
get { get {
@ -342,8 +323,31 @@ namespace ICSharpCode.SharpDevelop.Gui
padDescriptor = null; padDescriptor = null;
} }
public void ActivateContent() protected override void OnVisibleChanged(EventArgs e)
{
base.OnVisibleChanged(e);
if (Visible && Width > 0)
ActivateContent();
}
protected override void OnSizeChanged(EventArgs e)
{
base.OnSizeChanged(e);
if (Visible && Width > 0)
ActivateContent();
}
public void AllowInitialize()
{
allowInitialize = true;
if (Visible && Width > 0)
ActivateContent();
}
void ActivateContent()
{ {
if (!allowInitialize)
return;
if (!isInitialized) { if (!isInitialized) {
isInitialized = true; isInitialized = true;
IPadContent content = padDescriptor.PadContent; IPadContent content = padDescriptor.PadContent;
@ -419,13 +423,13 @@ namespace ICSharpCode.SharpDevelop.Gui
public void ActivatePad(PadDescriptor padContent) public void ActivatePad(PadDescriptor padContent)
{ {
if (padContent != null && contentHash.ContainsKey(padContent.Class)) { if (padContent != null && contentHash.ContainsKey(padContent.Class)) {
contentHash[padContent.Class].ActivateContent(); //contentHash[padContent.Class].ActivateContent();
contentHash[padContent.Class].Show(); contentHash[padContent.Class].Show();
} }
} }
public void ActivatePad(string fullyQualifiedTypeName) public void ActivatePad(string fullyQualifiedTypeName)
{ {
contentHash[fullyQualifiedTypeName].ActivateContent(); //contentHash[fullyQualifiedTypeName].ActivateContent();
contentHash[fullyQualifiedTypeName].Show(); contentHash[fullyQualifiedTypeName].Show();
} }

Loading…
Cancel
Save