Author: jackson
Date: 2007-05-15 14:42:28 -0400 (Tue, 15 May 2007)
New Revision: 77426

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/TextBox.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
Log:

        * TextBox.cs:
        * TextBoxBase.cs:
        * RichTextBox.cs: Some new 2.0 methods



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-05-15 18:42:21 UTC (rev 77425)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-05-15 18:42:28 UTC (rev 77426)
@@ -1,3 +1,9 @@
+2007-05-15  Jackson Harper  <[EMAIL PROTECTED]>
+
+       * TextBox.cs:
+       * TextBoxBase.cs:
+       * RichTextBox.cs: Some new 2.0 methods
+
 2007-05-15  Gert Driesen  <[EMAIL PROTECTED]>
 
        * FileDialog.cs: On 1.0 profile, do not support multidotted 

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs   
2007-05-15 18:42:21 UTC (rev 77425)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs   
2007-05-15 18:42:28 UTC (rev 77426)
@@ -1046,6 +1046,22 @@
 //                     }
                }
 
+#if NET_2_0
+               public void DrawToBitmap (Bitmap bitmap, Rectangle clip)
+               {
+                       Graphics dc = Graphics.FromImage (bitmap);
+
+                       if (backcolor_set || (Enabled && !read_only)) {
+                               dc.FillRectangle 
(ThemeEngine.Current.ResPool.GetSolidBrush (BackColor), clip);
+                       } else {
+                               dc.FillRectangle 
(ThemeEngine.Current.ResPool.GetSolidBrush (ThemeEngine.Current.ColorControl), 
clip);
+                       }
+                       
+                       // Draw the viewable document
+                       document.Draw (dc, clip);
+               }
+#endif
+
                #endregion      // Public Instance Methods
 
                #region Protected Instance Methods
@@ -1127,6 +1143,13 @@
                protected override void WndProc(ref Message m) {
                        base.WndProc (ref m);
                }
+
+#if NET_2_0
+               protected override bool ProcessCmdKey (ref Message msg, Keys 
keyData)
+               {
+                       return base.ProcessCmdKey (ref msg, keyData);
+               }
+#endif
                #endregion      // Protected Instance Methods
 
                #region Events

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBox.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBox.cs       
2007-05-15 18:42:21 UTC (rev 77425)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBox.cs       
2007-05-15 18:42:28 UTC (rev 77426)
@@ -326,6 +326,14 @@
                }
                #endregion      // Public Instance Properties
 
+               public void Paste (string text)
+               {
+                       document.ReplaceSelection (CaseAdjust (text), false);
+
+                       ScrollToCaret();
+                       OnTextChanged(EventArgs.Empty);
+               }
+
                #region Protected Instance Methods
                protected override CreateParams CreateParams {
                        get {
@@ -338,9 +346,7 @@
                                return base.DefaultImeMode;
                        }
                }
-               #endregion      // Protected Instance Methods
 
-               #region Protected Instance Methods
 #if NET_2_0
                protected override void Dispose (bool disposing)
                {

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2007-05-15 18:42:21 UTC (rev 77425)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2007-05-15 18:42:28 UTC (rev 77426)
@@ -229,7 +229,9 @@
                                                        ClientSize = new 
Size(ClientSize.Width, PreferredHeight);
                                                }
                                        }
+#if NET_1_1
                                        OnAutoSizeChanged(EventArgs.Empty);
+#endif
                                }
                        }
                }
@@ -649,6 +651,16 @@
                                }
                        }
                }
+#if NET_2_0
+               public override ImageLayout BackgroundImageLayout {
+                       get { return base.BackgroundImageLayout; } 
+                       set { base.BackgroundImageLayout = value; }
+               }
+
+               protected override Cursor DefaultCursor {
+                       get { return Cursors.IBeam; }
+               }
+#endif
                #endregion      // Public Instance Properties
 
                #region Protected Instance Properties
@@ -663,6 +675,15 @@
                                return new Size(100, 20);
                        }
                }
+
+#if NET_2_0
+               // Currently our double buffering breaks our scrolling, so 
don't let people enable this
+               protected override bool DoubleBuffered {
+                       get { return false; }
+                       set { }
+               }
+#endif
+               
                #endregion      // Protected Instance Properties
 
                #region Public Instance Methods
@@ -771,6 +792,11 @@
                }
 
 #if NET_2_0
+               public void DeselectAll ()
+               {
+                       SelectionLength = 0;
+               }
+
                public virtual char GetCharFromPosition (Point p)
                {
                        int index;
@@ -905,12 +931,13 @@
                        if (eh != null)
                                eh (this, e);
                }
-
+#if NET_1_1
                protected virtual void OnAutoSizeChanged(EventArgs e) {
                        EventHandler eh = (EventHandler)(Events 
[AutoSizeChangedEvent]);
                        if (eh != null)
                                eh (this, e);
                }
+#endif
 
                protected virtual void OnBorderStyleChanged(EventArgs e) {
                        EventHandler eh = (EventHandler)(Events 
[BorderStyleChangedEvent]);
@@ -961,6 +988,12 @@
                                eh (this, e);
                }
 
+#if NET_2_0
+               protected override bool ProcessCmdKey (ref Message msg, Keys 
keyData)
+               {
+                       return base.ProcessCmdKey (ref msg, keyData);
+               }
+#endif
                protected override bool ProcessDialogKey(Keys keyData) {
                        return base.ProcessDialogKey(keyData);
                }

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

Reply via email to