+2007-03-09 Jackson Harper <jackson@ximian.com>
+
+ * TextBox.cs: Don't explicitly set our background colors.
+ * TextControl.cs:
+ * TextBoxBase.cs: Draw readonly text.
+
2007-03-09 Jackson Harper <jackson@ximian.com>
* TextBoxBase.cs: Don't set the forecolor until the handle is
scrollbars = RichTextBoxScrollBars.None;
alignment = HorizontalAlignment.Left;
this.LostFocus +=new EventHandler(TextBox_LostFocus);
- this.BackColor = ThemeEngine.Current.ColorWindow;
- this.ForeColor = ThemeEngine.Current.ColorWindowText;
SetStyle (ControlStyles.StandardClick | ControlStyles.StandardDoubleClick, false);
SetStyle (ControlStyles.FixedHeight, true);
return base.BackColor;
}
set {
- if (value != ThemeEngine.Current.ColorWindow) {
- backcolor_set = true;
- } else {
- backcolor_set = false;
- }
+ backcolor_set = true;
base.BackColor = value;
}
}
// textdocument until the handle is created,
// and forecolor is actually a property of the
// textdocument.
- if (this is TextBox && !IsHandleCreated)
+ if (this is TextBox && read_only && !backcolor_set)
return;
base.ForeColor = value;
}
Brush tag_brush;
Brush current_brush;
Brush disabled_brush;
+ Brush readonly_brush;
Brush hilight;
Brush hilight_text;
#endif
disabled_brush = ThemeEngine.Current.ResPool.GetSolidBrush(ThemeEngine.Current.ColorGrayText);
+ readonly_brush = ThemeEngine.Current.ResPool.GetSolidBrush (ThemeEngine.Current.ColorControlText);
hilight = ThemeEngine.Current.ResPool.GetSolidBrush(ThemeEngine.Current.ColorHighlight);
hilight_text = ThemeEngine.Current.ResPool.GetSolidBrush(ThemeEngine.Current.ColorHighlightText);
tag_brush = tag.color;
current_brush = tag_brush;
-
+
if (!owner.is_enabled) {
Color a = ((SolidBrush) tag.color).Color;
Color b = ThemeEngine.Current.ColorWindowText;
if ((a.R == b.R) && (a.G == b.G) && (a.B == b.B)) {
tag_brush = disabled_brush;
}
+ } else if (owner.read_only && !owner.backcolor_set) {
+ tag_brush = readonly_brush;
}
int tag_pos = tag.start;
current_brush = hilight_text;
tag_pos = Math.Min (tag.end, line_selection_end);
} else if (tag_pos < line_selection_start) {
- current_brush = tag.color;
+ current_brush = tag_brush;
tag_pos = Math.Min (tag.end, line_selection_start);
} else {
- current_brush = tag.color;
+ current_brush = tag_brush;
tag_pos = tag.end;
}