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.
Closes #14930.
(this is a backport of 8e0799e3e5
from master)
This commit is contained in:
@@ -640,6 +640,7 @@ wxOSX:
|
|||||||
- Fix handling of "Cancel" button in wxSearchCtrl (John Roberts).
|
- Fix handling of "Cancel" button in wxSearchCtrl (John Roberts).
|
||||||
- Generate correct events for WXK_NUMPAD_ENTER (John Roberts).
|
- Generate correct events for WXK_NUMPAD_ENTER (John Roberts).
|
||||||
- Fix handling of WXK_NUMPAD_ENTER in wxTextCtrl (John Roberts).
|
- Fix handling of WXK_NUMPAD_ENTER in wxTextCtrl (John Roberts).
|
||||||
|
- Generate wxEVT_TEXT_ENTER for wxTE_PASSWORD controls too (mj_smoker).
|
||||||
- Send wxIconizeEvent when a window is iconized/restore (Rob Krakora).
|
- Send wxIconizeEvent when a window is iconized/restore (Rob Krakora).
|
||||||
- Use correct colour for disabled wxStaticText (sbrowne).
|
- Use correct colour for disabled wxStaticText (sbrowne).
|
||||||
- Fix printing all pages non-interactively (John Roberts).
|
- Fix printing all pages non-interactively (John Roberts).
|
||||||
|
@@ -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