]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
invalidate best size cache when GTK style changes
[wxWidgets.git] / src / generic / listctrl.cpp
index 7b1bffec796c4faae4ad1f991874f6af693d686d..ee4d53272ecb00ffd9d8933144f532e8576c61bd 100644 (file)
@@ -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;