Support activation in wxGridCellBoolEditor

This makes it much more convenient to use interactively, as the cell
value is toggled immediately and, even more importantly, the UI doesn't
enter the confusing editing mode which doesn't look any different from
the normal grid appearance except for the current cell border absence.

Note that we still keep support for classic in-place editing to preserve
compatibility with the code which calls EnableCellEditControl()
explicitly and expects an editor to be shown, but perhaps we could
switch to using only activation in the future.
This commit is contained in:
Vadim Zeitlin
2020-06-30 02:31:29 +02:00
parent ca84560350
commit dc69cb79d7
2 changed files with 60 additions and 0 deletions

View File

@@ -238,6 +238,11 @@ class WXDLLIMPEXP_ADV wxGridCellBoolEditor : public wxGridCellEditor
public:
wxGridCellBoolEditor() { }
virtual wxGridActivationResult
TryActivate(int row, int col, wxGrid* grid,
const wxGridActivationSource& actSource) wxOVERRIDE;
virtual void DoActivate(int row, int col, wxGrid* grid) wxOVERRIDE;
virtual void Create(wxWindow* parent,
wxWindowID id,
wxEvtHandler* evtHandler) wxOVERRIDE;