X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2c1a331259c998fdf79ae0303a1845863de6afbb..28b4db7f890258e83fa0a57ea85c72585e48b756:/src/mac/listbox.cpp diff --git a/src/mac/listbox.cpp b/src/mac/listbox.cpp index 656a835b6e..9daaf275e8 100644 --- a/src/mac/listbox.cpp +++ b/src/mac/listbox.cpp @@ -221,7 +221,6 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, Str255 fontName ; SInt16 fontSize ; Style fontStyle ; - SInt16 fontNum ; #if TARGET_CARBON GetThemeFont(kThemeViewsFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ; #else @@ -824,7 +823,7 @@ void wxListBox::OnSize( const wxSizeEvent &event) LCellSize( pt , (ListHandle)m_macList ) ; } -void wxListBox::MacHandleControlClick( WXWidget control , wxInt16 controlpart ) +void wxListBox::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED(mouseStillDown)) { Boolean wasDoubleClick = false ; long result ; @@ -925,10 +924,14 @@ void wxListBox::OnChar(wxKeyEvent& event) /* generate wxID_CANCEL if command-. or 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 ) ; - wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL); - new_event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( new_event ); + 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 ) {