Author Topic: the wxTextValidator does not work  (Read 3519 times)

Offline immm008

  • Multiple posting newcomer
  • *
  • Posts: 11
the wxTextValidator does not work
« 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: the wxTextValidator does not work
« Reply #1 on: June 08, 2013, 05:29:18 pm »
Have you looked at the generated code?
Are you sure it is correct?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline immm008

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: the wxTextValidator does not work
« Reply #2 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.