Refactor wxGridCellBoolEditor to make some functions reusable

No real changes, just factor out code for getting and setting the grid
cell value as bool from {Begin,Apply}Edit() to {Get,Set}GridValue() to
make it possible to reuse these functions in the upcoming commits.

This commit is best viewed with the --color-moved option.
This commit is contained in:
Vadim Zeitlin
2020-06-30 00:53:01 +02:00
parent d14a33bf37
commit 251584b73b
2 changed files with 46 additions and 27 deletions

View File

@@ -275,6 +275,15 @@ protected:
wxCheckBox *CBox() const { return (wxCheckBox *)m_control; }
private:
// These functions modify or use m_value.
void SetValueFromGrid(int row, int col, wxGrid* grid);
void SetGridFromValue(int row, int col, wxGrid* grid) const;
wxString GetStringValue() const { return GetStringValue(m_value); }
static
wxString GetStringValue(bool value) { return ms_stringValues[value]; }
bool m_value;
static wxString ms_stringValues[2];