]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/notebook.cpp
Tinderbox warning fix.
[wxWidgets.git] / src / gtk / notebook.cpp
index c074dcb480ba713f21abbdc538802a8f067823a6..b8dfb49c813dd01d987b9d490fb6abce11c08a5c 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
@@ -324,6 +324,9 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
     m_acceptsFocus = true;
     m_insertCallback = (wxInsertChildFunction)wxInsertChildInNotebook;
 
+    if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
+        style |= wxBK_TOP;
+
     if (!PreCreation( parent, pos, size ) ||
         !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
     {
@@ -775,15 +778,15 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
 
                 if ( pixmap && IsPointInsideWidget(pt, pixmap, x, y) )
                 {
-                    *flags = wxNB_HITTEST_ONICON;
+                    *flags = wxBK_HITTEST_ONICON;
                 }
                 else if ( IsPointInsideWidget(pt, GTK_WIDGET(nb_page->m_label), x, y) )
                 {
-                    *flags = wxNB_HITTEST_ONLABEL;
+                    *flags = wxBK_HITTEST_ONLABEL;
                 }
                 else
                 {
-                    *flags = wxNB_HITTEST_ONITEM;
+                    *flags = wxBK_HITTEST_ONITEM;
                 }
             }
 
@@ -792,7 +795,22 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
     }
 
     if ( flags )
-        *flags = wxNB_HITTEST_NOWHERE;
+    {
+        *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.Inside( pt ) )
+                *flags |= wxBK_HITTEST_ONPAGE;
+        }
+    }
 
     return wxNOT_FOUND;
 }