Author: jpobst
Date: 2007-09-26 16:11:34 -0400 (Wed, 26 Sep 2007)
New Revision: 86440

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/WindowsFormsSynchronizationContext.cs
Log:
2007-09-26  Jonathan Pobst  <[EMAIL PROTECTED]>

        * RichTextBox.cs, TextBoxBase.cs, WindowsFormsSynchronizationContext.cs:
        corcompare stuffs.

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-09-26 20:01:40 UTC (rev 86439)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-09-26 20:11:34 UTC (rev 86440)
@@ -1,5 +1,10 @@
 2007-09-26  Jonathan Pobst  <[EMAIL PROTECTED]>
 
+       * RichTextBox.cs, TextBoxBase.cs, WindowsFormsSynchronizationContext.cs:
+       corcompare stuffs.
+
+2007-09-26  Jonathan Pobst  <[EMAIL PROTECTED]>
+
        * Application.cs: Move the sync context stuff to Run instead of RunLoop
        so that it doesn't get uninstalled on modal forms.
        * Control.cs: Install a sync context when a control is created.

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs   
2007-09-26 20:01:40 UTC (rev 86439)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs   
2007-09-26 20:11:34 UTC (rev 86440)
@@ -41,6 +41,7 @@
        [ClassInterface (ClassInterfaceType.AutoDispatch)]
        [Docking (DockingBehavior.Ask)]
        [ComVisible (true)]
+       [Designer ("System.Windows.Forms.Design.RichTextBoxDesigner, " + 
Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
 #endif
        public class RichTextBox : TextBoxBase {
                #region Local Variables
@@ -63,6 +64,13 @@
                private int             rtf_cursor_y;
                private int             rtf_chars;
                private int rtf_par_line_left_indent;
+
+#if NET_2_0
+               private bool            enable_auto_drag_drop;
+               private RichTextBoxLanguageOptions language_option;
+               private bool            rich_text_shortcuts_enabled;
+               private Color           selection_back_color;
+#endif
                #endregion      // Local Variables
 
                #region Public Constructors
@@ -85,6 +93,9 @@
                        BackColor = ThemeEngine.Current.ColorWindow;
 #if NET_2_0
                        backcolor_set = false;
+                       language_option = 
RichTextBoxLanguageOptions.AutoFontSizeAdjust;
+                       rich_text_shortcuts_enabled = true;
+                       selection_back_color = DefaultBackColor;
 #endif
                        ForeColor = ThemeEngine.Current.ColorWindowText;
 
@@ -173,6 +184,15 @@
                        set { base.BackgroundImage = value; }
                }
 
+#if NET_2_0
+               [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               public override ImageLayout BackgroundImageLayout {
+                       get { return base.BackgroundImageLayout; }
+                       set { base.BackgroundImageLayout = value; }
+               }
+#endif
+
                [DefaultValue(0)]
                [Localizable(true)]
                public int BulletIndent {
@@ -204,6 +224,15 @@
                        }
                }
 
+#if NET_2_0
+               [MonoTODO ("Stub")]
+               [DefaultValue (false)]
+               public bool EnableAutoDragDrop {
+                       get { return enable_auto_drag_drop; }
+                       set { enable_auto_drag_drop = value; }
+               }
+#endif
+
                public override Font Font {
                        get {
                                return base.Font;
@@ -240,6 +269,16 @@
                        }
                }
 
+#if NET_2_0
+               [MonoTODO ("Stub")]
+               [Browsable (false)]
+               [DesignerSerializationVisibility 
(DesignerSerializationVisibility.Hidden)]
+               public RichTextBoxLanguageOptions LanguageOption {
+                       get { return language_option; }
+                       set { language_option = value; }
+               }
+#endif
+
                [DefaultValue(Int32.MaxValue)]
                public override int MaxLength {
                        get {
@@ -271,6 +310,17 @@
                        }
                }
 
+#if NET_2_0
+               [MonoTODO ("Stub")]
+               [Browsable (false)]
+               [DefaultValue (true)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               public bool RichTextShortcutsEnabled {
+                       get { return rich_text_shortcuts_enabled; }
+                       set { rich_text_shortcuts_enabled = value; }
+               }
+#endif
+
                [DefaultValue(0)]
                [Localizable(true)]
                [MonoTODO("Teach TextControl.RecalculateLine to consider the 
right margin as well")]
@@ -437,6 +487,16 @@
                        }
                }
 
+#if NET_2_0
+               [MonoTODO ("Stub")]
+               [Browsable (false)]
+               [DesignerSerializationVisibility 
(DesignerSerializationVisibility.Hidden)]
+               public Color SelectionBackColor {
+                       get { return selection_back_color; }
+                       set { selection_back_color = value; }
+               }
+#endif
+
                [Browsable(false)]
                [DefaultValue(false)]
                
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -830,11 +890,9 @@
                        return Find(str, -1, -1, options);
                }
 
-               public
-#if NET_2_0
-               override
-#endif
-               char GetCharFromPosition(Point pt) {
+               
+#if !NET_2_0
+               public char GetCharFromPosition(Point pt) {
                        LineTag tag;
                        int     pos;
 
@@ -845,9 +903,22 @@
                        }
 
                        return tag.line.text[pos];
-                       
                }
+#else
+               internal override char GetCharFromPositionInternal (Point p)
+               {
+                       LineTag tag;
+                       int pos;
 
+                       PointToTagPos (p, out tag, out pos);
+
+                       if (pos >= tag.line.text.Length)
+                               return '\n';
+
+                       return tag.line.text[pos];
+               }
+#endif
+
                public
 #if NET_2_0
                override
@@ -1050,6 +1121,7 @@
                }
 
 #if NET_2_0
+               [EditorBrowsable (EditorBrowsableState.Never)]
                public new void DrawToBitmap (Bitmap bitmap, Rectangle clip)
                {
                        Graphics dc = Graphics.FromImage (bitmap);
@@ -1129,6 +1201,7 @@
                                eh (this, e);
                }
 
+#if !NET_2_0
                protected override void OnSystemColorsChanged(EventArgs e) {
                        base.OnSystemColorsChanged (e);
                }
@@ -1136,6 +1209,7 @@
                protected override void OnTextChanged(EventArgs e) {
                        base.OnTextChanged (e);
                }
+#endif
 
                protected virtual void OnVScroll(EventArgs e) {
                        EventHandler eh = (EventHandler)(Events [VScrollEvent]);
@@ -1171,17 +1245,28 @@
                        remove { base.BackgroundImageChanged -= value; }
                }
 
+#if NET_2_0
+               [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               public new event EventHandler BackgroundImageLayoutChanged {
+                       add { base.BackgroundImageLayoutChanged += value; }
+                       remove { base.BackgroundImageLayoutChanged -= value; }
+               }
+#endif
+
                public event ContentsResizedEventHandler ContentsResized {
                        add { Events.AddHandler (ContentsResizedEvent, value); }
                        remove { Events.RemoveHandler (ContentsResizedEvent, 
value); }
                }
 
+#if !NET_2_0
                [Browsable(false)]
                [EditorBrowsable(EditorBrowsableState.Never)]
                public new event EventHandler DoubleClick {
                        add { base.DoubleClick += value; }
                        remove { base.DoubleClick -= value; }
                }
+#endif
 
                [Browsable(false)]
 #if !NET_2_0

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2007-09-26 20:01:40 UTC (rev 86439)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2007-09-26 20:11:34 UTC (rev 86440)
@@ -840,6 +840,11 @@
 
                public virtual char GetCharFromPosition (Point p)
                {
+                       return GetCharFromPositionInternal (p);
+               }
+               
+               internal virtual char GetCharFromPositionInternal (Point p)
+               {
                        int index;
                        LineTag tag = document.FindCursor (p.X, p.Y, out index);
                        if (tag == null)

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/WindowsFormsSynchronizationContext.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/WindowsFormsSynchronizationContext.cs
    2007-09-26 20:01:40 UTC (rev 86439)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/WindowsFormsSynchronizationContext.cs
    2007-09-26 20:11:34 UTC (rev 86440)
@@ -1,35 +1,36 @@
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2007 Novell, Inc.
-//
-
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007 Novell, Inc.
+//
+
 using System;
-using System.Threading;
-
-#if NET_2_0
-
+using System.Threading;
+using System.ComponentModel;
+
+#if NET_2_0
+
 // Some implementation details:
-// http://msdn.microsoft.com/msdnmag/issues/06/06/NETMatters/default.aspx
-namespace System.Windows.Forms
-{
-       public sealed class WindowsFormsSynchronizationContext : 
SynchronizationContext, IDisposable
+// http://msdn.microsoft.com/msdnmag/issues/06/06/NETMatters/default.aspx
+namespace System.Windows.Forms
+{
+       public sealed class WindowsFormsSynchronizationContext : 
SynchronizationContext, IDisposable
        {
                private static bool auto_installed;
                private static Control invoke_control;
@@ -50,6 +51,7 @@
                #endregion
 
                #region Public Properties
+               [EditorBrowsable (EditorBrowsableState.Advanced)]
                public static bool AutoInstall {
                        get { return auto_installed; }
                        set { auto_installed = value; }
@@ -76,14 +78,14 @@
                        invoke_control.Invoke (d, new object[] { state });
                }
                
-               public static void Uninstall ()
-               {
-                       if (previous_context == null)
-                               previous_context = new SynchronizationContext 
();
-                               
-                       SynchronizationContext.SetSynchronizationContext 
(previous_context);
-               }
-               #endregion
-       }
-}
-#endif
+               public static void Uninstall ()
+               {
+                       if (previous_context == null)
+                               previous_context = new SynchronizationContext 
();
+                               
+                       SynchronizationContext.SetSynchronizationContext 
(previous_context);
+               }
+               #endregion
+       }
+}
+#endif

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

Reply via email to