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:
Vadim Zeitlin
2019-07-14 01:03:11 +02:00
parent f7ead9f844
commit 13aa2a6721
4 changed files with 163 additions and 0 deletions

View File

@@ -1249,4 +1249,19 @@ void TextCtrlTestCase::XYToPositionSingleLine()
}
}
TEST_CASE("wxTextCtrl::ProcessEnter", "[wxTextCtrl][enter]")
{
struct TextCtrlCreator
{
static wxControl* Do(wxWindow* parent, int style)
{
return new wxTextCtrl(parent, wxID_ANY, wxString(),
wxDefaultPosition, wxDefaultSize,
style);
}
};
TestProcessEnter(&TextCtrlCreator::Do);
}
#endif //wxUSE_TEXTCTRL