cursor fix for splitter window
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2352
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
bool DoPhase(int phase);
void ApplyWidgetStyle();
bool DoPhase(int phase);
void ApplyWidgetStyle();
+ // report if window belongs to notebook
+ bool IsOwnGtkWindow( GdkWindow *window );
+
// common part of all ctors
void Init();
// common part of all ctors
void Init();
bool DoPhase(int phase);
void ApplyWidgetStyle();
bool DoPhase(int phase);
void ApplyWidgetStyle();
+ // report if window belongs to notebook
+ bool IsOwnGtkWindow( GdkWindow *window );
+
// common part of all ctors
void Init();
// common part of all ctors
void Init();
{ (const wxEventTable *)NULL, &wxEvtHandler::sm_eventTableEntries[0] };
const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] =
{ (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
#endif // !USE_SHARED_LIBRARY
SetCursor(wxCursor());
#endif
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) )
if (event.LeftDown())
{
if ( SashHitTest(x, y) )
m_dragMode = wxSPLIT_DRAG_NONE;
ReleaseMouse();
m_dragMode = wxSPLIT_DRAG_NONE;
ReleaseMouse();
-#ifdef __WXGTK__
- SetCursor(* wxSTANDARD_CURSOR);
-#endif
// Erase old tracker
DrawSashTracker(m_oldX, m_oldY);
// Erase old tracker
DrawSashTracker(m_oldX, m_oldY);
SetCursor(*m_sashCursorNS);
}
}
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))
{
}
else if (event.Dragging() && (m_dragMode == wxSPLIT_DRAG_DRAGGING))
{
gtk_widget_set_style( m_widget, m_widgetStyle );
}
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
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// wxNotebookEvent
//-----------------------------------------------------------------------------
myfixed = GTK_MYFIXED (widget);
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)
children = myfixed->children;
while (children)
if (!win->HasVMT()) return FALSE;
if (g_blockEventsOnDrag) return FALSE;
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 ((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 (!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() );
/*
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())
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
- printf( win->GetClassInfo()->GetClassName() );
- printf( ".\n" );
+ wxPrintf( win->GetClassInfo()->GetClassName() );
+ wxPrintf( _T(".\n") );
*/
wxMouseEvent event( wxEVT_LEAVE_WINDOW );
*/
wxMouseEvent event( wxEVT_LEAVE_WINDOW );
gtk_widget_set_style( m_widget, m_widgetStyle );
}
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
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// wxNotebookEvent
//-----------------------------------------------------------------------------
myfixed = GTK_MYFIXED (widget);
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)
children = myfixed->children;
while (children)
if (!win->HasVMT()) return FALSE;
if (g_blockEventsOnDrag) return FALSE;
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 ((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 (!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() );
/*
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())
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
- printf( win->GetClassInfo()->GetClassName() );
- printf( ".\n" );
+ wxPrintf( win->GetClassInfo()->GetClassName() );
+ wxPrintf( _T(".\n") );
*/
wxMouseEvent event( wxEVT_LEAVE_WINDOW );
*/
wxMouseEvent event( wxEVT_LEAVE_WINDOW );