Fix HitTest to return the proper tab index in case there are more tabs than fit (and therefore there are scrolling

arrows), and the first visible tab isn't the first real tab. Before counting started from the visible tab, not real
tab.
While doing this, I noticed lots of "interesting" bugs wrt tab indexes and the whole wxGtkNotebookPage hack in the
code. In my opinion, to fix some of the bugs I noticed during testing, wxGtkNotebookPage has to be nuked and the
necessary parts rewritten.
Meanwhile, the HitTest fix works with wxNB_TOP styled notebooks that haven't modified tabs in a way that would have
mess up the wxGtkNotebookPage index sync. For other cases it might depend on the phase of the moon, and other factors.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mart Raudsepp 2005-12-13 01:20:41 +00:00
parent 52c3df9930
commit f660b2062c
2 changed files with 18 additions and 2 deletions

View File

@ -736,7 +736,15 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
const gint y = m_widget->allocation.y;
const size_t count = GetPageCount();
for ( size_t i = 0; i < count; i++ )
size_t i = 0;
#ifdef __WXGTK20__
GtkNotebook * notebook = GTK_NOTEBOOK(m_widget);
if (gtk_notebook_get_scrollable(notebook));
i = g_list_position( notebook->children, notebook->first_tab );
#endif
for ( ; i < count; i++ )
{
wxGtkNotebookPage* nb_page = GetNotebookPage(i);
GtkWidget *box = nb_page->m_box;

View File

@ -736,7 +736,15 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
const gint y = m_widget->allocation.y;
const size_t count = GetPageCount();
for ( size_t i = 0; i < count; i++ )
size_t i = 0;
#ifdef __WXGTK20__
GtkNotebook * notebook = GTK_NOTEBOOK(m_widget);
if (gtk_notebook_get_scrollable(notebook));
i = g_list_position( notebook->children, notebook->first_tab );
#endif
for ( ; i < count; i++ )
{
wxGtkNotebookPage* nb_page = GetNotebookPage(i);
GtkWidget *box = nb_page->m_box;