Author: mkrueger
Date: 2008-02-08 11:45:08 -0500 (Fri, 08 Feb 2008)
New Revision: 95275

Modified:
   trunk/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/ChangeLog
   
trunk/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs
Log:
* MonoDevelop.SourceEditor/SourceEditorView.cs: TextChange is now
  fired.

Modified: trunk/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/ChangeLog
===================================================================
--- trunk/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/ChangeLog       
2008-02-08 16:40:29 UTC (rev 95274)
+++ trunk/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/ChangeLog       
2008-02-08 16:45:08 UTC (rev 95275)
@@ -1,5 +1,9 @@
 2008-02-08  Mike Krüger <[EMAIL PROTECTED]> 
 
+       * MonoDevelop.SourceEditor/SourceEditorView.cs: TextChange is now fired.
+
+2008-02-08  Mike Krüger <[EMAIL PROTECTED]> 
+
        * gtk-gui/MonoDevelop.SourceEditor.SourceEditorWidget.cs,
          MonoDevelop.SourceEditor/SourceEditorWidget.cs,
          MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed highlighting

Modified: 
trunk/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs
===================================================================
--- 
trunk/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs
    2008-02-08 16:40:29 UTC (rev 95274)
+++ 
trunk/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs
    2008-02-08 16:45:08 UTC (rev 95275)
@@ -70,12 +70,12 @@
                public SourceEditorView()
                {
                        widget = new SourceEditorWidget (this);
-//                     widget.TextEditor.Buffer.TextReplaced += delegate 
(object sender, ReplaceEventArgs args) {
-//                             int startIndex = args.Offset;
-//                             int endIndex   = startIndex + Math.Max 
(args.Count, args.Value != null ? args.Value.Length : 0);
-//                             if (TextChanged != null)
-//                                     TextChanged (this, new 
TextChangedEventArgs (startIndex, endIndex));
-//                     };
+                       widget.TextEditor.Buffer.TextReplaced += delegate 
(object sender, ReplaceEventArgs args) {
+                               int startIndex = args.Offset;
+                               int endIndex   = startIndex + Math.Max 
(args.Count, args.Value != null ? args.Value.Length : 0);
+                               if (TextChanged != null)
+                                       TextChanged (this, new 
TextChangedEventArgs (startIndex, endIndex));
+                       };
                        
                        widget.TextEditor.Buffer.TextReplaced += delegate {
                                this.IsDirty = true;
@@ -940,14 +940,23 @@
                        int linesPerPage = (int)((pageHeight - marginBottom - 
marginTop - 10) / widget.TextEditor.LineHeight);
                        linesPerPage -= 2;
                        totalPages = Document.Splitter.LineCount / linesPerPage;
-                       System.Console.WriteLine("height:" + pageHeight + " -- 
lines:" + linesPerPage);
-                       gpc.BeginPage ("page " + page++);
                        xPos = marginLeft;
-                       PrintHeader (gpc, config);
-                       Gnome.Font font       =  Gnome.Font.FindFromFullName 
(SourceEditorOptions.Options.FontName);
+                       string fontName = SourceEditorOptions.Options.FontName;
+                       Gnome.Font font =  Gnome.Font.FindClosestFromFullName 
(fontName);
+                       if (font == null) {
+                               LoggingService.LogError ("Can't find font: '" + 
fontName + "', trying default." );
+                               font = Gnome.Font.FindClosestFromFullName 
(IdeApp.Services.PlatformService.DefaultMonospaceFont);
+                       }
+                       if (font == null) {
+                               LoggingService.LogError ("Unable to load font." 
);
+                               
MonoDevelop.Core.Gui.Services.MessageService.ShowError ("Unable to initialize 
Font, aborting.");
+                               return;
+                       }
                        Gnome.Font boldFont   =  Gnome.Font.FindFromFullName 
(font.FontName + " Bold " + ((int)font.Size));
                        Gnome.Font italicFont =  Gnome.Font.FindFromFullName 
(font.FontName + " Italic " + ((int)font.Size));
                        
+                       gpc.BeginPage ("page " + page++);
+                       PrintHeader (gpc, config);
                        foreach (LineSegment line in Document.Splitter.Lines) {
                                if (yPos >= pageHeight - marginBottom - 5 - 
widget.TextEditor.LineHeight) {
                                        gpc.SetFont (font);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to