Allow using a different text value in wxGTK wxSpinCtrl
Make it possible to use a string value different from the numeric value, as wxMSW version allows this and some existing code depends on it. Closes #19140.
This commit is contained in:
@@ -74,6 +74,9 @@ public:
|
||||
virtual void GTKValueChanged() = 0;
|
||||
|
||||
protected:
|
||||
wxSpinCtrlGTKBase();
|
||||
~wxSpinCtrlGTKBase();
|
||||
|
||||
double DoGetValue() const;
|
||||
double DoGetMin() const;
|
||||
double DoGetMax() const;
|
||||
@@ -98,6 +101,19 @@ protected:
|
||||
// override this and return true.
|
||||
virtual bool UseGTKStyleBase() const wxOVERRIDE { return true; }
|
||||
|
||||
// Set or reset m_textOverride.
|
||||
void GTKSetTextOverride(const wxString& text);
|
||||
void GTKResetTextOverride();
|
||||
|
||||
private:
|
||||
// This function does _not_ take into account m_textOverride, so it is
|
||||
// private and normally shouldn't be used -- use DoGetValue() instead.
|
||||
double GTKGetValue() const;
|
||||
|
||||
// Non-null when the text value is different from the numeric value.
|
||||
class wxSpinCtrlGTKTextOverride* m_textOverride;
|
||||
|
||||
|
||||
friend class wxSpinCtrlEventDisabler;
|
||||
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
|
Reference in New Issue
Block a user