X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1729813a8d1b0769eee47fcda2b3b03b4f36e893..732e46f552027022e4dc87d013918c9d45b0f772:/src/generic/treectlg.cpp diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 5836734469..89df6f6b19 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -758,6 +758,8 @@ void wxGenericTreeCtrl::Init() m_findTimer = NULL; + m_dropEffectAboveItem = false; + m_lastOnSame = false; #ifdef __WXMAC_CARBON__ @@ -2499,7 +2501,7 @@ void wxGenericTreeCtrl::DrawDropEffect(wxGenericTreeItem *item) { // draw a line under the drop target because the item will be // dropped there - DrawLine(item, true /* below */); + DrawLine(item, !m_dropEffectAboveItem ); } SetCursor(wxCURSOR_BULLSEYE); @@ -3102,7 +3104,7 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event ) CaptureMouse(); } } - else if ( event.Moving() ) + else if ( event.Dragging() ) { if ( item != m_dropTarget ) { @@ -3114,7 +3116,7 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event ) // highlight the current drop target if any DrawDropEffect(m_dropTarget); -#if defined( __WXMSW__ ) || defined(__WXMAC__) +#if defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXGTK20__) Update(); #else wxYieldIfNeeded(); @@ -3175,11 +3177,12 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event ) if ( event.RightDown() ) { + DoSelectItem(item, true, false); wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, GetId()); nevent.m_item = item; nevent.m_pointDrag = CalcScrolledPosition(pt); nevent.SetEventObject(this); - GetEventHandler()->ProcessEvent(nevent); + event.Skip(!GetEventHandler()->ProcessEvent(nevent)); } else if ( event.LeftUp() ) { @@ -3561,6 +3564,20 @@ wxGenericTreeCtrl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) #endif } +#if WXWIN_COMPATIBILITY_2_4 + +int wxGenericTreeCtrl::GetItemSelectedImage(const wxTreeItemId& item) const +{ + return GetItemImage(item, wxTreeItemIcon_Selected); +} + +void wxGenericTreeCtrl::SetItemSelectedImage(const wxTreeItemId& item, int image) +{ + SetItemImage(item, image, wxTreeItemIcon_Selected); +} + +#endif // WXWIN_COMPATIBILITY_2_4 + #if WXWIN_COMPATIBILITY_2_2 wxTreeItemId wxGenericTreeCtrl::GetParent(const wxTreeItemId& item) const