From 0656823e2af1610055351a8d8c2d532a86b6cee3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 12 Oct 2019 17:34:35 +0200 Subject: [PATCH] Document that wxGrid::ShowCellEditControl() does not start editing This was sufficiently misleading that event our own wxGrid unit tests used this function in an attempt to start editing a grid cell -- even though it actually doesn't do it at all. Unfortunately documenting the surprising semantics of this functions looks like the best thing we can do because it appears to have always behaved like this and changing it now to actually show the cell editor control, i.e. starting to edit the cell, is almost certain to break some existing code. --- interface/wx/grid.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/interface/wx/grid.h b/interface/wx/grid.h index fafb571bb8..e11dfb6167 100644 --- a/interface/wx/grid.h +++ b/interface/wx/grid.h @@ -2866,8 +2866,14 @@ public: /** Enables or disables in-place editing of grid cell data. - The grid will issue either a @c wxEVT_GRID_EDITOR_SHOWN or - @c wxEVT_GRID_EDITOR_HIDDEN event. + Enabling in-place editing generates @c wxEVT_GRID_EDITOR_SHOWN and, if + it isn't vetoed by the application, shows the in-place editor which + allows the user to change the cell value. + + Disabling in-place editing does nothing if the in-place editor isn't + currently show, otherwise the @c wxEVT_GRID_EDITOR_HIDDEN event is + generated but, unlike the "shown" event, it can't be vetoed and the + in-place editor is dismissed unconditionally. */ void EnableCellEditControl(bool enable = true); @@ -3249,7 +3255,11 @@ public: void SetReadOnly(int row, int col, bool isReadOnly = true); /** - Displays the in-place cell edit control for the current cell. + Displays the active in-place cell edit control for the current cell + after it was hidden. + + Note that this method does @em not start editing the cell, this is only + done by EnableCellEditControl(). */ void ShowCellEditControl();