Add unit tests for checking wxTE_PROCESS_ENTER handling
Verify that pressing Enter in a dialog activates its default button when a text-like (i.e. wxTextCtrl or wxComboBox) has focus either if it doesn't have wxTE_PROCESS_ENTER style or if it does, but its handler skips the event, but not if the style is used and the event is handled.
This commit is contained in:
@@ -231,4 +231,22 @@ void ComboBoxTestCase::IsEmpty()
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST_CASE("wxComboBox::ProcessEnter", "[wxComboBox][enter]")
|
||||
{
|
||||
struct ComboBoxCreator
|
||||
{
|
||||
static wxControl* Do(wxWindow* parent, int style)
|
||||
{
|
||||
const wxString choices[] = { "foo", "bar", "baz" };
|
||||
|
||||
return new wxComboBox(parent, wxID_ANY, wxString(),
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
WXSIZEOF(choices), choices,
|
||||
style);
|
||||
}
|
||||
};
|
||||
|
||||
TestProcessEnter(&ComboBoxCreator::Do);
|
||||
}
|
||||
|
||||
#endif //wxUSE_COMBOBOX
|
||||
|
Reference in New Issue
Block a user