From: Julian Smart Date: Tue, 31 May 2005 09:35:07 +0000 (+0000) Subject: Applied patch [ 1210352 ] Fix editing in generic wxListCtrl with wxLC_EDIT_LABELS X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2cb1f3dae3688542c8217781d9b590f43602bb77 Applied patch [ 1210352 ] Fix editing in generic wxListCtrl with wxLC_EDIT_LABELS git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index b1fd5bd6f5..a51113da01 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -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; } }