News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

the wxTextValidator does not work

Started by immm008, June 08, 2013, 04:19:12 PM

Previous topic - Next topic

immm008

  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.

oBFusCATed

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!]

immm008

  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.