[Monodevelop-patches-list] r854 - in trunk/MonoDevelop/src/AddIns/DisplayBindings: SourceEditor SourceEditor/Commands SourceEditor/Gui SourceEditor/Gui/Dialogs TextEditor/Gui/Dialogs
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Mon Feb 9 20:13:44 EST 2004
Author: benm
Date: 2004-02-09 20:13:43 -0500 (Mon, 09 Feb 2004)
New Revision: 854
Added:
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/GotoLineNumberDialog.cs
Removed:
trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/Dialogs/GotoLineNumberDialog.cs
Modified:
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Commands/SearchCommands.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Makefile.am
Log:
gotoline
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Commands/SearchCommands.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Commands/SearchCommands.cs 2004-02-10 01:03:56 UTC (rev 853)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Commands/SearchCommands.cs 2004-02-10 01:13:43 UTC (rev 854)
@@ -158,12 +158,9 @@
{
public override void Run()
{
- Console.WriteLine ("Not implemented in the new editor");
- /*if (!GotoLineNumberDialog.IsVisible) {
- GotoLineNumberDialog gnd = new GotoLineNumberDialog();
- gnd.Run ();
- gnd.Hide ();
- }*/
+ if (!GotoLineNumberDialog.IsVisible)
+ using (GotoLineNumberDialog gnd = new GotoLineNumberDialog ())
+ gnd.Run ();
}
}
Copied: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/GotoLineNumberDialog.cs (from rev 852, trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/Dialogs/GotoLineNumberDialog.cs)
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/Dialogs/GotoLineNumberDialog.cs 2004-02-10 00:44:55 UTC (rev 852)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/GotoLineNumberDialog.cs 2004-02-10 01:13:43 UTC (rev 854)
@@ -0,0 +1,79 @@
+// <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.IO;
+using System.Resources;
+
+using ICSharpCode.Core.Properties;
+
+using ICSharpCode.Core.Services;
+
+using Gtk;
+using Glade;
+
+namespace ICSharpCode.SharpDevelop.Gui.Dialogs
+{
+ public class GotoLineNumberDialog : IDisposable
+ {
+ public static bool IsVisible = false;
+
+ [Widget] Dialog GotoLineDialog;
+ [Widget] Entry line_number_entry;
+
+ public GotoLineNumberDialog ()
+ {
+ new Glade.XML (null, "texteditoraddin.glade", "GotoLineDialog", null).Autoconnect (this);
+ }
+
+ public void Run ()
+ {
+ GotoLineDialog.ShowAll ();
+ IsVisible = true;
+ GotoLineDialog.Run ();
+ }
+
+ public void Hide ()
+ {
+ GotoLineDialog.Hide ();
+ IsVisible = false;
+ }
+
+ void on_btn_close_clicked (object sender, EventArgs e)
+ {
+ GotoLineDialog.Hide ();
+ }
+
+ void on_btn_go_to_line_clicked (object sender, EventArgs e)
+ {
+ try {
+ IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;
+
+
+ if (window != null && window.ViewContent is IPositionable) {
+ int l = Math.Max (0, Int32.Parse(line_number_entry.Text) - 1);
+
+ ((IPositionable) window.ViewContent).JumpTo (l, 0);
+ }
+ } catch (Exception) {
+
+ } finally {
+ GotoLineDialog.Hide ();
+ }
+ }
+
+ public void Dispose ()
+ {
+ if (GotoLineDialog != null) {
+ GotoLineDialog.Dispose ();
+ GotoLineDialog = null;
+ line_number_entry = null;
+ IsVisible = false;
+ }
+ }
+ }
+}
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Makefile.am
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Makefile.am 2004-02-10 01:03:56 UTC (rev 853)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Makefile.am 2004-02-10 01:13:43 UTC (rev 854)
@@ -5,6 +5,7 @@
$(DLL) : $(shell find . -name \*.cs)
mcs $(shell find . -name \*.cs) /out:$@ /t:library \
/resource:../../../../data/resources/glade/EditorBindings.glade,EditorBindings.glade \
+ /resource:../../../../data/resources/glade/texteditoraddin.glade,texteditoraddin.glade \
/r:gtk-sharp /r:gdk-sharp $(GTKSOURCEVIEW_SHARP) /r:glib-sharp \
/r:../../../../build/bin/MonoDevelop.Core.dll \
/r:../../../../build/bin/MonoDevelop.Base.dll \
Deleted: trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/Dialogs/GotoLineNumberDialog.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/Dialogs/GotoLineNumberDialog.cs 2004-02-10 01:03:56 UTC (rev 853)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/Dialogs/GotoLineNumberDialog.cs 2004-02-10 01:13:43 UTC (rev 854)
@@ -1,74 +0,0 @@
-// <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.IO;
-using System.Resources;
-
-using ICSharpCode.TextEditor.Document;
-using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor;
-using ICSharpCode.Core.Properties;
-
-using ICSharpCode.Core.Services;
-using ICSharpCode.TextEditor;
-
-using Gtk;
-using Glade;
-
-// TODO: this dialog should be moved to the core, as it has no deps
-// on this binding.
-
-namespace ICSharpCode.SharpDevelop.Gui.Dialogs
-{
- public class GotoLineNumberDialog
- {
- public static bool IsVisible = false;
-
- [Widget] Dialog GotoLineDialog;
- [Widget] Entry line_number_entry;
-
- public GotoLineNumberDialog ()
- {
- new Glade.XML (null, "texteditoraddin.glade", "GotoLineDialog", null).Autoconnect (this);
-
- GotoLineDialog.ShowAll ();
- }
-
- public void Run ()
- {
- GotoLineDialog.Run ();
- }
-
- public void Hide ()
- {
- GotoLineDialog.Hide ();
- }
-
- void on_btn_close_clicked (object sender, EventArgs e)
- {
- GotoLineDialog.Hide ();
- }
-
- void on_btn_go_to_line_clicked (object sender, EventArgs e)
- {
- try {
- IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;
-
-
- if (window != null && window.ViewContent is IPositionable) {
- int l = Math.Max (0, Int32.Parse(line_number_entry.Text) - 1);
-
- ((IPositionable) window.ViewContent).JumpTo (l, 0);
- }
- } catch (Exception) {
-
- } finally {
- GotoLineDialog.Hide ();
- }
- }
- }
-}
More information about the Monodevelop-patches-list
mailing list