X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/80752b57a9bbdfa7613a917d9ece00fc47677080..bbc3761ee897d2cdae209c60d415ba00fe825554:/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp diff --git a/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp b/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp index 5d97fe6f35..a483db947a 100644 --- a/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp +++ b/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp @@ -18,10 +18,6 @@ // headers // --------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(__APPLE__) - #pragma implementation "treelistctrl.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -1856,8 +1852,6 @@ bool wxTreeListMainWindow::Create (wxTreeListCtrl *parent, const wxString& name) { #ifdef __WXMAC__ - if (style & wxTR_HAS_BUTTONS) style |= wxTR_MAC_BUTTONS; - if (style & wxTR_HAS_BUTTONS) style &= ~wxTR_HAS_BUTTONS; style &= ~wxTR_LINES_AT_ROOT; style |= wxTR_NO_LINES; @@ -2675,7 +2669,7 @@ void wxTreeListMainWindow::SelectItem (const wxTreeItemId& itemId, } void wxTreeListMainWindow::SelectAll() { - wxCHECK_RET (HasFlag(wxTR_MULTIPLE), _T("invalid tree style")); + wxCHECK_RET (HasFlag(wxTR_MULTIPLE), _T("invalid tree style, must have wxTR_MULTIPLE style to select all items")); // send event to user code wxTreeEvent event (wxEVT_COMMAND_TREE_SEL_CHANGING, m_owner->GetId()); @@ -2696,6 +2690,7 @@ void wxTreeListMainWindow::SelectAll() { wxTreeItemId root = GetRootItem(); wxTreeListItem *first = (wxTreeListItem *)GetFirstChild (root, cookie).m_pItem; wxTreeListItem *last = (wxTreeListItem *)GetLastChild (root, cookie).m_pItem; + if (!first || !last) return; if (!TagAllChildrenUntilLast (first, last)) { TagNextChildren (first, last); } @@ -3795,6 +3790,7 @@ void wxTreeListMainWindow::OnMouse (wxMouseEvent &event) { #else nevent.SetItem (item); // the item the drag is ended #endif + nevent.SetPoint (p); nevent.Veto(); // dragging must be explicit allowed! m_owner->GetEventHandler()->ProcessEvent (nevent); @@ -4620,8 +4616,7 @@ void wxTreeListCtrl::ScrollTo(const wxTreeItemId& item) wxTreeItemId wxTreeListCtrl::HitTest(const wxPoint& pos, int& flags, int& column) { - wxPoint p = m_main_win->ScreenToClient (ClientToScreen (pos)); - return m_main_win->HitTest (p, flags, column); + return m_main_win->HitTest (pos, flags, column); } bool wxTreeListCtrl::GetBoundingRect(const wxTreeItemId& item, wxRect& rect,