Author: pbartok
Date: 2006-01-13 17:14:10 -0500 (Fri, 13 Jan 2006)
New Revision: 55556

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
Log:
        * TextControl.cs: Draw text in gray if control is disabled

2006-01-13  Peter Dennis Bartok  <[EMAIL PROTECTED]> 



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-01-13 22:13:29 UTC (rev 55555)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-01-13 22:14:10 UTC (rev 55556)
@@ -26,6 +26,10 @@
 
 2006-01-13  Peter Dennis Bartok  <[EMAIL PROTECTED]> 
 
+       * TextControl.cs: Draw text in gray if control is disabled
+
+2006-01-13  Peter Dennis Bartok  <[EMAIL PROTECTED]> 
+
        * TreeView.cs: Draw the focus rectangle outside the highlight, to
          make sure it's always visible. Fixes #76680.
 

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs   
2006-01-13 22:13:29 UTC (rev 55555)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs   
2006-01-13 22:14:10 UTC (rev 55556)
@@ -1560,6 +1560,7 @@
                        int             end;            // Last line to draw
                        StringBuilder   text;   // String representing the 
current line
                        int             line_no;        //
+                       Brush           disabled;
                        Brush           hilight;
                        Brush           hilight_text;
 
@@ -1576,6 +1577,7 @@
                                Console.WriteLine("Started drawing: {0}s 
{1}ms", n.Second, n.Millisecond);
                        #endif
 
+                       disabled = 
ThemeEngine.Current.ResPool.GetSolidBrush(ThemeEngine.Current.ColorGrayText);
                        hilight = 
ThemeEngine.Current.ResPool.GetSolidBrush(ThemeEngine.Current.ColorHighlight);
                        hilight_text = 
ThemeEngine.Current.ResPool.GetSolidBrush(ThemeEngine.Current.ColorHighlightText);
 
@@ -1599,7 +1601,21 @@
                                                if ((!selection_visible) || 
(!owner.has_focus) || (line_no < selection_start.line.line_no) || (line_no > 
selection_end.line.line_no)) {
                                                        // regular drawing, no 
selection to deal with
                                                        
//g.DrawString(s.Substring(tag.start-1, tag.length), tag.font, tag.color, tag.X 
+ line.align_shift - viewport_x, line.Y + tag.shift  - viewport_y, 
StringFormat.GenericTypographic);
-                                                       
g.DrawString(text.ToString(tag.start-1, tag.length), tag.font, tag.color, tag.X 
+ line.align_shift - viewport_x, line.Y + tag.shift  - viewport_y, 
StringFormat.GenericTypographic);
+                                                       if (owner.is_enabled) {
+                                                               
g.DrawString(text.ToString(tag.start-1, tag.length), tag.font, tag.color, tag.X 
+ line.align_shift - viewport_x, line.Y + tag.shift  - viewport_y, 
StringFormat.GenericTypographic);
+                                                       } else {
+                                                               Color a;
+                                                               Color b;
+
+                                                               a = 
((SolidBrush)tag.color).Color;
+                                                               b = 
ThemeEngine.Current.ColorWindowText;
+
+                                                               if ((a.R == 
b.R) && (a.G == b.G) && (a.B == b.B)) {
+                                                                       
g.DrawString(text.ToString(tag.start-1, tag.length), tag.font, disabled, tag.X 
+ line.align_shift - viewport_x, line.Y + tag.shift  - viewport_y, 
StringFormat.GenericTypographic);
+                                                               } else {
+                                                                       
g.DrawString(text.ToString(tag.start-1, tag.length), tag.font, tag.color, tag.X 
+ line.align_shift - viewport_x, line.Y + tag.shift  - viewport_y, 
StringFormat.GenericTypographic);
+                                                               }
+                                                       }
                                                } else {
                                                        // we might have to 
draw our selection
                                                        if ((line_no != 
selection_start.line.line_no) && (line_no != selection_end.line.line_no)) {
@@ -3826,6 +3842,7 @@
                                return retval;
                        }
 
+//Console.WriteLine("Finding tag for {0} {1}", line, start);
                        start_tag = FindTag(line, start);
 
                        tag = new LineTag(line, start, length);
@@ -3835,7 +3852,7 @@
                        if (start == 1) {
                                line.tags = tag;
                        }
-
+//Console.WriteLine("Start tag: '{0}'", start_tag!=null ? start_tag.ToString() 
: "NULL");
                        if (start_tag.start == start) {
                                tag.next = start_tag;
                                tag.previous = start_tag.previous;

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

Reply via email to