* TextControl.cs: Handle tabs in non multiline mode a little
authorJackson Harper <jackson@novell.com>
Thu, 24 May 2007 19:20:30 +0000 (19:20 -0000)
committerJackson Harper <jackson@novell.com>
Thu, 24 May 2007 19:20:30 +0000 (19:20 -0000)
        differently.

svn path=/trunk/mcs/; revision=77926

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs

index 126b1653f126ec02b0204ba68e53918d34b62593..4ae7186da94fb224f7218ed66792d14ee10b173c 100644 (file)
@@ -4,6 +4,11 @@
        check for mouse down events in case we need to close the menu.
        * Control.cs, Form.cs: Remove mouse down checks for menus.
 
+2007-05-24  Jackson Harper  <jackson@ximian.com>
+
+       * TextControl.cs: Handle tabs in non multiline mode a little
+       differently.
+
 2007-05-24  Jackson Harper  <jackson@ximian.com>
 
        * TextControl.cs: We need to manually break apart tabbed text and
index 89d99cb39f53bb985d859eaa0d75a107b6dc5fd5..b5fbd4d4aca0e379dc5a33c3841da130b32ddd1c 100644 (file)
@@ -4617,6 +4617,8 @@ namespace System.Windows.Forms {
                        string text = line.text.ToString (pos, 1);
                        switch ((int) text [0]) {
                        case '\t':
+                               if (!line.document.multiline)
+                                       goto case 10;
                                SizeF res = dc.MeasureString (" ", font, 10000, Document.string_format);
                                res.Width *= 8.0F;
                                return res;
@@ -4646,6 +4648,11 @@ namespace System.Windows.Forms {
                                        tab_index = end;
                                dc.DrawString (text.Substring (start, tab_index - start), font, brush, xoff + line.widths [start],
                                                y, StringFormat.GenericTypographic);
+
+                               // non multilines get the unknown char 
+                               if (!line.document.multiline && tab_index != end)
+                                       dc.DrawString ("\u0013", font, brush,  xoff + line.widths [tab_index], y, Document.string_format);
+                                       
                                start = tab_index + 1;
                        }
                }