Don't send EVT_TEXT_ENTER to controls without wxTE_PROCESS_ENTER
wxMSW always sent this event to multiline text controls, even when they didn't have wxTE_PROCESS_ENTER style, contrary to what was documented. Avoid sending this event unless wxTE_PROCESS_ENTER is used and add unit tests checking that multiline text controls don't get it without this style (but still do get it with it).
This commit is contained in:
@@ -1274,7 +1274,8 @@ TEST_CASE("wxTextCtrl::ProcessEnter", "[wxTextCtrl][enter]")
|
||||
class TextCtrlCreator : public TextLikeControlCreator
|
||||
{
|
||||
public:
|
||||
explicit TextCtrlCreator()
|
||||
explicit TextCtrlCreator(int styleToAdd = 0)
|
||||
: m_styleToAdd(styleToAdd)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1282,8 +1283,16 @@ TEST_CASE("wxTextCtrl::ProcessEnter", "[wxTextCtrl][enter]")
|
||||
{
|
||||
return new wxTextCtrl(parent, wxID_ANY, wxString(),
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
style);
|
||||
style | m_styleToAdd);
|
||||
}
|
||||
|
||||
virtual TextLikeControlCreator* CloneAsMultiLine() const wxOVERRIDE
|
||||
{
|
||||
return new TextCtrlCreator(wxTE_MULTILINE);
|
||||
}
|
||||
|
||||
private:
|
||||
int m_styleToAdd;
|
||||
};
|
||||
|
||||
TestProcessEnter(TextCtrlCreator());
|
||||
|
Reference in New Issue
Block a user