bool DoPhase(int phase);
void ApplyWidgetStyle();
+ // report if window belongs to notebook
+ bool IsOwnGtkWindow( GdkWindow *window );
+
// common part of all ctors
void Init();
bool DoPhase(int phase);
void ApplyWidgetStyle();
+ // report if window belongs to notebook
+ bool IsOwnGtkWindow( GdkWindow *window );
+
// common part of all ctors
void Init();
{ (const wxEventTable *)NULL, &wxEvtHandler::sm_eventTableEntries[0] };
const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] =
- { { 0, 0, 0,
- #ifdef __SGI_CC__
- // stupid SGI compiler --- offer aug 98
- 0L }
- #else // !SGI CC
- NULL }
- #endif // SGI/!SGI
- };
+ { { 0, 0, 0, (wxObjectEventFunction) NULL, (wxObject*) NULL } };
#endif // !USE_SHARED_LIBRARY
SetCursor(wxCursor());
#endif
+ // under wxGTK the method above causes the mouse
+ // to flicker so we set the standard cursor only
+ // when leaving the window and when moving over
+ // non-sash parts of the window. this should work
+ // on the other platforms as well, but who knows.
+#ifdef __WXGTK__
+ if (event.Leaving())
+ SetCursor(* wxSTANDARD_CURSOR);
+#endif
+
if (event.LeftDown())
{
if ( SashHitTest(x, y) )
m_dragMode = wxSPLIT_DRAG_NONE;
ReleaseMouse();
-#ifdef __WXGTK__
- SetCursor(* wxSTANDARD_CURSOR);
-#endif
// Erase old tracker
DrawSashTracker(m_oldX, m_oldY);
SetCursor(*m_sashCursorNS);
}
}
+#ifdef __WXGTK__
+ else
+ {
+ // where else do we unset the cursor?
+ SetCursor(* wxSTANDARD_CURSOR);
+ }
+#endif
}
else if (event.Dragging() && (m_dragMode == wxSPLIT_DRAG_DRAGGING))
{
gtk_widget_set_style( m_widget, m_widgetStyle );
}
+bool wxNotebook::IsOwnGtkWindow( GdkWindow *window )
+{
+ return ((m_widget->window == window) ||
+ (GTK_NOTEBOOK(m_widget)->panel == window));
+}
+
//-----------------------------------------------------------------------------
// wxNotebookEvent
//-----------------------------------------------------------------------------
myfixed = GTK_MYFIXED (widget);
- requisition->width = widget->requisition.width;
- requisition->height = widget->requisition.height;
+ /* request very little, I'm not sure if requesting nothing
+ will always have positive effects on stability... */
+ requisition->width = 2;
+ requisition->height = 2;
children = myfixed->children;
while (children)
if (!win->HasVMT()) return FALSE;
if (g_blockEventsOnDrag) return FALSE;
- if (widget->window != gdk_event->window) return FALSE;
+ if (!win->IsOwnGtkWindow( gdk_event->window )) return FALSE;
if ((widget->window) && (win->m_cursor.Ok()))
gdk_window_set_cursor( widget->window, win->m_cursor.GetCursor() );
if (!win->HasVMT()) return FALSE;
if (g_blockEventsOnDrag) return FALSE;
- if (widget->window != gdk_event->window) return FALSE;
+ if (!win->IsOwnGtkWindow( gdk_event->window )) return FALSE;
if (widget->window)
gdk_window_set_cursor( widget->window, wxSTANDARD_CURSOR->GetCursor() );
/*
- printf( "OnLeave from " );
+ wxPrintf( _T("OnLeave from ") );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
- printf( win->GetClassInfo()->GetClassName() );
- printf( ".\n" );
+ wxPrintf( win->GetClassInfo()->GetClassName() );
+ wxPrintf( _T(".\n") );
*/
wxMouseEvent event( wxEVT_LEAVE_WINDOW );
gtk_widget_set_style( m_widget, m_widgetStyle );
}
+bool wxNotebook::IsOwnGtkWindow( GdkWindow *window )
+{
+ return ((m_widget->window == window) ||
+ (GTK_NOTEBOOK(m_widget)->panel == window));
+}
+
//-----------------------------------------------------------------------------
// wxNotebookEvent
//-----------------------------------------------------------------------------
myfixed = GTK_MYFIXED (widget);
- requisition->width = widget->requisition.width;
- requisition->height = widget->requisition.height;
+ /* request very little, I'm not sure if requesting nothing
+ will always have positive effects on stability... */
+ requisition->width = 2;
+ requisition->height = 2;
children = myfixed->children;
while (children)
if (!win->HasVMT()) return FALSE;
if (g_blockEventsOnDrag) return FALSE;
- if (widget->window != gdk_event->window) return FALSE;
+ if (!win->IsOwnGtkWindow( gdk_event->window )) return FALSE;
if ((widget->window) && (win->m_cursor.Ok()))
gdk_window_set_cursor( widget->window, win->m_cursor.GetCursor() );
if (!win->HasVMT()) return FALSE;
if (g_blockEventsOnDrag) return FALSE;
- if (widget->window != gdk_event->window) return FALSE;
+ if (!win->IsOwnGtkWindow( gdk_event->window )) return FALSE;
if (widget->window)
gdk_window_set_cursor( widget->window, wxSTANDARD_CURSOR->GetCursor() );
/*
- printf( "OnLeave from " );
+ wxPrintf( _T("OnLeave from ") );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
- printf( win->GetClassInfo()->GetClassName() );
- printf( ".\n" );
+ wxPrintf( win->GetClassInfo()->GetClassName() );
+ wxPrintf( _T(".\n") );
*/
wxMouseEvent event( wxEVT_LEAVE_WINDOW );