Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: immm008 on June 08, 2013, 04:19:12 pm

Title: the wxTextValidator does not work
Post by: immm008 on June 08, 2013, 04:19:12 pm
  I use wxSmith to generate a new dialog with only a wxtextctrl and a button,the id of button is wxID_OK,so it can call validate automaticly,then i specfic a wxTextValidator with a wxFILTER_ALPHA and a pointer to wxString(_("123")) in wxTextcrtl's constructor.
when i show the dialog showmodal,the "123" does not appear at wxtextctrl,of course after i type some characters in it,the string i passed by pointer contains nothing,but the filter works,i can't type non-alphabeta in it.
Title: Re: the wxTextValidator does not work
Post by: oBFusCATed on June 08, 2013, 05:29:18 pm
Have you looked at the generated code?
Are you sure it is correct?
Title: Re: the wxTextValidator does not work
Post by: immm008 on June 09, 2013, 01:34:23 am
  I find the reason,the wxtextctrl which wxsmith gernerates takes a panel as his parent pointer.so the wxtextctrl is not the children of the dialog,since the extra style recursively validate is not default set,so it does not  work.