From 9bce7b7b134224a3bc8c4a47c1be630b2759049b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 22 Jul 2010 12:16:19 +0000 Subject: [PATCH] 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 --- src/generic/spinctlg.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.45.2