minor fixes

cursor fix for splitter window


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2352 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 1999-05-06 14:30:49 +00:00
parent 051b55ad8b
commit 58d1c1ae86
10 changed files with 54 additions and 25 deletions

View File

@ -164,6 +164,9 @@ public:
bool DoPhase(int phase);
void ApplyWidgetStyle();
// report if window belongs to notebook
bool IsOwnGtkWindow( GdkWindow *window );
// common part of all ctors
void Init();

View File

@ -164,6 +164,9 @@ public:
bool DoPhase(int phase);
void ApplyWidgetStyle();
// report if window belongs to notebook
bool IsOwnGtkWindow( GdkWindow *window );
// common part of all ctors
void Init();

View File

@ -67,14 +67,7 @@
{ (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

View File

@ -153,6 +153,16 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
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) )
@ -173,9 +183,6 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
m_dragMode = wxSPLIT_DRAG_NONE;
ReleaseMouse();
#ifdef __WXGTK__
SetCursor(* wxSTANDARD_CURSOR);
#endif
// Erase old tracker
DrawSashTracker(m_oldX, m_oldY);
@ -253,6 +260,13 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
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))
{

View File

@ -707,6 +707,12 @@ void wxNotebook::ApplyWidgetStyle()
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
//-----------------------------------------------------------------------------

View File

@ -464,8 +464,10 @@ gtk_myfixed_size_request (GtkWidget *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)

View File

@ -1092,7 +1092,7 @@ static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_
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() );
@ -1144,16 +1144,16 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_
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 );

View File

@ -707,6 +707,12 @@ void wxNotebook::ApplyWidgetStyle()
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
//-----------------------------------------------------------------------------

View File

@ -464,8 +464,10 @@ gtk_myfixed_size_request (GtkWidget *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)

View File

@ -1092,7 +1092,7 @@ static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_
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() );
@ -1144,16 +1144,16 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_
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 );