Do erase background even in wxGridCellTextEditor
It is necessary to do it since the switch to double buffering wxGrid
painting in ebbadae09a
(Double buffer wxGridWindow drawing, 2020-01-28)
as even a "full cell" editor such as wxGridCellTextEditor still doesn't
fill the entire cell, as there are margins around it, and the backing
bitmap could keep whatever junk happened to be there if we didn't erase
it, so do erase it now.
Remove the code doing the same thing from ShowCellEditControl(),
however, as it's redundant and doesn't do anything except creating some
flicker, and also doesn't work on the platforms not supporting the use
of wxClientDC anyhow.
This commit is contained in:
@@ -7265,15 +7265,6 @@ void wxGrid::ShowCellEditControl()
|
||||
m_currentCellCoords.SetCol( col );
|
||||
}
|
||||
|
||||
// erase the highlight and the cell contents because the editor
|
||||
// might not cover the entire cell
|
||||
wxClientDC dc( gridWindow );
|
||||
PrepareDCFor(dc, gridWindow);
|
||||
wxGridCellAttrPtr attr = GetCellAttrPtr(row, col);
|
||||
dc.SetBrush(wxBrush(attr->GetBackgroundColour()));
|
||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||
dc.DrawRectangle(rect);
|
||||
|
||||
rect.Offset(-GetGridWindowOffset(gridWindow));
|
||||
|
||||
// convert to scrolled coords
|
||||
@@ -7286,6 +7277,7 @@ void wxGrid::ShowCellEditControl()
|
||||
rect.Deflate(1, 1);
|
||||
#endif
|
||||
|
||||
wxGridCellAttrPtr attr = GetCellAttrPtr(row, col);
|
||||
wxGridCellEditorPtr editor = attr->GetEditorPtr(this, row, col);
|
||||
if ( !editor->IsCreated() )
|
||||
{
|
||||
|
Reference in New Issue
Block a user