]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
Fixed a long-standing issue where wxSlider controls with a hardcoded size would mispl...
[wxWidgets.git] / src / generic / listctrl.cpp
index 1d9eda16d99584bba301a860b91b2151be9619c9..698a7e335bf35ef0d27f58396047e65bc0f8247d 100644 (file)
@@ -1746,7 +1746,7 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
                                     dc,
                                     wxRect(x, HEADER_OFFSET_Y, cw, h - 2),
                                     m_parent->IsEnabled() ? 0
-                                                          : wxCONTROL_DISABLED
+                                                          : (int)wxCONTROL_DISABLED
                                 );
 
         // see if we have enough space for the column label
@@ -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;
 
@@ -2874,15 +2873,13 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
     if ( GetParent()->GetEventHandler()->ProcessEvent( event) )
         return;
 
-#if wxUSE_MOUSEWHEEL
     if (event.GetEventType() == wxEVT_MOUSEWHEEL)
     {
         // let the base handle mouse wheel events.
         event.Skip();
         return;
     }
-#endif
-    
+
     if ( !HasCurrent() || IsEmpty() )
         return;
 
@@ -2990,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() );
     }