+ if ( IsPointInsideWidget(pt, box, x, y, border) )
+ {
+ // ok, we're inside this tab -- now find out where, if needed
+ if ( flags )
+ {
+ if (pageData->m_image && IsPointInsideWidget(pt, pageData->m_image, x, y))
+ {
+ *flags = wxBK_HITTEST_ONICON;
+ }
+ else if (IsPointInsideWidget(pt, pageData->m_label, x, y))
+ {
+ *flags = wxBK_HITTEST_ONLABEL;
+ }
+ else
+ {
+ *flags = wxBK_HITTEST_ONITEM;
+ }
+ }
+
+ return i;
+ }
+ }
+
+ if ( flags )
+ {
+ *flags = wxBK_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.Contains( pt ) )
+ *flags |= wxBK_HITTEST_ONPAGE;
+ }
+ }
+
+ return wxNOT_FOUND;