Test for result of searching for wxID_CANCEL button
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20207 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
8d60dc8aa0
commit
4455332266
@ -925,11 +925,15 @@ void wxListBox::OnChar(wxKeyEvent& event)
|
||||
/* generate wxID_CANCEL if command-. or <esc> has been pressed (typically in dialogs) */
|
||||
else if (event.GetKeyCode() == WXK_ESCAPE || (event.GetKeyCode() == '.' && event.MetaDown() ) )
|
||||
{
|
||||
// FIXME: look in ancestors, not just parent.
|
||||
wxWindow* win = GetParent()->FindWindow( wxID_CANCEL ) ;
|
||||
if (win)
|
||||
{
|
||||
wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL);
|
||||
new_event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( new_event );
|
||||
}
|
||||
}
|
||||
else if ( event.GetKeyCode() == WXK_TAB )
|
||||
{
|
||||
wxNavigationKeyEvent new_event;
|
||||
|
@ -925,11 +925,15 @@ void wxListBox::OnChar(wxKeyEvent& event)
|
||||
/* generate wxID_CANCEL if command-. or <esc> has been pressed (typically in dialogs) */
|
||||
else if (event.GetKeyCode() == WXK_ESCAPE || (event.GetKeyCode() == '.' && event.MetaDown() ) )
|
||||
{
|
||||
// FIXME: look in ancestors, not just parent.
|
||||
wxWindow* win = GetParent()->FindWindow( wxID_CANCEL ) ;
|
||||
if (win)
|
||||
{
|
||||
wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL);
|
||||
new_event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( new_event );
|
||||
}
|
||||
}
|
||||
else if ( event.GetKeyCode() == WXK_TAB )
|
||||
{
|
||||
wxNavigationKeyEvent new_event;
|
||||
|
Loading…
Reference in New Issue
Block a user