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
This commit is contained in:
Julian Smart 2005-05-31 09:35:07 +00:00
parent d69225772a
commit 2cb1f3dae3

View File

@ -3010,11 +3010,11 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
HighlightAll( false ); HighlightAll( false );
ReverseHighlight(m_lineSelectSingleOnUp); ReverseHighlight(m_lineSelectSingleOnUp);
} }
else if (m_lastOnSame) if (m_lastOnSame)
{ {
if ((current == m_current) && if ((current == m_current) &&
(hitResult == wxLIST_HITTEST_ONITEMLABEL) && (hitResult == wxLIST_HITTEST_ONITEMLABEL) &&
HasFlag(wxLC_EDIT_LABELS) ) HasFlag(wxLC_EDIT_LABELS) )
{ {
m_renameTimer->Start( 100, true ); m_renameTimer->Start( 100, true );
} }
@ -3057,6 +3057,8 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
m_lineLastClicked = current; m_lineLastClicked = current;
size_t oldCurrent = m_current; size_t oldCurrent = m_current;
bool oldWasSelected = IsHighlighted(m_current);
bool cmdModifierDown = event.CmdDown(); bool cmdModifierDown = event.CmdDown();
if ( IsSingleSel() || !(cmdModifierDown || event.ShiftDown()) ) 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 // 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;
} }
} }