Simplify after recent changes by adding DoSetDigitsAndUpdate()
There is no need for a separate UpdateAfterDigitsChange(), it is always called together with DoSetDigits().
This commit is contained in:
@@ -430,11 +430,11 @@ private:
|
|||||||
// specified increment without loss of precision.
|
// specified increment without loss of precision.
|
||||||
static unsigned DetermineDigits(double inc);
|
static unsigned DetermineDigits(double inc);
|
||||||
|
|
||||||
// Set the number of digits and the format unconditionally.
|
// Just set the number of digits and the format unconditionally.
|
||||||
void DoSetDigits(unsigned digits);
|
void DoSetDigits(unsigned digits);
|
||||||
|
|
||||||
// Update the appearance after the number of digits has changed.
|
// Call DoSetDigits() and update the appearance.
|
||||||
void UpdateAfterDigitsChange();
|
void DoSetDigitsAndUpdate(unsigned digits);
|
||||||
|
|
||||||
|
|
||||||
wxString m_format;
|
wxString m_format;
|
||||||
|
@@ -759,11 +759,7 @@ void wxSpinCtrlDouble::SetIncrement(double inc)
|
|||||||
// could be undesirable, but we do increase it if the current number is not
|
// could be undesirable, but we do increase it if the current number is not
|
||||||
// high enough to show the numbers without losing precision.
|
// high enough to show the numbers without losing precision.
|
||||||
if ( digits > m_digits )
|
if ( digits > m_digits )
|
||||||
{
|
DoSetDigitsAndUpdate(digits);
|
||||||
DoSetDigits(digits);
|
|
||||||
|
|
||||||
UpdateAfterDigitsChange();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxSpinCtrlDouble::SetDigits(unsigned digits)
|
void wxSpinCtrlDouble::SetDigits(unsigned digits)
|
||||||
@@ -773,13 +769,13 @@ void wxSpinCtrlDouble::SetDigits(unsigned digits)
|
|||||||
if ( digits == m_digits )
|
if ( digits == m_digits )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DoSetDigits(digits);
|
DoSetDigitsAndUpdate(digits);
|
||||||
|
|
||||||
UpdateAfterDigitsChange();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxSpinCtrlDouble::UpdateAfterDigitsChange()
|
void wxSpinCtrlDouble::DoSetDigitsAndUpdate(unsigned digits)
|
||||||
{
|
{
|
||||||
|
DoSetDigits(digits);
|
||||||
|
|
||||||
ResetTextValidator();
|
ResetTextValidator();
|
||||||
m_textCtrl->InvalidateBestSize();
|
m_textCtrl->InvalidateBestSize();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user