[Monodevelop-patches-list] r670 - trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Mon Jan 26 22:01:18 EST 2004
Author: benm
Date: 2004-01-26 22:01:18 -0500 (Mon, 26 Jan 2004)
New Revision: 670
Modified:
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorWidget.cs
Log:
more stuff working here
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs 2004-01-27 01:34:47 UTC (rev 669)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs 2004-01-27 03:01:18 UTC (rev 670)
@@ -60,7 +60,8 @@
}
}
- public class SourceEditorDisplayBindingWrapper : AbstractViewContent
+ public class SourceEditorDisplayBindingWrapper : AbstractViewContent,
+ IEditable, IClipboardHandler
{
internal SourceEditor se;
@@ -97,6 +98,9 @@
public override void Save (string fileName)
{
+ TextWriter s = new StreamWriter (fileName, false);
+ s.Write (se.Text);
+ s.Close ();
}
public override void Load (string fileName)
@@ -105,6 +109,8 @@
se.LoadFile (fileName, "text/x-csharp");
else
se.LoadFile (fileName);
+
+ ContentName = fileName;
}
public void LoadString (string mime, string val)
@@ -114,5 +120,70 @@
else
se.LoadText (val);
}
+
+#region IEditable
+ public IClipboardHandler ClipboardHandler {
+ get { return this; }
+ }
+
+ public string Text {
+ get { return se.Text; }
+ set { se.Text = value; }
+ }
+
+ public void Undo ()
+ {
+ se.buffer.Undo ();
+ }
+
+ public void Redo ()
+ {
+ se.buffer.Redo ();
+ }
+#endregion
+#region IClipboardHandler
+ //
+ // TODO: All of this ;-)
+ //
+ public bool EnableCut {
+ get { return false; }
+ }
+
+ public bool EnableCopy {
+ get { return false; }
+ }
+
+ public bool EnablePaste {
+ get { return false; }
+ }
+
+ public bool EnableDelete {
+ get { return false; }
+ }
+
+ public bool EnableSelectAll {
+ get { return false; }
+ }
+
+ public void Cut (object sender, EventArgs e)
+ {
+ }
+
+ public void Copy (object sender, EventArgs e)
+ {
+ }
+
+ public void Paste (object sender, EventArgs e)
+ {
+ }
+
+ public void Delete (object sender, EventArgs e)
+ {
+ }
+
+ public void SelectAll (object sender, EventArgs e)
+ {
+ }
+#endregion
}
}
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorWidget.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorWidget.cs 2004-01-27 01:34:47 UTC (rev 669)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorWidget.cs 2004-01-27 03:01:18 UTC (rev 670)
@@ -8,19 +8,19 @@
namespace MonoDevelop.SourceEditor.Gui {
public class SourceEditor : ScrolledWindow {
SourceView sv;
- SourceBuffer sb;
+ internal SourceBuffer buffer;
SourceLanguagesManager slm = new SourceLanguagesManager ();
public SourceEditor ()
{
- sb = new SourceBuffer (new SourceTagTable ());
- sv = new SourceView (sb);
+ buffer = new SourceBuffer (new SourceTagTable ());
+ sv = new SourceView (buffer);
sv.AutoIndent = true;
sv.SmartHomeEnd = true;
sv.ShowLineNumbers = true;
sv.ShowLineMarkers = true;
- sb.Highlight = true;
+ buffer.Highlight = true;
Add (sv);
}
@@ -30,23 +30,25 @@
LoadText (File.OpenText (file).ReadToEnd (), mime);
}
-
public void LoadFile (string file)
{
- sb.Text = File.OpenText (file).ReadToEnd ();
+ buffer.Text = File.OpenText (file).ReadToEnd ();
}
public void LoadText (string text, string mime)
{
- sb.Text = text;
- sb.Language = slm.GetLanguageFromMimeType (mime);
+ buffer.Text = text;
+ buffer.Language = slm.GetLanguageFromMimeType (mime);
}
public void LoadText (string text)
{
- sb.Text = text;
+ buffer.Text = text;
}
- public string Text { get { return sb.Text; } }
+ public string Text {
+ get { return buffer.Text; }
+ set { buffer.Text = value; }
+ }
}
}
\ No newline at end of file
More information about the Monodevelop-patches-list
mailing list