Don't always turn on wxTE_PROCESS_ENTER in wxOSX

This style was unconditionally used for all multiline controls for some
reason, meaning that wxEVT_TEXT_ENTER could be received even for the controls
not using wxTE_PROCESS_ENTER explicitly, which was unexpected.

Don't do this any more to conform to the expected behaviour.

Also do use wxTE_PROCESS_ENTER for the text control supposed to allow handling
"Enter" in the text sample: surprisingly, it didn't have this style before,
although it was clearly supposed to.

Closes #1913.
This commit is contained in:
Vadim Zeitlin 2015-11-09 03:48:24 +01:00
parent a1a06bee7e
commit fbf59742a4
3 changed files with 2 additions and 9 deletions

View File

@ -195,3 +195,4 @@ wxOSX/Cocoa:
- Provide native implementation of wxStandardPaths (Tobias Taschner).
- Add wxTE_{RIGHT,CENTER} support for multiline wxTextCtrl (Andreas Falkenhahn).
- Don't leave wxSlider labels shown when the slider itself is hidden.
- Don't generate wxEVT_TEXT_ENTER for controls without wxTE_PROCESS_ENTER.

View File

@ -1160,7 +1160,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
m_tab->SetClientData((void *)wxT("tab"));
m_enter = new MyTextCtrl( this, 100, wxT("Multiline, allow <ENTER> processing."),
wxPoint(180,170), wxSize(200,70), wxTE_MULTILINE);
wxPoint(180,170), wxSize(200,70), wxTE_MULTILINE | wxTE_PROCESS_ENTER );
m_enter->SetClientData((void *)wxT("enter"));
m_textrich = new MyTextCtrl(this, wxID_ANY, wxT("Allows more than 30Kb of text\n")

View File

@ -103,14 +103,6 @@ bool wxTextCtrl::Create( wxWindow *parent,
if ( !wxTextCtrlBase::Create( parent, id, pos, size, style & ~(wxHSCROLL | wxVSCROLL), validator, name ) )
return false;
if ( m_windowStyle & wxTE_MULTILINE )
{
// always turn on this style for multi-line controls
m_windowStyle |= wxTE_PROCESS_ENTER;
style |= wxTE_PROCESS_ENTER ;
}
SetPeer(wxWidgetImpl::CreateTextControl( this, GetParent(), GetId(), str, pos, size, style, GetExtraStyle() ));
MacPostControlCreate(pos, size) ;