Page 1 of 1

SpinCtrl with empty value?

Posted: Sat Apr 25, 2015 2:02 pm
by MoonKid
Does the SpinCtrl allow and empty value? I mean the text field is empty.

Re: SpinCtrl with empty value?

Posted: Sat Apr 25, 2015 2:24 pm
by DenDev
Have you tried to set a validator to the spinctrl?

Code: Select all

wxIntegerValidator<int> intval;
intval.SetStyle(wxNUM_VAL_ZERO_AS_BLANK);
spinctrl->SetValidator(intval);
This should allow empty value to be set/get as "0" - otherwise I do not think an empty value is allowed.

Re: SpinCtrl with empty value?

Posted: Sat Apr 25, 2015 2:40 pm
by MoonKid
This isn't full implemented in wxPython/wxPhoenix.

And it is a workaround.

An empty value is NULL/None/the-definied-nothing.
'0' or 0 is a value.

This is a big difference and I want my gui to display that.