User forums > Using Code::Blocks

the wxTextValidator does not work

(1/1)

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?

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.

Navigation

[0] Message Index

Go to full version