+bool wxSpinCtrl::SetBase(int base)
+{
+ // Currently we only support base 10 and 16. We could add support for base
+ // 8 quite easily but wxMSW doesn't support it natively so don't bother.
+ if ( base != 10 && base != 16 )
+ return false;
+
+ if ( base == m_base )
+ return true;
+
+ // Update the current control contents to show in the new base: be careful
+ // to call DoTextToValue() before changing the base...
+ double val;
+ const bool hasValidVal = DoTextToValue(m_textCtrl->GetValue(), &val);
+
+ m_base = base;
+
+ // ... but DoValueToText() after doing it.
+ if ( hasValidVal )
+ m_textCtrl->SetValue(DoValueToText(val));
+
+ return true;
+}
+