diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index 9709c570c5..050469cd02 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -1069,6 +1069,15 @@ public: int GetBatchCount() { return m_batchCount; } + // Use this, rather than wxWindow::Refresh(), to force an + // immediate repainting of the grid. Has no effect if you are + // already inside a BeginBatch / EndBatch block. + // + // This function is necessary because wxGrid has a minimal OnPaint() + // handler to reduce screen flicker. + // + void ForceRefresh(); + // ------ edit control functions // diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 1b31ef10db..e5ab724cad 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -5240,7 +5240,8 @@ bool wxGrid::SendEvent( const wxEventType type, type, this, rowOrCol, - mouseEv.GetX(), mouseEv.GetY(), + mouseEv.GetX() + GetColLabelSize(), + mouseEv.GetY() + GetRowLabelSize(), mouseEv.ControlDown(), mouseEv.ShiftDown(), mouseEv.AltDown(), @@ -5270,7 +5271,8 @@ bool wxGrid::SendEvent( const wxEventType type, type, this, row, col, - mouseEv.GetX(), mouseEv.GetY(), + mouseEv.GetX() + GetColLabelSize(), + mouseEv.GetY() + GetRowLabelSize(), FALSE, mouseEv.ControlDown(), mouseEv.ShiftDown(), @@ -6150,6 +6152,17 @@ void wxGrid::EndBatch() } } +// Use this, rather than wxWindow::Refresh(), to force an immediate +// repainting of the grid. Has no effect if you are already inside a +// BeginBatch / EndBatch block. +// +void wxGrid::ForceRefresh() +{ + BeginBatch(); + EndBatch(); +} + + // // ------ Edit control functions //