From: Michael Bedward Date: Fri, 21 Jul 2000 06:51:22 +0000 (+0000) Subject: Added ForceRefresh() to request immediate repainting of a grid. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d82323930c8ce1b800f2213a598fbda79f868d1d Added ForceRefresh() to request immediate repainting of a grid. Calling Refresh() doesn't do this because of our minimal OnPaint handler (to reduce screen flicker). Setting of position coords for wxGridEvents now takes account of row and col label sizes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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 //