Revert "Skip mouse button release events in wxGenericTreeCtrl."

This reverts r76094 as it broke label editing in the control.

See #16055, closes #16573.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77891 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-09-27 16:12:34 +00:00
parent 0465215157
commit 47f6df12b3

View File

@ -3709,46 +3709,39 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
#endif
}
}
else if ( event.LeftUp() || event.RightUp() )
else if ( (event.LeftUp() || event.RightUp()) && m_isDragging )
{
if ( m_isDragging )
ReleaseMouse();
// erase the highlighting
DrawDropEffect(m_dropTarget);
if ( m_oldSelection )
{
ReleaseMouse();
m_oldSelection->SetHilight(true);
RefreshLine(m_oldSelection);
m_oldSelection = NULL;
}
// erase the highlighting
DrawDropEffect(m_dropTarget);
// generate the drag end event
wxTreeEvent eventEndDrag(wxEVT_TREE_END_DRAG, this, item);
if ( m_oldSelection )
{
m_oldSelection->SetHilight(true);
RefreshLine(m_oldSelection);
m_oldSelection = NULL;
}
eventEndDrag.m_pointDrag = CalcScrolledPosition(pt);
// generate the drag end event
wxTreeEvent eventEndDrag(wxEVT_TREE_END_DRAG, this, item);
(void)GetEventHandler()->ProcessEvent(eventEndDrag);
eventEndDrag.m_pointDrag = CalcScrolledPosition(pt);
m_isDragging = false;
m_dropTarget = NULL;
(void)GetEventHandler()->ProcessEvent(eventEndDrag);
m_isDragging = false;
m_dropTarget = NULL;
SetCursor(m_oldCursor);
SetCursor(m_oldCursor);
#if defined( __WXMSW__ ) || defined(__WXMAC__) || defined(__WXGTK20__)
Update();
Update();
#else
// TODO: remove this call or use wxEventLoopBase::GetActive()->YieldFor(wxEVT_CATEGORY_UI)
// instead (needs to be tested!)
wxYieldIfNeeded();
// TODO: remove this call or use wxEventLoopBase::GetActive()->YieldFor(wxEVT_CATEGORY_UI)
// instead (needs to be tested!)
wxYieldIfNeeded();
#endif
}
else
{
event.Skip();
}
}
else
{