Author: jackson
Date: 2007-04-02 12:45:25 -0400 (Mon, 02 Apr 2007)
New Revision: 75286
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs
Log:
* RichTextBox.cs: Use the new methods for setting the font and
color, these methods set the specified attribute without
overriding the other attributes.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-04-02 16:39:13 UTC (rev 75285)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-04-02 16:45:25 UTC (rev 75286)
@@ -1,3 +1,9 @@
+2007-04-02 Jackson Harper <[EMAIL PROTECTED]>
+
+ * RichTextBox.cs: Use the new methods for setting the font and
+ color, these methods set the specified attribute without
+ overriding the other attributes.
+
2007-04-02 Jonathan Pobst <[EMAIL PROTECTED]>
* ToolStripPanel.cs: Fixes for better layouts in PDN.
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs
2007-04-02 16:39:13 UTC (rev 75285)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs
2007-04-02 16:45:25 UTC (rev 75286)
@@ -486,17 +486,15 @@
}
set {
- FontDefinition attributes;
- int sel_start;
- int sel_end;
+ int sel_start;
+ int sel_end;
- attributes = new FontDefinition();
- attributes.color = value;
-
sel_start =
document.LineTagToCharIndex(document.selection_start.line,
document.selection_start.pos);
sel_end =
document.LineTagToCharIndex(document.selection_end.line,
document.selection_end.pos);
-
document.FormatText(document.selection_start.line, document.selection_start.pos
+ 1, document.selection_end.line, document.selection_end.pos + 1, attributes);
+ document.FormatText
(document.selection_start.line, document.selection_start.pos + 1,
+ document.selection_end.line,
document.selection_end.pos + 1, null,
+ new SolidBrush (value), null,
FormatSpecified.Color);
document.CharIndexToLineTag(sel_start, out
document.selection_start.line, out document.selection_start.tag, out
document.selection_start.pos);
document.CharIndexToLineTag(sel_end, out
document.selection_end.line, out document.selection_end.tag, out
document.selection_end.pos);
@@ -534,17 +532,15 @@
}
set {
- FontDefinition attributes;
int sel_start;
int sel_end;
- attributes = new FontDefinition();
- attributes.font_obj = value;
-
sel_start =
document.LineTagToCharIndex(document.selection_start.line,
document.selection_start.pos);
sel_end =
document.LineTagToCharIndex(document.selection_end.line,
document.selection_end.pos);
-
document.FormatText(document.selection_start.line, document.selection_start.pos
+ 1, document.selection_end.line, document.selection_end.pos + 1, attributes);
+ document.FormatText
(document.selection_start.line, document.selection_start.pos + 1,
+ document.selection_end.line,
document.selection_end.pos + 1, value,
+ null, null,
FormatSpecified.Font);
document.CharIndexToLineTag(sel_start, out
document.selection_start.line, out document.selection_start.tag, out
document.selection_start.pos);
document.CharIndexToLineTag(sel_end, out
document.selection_end.line, out document.selection_end.tag, out
document.selection_end.pos);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches