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:
committed by
Vadim Zeitlin
parent
9ef1b1529d
commit
1be43ed67b
@@ -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);
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user