Fix resetting text override when manually entering the text

The entered text wasn't taken into account, as the override was still
used when its numeric value was retrieved by GtkSpinButton using our
"input" handler, so reset the override now as soon as we get "changed"
signal.
This commit is contained in:
Vadim Zeitlin
2021-04-21 09:24:02 +02:00
parent 86c0394383
commit c356f83da2
2 changed files with 22 additions and 4 deletions

View File

@@ -102,10 +102,17 @@ protected:
// override this and return true.
virtual bool UseGTKStyleBase() const wxOVERRIDE { return true; }
// Set or reset m_textOverride.
// Set m_textOverride to use the given text instead of the numeric value.
void GTKSetTextOverride(const wxString& text);
// Reset the override and changing the value to correspond to the
// previously overridden numeric value.
void GTKResetTextOverride();
// Just reset the override, without touching the value, returning true if
// we did it. In most cases, the function above should be used instead.
bool GTKResetTextOverrideOnly();
private:
// This function does _not_ take into account m_textOverride, so it is
// private and normally shouldn't be used -- use DoGetValue() instead.