Handle wxTE_PROCESS_ENTER with wxTE_PASSWORD correctly in wxOSX.
Controls with wxTE_PASSWORD style didn't send wxEVT_TEXT_ENTER even if they also had wxTE_PROCESS_ENTER. Fix this by checking for the latter style before mapping the enter presses to default button activation. See #14930.
This commit is contained in:
@@ -212,6 +212,17 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil;
|
|||||||
if ( wxpeer )
|
if ( wxpeer )
|
||||||
{
|
{
|
||||||
if (commandSelector == @selector(insertNewline:))
|
if (commandSelector == @selector(insertNewline:))
|
||||||
|
{
|
||||||
|
if ( wxpeer->GetWindowStyle() & wxTE_PROCESS_ENTER )
|
||||||
|
{
|
||||||
|
wxCommandEvent event(wxEVT_TEXT_ENTER, wxpeer->GetId());
|
||||||
|
event.SetEventObject( wxpeer );
|
||||||
|
wxTextWidgetImpl* impl = (wxNSTextFieldControl * ) wxWidgetImpl::FindFromWXWidget( self );
|
||||||
|
wxTextEntry * const entry = impl->GetTextEntry();
|
||||||
|
event.SetString( entry->GetValue() );
|
||||||
|
handled = wxpeer->HandleWindowEvent( event );
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(wxpeer), wxTopLevelWindow);
|
wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(wxpeer), wxTopLevelWindow);
|
||||||
if ( tlw && tlw->GetDefaultItem() )
|
if ( tlw && tlw->GetDefaultItem() )
|
||||||
@@ -228,6 +239,7 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user