[Monodevelop-patches-list] r777 - in trunk/MonoDevelop: build/AddIns src/AddIns/DisplayBindings/EditorBindings src/AddIns/DisplayBindings/EditorBindings/Gui src/AddIns/DisplayBindings/EditorBindings/Gui/Pads src/AddIns/DisplayBindings/TextEditor src/AddIns/DisplayBindings/TextEditor/Gui src/Main/Base/Gui/Workbench src/Main/Base/Gui/Workbench/Layouts
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Wed Feb 4 00:11:25 EST 2004
Author: tberman
Date: 2004-02-04 00:11:25 -0500 (Wed, 04 Feb 2004)
New Revision: 777
Added:
trunk/MonoDevelop/src/AddIns/DisplayBindings/EditorBindings/Gui/
trunk/MonoDevelop/src/AddIns/DisplayBindings/EditorBindings/Gui/Pads/
trunk/MonoDevelop/src/AddIns/DisplayBindings/EditorBindings/Gui/Pads/CompilerMessageView.cs
Removed:
trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/Pads/
Modified:
trunk/MonoDevelop/build/AddIns/MonoDevelopEditorBindings.addin
trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Makefile
trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs
trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
Log:
ben, this is a birthday present for you.
1) moved the Output tab to the EditorBindings.
2) now using a Gtk.TextView instead of the ported text editor.
Modified: trunk/MonoDevelop/build/AddIns/MonoDevelopEditorBindings.addin
===================================================================
--- trunk/MonoDevelop/build/AddIns/MonoDevelopEditorBindings.addin 2004-02-04 02:10:55 UTC (rev 776)
+++ trunk/MonoDevelop/build/AddIns/MonoDevelopEditorBindings.addin 2004-02-04 05:11:25 UTC (rev 777)
@@ -56,7 +56,7 @@
<Extension path = "/SharpDevelop/Workbench/Views">
<Class id = "CompilerMessageView"
- class = "ICSharpCode.SharpDevelop.Gui.Pads.CompilerMessageView"/>
+ class = "MonoDevelop.EditorBindings.Gui.Pads.CompilerMessageView"/>
</Extension>
<Extension path = "/SharpDevelop/ViewContent/DefaultTextEditor/ContextMenu">
Copied: trunk/MonoDevelop/src/AddIns/DisplayBindings/EditorBindings/Gui/Pads/CompilerMessageView.cs (from rev 776, trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/Pads/CompilerMessageView.cs)
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/Pads/CompilerMessageView.cs 2004-02-04 02:10:55 UTC (rev 776)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/EditorBindings/Gui/Pads/CompilerMessageView.cs 2004-02-04 05:11:25 UTC (rev 777)
@@ -0,0 +1,167 @@
+// <file>
+// <copyright see="prj:///doc/copyright.txt"/>
+// <license see="prj:///doc/license.txt"/>
+// <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
+// <version value="$version"/>
+// </file>
+
+using System;
+using System.CodeDom.Compiler;
+using System.IO;
+using System.Diagnostics;
+using ICSharpCode.SharpDevelop.Services;
+
+using ICSharpCode.Core.Properties;
+using ICSharpCode.Core.Services;
+using ICSharpCode.SharpDevelop.Gui;
+
+namespace MonoDevelop.EditorBindings.Gui.Pads
+{
+ // Note: I moved the pads to this assembly, because I want no cyclic dll dependency
+ // on the ICSharpCode.TextEditor assembly.
+
+ /// <summary>
+ /// This class displays the errors and warnings which the compiler outputs and
+ /// allows the user to jump to the source of the warnig / error
+ /// </summary>
+ public class CompilerMessageView : IPadContent
+ {
+ Gtk.TextBuffer buffer;
+ Gtk.TextView textEditorControl;
+ Gtk.ScrolledWindow scroller;
+ //Panel myPanel = new Panel();
+ ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
+
+ public Gtk.Widget Control {
+ get {
+ return scroller;
+ }
+ }
+
+ public string Title {
+ get {
+ return resourceService.GetString("MainWindow.Windows.OutputWindow");
+ }
+ }
+
+ public string Icon {
+ get {
+ return "Icons.16x16.OutputIcon";
+ }
+ }
+
+ public void Dispose()
+ {
+ }
+
+ public void RedrawContent()
+ {
+ OnTitleChanged(null);
+ OnIconChanged(null);
+ }
+
+ public CompilerMessageView()
+ {
+ buffer = new Gtk.TextBuffer (new Gtk.TextTagTable ());
+ textEditorControl = new Gtk.TextView (buffer);
+ textEditorControl.Editable = false;
+ scroller = new Gtk.ScrolledWindow ();
+ scroller.Add (textEditorControl);
+ ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
+
+ TaskService taskService = (TaskService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(TaskService));
+
+ taskService.CompilerOutputChanged += new EventHandler(SetOutput);
+ }
+
+ void OnCombineOpen(object sender, CombineEventArgs e)
+ {
+ buffer.Text = String.Empty;
+ }
+
+ void OnCombineClosed(object sender, CombineEventArgs e)
+ {
+ buffer.Text = String.Empty;
+ }
+
+ void SelectMessageView(object sender, EventArgs e)
+ {
+ PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
+
+ if (WorkbenchSingleton.Workbench.WorkbenchLayout.IsVisible(this)) {
+ WorkbenchSingleton.Workbench.WorkbenchLayout.ActivatePad(this);
+ } else {
+ if ((bool)propertyService.GetProperty("SharpDevelop.ShowOutputWindowAtBuild", true)) {
+ WorkbenchSingleton.Workbench.WorkbenchLayout.ShowPad(this);
+ WorkbenchSingleton.Workbench.WorkbenchLayout.ActivatePad(this);
+ }
+ }
+
+ }
+
+ void SetOutput2()
+ {
+ TaskService taskService = (TaskService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(TaskService));
+ try {
+ buffer.Text = taskService.CompilerOutput;
+ UpdateTextArea();
+ } catch (Exception) {}
+
+ System.Threading.Thread.Sleep(100);
+ }
+
+ void UpdateTextArea()
+ {
+ buffer.MoveMark (buffer.InsertMark, buffer.EndIter);
+ textEditorControl.ScrollMarkOnscreen (buffer.InsertMark);
+ }
+
+ string outputText = null;
+ void SetOutput(object sender, EventArgs e)
+ {
+ //Console.WriteLine("Create CompilerMessage View Handle:" + textEditorControl.Handle);
+ //throw new Exception("Trace me...");
+ if (WorkbenchSingleton.Workbench.WorkbenchLayout.IsVisible(this)) {
+ SetOutput2();
+ outputText = null;
+ } else {
+ TaskService taskService = (TaskService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(TaskService));
+ outputText = taskService.CompilerOutput;
+ UpdateTextArea();
+ }
+ }
+
+ void ActivateTextBox(object sender, EventArgs e)
+ {
+ if (outputText != null && textEditorControl.Visible) {
+ buffer.Text = outputText;
+ UpdateTextArea();
+ outputText = null;
+ }
+ }
+
+ protected virtual void OnTitleChanged(EventArgs e)
+ {
+ if (TitleChanged != null) {
+ TitleChanged(this, e);
+ }
+ }
+ protected virtual void OnIconChanged(EventArgs e)
+ {
+ if (IconChanged != null) {
+ IconChanged(this, e);
+ }
+ }
+ public event EventHandler TitleChanged;
+ public event EventHandler IconChanged;
+
+ public void BringToFront()
+ {
+ if (!WorkbenchSingleton.Workbench.WorkbenchLayout.IsVisible(this)) {
+ WorkbenchSingleton.Workbench.WorkbenchLayout.ShowPad(this);
+ }
+ WorkbenchSingleton.Workbench.WorkbenchLayout.ActivatePad(this);
+ }
+
+ }
+}
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Makefile
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Makefile 2004-02-04 02:10:55 UTC (rev 776)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Makefile 2004-02-04 05:11:25 UTC (rev 777)
@@ -1,6 +1,5 @@
SDDIR=../../../SharpDevelop/src/Main/Core
SOURCES = \
-./Gui/Pads/CompilerMessageView.cs \
./Gui/Editor/ParserFoldingStrategy.cs \
./Gui/Editor/SharpDevelopTextEditorProperties.cs \
./Gui/Editor/SharpDevelopTextAreaControl.cs \
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs 2004-02-04 02:10:55 UTC (rev 776)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs 2004-02-04 05:11:25 UTC (rev 777)
@@ -575,7 +575,6 @@
public void UpdateToolbars()
{
-#if GTK
foreach (Gtk.Toolbar toolbar in ToolBars) {
foreach (object item in toolbar.Children) {
if (item is IStatusUpdate) {
@@ -583,15 +582,6 @@
}
}
}
-#else
- foreach (CommandBar commandBar in ToolBars) {
- foreach (object item in commandBar.Items) {
- if (item is IStatusUpdate) {
- ((IStatusUpdate)item).UpdateStatus();
- }
- }
- }
-#endif
}
// this method simply copies over the enabled state of the toolbar,
@@ -601,19 +591,11 @@
void CreateToolBars()
{
-#if GTK
if (ToolBars == null) {
ToolbarService toolBarService = (ToolbarService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(ToolbarService));
Gtk.Toolbar[] toolBars = toolBarService.CreateToolbars();
ToolBars = toolBars;
}
-#else
- if (ToolBars == null) {
- ToolbarService toolBarService = (ToolbarService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(ToolbarService));
- CommandBar[] toolBars = toolBarService.CreateToolbars();
- ToolBars = toolBars;
- }
-#endif
}
public void UpdateViews(object sender, EventArgs e)
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs 2004-02-04 02:10:55 UTC (rev 776)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs 2004-02-04 05:11:25 UTC (rev 777)
@@ -187,7 +187,7 @@
};
string[] bottomContents = new string[] {
"ICSharpCode.SharpDevelop.Gui.Pads.OpenTaskView",
- "ICSharpCode.SharpDevelop.Gui.Pads.CompilerMessageView"
+ "MonoDevelop.EditorBindings.Gui.Pads.CompilerMessageView"
};
foreach (string typeName in leftContents) {
More information about the Monodevelop-patches-list
mailing list