]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/notebook.cpp
[ 1509599 ] 'Split pickers page in widgets sample' with more icons and rebaking.
[wxWidgets.git] / src / gtk / notebook.cpp
index 8c22e6af9e96ffe8aa94b8bc40268b825e692e48..25efc437f89210899e493431d50624581219fa53 100644 (file)
     #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;
 }