X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e6bf95736ea986457ba834e2bbdda01a43250e63..6dd18972d509fce16afa05eba194ca21db2c48f3:/src/generic/listctrl.cpp?ds=inline diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 7b1bffec79..ee4d53272e 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2074,12 +2074,14 @@ void wxListTextCtrl::OnChar( wxKeyEvent &event ) switch ( event.m_keyCode ) { case WXK_RETURN: - if ( !AcceptChanges() ) + if ( AcceptChanges() ) { - // vetoed by the user code - break; + // Close the text control, changes were accepted + Finish(); } - //else: fall through + // else do nothing, do not accept and do not close + + break; case WXK_ESCAPE: Finish(); @@ -4297,7 +4299,7 @@ long wxListMainWindow::FindItem( const wxPoint& pt ) GetItemPosition( GetItemCount()-1, p ); if( p.y == 0 ) return topItem; - long id = (long) floor( pt.y*(GetItemCount()-topItem-1)/p.y+topItem ); + long id = (long) floor( pt.y*double(GetItemCount()-topItem-1)/p.y+topItem ); if( id >= 0 && id < (long)GetItemCount() ) return id;