Updated configure (not only configure.in)

Refresh improvements


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3836 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-10-05 19:38:05 +00:00
parent fe8aa971c4
commit f7a11f8c8e
12 changed files with 973 additions and 729 deletions

1177
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -285,7 +285,7 @@ void MyFrame::OnCount(wxCommandEvent& WXUNUSED(event))
int i = m_treeCtrl->GetChildrenCount( item, FALSE ); int i = m_treeCtrl->GetChildrenCount( item, FALSE );
wxLogMessage(_T("%d children"), i); wxLogMessage(T("%d children"), i);
} }
void MyFrame::OnCountRec(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnCountRec(wxCommandEvent& WXUNUSED(event))
@@ -296,7 +296,7 @@ void MyFrame::OnCountRec(wxCommandEvent& WXUNUSED(event))
int i = m_treeCtrl->GetChildrenCount( item ); int i = m_treeCtrl->GetChildrenCount( item );
wxLogMessage(_T("%d children"), i); wxLogMessage(T("%d children"), i);
} }
void MyFrame::DoSort(bool reverse) void MyFrame::DoSort(bool reverse)
@@ -324,7 +324,7 @@ void MyFrame::OnDumpSelected(wxCommandEvent& WXUNUSED(event))
wxArrayTreeItemIds array; wxArrayTreeItemIds array;
size_t count = m_treeCtrl->GetSelections(array); size_t count = m_treeCtrl->GetSelections(array);
wxLogMessage(_T("%u items selected"), count); wxLogMessage(T("%u items selected"), count);
for ( size_t n = 0; n < count; n++ ) for ( size_t n = 0; n < count; n++ )
{ {

View File

@@ -1011,12 +1011,14 @@ void wxListBox::OnInternalIdle()
wxCursor cursor = m_cursor; wxCursor cursor = m_cursor;
if (g_globalCursor.Ok()) cursor = g_globalCursor; if (g_globalCursor.Ok()) cursor = g_globalCursor;
if (GTK_WIDGET(m_list)->window && cursor.Ok() && m_currentGdkCursor != cursor) if (GTK_WIDGET(m_list)->window && cursor.Ok())
{ {
wxCursor oldGdkCursor = m_currentGdkCursor; /* I now set the cursor the anew in every OnInternalIdle call
m_currentGdkCursor = cursor; as setting the cursor in a parent window also effects the
windows above so that checking for the current cursor is
not possible. */
gdk_window_set_cursor( GTK_WIDGET(m_list)->window, m_currentGdkCursor.GetCursor() ); gdk_window_set_cursor( GTK_WIDGET(m_list)->window, cursor.GetCursor() );
GList *child = m_list->children; GList *child = m_list->children;
while (child) while (child)
@@ -1025,15 +1027,9 @@ void wxListBox::OnInternalIdle()
GtkWidget *label = GTK_WIDGET( bin->child ); GtkWidget *label = GTK_WIDGET( bin->child );
if (!label->window) if (!label->window)
{
/* windows not yet realized. come back later. */
m_currentGdkCursor = oldGdkCursor;
break; break;
}
else else
{ gdk_window_set_cursor( label->window, cursor.GetCursor() );
gdk_window_set_cursor( label->window, m_currentGdkCursor.GetCursor() );
}
child = child->next; child = child->next;
} }

View File

@@ -604,25 +604,33 @@ void wxToolBar::OnInternalIdle()
wxCursor cursor = m_cursor; wxCursor cursor = m_cursor;
if (g_globalCursor.Ok()) cursor = g_globalCursor; if (g_globalCursor.Ok()) cursor = g_globalCursor;
if (cursor.Ok() && m_currentGdkCursor != cursor) if (cursor.Ok())
{ {
wxCursor oldGdkCursor = m_currentGdkCursor; /* I now set the cursor the anew in every OnInternalIdle call
m_currentGdkCursor = cursor; as setting the cursor in a parent window also effects the
windows above so that checking for the current cursor is
not possible. */
if (HasFlag(wxTB_DOCKABLE))
{
/* if the toolbar is dockable, then m_widget stands for the
GtkHandleBox widget, which uses its own window so that we
can set the cursor for it. if the toolbar is not dockable,
m_widget comes from m_toolbar which uses its parent's
window ("windowless windows") and thus we cannot set the
cursor. */
gdk_window_set_cursor( m_widget->window, cursor.GetCursor() );
}
wxNode *node = m_tools.First(); wxNode *node = m_tools.First();
while (node) while (node)
{ {
wxToolBarTool *tool = (wxToolBarTool*)node->Data(); wxToolBarTool *tool = (wxToolBarTool*)node->Data();
if (!tool->m_item->window) if (!tool->m_item->window)
{
/* windows not yet realized. come back later. */
m_currentGdkCursor = oldGdkCursor;
break; break;
}
else else
{ gdk_window_set_cursor( tool->m_item->window, cursor.GetCursor() );
gdk_window_set_cursor( tool->m_item->window, m_currentGdkCursor.GetCursor() );
}
node = node->Next(); node = node->Next();
} }
} }

View File

@@ -610,9 +610,11 @@ gtk_myfixed_draw (GtkWidget *widget,
if (GTK_WIDGET_DRAWABLE (widget)) if (GTK_WIDGET_DRAWABLE (widget))
{ {
myfixed = GTK_MYFIXED (widget); myfixed = GTK_MYFIXED (widget);
gtk_myfixed_paint (widget, area);
children = myfixed->children; children = myfixed->children;
if (children) /* mini optimisation */
gtk_myfixed_paint (widget, area);
while (children) while (children)
{ {
child = children->data; child = children->data;

View File

@@ -686,10 +686,6 @@ static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExp
if (gdk_event->count > 0) if (gdk_event->count > 0)
return; return;
wxPaintEvent event( win->GetId() );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
/* /*
wxPrintf( "OnExpose from " ); wxPrintf( "OnExpose from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
@@ -700,6 +696,10 @@ static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExp
(int)gdk_event->area.height ); (int)gdk_event->area.height );
*/ */
wxPaintEvent event( win->GetId() );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
win->GetUpdateRegion().Clear(); win->GetUpdateRegion().Clear();
} }
@@ -707,7 +707,7 @@ static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExp
// "draw" of m_wxwindow // "draw" of m_wxwindow
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxWindow *win ) static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxWindow *win )
{ {
if (g_isIdle) if (g_isIdle)
wxapp_install_idle_handler(); wxapp_install_idle_handler();
@@ -715,12 +715,13 @@ static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle
if (!win->m_hasVMT) if (!win->m_hasVMT)
return; return;
GtkMyFixed *myfixed = GTK_MYFIXED (widget);
if (!myfixed->children)
return; /* mini optimisation */
win->GetUpdateRegion().Union( rect->x, rect->y, win->GetUpdateRegion().Union( rect->x, rect->y,
rect->width, rect->height ); rect->width, rect->height );
wxPaintEvent event( win->GetId() );
event.SetEventObject( win );
/* /*
wxPrintf( "OnDraw from " ); wxPrintf( "OnDraw from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
@@ -731,6 +732,8 @@ static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle
(int)rect->height ); (int)rect->height );
*/ */
wxPaintEvent event( win->GetId() );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
win->GetUpdateRegion().Clear(); win->GetUpdateRegion().Clear();
@@ -1249,7 +1252,6 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
gdk_window_get_pointer(gdk_event->window, &x, &y, &state); gdk_window_get_pointer(gdk_event->window, &x, &y, &state);
gdk_event->x = x; gdk_event->x = x;
gdk_event->y = y; gdk_event->y = y;
gdk_event->state = state;
} }
/* /*
@@ -2201,9 +2203,12 @@ void wxWindow::OnInternalIdle()
wxCursor cursor = m_cursor; wxCursor cursor = m_cursor;
if (g_globalCursor.Ok()) cursor = g_globalCursor; if (g_globalCursor.Ok()) cursor = g_globalCursor;
if (cursor.Ok() && m_currentGdkCursor != cursor) if (cursor.Ok())
{ {
m_currentGdkCursor = cursor; /* I now set the cursor the anew in every OnInternalIdle call
as setting the cursor in a parent window also effects the
windows above so that checking for the current cursor is
not possible. */
if (m_wxwindow) if (m_wxwindow)
{ {
@@ -2671,16 +2676,16 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
if (m_wxwindow) if (m_wxwindow)
{ {
/* call the callback directly for preventing GTK from /* call the callback directly for preventing GTK from
clearing the bakground */ clearing the background */
int w = 0; int w = 0;
int h = 0; int h = 0;
GetClientSize( &w, &h ); GetClientSize( &w, &h );
GdkRectangle gdk_rect;
gdk_rect.x = 0; GetUpdateRegion().Union( 0, 0, w, h );
gdk_rect.y = 0; wxPaintEvent event( GetId() );
gdk_rect.width = w; event.SetEventObject( this );
gdk_rect.height = h; GetEventHandler()->ProcessEvent( event );
gtk_window_draw_callback( m_wxwindow, &gdk_rect, this ); GetUpdateRegion().Clear();
} }
else else
{ {
@@ -2688,6 +2693,19 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
} }
} }
else else
{
if (m_wxwindow)
{
/* call the callback directly for preventing GTK from
clearing the background */
GetUpdateRegion().Union( rect->x, rect->y, rect->width, rect->height );
wxPaintEvent event( GetId() );
event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event );
GetUpdateRegion().Clear();
}
else
{ {
GdkRectangle gdk_rect; GdkRectangle gdk_rect;
gdk_rect.x = rect->x; gdk_rect.x = rect->x;
@@ -2695,14 +2713,6 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
gdk_rect.width = rect->width; gdk_rect.width = rect->width;
gdk_rect.height = rect->height; gdk_rect.height = rect->height;
if (m_wxwindow)
{
/* call the callback directly for preventing GTK from
clearing the bakground */
gtk_window_draw_callback( m_wxwindow, &gdk_rect, this );
}
else
{
gtk_widget_draw( m_widget, &gdk_rect ); gtk_widget_draw( m_widget, &gdk_rect );
} }
} }
@@ -3018,6 +3028,7 @@ void wxWindow::CaptureMouse()
(GdkEventMask) (GdkEventMask)
(GDK_BUTTON_PRESS_MASK | (GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_HINT_MASK |
GDK_POINTER_MOTION_MASK), GDK_POINTER_MOTION_MASK),
(GdkWindow *) NULL, (GdkWindow *) NULL,
m_cursor.GetCursor(), m_cursor.GetCursor(),

View File

@@ -1011,12 +1011,14 @@ void wxListBox::OnInternalIdle()
wxCursor cursor = m_cursor; wxCursor cursor = m_cursor;
if (g_globalCursor.Ok()) cursor = g_globalCursor; if (g_globalCursor.Ok()) cursor = g_globalCursor;
if (GTK_WIDGET(m_list)->window && cursor.Ok() && m_currentGdkCursor != cursor) if (GTK_WIDGET(m_list)->window && cursor.Ok())
{ {
wxCursor oldGdkCursor = m_currentGdkCursor; /* I now set the cursor the anew in every OnInternalIdle call
m_currentGdkCursor = cursor; as setting the cursor in a parent window also effects the
windows above so that checking for the current cursor is
not possible. */
gdk_window_set_cursor( GTK_WIDGET(m_list)->window, m_currentGdkCursor.GetCursor() ); gdk_window_set_cursor( GTK_WIDGET(m_list)->window, cursor.GetCursor() );
GList *child = m_list->children; GList *child = m_list->children;
while (child) while (child)
@@ -1025,15 +1027,9 @@ void wxListBox::OnInternalIdle()
GtkWidget *label = GTK_WIDGET( bin->child ); GtkWidget *label = GTK_WIDGET( bin->child );
if (!label->window) if (!label->window)
{
/* windows not yet realized. come back later. */
m_currentGdkCursor = oldGdkCursor;
break; break;
}
else else
{ gdk_window_set_cursor( label->window, cursor.GetCursor() );
gdk_window_set_cursor( label->window, m_currentGdkCursor.GetCursor() );
}
child = child->next; child = child->next;
} }

View File

@@ -604,25 +604,33 @@ void wxToolBar::OnInternalIdle()
wxCursor cursor = m_cursor; wxCursor cursor = m_cursor;
if (g_globalCursor.Ok()) cursor = g_globalCursor; if (g_globalCursor.Ok()) cursor = g_globalCursor;
if (cursor.Ok() && m_currentGdkCursor != cursor) if (cursor.Ok())
{ {
wxCursor oldGdkCursor = m_currentGdkCursor; /* I now set the cursor the anew in every OnInternalIdle call
m_currentGdkCursor = cursor; as setting the cursor in a parent window also effects the
windows above so that checking for the current cursor is
not possible. */
if (HasFlag(wxTB_DOCKABLE))
{
/* if the toolbar is dockable, then m_widget stands for the
GtkHandleBox widget, which uses its own window so that we
can set the cursor for it. if the toolbar is not dockable,
m_widget comes from m_toolbar which uses its parent's
window ("windowless windows") and thus we cannot set the
cursor. */
gdk_window_set_cursor( m_widget->window, cursor.GetCursor() );
}
wxNode *node = m_tools.First(); wxNode *node = m_tools.First();
while (node) while (node)
{ {
wxToolBarTool *tool = (wxToolBarTool*)node->Data(); wxToolBarTool *tool = (wxToolBarTool*)node->Data();
if (!tool->m_item->window) if (!tool->m_item->window)
{
/* windows not yet realized. come back later. */
m_currentGdkCursor = oldGdkCursor;
break; break;
}
else else
{ gdk_window_set_cursor( tool->m_item->window, cursor.GetCursor() );
gdk_window_set_cursor( tool->m_item->window, m_currentGdkCursor.GetCursor() );
}
node = node->Next(); node = node->Next();
} }
} }

View File

@@ -610,9 +610,11 @@ gtk_myfixed_draw (GtkWidget *widget,
if (GTK_WIDGET_DRAWABLE (widget)) if (GTK_WIDGET_DRAWABLE (widget))
{ {
myfixed = GTK_MYFIXED (widget); myfixed = GTK_MYFIXED (widget);
gtk_myfixed_paint (widget, area);
children = myfixed->children; children = myfixed->children;
if (children) /* mini optimisation */
gtk_myfixed_paint (widget, area);
while (children) while (children)
{ {
child = children->data; child = children->data;

View File

@@ -686,10 +686,6 @@ static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExp
if (gdk_event->count > 0) if (gdk_event->count > 0)
return; return;
wxPaintEvent event( win->GetId() );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
/* /*
wxPrintf( "OnExpose from " ); wxPrintf( "OnExpose from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
@@ -700,6 +696,10 @@ static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExp
(int)gdk_event->area.height ); (int)gdk_event->area.height );
*/ */
wxPaintEvent event( win->GetId() );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
win->GetUpdateRegion().Clear(); win->GetUpdateRegion().Clear();
} }
@@ -707,7 +707,7 @@ static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExp
// "draw" of m_wxwindow // "draw" of m_wxwindow
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxWindow *win ) static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxWindow *win )
{ {
if (g_isIdle) if (g_isIdle)
wxapp_install_idle_handler(); wxapp_install_idle_handler();
@@ -715,12 +715,13 @@ static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle
if (!win->m_hasVMT) if (!win->m_hasVMT)
return; return;
GtkMyFixed *myfixed = GTK_MYFIXED (widget);
if (!myfixed->children)
return; /* mini optimisation */
win->GetUpdateRegion().Union( rect->x, rect->y, win->GetUpdateRegion().Union( rect->x, rect->y,
rect->width, rect->height ); rect->width, rect->height );
wxPaintEvent event( win->GetId() );
event.SetEventObject( win );
/* /*
wxPrintf( "OnDraw from " ); wxPrintf( "OnDraw from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
@@ -731,6 +732,8 @@ static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle
(int)rect->height ); (int)rect->height );
*/ */
wxPaintEvent event( win->GetId() );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->GetEventHandler()->ProcessEvent( event );
win->GetUpdateRegion().Clear(); win->GetUpdateRegion().Clear();
@@ -1249,7 +1252,6 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
gdk_window_get_pointer(gdk_event->window, &x, &y, &state); gdk_window_get_pointer(gdk_event->window, &x, &y, &state);
gdk_event->x = x; gdk_event->x = x;
gdk_event->y = y; gdk_event->y = y;
gdk_event->state = state;
} }
/* /*
@@ -2201,9 +2203,12 @@ void wxWindow::OnInternalIdle()
wxCursor cursor = m_cursor; wxCursor cursor = m_cursor;
if (g_globalCursor.Ok()) cursor = g_globalCursor; if (g_globalCursor.Ok()) cursor = g_globalCursor;
if (cursor.Ok() && m_currentGdkCursor != cursor) if (cursor.Ok())
{ {
m_currentGdkCursor = cursor; /* I now set the cursor the anew in every OnInternalIdle call
as setting the cursor in a parent window also effects the
windows above so that checking for the current cursor is
not possible. */
if (m_wxwindow) if (m_wxwindow)
{ {
@@ -2671,16 +2676,16 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
if (m_wxwindow) if (m_wxwindow)
{ {
/* call the callback directly for preventing GTK from /* call the callback directly for preventing GTK from
clearing the bakground */ clearing the background */
int w = 0; int w = 0;
int h = 0; int h = 0;
GetClientSize( &w, &h ); GetClientSize( &w, &h );
GdkRectangle gdk_rect;
gdk_rect.x = 0; GetUpdateRegion().Union( 0, 0, w, h );
gdk_rect.y = 0; wxPaintEvent event( GetId() );
gdk_rect.width = w; event.SetEventObject( this );
gdk_rect.height = h; GetEventHandler()->ProcessEvent( event );
gtk_window_draw_callback( m_wxwindow, &gdk_rect, this ); GetUpdateRegion().Clear();
} }
else else
{ {
@@ -2688,6 +2693,19 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
} }
} }
else else
{
if (m_wxwindow)
{
/* call the callback directly for preventing GTK from
clearing the background */
GetUpdateRegion().Union( rect->x, rect->y, rect->width, rect->height );
wxPaintEvent event( GetId() );
event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event );
GetUpdateRegion().Clear();
}
else
{ {
GdkRectangle gdk_rect; GdkRectangle gdk_rect;
gdk_rect.x = rect->x; gdk_rect.x = rect->x;
@@ -2695,14 +2713,6 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
gdk_rect.width = rect->width; gdk_rect.width = rect->width;
gdk_rect.height = rect->height; gdk_rect.height = rect->height;
if (m_wxwindow)
{
/* call the callback directly for preventing GTK from
clearing the bakground */
gtk_window_draw_callback( m_wxwindow, &gdk_rect, this );
}
else
{
gtk_widget_draw( m_widget, &gdk_rect ); gtk_widget_draw( m_widget, &gdk_rect );
} }
} }
@@ -3018,6 +3028,7 @@ void wxWindow::CaptureMouse()
(GdkEventMask) (GdkEventMask)
(GDK_BUTTON_PRESS_MASK | (GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_HINT_MASK |
GDK_POINTER_MOTION_MASK), GDK_POINTER_MOTION_MASK),
(GdkWindow *) NULL, (GdkWindow *) NULL,
m_cursor.GetCursor(), m_cursor.GetCursor(),

View File

@@ -137,6 +137,9 @@ gtk_glwindow_realized_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win )
{ {
win->m_glContext = new wxGLContext( TRUE, win, wxNullPalette, win->m_glContext ); win->m_glContext = new wxGLContext( TRUE, win, wxNullPalette, win->m_glContext );
XFree( g_vi );
g_vi = (XVisualInfo*) NULL;
return FALSE; return FALSE;
} }
@@ -241,12 +244,6 @@ bool wxGLCanvas::Create( wxWindow *parent,
gtk_widget_pop_visual(); gtk_widget_pop_visual();
gtk_widget_pop_colormap(); gtk_widget_pop_colormap();
/* must be realized for OpenGl output */
gtk_widget_realize( m_glWidget );
XFree( g_vi );
g_vi = (XVisualInfo*) NULL;
return TRUE; return TRUE;
} }