made wxNO_FULL_REPAINT_ON_RESIZE default, added wxFULL_REPAINT_ON_RESIZE
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23871 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -5,6 +5,19 @@ wxWindows 2.5/2.6 Change Log
|
|||||||
INCOMPATIBLE CHANGES SINCE 2.4.x
|
INCOMPATIBLE CHANGES SINCE 2.4.x
|
||||||
================================
|
================================
|
||||||
|
|
||||||
|
Please take a few minutes to read the following list, especially
|
||||||
|
paying attention to the most important changes which are marked
|
||||||
|
with '!' in the first column.
|
||||||
|
|
||||||
|
Also please note that you should ensure that WXWIN_COMPATIBILITY_2_4
|
||||||
|
is defined to 1 if you wish to retain maximal compatibility with 2.4
|
||||||
|
series.
|
||||||
|
|
||||||
|
! windows are no longer fully repainted when resized, use new style
|
||||||
|
wxFULL_REPAINT_ON_RESIZE to force this (wxNO_FULL_REPAINT_ON_RESIZE stll
|
||||||
|
exists but doesn't do anything any more, this behaviour is default now)
|
||||||
|
|
||||||
|
|
||||||
- no initialization/cleanup can be done in wxApp/~wxApp because they are
|
- no initialization/cleanup can be done in wxApp/~wxApp because they are
|
||||||
now called much earlier/later than before; please move any exiting code
|
now called much earlier/later than before; please move any exiting code
|
||||||
from there to wxApp::OnInit()/OnExit()
|
from there to wxApp::OnInit()/OnExit()
|
||||||
|
@@ -53,6 +53,11 @@ This style is currently only implemented for wxMSW and wxUniversal and does
|
|||||||
nothing on the other platforms.}
|
nothing on the other platforms.}
|
||||||
\twocolitem{\windowstyle{wxCLIP\_CHILDREN}}{Use this style to eliminate flicker caused by the background being
|
\twocolitem{\windowstyle{wxCLIP\_CHILDREN}}{Use this style to eliminate flicker caused by the background being
|
||||||
repainted, then children being painted over them. Windows only.}
|
repainted, then children being painted over them. Windows only.}
|
||||||
|
\twocolitem{\windowstyle{wxFULL\_REPAINT\_ON\_RESIZE}}{Use this style to force
|
||||||
|
a complete redraw of the window whenever it is resized instead of redrawing
|
||||||
|
just the part of the window affected by resizing. Note that this was the
|
||||||
|
behaviour by default before 2.5.1 release and that if you experience redraw
|
||||||
|
problems with the code which previously used to work you may want to try this.}
|
||||||
\end{twocollist}
|
\end{twocollist}
|
||||||
|
|
||||||
See also \helpref{window styles overview}{windowstyles}.
|
See also \helpref{window styles overview}{windowstyles}.
|
||||||
|
@@ -1219,9 +1219,15 @@ enum wxBorder
|
|||||||
// mouse is clicked outside of it or if it loses focus in any other way
|
// mouse is clicked outside of it or if it loses focus in any other way
|
||||||
#define wxPOPUP_WINDOW 0x00020000
|
#define wxPOPUP_WINDOW 0x00020000
|
||||||
|
|
||||||
|
// force a full repaint when the window is resized (instead of repainting just
|
||||||
|
// the invalidated area)
|
||||||
|
#define wxFULL_REPAINT_ON_RESIZE 0x00010000
|
||||||
|
|
||||||
|
// obsolete: now this is the default behaviour
|
||||||
|
//
|
||||||
// don't invalidate the whole window (resulting in a PAINT event) when the
|
// don't invalidate the whole window (resulting in a PAINT event) when the
|
||||||
// window is resized (currently, makes sense for wxMSW only)
|
// window is resized (currently, makes sense for wxMSW only)
|
||||||
#define wxNO_FULL_REPAINT_ON_RESIZE 0x00010000
|
#define wxNO_FULL_REPAINT_ON_RESIZE 0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Extra window style flags (use wxWS_EX prefix to make it clear that they
|
* Extra window style flags (use wxWS_EX prefix to make it clear that they
|
||||||
|
@@ -87,10 +87,6 @@ bool wxSplitterWindow::Create(wxWindow *parent, wxWindowID id,
|
|||||||
style &= ~wxBORDER_MASK;
|
style &= ~wxBORDER_MASK;
|
||||||
style |= wxBORDER_NONE;
|
style |= wxBORDER_NONE;
|
||||||
|
|
||||||
// we don't need to be completely repainted after resize and doing it
|
|
||||||
// results in horrible flicker
|
|
||||||
style |= wxNO_FULL_REPAINT_ON_RESIZE;
|
|
||||||
|
|
||||||
if ( !wxWindow::Create(parent, id, pos, size, style, name) )
|
if ( !wxWindow::Create(parent, id, pos, size, style, name) )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
@@ -611,10 +611,11 @@ static void gtk_window_draw_callback( GtkWidget *widget,
|
|||||||
if (g_isIdle)
|
if (g_isIdle)
|
||||||
wxapp_install_idle_handler();
|
wxapp_install_idle_handler();
|
||||||
|
|
||||||
// The wxNO_FULL_REPAINT_ON_RESIZE flag only works if
|
// if there are any children we must refresh everything
|
||||||
// there are no child windows.
|
//
|
||||||
if ((win->HasFlag(wxNO_FULL_REPAINT_ON_RESIZE)) &&
|
// VZ: why?
|
||||||
(win->GetChildren().GetCount() == 0))
|
if ( !win->HasFlag(wxFULL_REPAINT_ON_RESIZE) &&
|
||||||
|
win->GetChildren().IsEmpty() )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2748,13 +2749,13 @@ void wxWindowGTK::PostCreation()
|
|||||||
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
|
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
|
||||||
GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this );
|
||||||
|
|
||||||
if (HasFlag(wxNO_FULL_REPAINT_ON_RESIZE))
|
if (!HasFlag(wxFULL_REPAINT_ON_RESIZE))
|
||||||
{
|
{
|
||||||
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "event",
|
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "event",
|
||||||
GTK_SIGNAL_FUNC(gtk_window_event_event_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_window_event_event_callback), (gpointer)this );
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// gtk_widget_set_redraw_on_allocate( GTK_WIDGET(m_wxwindow), HasFlag( wxNO_FULL_REPAINT_ON_RESIZE ) );
|
// gtk_widget_set_redraw_on_allocate( GTK_WIDGET(m_wxwindow), !HasFlag( wxFULL_REPAINT_ON_RESIZE ) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
|
@@ -611,10 +611,11 @@ static void gtk_window_draw_callback( GtkWidget *widget,
|
|||||||
if (g_isIdle)
|
if (g_isIdle)
|
||||||
wxapp_install_idle_handler();
|
wxapp_install_idle_handler();
|
||||||
|
|
||||||
// The wxNO_FULL_REPAINT_ON_RESIZE flag only works if
|
// if there are any children we must refresh everything
|
||||||
// there are no child windows.
|
//
|
||||||
if ((win->HasFlag(wxNO_FULL_REPAINT_ON_RESIZE)) &&
|
// VZ: why?
|
||||||
(win->GetChildren().GetCount() == 0))
|
if ( !win->HasFlag(wxFULL_REPAINT_ON_RESIZE) &&
|
||||||
|
win->GetChildren().IsEmpty() )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2748,13 +2749,13 @@ void wxWindowGTK::PostCreation()
|
|||||||
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
|
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
|
||||||
GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this );
|
||||||
|
|
||||||
if (HasFlag(wxNO_FULL_REPAINT_ON_RESIZE))
|
if (!HasFlag(wxFULL_REPAINT_ON_RESIZE))
|
||||||
{
|
{
|
||||||
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "event",
|
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "event",
|
||||||
GTK_SIGNAL_FUNC(gtk_window_event_event_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_window_event_event_callback), (gpointer)this );
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// gtk_widget_set_redraw_on_allocate( GTK_WIDGET(m_wxwindow), HasFlag( wxNO_FULL_REPAINT_ON_RESIZE ) );
|
// gtk_widget_set_redraw_on_allocate( GTK_WIDGET(m_wxwindow), !HasFlag( wxFULL_REPAINT_ON_RESIZE ) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
|
@@ -1088,7 +1088,7 @@ void wxTopLevelWindowMac::DoMoveWindow(int x, int y, int width, int height)
|
|||||||
// the OS takes care of invalidating and erasing the new area so we only have to
|
// the OS takes care of invalidating and erasing the new area so we only have to
|
||||||
// take care of refreshing for full repaints
|
// take care of refreshing for full repaints
|
||||||
|
|
||||||
if ( doResize && !HasFlag(wxNO_FULL_REPAINT_ON_RESIZE) )
|
if ( doResize && HasFlag(wxFULL_REPAINT_ON_RESIZE) )
|
||||||
Refresh() ;
|
Refresh() ;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -627,7 +627,7 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
|
|||||||
|
|
||||||
bool partialRepaint = false ;
|
bool partialRepaint = false ;
|
||||||
|
|
||||||
if ( HasFlag(wxNO_FULL_REPAINT_ON_RESIZE) )
|
if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) )
|
||||||
{
|
{
|
||||||
wxPoint oldPos( m_x , m_y ) ;
|
wxPoint oldPos( m_x , m_y ) ;
|
||||||
wxPoint newPos( actualX , actualY ) ;
|
wxPoint newPos( actualX , actualY ) ;
|
||||||
|
@@ -1088,7 +1088,7 @@ void wxTopLevelWindowMac::DoMoveWindow(int x, int y, int width, int height)
|
|||||||
// the OS takes care of invalidating and erasing the new area so we only have to
|
// the OS takes care of invalidating and erasing the new area so we only have to
|
||||||
// take care of refreshing for full repaints
|
// take care of refreshing for full repaints
|
||||||
|
|
||||||
if ( doResize && !HasFlag(wxNO_FULL_REPAINT_ON_RESIZE) )
|
if ( doResize && HasFlag(wxFULL_REPAINT_ON_RESIZE) )
|
||||||
Refresh() ;
|
Refresh() ;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -627,7 +627,7 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
|
|||||||
|
|
||||||
bool partialRepaint = false ;
|
bool partialRepaint = false ;
|
||||||
|
|
||||||
if ( HasFlag(wxNO_FULL_REPAINT_ON_RESIZE) )
|
if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) )
|
||||||
{
|
{
|
||||||
wxPoint oldPos( m_x , m_y ) ;
|
wxPoint oldPos( m_x , m_y ) ;
|
||||||
wxPoint newPos( actualX , actualY ) ;
|
wxPoint newPos( actualX , actualY ) ;
|
||||||
|
@@ -624,7 +624,7 @@ bool wxWindowMGL::Create(wxWindow *parent,
|
|||||||
long mgl_style = 0;
|
long mgl_style = 0;
|
||||||
window_t *wnd_parent = parent ? parent->GetHandle() : NULL;
|
window_t *wnd_parent = parent ? parent->GetHandle() : NULL;
|
||||||
|
|
||||||
if ( !(style & wxNO_FULL_REPAINT_ON_RESIZE) )
|
if ( style & wxFULL_REPAINT_ON_RESIZE )
|
||||||
{
|
{
|
||||||
mgl_style |= MGL_WM_FULL_REPAINT_ON_RESIZE;
|
mgl_style |= MGL_WM_FULL_REPAINT_ON_RESIZE;
|
||||||
}
|
}
|
||||||
|
@@ -502,7 +502,7 @@ long wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
// creates flicker but at least doesn't show garbage on the screen
|
// creates flicker but at least doesn't show garbage on the screen
|
||||||
rc = wxWindow::MSWWindowProc(message, wParam, lParam);
|
rc = wxWindow::MSWWindowProc(message, wParam, lParam);
|
||||||
processed = TRUE;
|
processed = TRUE;
|
||||||
if ( !HasFlag(wxNO_FULL_REPAINT_ON_RESIZE) )
|
if ( HasFlag(wxFULL_REPAINT_ON_RESIZE) )
|
||||||
{
|
{
|
||||||
::InvalidateRect(GetHwnd(), NULL, FALSE /* erase bg */);
|
::InvalidateRect(GetHwnd(), NULL, FALSE /* erase bg */);
|
||||||
}
|
}
|
||||||
|
@@ -671,9 +671,9 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
|
|||||||
|
|
||||||
MDICREATESTRUCT mcs;
|
MDICREATESTRUCT mcs;
|
||||||
|
|
||||||
mcs.szClass = style & wxNO_FULL_REPAINT_ON_RESIZE
|
mcs.szClass = style & wxFULL_REPAINT_ON_RESIZE
|
||||||
? wxMDIChildFrameClassNameNoRedraw
|
? wxMDIChildFrameClassName
|
||||||
: wxMDIChildFrameClassName;
|
: wxMDIChildFrameClassNameNoRedraw;
|
||||||
mcs.szTitle = title;
|
mcs.szTitle = title;
|
||||||
mcs.hOwner = wxGetInstance();
|
mcs.hOwner = wxGetInstance();
|
||||||
if (x > -1)
|
if (x > -1)
|
||||||
|
@@ -3021,7 +3021,7 @@ bool wxWindowMSW::MSWCreate(const wxChar *wclass,
|
|||||||
// which is the same but without CS_[HV]REDRAW class styles so using it
|
// which is the same but without CS_[HV]REDRAW class styles so using it
|
||||||
// ensures that the window is not fully repainted on each resize
|
// ensures that the window is not fully repainted on each resize
|
||||||
wxString className(wclass);
|
wxString className(wclass);
|
||||||
if ( GetWindowStyleFlag() & wxNO_FULL_REPAINT_ON_RESIZE )
|
if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) )
|
||||||
{
|
{
|
||||||
className += wxT("NR");
|
className += wxT("NR");
|
||||||
}
|
}
|
||||||
|
@@ -3188,7 +3188,7 @@ bool wxWindowOS2::OS2Create(
|
|||||||
// which is the same but without CS_[HV]REDRAW class styles so using it
|
// which is the same but without CS_[HV]REDRAW class styles so using it
|
||||||
// ensures that the window is not fully repainted on each resize
|
// ensures that the window is not fully repainted on each resize
|
||||||
//
|
//
|
||||||
if (GetWindowStyleFlag() & wxNO_FULL_REPAINT_ON_RESIZE)
|
if (!HasStyle(wxFULL_REPAINT_ON_RESIZE))
|
||||||
{
|
{
|
||||||
sClassName += wxT("NR");
|
sClassName += wxT("NR");
|
||||||
}
|
}
|
||||||
|
@@ -70,12 +70,7 @@ bool wxControl::Create(wxWindow *parent,
|
|||||||
const wxValidator& validator,
|
const wxValidator& validator,
|
||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
// Ee use wxNO_FULL_REPAINT_ON_RESIZE by default as it results in much
|
if ( !wxControlBase::Create(parent, id, pos, size, style, validator, name) )
|
||||||
// less flicker and none of the standard controls needs to be entirely
|
|
||||||
// repainted after resize anyhow.
|
|
||||||
if ( !wxControlBase::Create(parent, id, pos, size,
|
|
||||||
style | wxNO_FULL_REPAINT_ON_RESIZE ,
|
|
||||||
validator, name) )
|
|
||||||
{
|
{
|
||||||
// underlying window creation failed?
|
// underlying window creation failed?
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@@ -1664,8 +1664,6 @@ void wxMenuBar::Init()
|
|||||||
m_menuShown = NULL;
|
m_menuShown = NULL;
|
||||||
|
|
||||||
m_shouldShowMenu = FALSE;
|
m_shouldShowMenu = FALSE;
|
||||||
|
|
||||||
m_windowStyle |= wxNO_FULL_REPAINT_ON_RESIZE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMenuBar::Attach(wxFrame *frame)
|
void wxMenuBar::Attach(wxFrame *frame)
|
||||||
|
@@ -533,7 +533,7 @@ void wxWindow::OnSize(wxSizeEvent& event)
|
|||||||
#if 0 // ndef __WXMSW__
|
#if 0 // ndef __WXMSW__
|
||||||
// Refresh the area (strip) previously occupied by the border
|
// Refresh the area (strip) previously occupied by the border
|
||||||
|
|
||||||
if (HasFlag( wxNO_FULL_REPAINT_ON_RESIZE ) && IsShown())
|
if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) && IsShown() )
|
||||||
{
|
{
|
||||||
// This code assumes that wxSizeEvent.GetSize() returns
|
// This code assumes that wxSizeEvent.GetSize() returns
|
||||||
// the area of the entire window, not just the client
|
// the area of the entire window, not just the client
|
||||||
|
@@ -221,7 +221,7 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
|||||||
style |= wxALWAYS_SHOW_SB;
|
style |= wxALWAYS_SHOW_SB;
|
||||||
|
|
||||||
wxTextCtrlBase::Create( parent, id, pos /* wxDefaultPosition */, size,
|
wxTextCtrlBase::Create( parent, id, pos /* wxDefaultPosition */, size,
|
||||||
style|wxVSCROLL|wxHSCROLL|wxNO_FULL_REPAINT_ON_RESIZE );
|
style | wxVSCROLL | wxHSCROLL);
|
||||||
|
|
||||||
SetBackgroundColour( *wxWHITE );
|
SetBackgroundColour( *wxWHITE );
|
||||||
|
|
||||||
|
@@ -139,7 +139,7 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
|
|||||||
xattributes.override_redirect = True;
|
xattributes.override_redirect = True;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HasFlag( wxNO_FULL_REPAINT_ON_RESIZE ))
|
if (!HasFlag( wxFULL_REPAINT_ON_RESIZE ))
|
||||||
{
|
{
|
||||||
xattributes_mask |= CWBitGravity;
|
xattributes_mask |= CWBitGravity;
|
||||||
xattributes.bit_gravity = NorthWestGravity;
|
xattributes.bit_gravity = NorthWestGravity;
|
||||||
|
@@ -224,7 +224,7 @@ bool wxWindowX11::Create(wxWindow *parent, wxWindowID id,
|
|||||||
KeymapStateMask | FocusChangeMask | ColormapChangeMask | StructureNotifyMask |
|
KeymapStateMask | FocusChangeMask | ColormapChangeMask | StructureNotifyMask |
|
||||||
PropertyChangeMask | VisibilityChangeMask ;
|
PropertyChangeMask | VisibilityChangeMask ;
|
||||||
|
|
||||||
if (HasFlag( wxNO_FULL_REPAINT_ON_RESIZE ))
|
if (!HasFlag( wxFULL_REPAINT_ON_RESIZE ))
|
||||||
{
|
{
|
||||||
xattributes_mask |= CWBitGravity;
|
xattributes_mask |= CWBitGravity;
|
||||||
xattributes.bit_gravity = StaticGravity;
|
xattributes.bit_gravity = StaticGravity;
|
||||||
@@ -304,7 +304,7 @@ bool wxWindowX11::Create(wxWindow *parent, wxWindowID id,
|
|||||||
KeymapStateMask | FocusChangeMask | ColormapChangeMask | StructureNotifyMask |
|
KeymapStateMask | FocusChangeMask | ColormapChangeMask | StructureNotifyMask |
|
||||||
PropertyChangeMask | VisibilityChangeMask ;
|
PropertyChangeMask | VisibilityChangeMask ;
|
||||||
|
|
||||||
if (HasFlag( wxNO_FULL_REPAINT_ON_RESIZE ))
|
if (!HasFlag( wxFULL_REPAINT_ON_RESIZE ))
|
||||||
{
|
{
|
||||||
xattributes_mask |= CWBitGravity;
|
xattributes_mask |= CWBitGravity;
|
||||||
xattributes.bit_gravity = NorthWestGravity;
|
xattributes.bit_gravity = NorthWestGravity;
|
||||||
|
Reference in New Issue
Block a user