X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5e4a7f9196ed618fd66577615cce896d49744961..249803fbcd1f73040e4b5457e341d8db2e5cb66e:/src/generic/treebkg.cpp diff --git a/src/generic/treebkg.cpp b/src/generic/treebkg.cpp index 8728039648..2bcb1da8dd 100644 --- a/src/generic/treebkg.cpp +++ b/src/generic/treebkg.cpp @@ -651,7 +651,8 @@ int wxTreebook::DoSetSelection(size_t pagePos) else // page change vetoed { // tree selection might have already had changed - tree->SelectItem(DoInternalGetPage(oldSel)); + if ( oldSel != wxNOT_FOUND ) + tree->SelectItem(DoInternalGetPage(oldSel)); } return oldSel; @@ -742,7 +743,7 @@ int wxTreebook::HitTest(wxPoint const & pt, long * flags) const const wxPoint treePt = tree->ScreenToClient(ClientToScreen(pt)); // is it over the tree? - if ( wxRect(tree->GetSize()).Inside(treePt) ) + if ( wxRect(tree->GetSize()).Contains(treePt) ) { int flagsTree; wxTreeItemId id = tree->HitTest(treePt, flagsTree); @@ -768,7 +769,7 @@ int wxTreebook::HitTest(wxPoint const & pt, long * flags) const } else // not over the tree { - if ( flags && GetPageRect().Inside( pt ) ) + if ( flags && GetPageRect().Contains( pt ) ) *flags |= wxBK_HITTEST_ONPAGE; }