generate middle click events (patch 1521314)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40296 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -166,6 +166,7 @@ All (GUI):
|
|||||||
- Added wxTopLevelWindow::SetTransparent and CanSetTransparent, with
|
- Added wxTopLevelWindow::SetTransparent and CanSetTransparent, with
|
||||||
implementations (so far) for wxMSW and wxMac.
|
implementations (so far) for wxMSW and wxMac.
|
||||||
- Allow customizing individual grid lines appearance (S<>ren Lassen)
|
- Allow customizing individual grid lines appearance (S<>ren Lassen)
|
||||||
|
- Fixed middle click events generation in generic wxTreeCtrl (Olly Betts)
|
||||||
|
|
||||||
wxMSW:
|
wxMSW:
|
||||||
|
|
||||||
|
@@ -3016,11 +3016,12 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// we process left mouse up event (enables in-place edit), right down
|
// we process left mouse up event (enables in-place edit), middle/right down
|
||||||
// (pass to the user code), left dbl click (activate item) and
|
// (pass to the user code), left dbl click (activate item) and
|
||||||
// dragging/moving events for items drag-and-drop
|
// dragging/moving events for items drag-and-drop
|
||||||
if ( !(event.LeftDown() ||
|
if ( !(event.LeftDown() ||
|
||||||
event.LeftUp() ||
|
event.LeftUp() ||
|
||||||
|
event.MiddleDown() ||
|
||||||
event.RightDown() ||
|
event.RightDown() ||
|
||||||
event.LeftDClick() ||
|
event.LeftDClick() ||
|
||||||
event.Dragging() ||
|
event.Dragging() ||
|
||||||
@@ -3171,6 +3172,12 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
|
|||||||
nevent2.m_pointDrag = CalcScrolledPosition(pt);
|
nevent2.m_pointDrag = CalcScrolledPosition(pt);
|
||||||
GetEventHandler()->ProcessEvent(nevent2);
|
GetEventHandler()->ProcessEvent(nevent2);
|
||||||
}
|
}
|
||||||
|
else if ( event.MiddleDown() )
|
||||||
|
{
|
||||||
|
wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, this, item);
|
||||||
|
nevent.m_pointDrag = CalcScrolledPosition(pt);
|
||||||
|
event.Skip(!GetEventHandler()->ProcessEvent(nevent));
|
||||||
|
}
|
||||||
else if ( event.LeftUp() )
|
else if ( event.LeftUp() )
|
||||||
{
|
{
|
||||||
// this facilitates multiple-item drag-and-drop
|
// this facilitates multiple-item drag-and-drop
|
||||||
@@ -3210,7 +3217,7 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
|
|||||||
m_lastOnSame = false;
|
m_lastOnSame = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // !RightDown() && !LeftUp() ==> LeftDown() || LeftDClick()
|
else // !RightDown() && !MiddleDown() && !LeftUp() ==> LeftDown() || LeftDClick()
|
||||||
{
|
{
|
||||||
if ( event.LeftDown() )
|
if ( event.LeftDown() )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user