stop the rename timer when the current item changes (Tim Kosse)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-12-03 14:19:42 +00:00
parent fcb29b2338
commit 6fef2483d9

View File

@@ -2876,6 +2876,11 @@ void wxListMainWindow::ChangeCurrent(size_t current)
{ {
m_current = current; m_current = current;
// as the current item changed, we shouldn't start editing it when the
// "slow click" timer expires as the click happened on another item
if ( m_renameTimer->IsRunning() )
m_renameTimer->Stop();
SendNotify(current, wxEVT_COMMAND_LIST_ITEM_FOCUSED); SendNotify(current, wxEVT_COMMAND_LIST_ITEM_FOCUSED);
} }
@@ -3076,7 +3081,9 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
bool forceClick = false; bool forceClick = false;
if (event.ButtonDClick()) if (event.ButtonDClick())
{ {
if ( m_renameTimer->IsRunning() )
m_renameTimer->Stop(); m_renameTimer->Stop();
m_lastOnSame = false; m_lastOnSame = false;
if ( current == m_lineLastClicked ) if ( current == m_lineLastClicked )