]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
Make list consistent with tree in terms of Vetoed changes closing the inline edit...
[wxWidgets.git] / src / generic / listctrl.cpp
index def1d4591a4c89bed1d9b70936fe79d10bf7ccfb..698a7e335bf35ef0d27f58396047e65bc0f8247d 100644 (file)
@@ -2075,12 +2075,11 @@ void wxListTextCtrl::OnChar( wxKeyEvent &event )
     switch ( event.m_keyCode )
     {
         case WXK_RETURN:
-            if ( AcceptChanges() )
-            {
-                // Close the text control, changes were accepted
-                Finish();
-            }
-            // else do nothing, do not accept and do not close
+            // Notify the owner about the changes
+            AcceptChanges();
+
+            // Even if vetoed, close the control (consistent with MSW)
+            Finish();
 
             break;
 
@@ -2988,6 +2987,15 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
     }
     else if (event.RightDown())
     {
+        // If the item is already selected, do not update the selection.
+        // Multi-selections should not be cleared if a selected item is clicked.
+        if (!IsHighlighted(current))
+        {
+            HighlightAll(false);
+            ChangeCurrent(current);
+            ReverseHighlight(m_current);
+        }
+
         SendNotify( current, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK,
                     event.GetPosition() );
     }