]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 1210352 ] Fix editing in generic wxListCtrl with wxLC_EDIT_LABELS
authorJulian Smart <julian@anthemion.co.uk>
Tue, 31 May 2005 09:35:07 +0000 (09:35 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 31 May 2005 09:35:07 +0000 (09:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/listctrl.cpp

index b1fd5bd6f5252a0fc09cd0648fdbefefd35a2a3d..a51113da0130cbd87c7458a93aa86006d3676259 100644 (file)
@@ -3010,11 +3010,11 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
             HighlightAll( false );
             ReverseHighlight(m_lineSelectSingleOnUp);
         }
-        else if (m_lastOnSame)
+        if (m_lastOnSame)
         {
             if ((current == m_current) &&
                 (hitResult == wxLIST_HITTEST_ONITEMLABEL) &&
-                HasFlag(wxLC_EDIT_LABELS)  )
+                HasFlag(wxLC_EDIT_LABELS) )
             {
                 m_renameTimer->Start( 100, true );
             }
@@ -3057,6 +3057,8 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
         m_lineLastClicked = current;
 
         size_t oldCurrent = m_current;
+        bool oldWasSelected = IsHighlighted(m_current);
+
         bool cmdModifierDown = event.CmdDown();
         if ( IsSingleSel() || !(cmdModifierDown || event.ShiftDown()) )
         {
@@ -3110,7 +3112,7 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
         }
 
         // forceClick is only set if the previous click was on another item
-        m_lastOnSame = !forceClick && (m_current == oldCurrent);
+        m_lastOnSame = !forceClick && (m_current == oldCurrent) && oldWasSelected;
     }
 }