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:
Julian Smart 2003-04-13 22:56:09 +00:00
parent 8d60dc8aa0
commit 4455332266
2 changed files with 14 additions and 6 deletions

View File

@ -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;

View File

@ -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;