From c916e13bc059fb758c271ec7e36213c564983a5f Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Thu, 17 Feb 2000 21:17:54 +0000 Subject: [PATCH] Small testing changes, Small flicker reduction in wxGrid. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6126 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/drawing/drawing.cpp | 7 +++-- src/generic/grid.cpp | 3 ++ src/gtk/win_gtk.c | 8 +++-- src/gtk/window.cpp | 58 +------------------------------------ src/gtk1/win_gtk.c | 8 +++-- src/gtk1/window.cpp | 58 +------------------------------------ 6 files changed, 21 insertions(+), 121 deletions(-) diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index aa985078e8..aec42daa61 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -616,7 +616,6 @@ void MyCanvas::DrawDefault(wxDC& dc) // to the right wxPen pen = *wxRED_PEN; - pen.SetWidth(2); memdc.SetPen(pen); memdc.DrawLine( 10, 5,10, 5 ); memdc.DrawLine( 10,10,11,10 ); @@ -1060,8 +1059,10 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg; - msg.Printf( _T("This is the about dialog of the drawing sample.\n") - _T("Copyright (c) Robert Roebling 1999") + msg.Printf( wxT("This is the about dialog of the drawing sample.\n") + wxT("This sample tests various primitive drawing functions\n") + wxT("without any tests to prevent flicker.\n") + wxT("Copyright (c) Robert Roebling 1999") ); wxMessageBox(msg, "About Drawing", wxOK | wxICON_INFORMATION, this); diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index e99d25cea7..b93201eeb2 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -5536,6 +5536,9 @@ int wxGrid::GetColSize( int col ) void wxGrid::SetDefaultCellBackgroundColour( const wxColour& col ) { m_defaultCellAttr->SetBackgroundColour(col); +#ifdef __WXGTK__ + m_gridWin->SetBackgroundColour(col); +#endif } void wxGrid::SetDefaultCellTextColour( const wxColour& col ) diff --git a/src/gtk/win_gtk.c b/src/gtk/win_gtk.c index b420b7764b..e4e55594f2 100644 --- a/src/gtk/win_gtk.c +++ b/src/gtk/win_gtk.c @@ -18,6 +18,10 @@ extern "C" { #endif /* __cplusplus */ +#include +#include +#include + #define IS_ONSCREEN(x,y) ((x >= G_MINSHORT) && (x <= G_MAXSHORT) && \ (y >= G_MINSHORT) && (y <= G_MAXSHORT)) @@ -483,7 +487,7 @@ gtk_pizza_realize (GtkWidget *widget) GDK_VISIBILITY_NOTIFY_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; - widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), + widget->window = gdk_window_new(gtk_widget_get_parent_window (widget), &attributes, attributes_mask); gdk_window_set_user_data (widget->window, widget); @@ -507,7 +511,7 @@ gtk_pizza_realize (GtkWidget *widget) GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK; - pizza->bin_window = gdk_window_new (widget->window, + pizza->bin_window = gdk_window_new(widget->window, &attributes, attributes_mask); gdk_window_set_user_data (pizza->bin_window, widget); diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 5e09f6f528..8e9a7d3052 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2927,7 +2927,7 @@ void wxWindow::Clear() if (m_wxwindow && m_wxwindow->window) { - gdk_window_clear( m_wxwindow->window ); +// gdk_window_clear( m_wxwindow->window ); } } @@ -3435,61 +3435,5 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) ) wxCHECK_RET( m_wxwindow != NULL, wxT("window needs client area for scrolling") ); -/* - printf( "ScrollWindow: %d %d\n", dx, dy ); -*/ - gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy ); - -/* - if (!m_scrollGC) - { - m_scrollGC = gdk_gc_new( m_wxwindow->window ); - gdk_gc_set_exposures( m_scrollGC, TRUE ); - } - - wxNode *node = m_children.First(); - while (node) - { - wxWindow *child = (wxWindow*) node->Data(); - int sx = 0; - int sy = 0; - child->GetSize( &sx, &sy ); - child->SetSize( child->m_x + dx, child->m_y + dy, sx, sy, wxSIZE_ALLOW_MINUS_ONE ); - node = node->Next(); - } - - int cw = 0; - int ch = 0; - GetClientSize( &cw, &ch ); - int w = cw - abs(dx); - int h = ch - abs(dy); - - if ((h < 0) || (w < 0)) - { - Refresh(); - } - else - { - int s_x = 0; - int s_y = 0; - if (dx < 0) s_x = -dx; - if (dy < 0) s_y = -dy; - int d_x = 0; - int d_y = 0; - if (dx > 0) d_x = dx; - if (dy > 0) d_y = dy; - - gdk_window_copy_area( m_wxwindow->window, m_scrollGC, d_x, d_y, - m_wxwindow->window, s_x, s_y, w, h ); - - wxRect rect; - if (dx < 0) rect.x = cw+dx; else rect.x = 0; - if (dy < 0) rect.y = ch+dy; else rect.y = 0; - if (dy != 0) rect.width = cw; else rect.width = abs(dx); - if (dx != 0) rect.height = ch; else rect.height = abs(dy); - - Refresh( TRUE, &rect ); - } -*/ } diff --git a/src/gtk1/win_gtk.c b/src/gtk1/win_gtk.c index b420b7764b..e4e55594f2 100644 --- a/src/gtk1/win_gtk.c +++ b/src/gtk1/win_gtk.c @@ -18,6 +18,10 @@ extern "C" { #endif /* __cplusplus */ +#include +#include +#include + #define IS_ONSCREEN(x,y) ((x >= G_MINSHORT) && (x <= G_MAXSHORT) && \ (y >= G_MINSHORT) && (y <= G_MAXSHORT)) @@ -483,7 +487,7 @@ gtk_pizza_realize (GtkWidget *widget) GDK_VISIBILITY_NOTIFY_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; - widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), + widget->window = gdk_window_new(gtk_widget_get_parent_window (widget), &attributes, attributes_mask); gdk_window_set_user_data (widget->window, widget); @@ -507,7 +511,7 @@ gtk_pizza_realize (GtkWidget *widget) GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK; - pizza->bin_window = gdk_window_new (widget->window, + pizza->bin_window = gdk_window_new(widget->window, &attributes, attributes_mask); gdk_window_set_user_data (pizza->bin_window, widget); diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 5e09f6f528..8e9a7d3052 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -2927,7 +2927,7 @@ void wxWindow::Clear() if (m_wxwindow && m_wxwindow->window) { - gdk_window_clear( m_wxwindow->window ); +// gdk_window_clear( m_wxwindow->window ); } } @@ -3435,61 +3435,5 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) ) wxCHECK_RET( m_wxwindow != NULL, wxT("window needs client area for scrolling") ); -/* - printf( "ScrollWindow: %d %d\n", dx, dy ); -*/ - gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy ); - -/* - if (!m_scrollGC) - { - m_scrollGC = gdk_gc_new( m_wxwindow->window ); - gdk_gc_set_exposures( m_scrollGC, TRUE ); - } - - wxNode *node = m_children.First(); - while (node) - { - wxWindow *child = (wxWindow*) node->Data(); - int sx = 0; - int sy = 0; - child->GetSize( &sx, &sy ); - child->SetSize( child->m_x + dx, child->m_y + dy, sx, sy, wxSIZE_ALLOW_MINUS_ONE ); - node = node->Next(); - } - - int cw = 0; - int ch = 0; - GetClientSize( &cw, &ch ); - int w = cw - abs(dx); - int h = ch - abs(dy); - - if ((h < 0) || (w < 0)) - { - Refresh(); - } - else - { - int s_x = 0; - int s_y = 0; - if (dx < 0) s_x = -dx; - if (dy < 0) s_y = -dy; - int d_x = 0; - int d_y = 0; - if (dx > 0) d_x = dx; - if (dy > 0) d_y = dy; - - gdk_window_copy_area( m_wxwindow->window, m_scrollGC, d_x, d_y, - m_wxwindow->window, s_x, s_y, w, h ); - - wxRect rect; - if (dx < 0) rect.x = cw+dx; else rect.x = 0; - if (dy < 0) rect.y = ch+dy; else rect.y = 0; - if (dy != 0) rect.width = cw; else rect.width = abs(dx); - if (dx != 0) rect.height = ch; else rect.height = abs(dy); - - Refresh( TRUE, &rect ); - } -*/ } -- 2.47.2