#include "wx/log.h"
#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
#include <gdk/gdkkeysyms.h>
-#include "wx/msgdlg.h"
-
// ----------------------------------------------------------------------------
// events
// ----------------------------------------------------------------------------
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 ))
{
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;
}
}
}
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;
}