Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: eranon on August 12, 2013, 05:07:35 pm

Title: wxSmith - indicating a validator for a wxSpinCtrl does nothing
Post by: eranon on August 12, 2013, 05:07:35 pm
Hello. wxSmith provides a validator field in its properties grid about a wxSpinCtrl, but when you enter one, it does nothing (not any change in the generated code)...

And effectively, from what I've seen, wxSmith is used to use the validator parameter in the control ctor. But, the wxSpinCtrl ctor doesn't provide any parameter for this. So, to associate a validator, we have to set the validator afterward like this in my dialog ctor :

Code
m_nSpin1 = 10;
pSpinCtrl1->SetValidator(wxGenericValidator(&m_nSpin1));

Well, maybe it would be better to remove the validator field :( or generate the additional line of code :) for the controls which do not allow to pass a validator at contructor time.

Just my two cents