From: Vadim Zeitlin Date: Thu, 22 Jul 2010 12:16:19 +0000 (+0000) Subject: Update wxSpinCtrlDouble::m_digits in its SetDigits(). X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9bce7b7b134224a3bc8c4a47c1be630b2759049b Update wxSpinCtrlDouble::m_digits in its SetDigits(). We need to update the internally stored information about the number of digits we use and not just update the control appearance accordingly. Also don't do anything at all when the number of digits didn't really change. Closes #12260. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65042 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp index d36608adc4..d872780e9c 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -561,6 +561,11 @@ void wxSpinCtrlDouble::SetDigits(unsigned digits) { wxCHECK_RET( digits <= 20, "too many digits for wxSpinCtrlDouble" ); + if ( digits == m_digits ) + return; + + m_digits = digits; + m_format.Printf(wxT("%%0.%ulf"), digits); DoSetValue(m_value);