Author: lpage
Date: 2008-02-03 07:12:24 -0500 (Sun, 03 Feb 2008)
New Revision: 94674

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
Log:
2008-02-03  Luke Page  <[EMAIL PROTECTED]>

        * TextBoxBase.cs, RichTextBox.cs, TextControl.cs: Sets richtext
        property. Removed if for richtext property that was always true.
        PgUp/PgDn at top/bottom fixed for RTB. Fixes bug #358237.

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-02-03 11:17:19 UTC (rev 94673)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-02-03 12:12:24 UTC (rev 94674)
@@ -1,4 +1,11 @@
 2008-02-03  Luke Page  <[EMAIL PROTECTED]>
+
+       * TextBoxBase.cs, RichTextBox.cs, TextControl.cs: Sets richtext
+       property. Removed if for richtext property that was always true.
+       PgUp/PgDn at top/bottom fixed for RTB. Fixes bug #358237.
+
+2008-02-03  Luke Page  <[EMAIL PROTECTED]>
+
        * TextBoxBase.cs - commited patch from James Purcell that
        correctly sets the FixedHeight control style when the MultiLine
        property is changed on a TextBox control. Fixes bug 358229.

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs   
2008-02-03 11:17:19 UTC (rev 94673)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs   
2008-02-03 12:12:24 UTC (rev 94674)
@@ -83,6 +83,7 @@
                        document.CRLFSize = 1;
                        shortcuts_enabled = true;
                        base.EnableLinks = true;
+                       richtext = true;
                        
                        rtf_style = new RtfSectionStyle ();
                        rtf_section_stack = null;

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2008-02-03 11:17:19 UTC (rev 94673)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2008-02-03 12:12:24 UTC (rev 94674)
@@ -2172,22 +2172,20 @@
 
                private void TextBoxBase_FontOrColorChanged (object sender, 
EventArgs e)
                {
-                       if (!richtext) {
-                               Line    line;
+                       Line    line;
 
-                               document.SuspendRecalc ();
-                               // Font changes apply to the whole document
-                               for (int i = 1; i <= document.Lines; i++) {
-                                       line = document.GetLine(i);
-                                       if (LineTag.FormatText(line, 1, 
line.text.Length, Font, ForeColor,
-                                                       Color.Empty, 
FormatSpecified.Font | FormatSpecified.Color))
-                                               document.RecalculateDocument 
(CreateGraphicsInternal (), line.LineNo, line.LineNo, false);
-                               }
-                               document.ResumeRecalc (false);
-
-                               // Make sure the caret height is matching the 
new font height
-                               document.AlignCaret();
+                       document.SuspendRecalc ();
+                       // Font changes apply to the whole document
+                       for (int i = 1; i <= document.Lines; i++) {
+                               line = document.GetLine(i);
+                               if (LineTag.FormatText(line, 1, 
line.text.Length, Font, ForeColor,
+                                               Color.Empty, 
FormatSpecified.Font | FormatSpecified.Color))
+                                       document.RecalculateDocument 
(CreateGraphicsInternal (), line.LineNo, line.LineNo, false);
                        }
+                       document.ResumeRecalc (false);
+
+                       // Make sure the caret height is matching the new font 
height
+                       document.AlignCaret();
                }
 
                private void ScrollTimerTickHandler (object sender, EventArgs e)

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs   
2008-02-03 11:17:19 UTC (rev 94673)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs   
2008-02-03 12:12:24 UTC (rev 94674)
@@ -1504,7 +1504,7 @@
 
                                case CaretDirection.PgUp: {
 
-                                       if (viewport_y == 0 && owner.richtext) {
+                                       if (caret.line.line_no == 1 && 
owner.richtext) {
                                                owner.vscroll.Value = 0;
                                                Line line = GetLine (1);
                                                PositionCaret (line, 0);
@@ -1523,10 +1523,10 @@
 
                                case CaretDirection.PgDn: {
 
-                                       if (viewport_y + viewport_height >= 
document_y && owner.richtext) {
+                                       if (caret.line.line_no == lines && 
owner.richtext) {
                                                owner.vscroll.Value = 
owner.vscroll.Maximum - viewport_height + 1;
                                                Line line = GetLine (lines);
-                                               PositionCaret (line, 
line.Text.Length);
+                                               PositionCaret (line, 
line.TextLengthWithoutEnding());
                                        }
 
                                        int y_offset = caret.line.Y - 
viewport_y;

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

Reply via email to