Take number of digits into account in GTK wxSpinCtrlDouble
When determining the entry width in wxSpinCtrlDouble, we need to account not only for the width of the integer part, but also for the number of digits that determines the width of the fractional part. Do it in the overridden version of (now virtual) GtkSetEntryWidth(). See https://github.com/wxWidgets/wxWidgets/pull/1817 Closes #18734.
This commit is contained in:
@@ -71,8 +71,9 @@ protected:
|
||||
void GtkDisableEvents();
|
||||
void GtkEnableEvents();
|
||||
|
||||
// Update the number of digits used to match our range (and base).
|
||||
void GtkSetEntryWidth();
|
||||
// Update the width of the entry field to fit the current range (and also
|
||||
// base or number of digits depending on the derived class).
|
||||
virtual void GtkSetEntryWidth() = 0;
|
||||
|
||||
virtual wxSize DoGetSizeFromTextSize(int xlen, int ylen = -1) const wxOVERRIDE;
|
||||
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;
|
||||
@@ -136,6 +137,9 @@ public:
|
||||
virtual int GetBase() const wxOVERRIDE { return m_base; }
|
||||
virtual bool SetBase(int base) wxOVERRIDE;
|
||||
|
||||
protected:
|
||||
virtual void GtkSetEntryWidth() wxOVERRIDE;
|
||||
|
||||
private:
|
||||
// Common part of all ctors.
|
||||
void Init()
|
||||
@@ -201,6 +205,9 @@ public:
|
||||
virtual int GetBase() const wxOVERRIDE { return 10; }
|
||||
virtual bool SetBase(int WXUNUSED(base)) wxOVERRIDE { return false; }
|
||||
|
||||
protected:
|
||||
virtual void GtkSetEntryWidth() wxOVERRIDE;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxSpinCtrlDouble);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user