- // This wxCheckBox* doesn't need to be assigned to any pointer
- // because we don't use it elsewhere--it can be anonymous.
- // We don't need any such pointer to query its state, which
- // can be gotten directly from g_data.
- flexgridsizer->Add(new wxCheckBox(this, VALIDATE_CHECK, wxT("Sample checkbox"),
- wxPoint(130, 10), wxSize(120, wxDefaultCoord), 0,
- wxGenericValidator(&g_data.m_checkbox_state)),
- 1, wxALIGN_CENTER);
+
+ // Now set a wxTextValidator with an explicit list of characters NOT allowed:
+ wxTextValidator textVal(wxFILTER_EXCLUDE_CHAR_LIST, &g_data.m_string2);
+ textVal.SetCharExcludes("bcwyz");
+ flexgridsizer->Add(new wxTextCtrl(this, VALIDATE_TEXT2, wxEmptyString,
+ wxDefaultPosition, wxDefaultSize, 0, textVal),
+ 1, wxGROW);