if (g_blockEventsOnDrag) return FALSE;
if (!notebook->HasVMT()) return FALSE;
+
+ /* this code makes jumping down from the handles of the notebooks
+ to the actual items in the visible notebook page possible with
+ the down-arrow key */
if (gdk_event->keyval != GDK_Down) return FALSE;
IMPLEMENT_DYNAMIC_CLASS(wxNotebook,wxControl)
+BEGIN_EVENT_TABLE(wxNotebook, wxControl)
+ EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
+END_EVENT_TABLE()
+
void wxNotebook::Init()
{
m_imageList = (wxImageList *) NULL;
if (bForward)
SetSelection( sel == max ? 0 : sel + 1 );
else
- SetSelection( sel == 0 ? max : sel - 1 );
+ SetSelection( sel == 0 ? max-1 : sel - 1 );
}
void wxNotebook::SetImageList( wxImageList* imageList )
if (image == -1 && nb_page->m_image == -1)
return TRUE; /* Case 1): Nothing to do. */
- GtkWidget *pixmapwid = NULL;
+ GtkWidget *pixmapwid = (GtkWidget*) NULL;
if (nb_page->m_image != -1)
{
return TRUE;
}
+void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
+{
+ if (event.IsWindowChange())
+ AdvanceSelection( event.GetDirection() );
+ else
+ event.Skip();
+}
+
wxWindow *wxNotebook::GetPage( int page ) const
{
wxCHECK_MSG( m_widget != NULL, (wxWindow*) NULL, "invalid notebook" );