X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/90f9b8ef0c83c09f80c2f60ad65407ba16f11a3c..137c8bde085d6d5b7c459902d2ea1a198ab48765:/src/gtk/notebook.cpp diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index 8c22e6af9e..25efc437f8 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -20,10 +20,10 @@ #include "wx/utils.h" #include "wx/panel.h" #include "wx/msgdlg.h" + #include "wx/bitmap.h" #endif #include "wx/imaglist.h" -#include "wx/bitmap.h" #include "wx/fontutil.h" // FIXME: Use GtkImage instead of GtkPixmap. Don't use gtk_container_border_width @@ -795,7 +795,22 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const } if ( flags ) + { *flags = wxNB_HITTEST_NOWHERE; + wxWindowBase * page = GetCurrentPage(); + if ( page ) + { + // rect origin is in notebook's parent coordinates + wxRect rect = page->GetRect(); + + // adjust it to the notebook's coordinates + wxPoint pos = GetPosition(); + rect.x -= pos.x; + rect.y -= pos.y; + if ( rect.Inside( pt ) ) + *flags |= wxNB_HITTEST_ONPAGE; + } + } return wxNOT_FOUND; }