// PaintCells at row, column
int column_cnt = grid.FirstVisibleColumn + grid.VisibleColumnCount;
+ DataGridCell current_cell = grid.CurrentCell;
if (column_cnt > 0) {
Region prev_clip = g.Clip;
current_clip.Intersect (prev_clip);
g.Clip = current_clip;
+ Brush colBackBrush = backBrush;
+ Brush colForeBrush = foreBrush;
+
+ // If we are in the precise cell we are editing, then use the normal colors
+ // even if we are selected.
+ if (grid.is_editing && column == current_cell.ColumnNumber && row == current_cell.RowNumber) {
+ colBackBrush = ResPool.GetSolidBrush (grid.BackColor);
+ colForeBrush = ResPool.GetSolidBrush (grid.ForeColor);
+ }
+
if (is_newrow) {
grid.CurrentTableStyle.GridColumnStyles[column].PaintNewRow (g, rect_cell,
- backBrush,
- foreBrush);
+ colBackBrush,
+ colForeBrush);
} else {
grid.CurrentTableStyle.GridColumnStyles[column].Paint (g, rect_cell, grid.ListManager, row,
- backBrush,
- foreBrush,
+ colBackBrush,
+ colForeBrush,
grid.RightToLeft == RightToLeft.Yes);
}
Rectangle header_bounds = group.HeaderBounds;
text_bounds.Offset (8, 0);
text_bounds.Inflate (-8, 0);
- Size text_size = control.text_size;
+ int text_height = control.Font.Height + 2; // add a tiny padding between the text and the group line
Font font = new Font (control.Font, control.Font.Style | FontStyle.Bold);
Brush brush = new LinearGradientBrush (new Point (header_bounds.Left, 0), new Point (header_bounds.Left + ListViewGroupLineWidth, 0),
sformat.LineAlignment = StringAlignment.Near;
dc.DrawString (group.Header, font, SystemBrushes.ControlText, text_bounds, sformat);
- dc.DrawLine (pen, header_bounds.Left, header_bounds.Top + text_size.Height, header_bounds.Left + ListViewGroupLineWidth,
- header_bounds.Top + text_size.Height);
+ dc.DrawLine (pen, header_bounds.Left, header_bounds.Top + text_height, header_bounds.Left + ListViewGroupLineWidth,
+ header_bounds.Top + text_height);
sformat.Dispose ();
font.Dispose ();
balloon_window.Show ();
}
+ public override void HideBalloonWindow (IntPtr handle)
+ {
+ if (balloon_window == null || balloon_window.OwnerHandle != handle)
+ return;
+
+ balloon_window.Close ();
+ balloon_window.Dispose ();
+ balloon_window = null;
+ }
+
private const int balloon_iconsize = 16;
private const int balloon_bordersize = 8;