- text = new wxTextCtrl(this, VALIDATE_TEXT, "",
- wxPoint(10, 10), wxSize(120, -1), 0,
- wxTextValidator(wxFILTER_ALPHA, &g_data.m_string));
- flexgridsizer->Add(text);
+ m_text = new wxTextCtrl(this, VALIDATE_TEXT, wxEmptyString,
+ wxDefaultPosition, wxDefaultSize, 0,
+ wxTextValidator(wxFILTER_ALPHA, &g_data.m_string));
+ m_text->SetToolTip("uses wxTextValidator with wxFILTER_ALPHA");
+ flexgridsizer->Add(m_text, 1, wxGROW);
+
+
+ // Now set a wxTextValidator with an explicit list of characters NOT allowed:
+ wxTextValidator textVal(wxFILTER_EMPTY|wxFILTER_EXCLUDE_LIST, &g_data.m_string2);
+ textVal.SetCharExcludes("bcwyz");
+ wxTextCtrl* txt2 =
+ new wxTextCtrl(this, VALIDATE_TEXT2, wxEmptyString,
+ wxDefaultPosition, wxDefaultSize, 0, textVal);
+ txt2->SetToolTip("uses wxTextValidator with wxFILTER_EMPTY|wxFILTER_EXCLUDE_LIST (to exclude 'bcwyz')");
+ flexgridsizer->Add(txt2, 1, wxGROW);
+
+ flexgridsizer->Add(new wxListBox((wxWindow*)this, VALIDATE_LIST,
+ wxDefaultPosition, wxDefaultSize,
+ 3, g_listbox_choices, wxLB_MULTIPLE,
+ wxGenericValidator(&g_data.m_listbox_choices)),
+ 1, wxGROW);
+
+ m_combobox = new wxComboBox(this, VALIDATE_COMBO, wxEmptyString,
+ wxDefaultPosition, wxDefaultSize,
+ 3, g_combobox_choices, 0L,
+ MyComboBoxValidator(&g_data.m_combobox_choice));
+ m_combobox->SetToolTip("uses a custom validator (MyComboBoxValidator)");
+ flexgridsizer->Add(m_combobox, 1, wxALIGN_CENTER);