From 1b68e0b5b90ed63309f02f30e33b884eeaec5a3d Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Tue, 12 Oct 1999 21:52:17 +0000 Subject: [PATCH] Refresh() problem from DialogEd solved Unified the naming of GNU pragmas for base classed: dialogbase, choicebase, etc. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3944 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/choice.h | 2 +- include/wx/control.h | 2 +- include/wx/dialog.h | 4 ++++ include/wx/font.h | 4 ++++ src/common/choiccmn.cpp | 2 +- src/common/ctrlcmn.cpp | 2 +- src/common/dlgcmn.cpp | 4 +--- src/common/fontcmn.cpp | 4 ++++ src/gtk/window.cpp | 48 ++++++++++++++++++----------------------- src/gtk1/window.cpp | 48 ++++++++++++++++++----------------------- 10 files changed, 59 insertions(+), 61 deletions(-) diff --git a/include/wx/choice.h b/include/wx/choice.h index 3b9eaf5558..81d2e29ad9 100644 --- a/include/wx/choice.h +++ b/include/wx/choice.h @@ -17,7 +17,7 @@ // ---------------------------------------------------------------------------- #ifdef __GNUG__ - #pragma interface "choiccmn.h" + #pragma interface "choicebase.h" #endif #include "wx/control.h" // the base class diff --git a/include/wx/control.h b/include/wx/control.h index 5641eb3506..47c78785c5 100644 --- a/include/wx/control.h +++ b/include/wx/control.h @@ -17,7 +17,7 @@ // ---------------------------------------------------------------------------- #ifdef __GNUG__ - #pragma interface "ctrlcmn.h" + #pragma interface "controlbase.h" #endif #include "wx/window.h" // base class diff --git a/include/wx/dialog.h b/include/wx/dialog.h index ac5f9a9672..fb131cd96c 100644 --- a/include/wx/dialog.h +++ b/include/wx/dialog.h @@ -12,6 +12,10 @@ #ifndef _WX_DIALOG_H_BASE_ #define _WX_DIALOG_H_BASE_ +#ifdef __GNUG__ + #pragma interface "dialogbase.h" +#endif + #include "wx/defs.h" #include "wx/panel.h" diff --git a/include/wx/font.h b/include/wx/font.h index 5ae71a8007..4afebcc07d 100644 --- a/include/wx/font.h +++ b/include/wx/font.h @@ -12,6 +12,10 @@ #ifndef _WX_FONT_H_BASE_ #define _WX_FONT_H_BASE_ +#ifdef __GNUG__ + #pragma interface "fontbase.h" +#endif + // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- diff --git a/src/common/choiccmn.cpp b/src/common/choiccmn.cpp index cf1305605e..09e5d443d5 100644 --- a/src/common/choiccmn.cpp +++ b/src/common/choiccmn.cpp @@ -18,7 +18,7 @@ // ---------------------------------------------------------------------------- #ifdef __GNUG__ - #pragma implementation "choiccmn.h" + #pragma implementation "choicebase.h" #endif // For compilers that support precompilation, includes "wx.h". diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp index 916a4e578d..8e99dd0b17 100644 --- a/src/common/ctrlcmn.cpp +++ b/src/common/ctrlcmn.cpp @@ -18,7 +18,7 @@ // ---------------------------------------------------------------------------- #ifdef __GNUG__ - #pragma implementation "ctrlcmn.h" + #pragma implementation "controlbase.h" #endif // For compilers that support precompilation, includes "wx.h". diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp index bdae60dffb..73d1bcd7dc 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -17,10 +17,8 @@ // headers // ---------------------------------------------------------------------------- -#if 0 #ifdef __GNUG__ - #pragma implementation -#endif + #pragma implementation "dialogbase.h" #endif // For compilers that support precompilation, includes "wx.h". diff --git a/src/common/fontcmn.cpp b/src/common/fontcmn.cpp index c27bb8d92b..ca1921a2bc 100644 --- a/src/common/fontcmn.cpp +++ b/src/common/fontcmn.cpp @@ -17,6 +17,10 @@ // headers // ---------------------------------------------------------------------------- +#ifdef __GNUG__ + #pragma implementation "fontbase.h" +#endif + // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 7e235b0c06..5c6a1422e1 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2663,50 +2663,44 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect ) } } + /* there is no GTK equivalent of "draw only, don't clear" so we + invent our own in the GtkMyFixed widget */ + if (!rect) { if (m_wxwindow) { - /* call the callback directly for preventing GTK from - clearing the background */ - int w = 0; - int h = 0; - GetClientSize( &w, &h ); + GtkMyFixed *myfixed = GTK_MYFIXED(m_wxwindow); + gboolean old_clear = myfixed->clear_on_draw; + gtk_my_fixed_set_clear( myfixed, FALSE ); + + gtk_widget_draw( m_wxwindow, (GdkRectangle*) NULL ); - GetUpdateRegion().Union( 0, 0, w, h ); - wxPaintEvent event( GetId() ); - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); - GetUpdateRegion().Clear(); + gtk_my_fixed_set_clear( myfixed, old_clear ); } else - { gtk_widget_draw( m_widget, (GdkRectangle*) NULL ); - } } else { + GdkRectangle gdk_rect; + gdk_rect.x = rect->x; + gdk_rect.y = rect->y; + gdk_rect.width = rect->width; + gdk_rect.height = rect->height; 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(); + GtkMyFixed *myfixed = GTK_MYFIXED(m_wxwindow); + gboolean old_clear = myfixed->clear_on_draw; + gtk_my_fixed_set_clear( myfixed, FALSE ); + + gtk_widget_draw( m_wxwindow, &gdk_rect ); + + gtk_my_fixed_set_clear( myfixed, old_clear ); } else - { - GdkRectangle gdk_rect; - gdk_rect.x = rect->x; - gdk_rect.y = rect->y; - gdk_rect.width = rect->width; - gdk_rect.height = rect->height; - gtk_widget_draw( m_widget, &gdk_rect ); - } } } diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 7e235b0c06..5c6a1422e1 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -2663,50 +2663,44 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect ) } } + /* there is no GTK equivalent of "draw only, don't clear" so we + invent our own in the GtkMyFixed widget */ + if (!rect) { if (m_wxwindow) { - /* call the callback directly for preventing GTK from - clearing the background */ - int w = 0; - int h = 0; - GetClientSize( &w, &h ); + GtkMyFixed *myfixed = GTK_MYFIXED(m_wxwindow); + gboolean old_clear = myfixed->clear_on_draw; + gtk_my_fixed_set_clear( myfixed, FALSE ); + + gtk_widget_draw( m_wxwindow, (GdkRectangle*) NULL ); - GetUpdateRegion().Union( 0, 0, w, h ); - wxPaintEvent event( GetId() ); - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); - GetUpdateRegion().Clear(); + gtk_my_fixed_set_clear( myfixed, old_clear ); } else - { gtk_widget_draw( m_widget, (GdkRectangle*) NULL ); - } } else { + GdkRectangle gdk_rect; + gdk_rect.x = rect->x; + gdk_rect.y = rect->y; + gdk_rect.width = rect->width; + gdk_rect.height = rect->height; 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(); + GtkMyFixed *myfixed = GTK_MYFIXED(m_wxwindow); + gboolean old_clear = myfixed->clear_on_draw; + gtk_my_fixed_set_clear( myfixed, FALSE ); + + gtk_widget_draw( m_wxwindow, &gdk_rect ); + + gtk_my_fixed_set_clear( myfixed, old_clear ); } else - { - GdkRectangle gdk_rect; - gdk_rect.x = rect->x; - gdk_rect.y = rect->y; - gdk_rect.width = rect->width; - gdk_rect.height = rect->height; - gtk_widget_draw( m_widget, &gdk_rect ); - } } } -- 2.45.2