X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/daa7ae0c3053885e0c605af99c8c62c92dae016e..732e46f552027022e4dc87d013918c9d45b0f772:/src/generic/treectlg.cpp diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index ca9a9565df..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); @@ -3086,7 +3088,7 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event ) // remember the old cursor because we will change it while // dragging m_oldCursor = m_cursor; - + // in a single selection control, hide the selection temporarily if ( !(GetWindowStyleFlag() & wxTR_MULTIPLE) ) { @@ -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