Adjust entry width of wxSpinCtrl in wxGTK to its range

Ensure that the entry is always (just) big enough to show any value
valid in this spin control.

This also ensures that GetBestSize() doesn't need to be overridden to
use GetSizeFromTextSize() any longer as the best size will be determined
correctly by GTK itself.
This commit is contained in:
Vadim Zeitlin
2019-11-13 02:52:42 +01:00
parent b891ffe8d0
commit 7f368872d7
2 changed files with 16 additions and 3 deletions

View File

@@ -71,7 +71,9 @@ protected:
void GtkDisableEvents() const;
void GtkEnableEvents() const;
virtual wxSize DoGetBestSize() const wxOVERRIDE;
// Update the number of digits used to match our range (and base).
void GtkSetEntryWidth();
virtual wxSize DoGetSizeFromTextSize(int xlen, int ylen = -1) const wxOVERRIDE;
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;