Improve best size determination for wxSpinCtrl

Use the range and the base to determine the widest value string and use
it to calculate the best size.
This commit is contained in:
Ilya Sinitsyn
2019-10-03 00:39:12 +07:00
committed by Vadim Zeitlin
parent 9ef1b1529d
commit 1be43ed67b
4 changed files with 46 additions and 34 deletions

View File

@@ -143,6 +143,11 @@ namespace wxPrivate
// string containing hexadecimal representation of the given number.
extern wxString wxSpinCtrlFormatAsHex(long val, long maxVal);
// The helper function to determine the best size for the given control.
// We can't implement this function in the wxSpinCtrlBase because MSW implementation
// of wxSpinCtrl is derived from wxSpinButton but uses the same algorithm.
extern wxSize wxSpinCtrlGetBestSize(const wxControl* spin, int minVal, int maxVal, int base);
} // namespace wxPrivate
// old wxEVT_COMMAND_* constants