Fix wxGrid editors background painting.
There were two fundamental problems: first, we painted on a separately created wxClientDC instead of using the wxPaintDC already available in wxGrid. Second, we invalidated the control while painting, resulting in endless repainting, at least under wxGTK. Fix the first problem by passing wxDC to wxGridCellEditor::PaintBackground() and the second one by not refreshing the control from there as it just seems unnecessary. Also pass the attribute by reference for consistency with wxGridCellRenderer::Draw() and because this pointer can never be NULL. Closes #2628. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72697 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -59,7 +59,9 @@ public:
|
||||
wxEvtHandler* evtHandler);
|
||||
virtual void SetSize(const wxRect& rect);
|
||||
|
||||
virtual void PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr);
|
||||
virtual void PaintBackground(wxDC& dc,
|
||||
const wxRect& rectCell,
|
||||
const wxGridCellAttr& attr);
|
||||
|
||||
virtual bool IsAcceptedKey(wxKeyEvent& event);
|
||||
virtual void BeginEdit(int row, int col, wxGrid* grid);
|
||||
@@ -297,7 +299,9 @@ public:
|
||||
|
||||
virtual void SetSize(const wxRect& rect);
|
||||
|
||||
virtual void PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr);
|
||||
virtual void PaintBackground(wxDC& dc,
|
||||
const wxRect& rectCell,
|
||||
const wxGridCellAttr& attr);
|
||||
|
||||
virtual void BeginEdit(int row, int col, wxGrid* grid);
|
||||
virtual bool EndEdit(int row, int col, const wxGrid* grid,
|
||||
|
Reference in New Issue
Block a user