X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3e6e514739bdd157966d2bd2726118f1054dd1c1..02761f6cd478e3c2c97cf6f93442747f7b029833:/src/generic/treectlg.cpp diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 2ebb0d6c30..b0de2f9f2b 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -1021,6 +1021,12 @@ void wxGenericTreeCtrl::SetItemBold(const wxTreeItemId& item, bool bold) if ( pItem->IsBold() != bold ) { pItem->SetBold(bold); + + // recalculate the item size as bold and non bold fonts have different + // widths + wxClientDC dc(this); + CalculateSize(pItem, dc); + RefreshLine(pItem); } } @@ -3016,11 +3022,12 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event ) } #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 // dragging/moving events for items drag-and-drop if ( !(event.LeftDown() || event.LeftUp() || + event.MiddleDown() || event.RightDown() || event.LeftDClick() || event.Dragging() || @@ -3171,6 +3178,12 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event ) nevent2.m_pointDrag = CalcScrolledPosition(pt); 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() ) { // this facilitates multiple-item drag-and-drop @@ -3210,7 +3223,7 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event ) m_lastOnSame = false; } } - else // !RightDown() && !LeftUp() ==> LeftDown() || LeftDClick() + else // !RightDown() && !MiddleDown() && !LeftUp() ==> LeftDown() || LeftDClick() { if ( event.LeftDown() ) { @@ -3437,7 +3450,7 @@ void wxGenericTreeCtrl::RefreshLine( wxGenericTreeItem *item ) void wxGenericTreeCtrl::RefreshSelected() { - if (m_freezeCount || m_freezeCount) + if (m_freezeCount) return; // TODO: this is awfully inefficient, we should keep the list of all @@ -3448,7 +3461,7 @@ void wxGenericTreeCtrl::RefreshSelected() void wxGenericTreeCtrl::RefreshSelectedUnder(wxGenericTreeItem *item) { - if (m_freezeCount || m_freezeCount) + if (m_freezeCount) return; if ( item->IsSelected() )