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

@@ -168,6 +168,9 @@ private:
// (up-down control) and the text control (buddy window).
int GetOverlap() const;
// Calculate the best size for the number with the given number of digits.
wxSize GetBestSizeFromDigitsCount(int digitsCount) const;
wxDECLARE_DYNAMIC_CLASS(wxSpinCtrl);
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxSpinCtrl);