What is the proper validator to use for wxSpinCtrlDouble? wxGenericValidator seems to skip that control, and since the control doesn't derive from a textCtrl, wxFloatingPointValidator<> also doesn't work.
Is not including it in wxGenericValidator intentional or an oversight?
Validators for wxSpinCtrlDouble
Re: Validators for wxSpinCtrlDouble
Looking into the source code, wxSpinCtrlDouble does set a wxFloatingPointValidator by default.
What is not working for you?
What is not working for you?
Use the source, Luke!
Re: Validators for wxSpinCtrlDouble
here's the snippet:
When I hit the SetValidator() call, I get the Assert Failure:
Code: Select all
minFontSizeCtrl = new wxSpinCtrlDouble(labelBox, wxID_ANY, wxString(),
wxDefaultPosition, wxDefaultSize,
wxSP_ARROW_KEYS | wxALIGN_RIGHT, 0, 20,
m_doubleData, 0.1);
minFontSizeCtrl->SetDigits(1);
minFontSizeCtrl->SetValidator(wxFloatingPointValidator(&m_doubleData));
Stepping through the code, I do se the wxFloatingPointValidator used in DoSetDigits(), but that is set on m_textCtrl. And I don't see any way to access it.""Assert Failure"" failed in wxNumValidatorBase::SetWindow(): Can only be used with wxTextCtrl or wxComboBox.