X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FManaged.Windows.Forms%2FSystem.Windows.Forms%2FRichTextBox.cs;h=775b0c3c74afbec231aa9e4c677cc178604ffb25;hb=d596cdd2b88b361ab25935d82488d82673649302;hp=17b5752ed8761fc16612e900952a70e7aa6ce153;hpb=1da3fa560fcda70659a02193cedf0a7519cfc21d;p=mono.git diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs index 17b5752ed87..775b0c3c74a 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs @@ -92,12 +92,10 @@ namespace System.Windows.Forms { #region Private & Internal Methods private void RichTextBox_LostFocus(object sender, EventArgs e) { - has_focus = false; Invalidate(); } private void RichTextBox_GotFocus(object sender, EventArgs e) { - has_focus = true; Invalidate(); } #endregion // Private & Internal Methods @@ -139,13 +137,8 @@ namespace System.Windows.Forms { [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] public override System.Drawing.Image BackgroundImage { - get { - return background_image; - } - - set { - base.BackgroundImage = value; - } + get { return base.BackgroundImage; } + set { base.BackgroundImage = value; } } [DefaultValue(0)] @@ -200,7 +193,7 @@ namespace System.Windows.Forms { // Font changes always set the whole doc to that font start = document.GetLine(1); end = document.GetLine(document.Lines); - document.FormatText(start, 1, end, end.text.Length + 1, base.Font, new SolidBrush(this.ForeColor)); + document.FormatText(start, 1, end, end.text.Length + 1, base.Font, null, null, FormatSpecified.Font); } } } @@ -880,6 +873,10 @@ namespace System.Windows.Forms { } InsertRTFFromStream(data, 0, 1); + + document.PositionCaret (document.GetLine (1), 0); + document.SetSelectionToCaret (true); + ScrollToCaret (); } [MonoTODO("Make smarter RTF detection?")] @@ -1458,7 +1455,7 @@ namespace System.Windows.Forms { line = document.GetLine(rtf_cursor_y); if (rtf_line.Length > 0) { document.InsertString(line, rtf_cursor_x, rtf_line.ToString()); - document.FormatText(line, rtf_cursor_x + 1, line, rtf_cursor_x + 1 + length, font, rtf_color); // FormatText is 1-based + document.FormatText(line, rtf_cursor_x + 1, line, rtf_cursor_x + 1 + length, font, rtf_color, null, FormatSpecified.Font | FormatSpecified.Color); // FormatText is 1-based } if (newline) { document.Split(line, rtf_cursor_x + length);