]> git.saurik.com Git - wxWidgets.git/commitdiff
made wxNO_FULL_REPAINT_ON_RESIZE default, added wxFULL_REPAINT_ON_RESIZE
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 24 Sep 2003 00:26:40 +0000 (00:26 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 24 Sep 2003 00:26:40 +0000 (00:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23871 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

21 files changed:
docs/changes.txt
docs/latex/wx/window.tex
include/wx/defs.h
src/generic/splitter.cpp
src/gtk/window.cpp
src/gtk1/window.cpp
src/mac/carbon/toplevel.cpp
src/mac/carbon/window.cpp
src/mac/toplevel.cpp
src/mac/window.cpp
src/mgl/window.cpp
src/msw/dialog.cpp
src/msw/mdi.cpp
src/msw/window.cpp
src/os2/window.cpp
src/univ/control.cpp
src/univ/menu.cpp
src/univ/winuniv.cpp
src/x11/textctrl.cpp
src/x11/toplevel.cpp
src/x11/window.cpp

index 2051e5d57ce7f2b1cc0d25caeac5ea7bcad86839..86bbdd59667eb67a031f166bc94e3a8b526e1227 100644 (file)
@@ -5,6 +5,19 @@ wxWindows 2.5/2.6 Change Log
 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
   now called much earlier/later than before; please move any exiting code
   from there to wxApp::OnInit()/OnExit()
index 1b3c6f172b89dc99b3b5d063454a807347648364..6181f83df1a79c0c579a0c8ff6a6da0728c4fd54 100644 (file)
@@ -53,6 +53,11 @@ This style is currently only implemented for wxMSW and wxUniversal and does
 nothing on the other platforms.}
 \twocolitem{\windowstyle{wxCLIP\_CHILDREN}}{Use this style to eliminate flicker caused by the background being
 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}
 
 See also \helpref{window styles overview}{windowstyles}.
index dc152babef1ab5f3fa69d558784edb335c4bbdb2..04e4eb439d64ce1981d6ab7a70ffe49916f2aa2c 100644 (file)
@@ -1219,9 +1219,15 @@ enum wxBorder
 // mouse is clicked outside of it or if it loses focus in any other way
 #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
 // 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
index 078cdb7f7b266e05ae1b0fe8dc68cddf13452a62..3f1c33e32769c7cd13ab00a0337f6f4c46f23cb6 100644 (file)
@@ -87,10 +87,6 @@ bool wxSplitterWindow::Create(wxWindow *parent, wxWindowID id,
     style &= ~wxBORDER_MASK;
     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) )
         return FALSE;
 
index 9ad817a824b0e500d846f3b4a779b56f330adf17..d9e5d422b1dd32ce1d93a1dfdeeb646fbdee2007 100644 (file)
@@ -611,10 +611,11 @@ static void gtk_window_draw_callback( GtkWidget *widget,
     if (g_isIdle)
         wxapp_install_idle_handler();
 
-    // The wxNO_FULL_REPAINT_ON_RESIZE flag only works if
-    // there are no child windows.
-    if ((win->HasFlag(wxNO_FULL_REPAINT_ON_RESIZE)) &&
-        (win->GetChildren().GetCount() == 0))
+    // if there are any children we must refresh everything
+    //
+    // VZ: why?
+    if ( !win->HasFlag(wxFULL_REPAINT_ON_RESIZE) &&
+            win->GetChildren().IsEmpty() )
     {
         return;
     }
@@ -2748,13 +2749,13 @@ void wxWindowGTK::PostCreation()
             gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
                 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_FUNC(gtk_window_event_event_callback), (gpointer)this );
             }
 #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
 
 #ifdef __WXGTK20__
index 9ad817a824b0e500d846f3b4a779b56f330adf17..d9e5d422b1dd32ce1d93a1dfdeeb646fbdee2007 100644 (file)
@@ -611,10 +611,11 @@ static void gtk_window_draw_callback( GtkWidget *widget,
     if (g_isIdle)
         wxapp_install_idle_handler();
 
-    // The wxNO_FULL_REPAINT_ON_RESIZE flag only works if
-    // there are no child windows.
-    if ((win->HasFlag(wxNO_FULL_REPAINT_ON_RESIZE)) &&
-        (win->GetChildren().GetCount() == 0))
+    // if there are any children we must refresh everything
+    //
+    // VZ: why?
+    if ( !win->HasFlag(wxFULL_REPAINT_ON_RESIZE) &&
+            win->GetChildren().IsEmpty() )
     {
         return;
     }
@@ -2748,13 +2749,13 @@ void wxWindowGTK::PostCreation()
             gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
                 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_FUNC(gtk_window_event_event_callback), (gpointer)this );
             }
 #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
 
 #ifdef __WXGTK20__
index bf1864f056d4ef3aa2429e29000292738c583bbb..84fe9d8cc9b8d156f9fb33d78352cadf95974fc1 100644 (file)
@@ -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
         // take care of refreshing for full repaints
 
-        if ( doResize && !HasFlag(wxNO_FULL_REPAINT_ON_RESIZE) )
+        if ( doResize && HasFlag(wxFULL_REPAINT_ON_RESIZE) )
             Refresh() ;
 
 
index 86f4af777c81ab70ca481531df42f0254c529197..fbe96110d233a5c7f12fa0d02ff159c15d3fecdc 100644 (file)
@@ -627,7 +627,7 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
 
         bool partialRepaint = false ;
 
-        if ( HasFlag(wxNO_FULL_REPAINT_ON_RESIZE) )
+        if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) )
         {
             wxPoint oldPos( m_x , m_y ) ;
             wxPoint newPos( actualX , actualY ) ;
index bf1864f056d4ef3aa2429e29000292738c583bbb..84fe9d8cc9b8d156f9fb33d78352cadf95974fc1 100644 (file)
@@ -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
         // take care of refreshing for full repaints
 
-        if ( doResize && !HasFlag(wxNO_FULL_REPAINT_ON_RESIZE) )
+        if ( doResize && HasFlag(wxFULL_REPAINT_ON_RESIZE) )
             Refresh() ;
 
 
index 86f4af777c81ab70ca481531df42f0254c529197..fbe96110d233a5c7f12fa0d02ff159c15d3fecdc 100644 (file)
@@ -627,7 +627,7 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
 
         bool partialRepaint = false ;
 
-        if ( HasFlag(wxNO_FULL_REPAINT_ON_RESIZE) )
+        if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) )
         {
             wxPoint oldPos( m_x , m_y ) ;
             wxPoint newPos( actualX , actualY ) ;
index 75f3a09ffe487433251f70dc6c8d88a97f180881..86c0ae8534608fd1b251614e4296d296fa44bb89 100644 (file)
@@ -624,7 +624,7 @@ bool wxWindowMGL::Create(wxWindow *parent,
     long mgl_style = 0;
     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;
     }
index a2505b168dec6210234fff4f94b9cc01f68b7ffc..94cf00190a3113de6269602f49a32cfe8a48f219 100644 (file)
@@ -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
             rc = wxWindow::MSWWindowProc(message, wParam, lParam);
             processed = TRUE;
-            if ( !HasFlag(wxNO_FULL_REPAINT_ON_RESIZE) )
+            if ( HasFlag(wxFULL_REPAINT_ON_RESIZE) )
             {
                 ::InvalidateRect(GetHwnd(), NULL, FALSE /* erase bg */);
             }
index 626131f0bec930314b458027b714ce07e33664d9..5d2e46955cb02cd31d59987a4dca7a0999caf280 100644 (file)
@@ -671,9 +671,9 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
 
   MDICREATESTRUCT mcs;
 
-  mcs.szClass = style & wxNO_FULL_REPAINT_ON_RESIZE
-                    ? wxMDIChildFrameClassNameNoRedraw
-                    : wxMDIChildFrameClassName;
+  mcs.szClass = style & wxFULL_REPAINT_ON_RESIZE
+                    ? wxMDIChildFrameClassName
+                    : wxMDIChildFrameClassNameNoRedraw;
   mcs.szTitle = title;
   mcs.hOwner = wxGetInstance();
   if (x > -1)
index 2a65b3d3ff9136ba22eecd2ae10595ab2af80684..c208aa1b2a983153d98350ae6cda3f60782588f7 100644 (file)
@@ -3021,7 +3021,7 @@ bool wxWindowMSW::MSWCreate(const wxChar *wclass,
     // 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
     wxString className(wclass);
-    if ( GetWindowStyleFlag() & wxNO_FULL_REPAINT_ON_RESIZE )
+    if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) )
     {
         className += wxT("NR");
     }
index a58a694e85d375fda42066ace17047587caa0a6e..71d6eca0f9bcbd4951700884e45e1f9957477252 100644 (file)
@@ -3188,7 +3188,7 @@ bool wxWindowOS2::OS2Create(
     // 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
     //
-    if (GetWindowStyleFlag() & wxNO_FULL_REPAINT_ON_RESIZE)
+    if (!HasStyle(wxFULL_REPAINT_ON_RESIZE))
     {
         sClassName += wxT("NR");
     }
index 712ccbb4c0c52778224efad1bd09063ffc3ceee1..a719d491fa3ad7c43a34c5c237b764f8f4e78b68 100644 (file)
@@ -70,12 +70,7 @@ bool wxControl::Create(wxWindow *parent,
                        const wxValidator& validator,
                        const wxString& name)
 {
-    // Ee use wxNO_FULL_REPAINT_ON_RESIZE by default as it results in much
-    // 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) )
+    if ( !wxControlBase::Create(parent, id, pos, size, style, validator, name) )
     {
         // underlying window creation failed?
         return FALSE;
index 9749132df94c06c77a49904c6411c682c3552307..f760357497313239f475111f694b8c6ffba458dc 100644 (file)
@@ -123,7 +123,7 @@ class wxPopupMenuWindow : public wxPopupTransientWindow
 {
 public:
     wxPopupMenuWindow(wxWindow *parent, wxMenu *menu);
-    
+
     ~wxPopupMenuWindow();
 
     // override the base class version to select the first item initially
@@ -259,7 +259,7 @@ public:
         else
         {
             // return FALSE;
-            
+
             return wxEvtHandler::ProcessEvent(event);
         }
     }
@@ -376,7 +376,7 @@ wxMenuItemList::compatibility_iterator wxPopupMenuWindow::GetPrevNode() const
                          : m_menu->GetMenuItems().GetLast();
 }
 
-wxMenuItemList::compatibility_iterator 
+wxMenuItemList::compatibility_iterator
 wxPopupMenuWindow::GetPrevNode(wxMenuItemList::compatibility_iterator node) const
 {
     if ( node )
@@ -399,7 +399,7 @@ wxMenuItemList::compatibility_iterator wxPopupMenuWindow::GetNextNode() const
                          : m_menu->GetMenuItems().GetFirst();
 }
 
-wxMenuItemList::compatibility_iterator 
+wxMenuItemList::compatibility_iterator
 wxPopupMenuWindow::GetNextNode(wxMenuItemList::compatibility_iterator node) const
 {
     if ( node )
@@ -620,7 +620,7 @@ void wxPopupMenuWindow::ClickItem(wxMenuItem *item)
 
     // close all menus
     DismissAndNotify();
-    
+
     menu->ClickItem(item);
 }
 
@@ -685,7 +685,7 @@ bool wxPopupMenuWindow::ProcessLeftDown(wxMouseEvent& event)
             wxPopupMenuWindow *win = menu->m_popupMenu;
 
             wxCHECK_MSG( win, FALSE, _T("parent menu not shown?") );
-            
+
             pos = ClientToScreen(pos);
             if ( win->GetMenuItemFromPoint(win->ScreenToClient(pos)) )
             {
@@ -1245,7 +1245,7 @@ wxWindow *wxMenu::GetRootWindow() const
         // We are a submenu of a menu of a menubar
         if (menu->GetMenuBar())
            return menu->GetMenuBar();
-    
+
         win = menu->GetInvokingWindow();
         if ( win )
             break;
@@ -1256,7 +1256,7 @@ wxWindow *wxMenu::GetRootWindow() const
     // we're probably going to crash in the caller anyhow, but try to detect
     // this error as soon as possible
     wxASSERT_MSG( win, _T("menu without any associated window?") );
-    
+
     // also remember it in this menu so that we don't have to search for it the
     // next time
     wxConstCast(this, wxMenu)->m_invokingWindow = win;
@@ -1333,7 +1333,7 @@ void wxMenu::OnDismiss(bool dismissParent)
             wxCHECK_RET( m_invokingWindow, _T("what kind of menu is this?") );
 
             m_invokingWindow->DismissPopupMenu();
-            
+
             // Why reset it here? We need it for sending the event to...
             // SetInvokingWindow(NULL);
         }
@@ -1353,7 +1353,7 @@ void wxMenu::Popup(const wxPoint& pos, const wxSize& size, bool selectFirst)
     {
         m_popupMenu->SelectFirst();
     }
-    
+
     // the geometry might have changed since the last time we were shown, so
     // always resize
     m_popupMenu->SetClientSize(GetGeometryInfo().GetSize());
@@ -1405,7 +1405,7 @@ bool wxMenu::ClickItem(wxMenuItem *item)
         // not applicabled
         isChecked = -1;
     }
-    
+
     return SendEvent(item->GetId(), isChecked);
 }
 
@@ -1664,8 +1664,6 @@ void wxMenuBar::Init()
     m_menuShown = NULL;
 
     m_shouldShowMenu = FALSE;
-    
-    m_windowStyle |= wxNO_FULL_REPAINT_ON_RESIZE;
 }
 
 void wxMenuBar::Attach(wxFrame *frame)
@@ -2500,9 +2498,9 @@ bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y)
 #endif // 0
 
     menu->SetInvokingWindow(this);
-    
+
     // wxLogDebug( "Name of invoking window %s", menu->GetInvokingWindow()->GetName().c_str() );
-    
+
     menu->Popup(ClientToScreen(wxPoint(x, y)), wxSize(0, 0));
 
     // this is not very useful if the menu was popped up because of the mouse
@@ -2537,7 +2535,7 @@ bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y)
 void wxWindow::DismissPopupMenu()
 {
     wxCHECK_RET( ms_evtLoopPopup, _T("no popup menu shown") );
-    
+
     ms_evtLoopPopup->Exit();
 }
 
index d36c97fb753126abad2f6e386a7d7a52bef02d87..4de62140fcde70049e1d6941c4a3e54063871600 100644 (file)
@@ -533,7 +533,7 @@ void wxWindow::OnSize(wxSizeEvent& event)
 #if 0   // ndef __WXMSW__
     // 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
         // the area of the entire window, not just the client
index 6f74efadb201bba163ff3bd20552b453ce8053ae..3b778c72a9fc4399ae95d3033d771b086f669dd6 100644 (file)
@@ -221,7 +221,7 @@ bool wxTextCtrl::Create( wxWindow *parent,
         style |= wxALWAYS_SHOW_SB;
         
     wxTextCtrlBase::Create( parent, id, pos /* wxDefaultPosition */, size,
-                              style|wxVSCROLL|wxHSCROLL|wxNO_FULL_REPAINT_ON_RESIZE );
+                            style | wxVSCROLL | wxHSCROLL);
                               
     SetBackgroundColour( *wxWHITE );
     
index adb3b421786f465d716df5bfe3dda65658959ad7..7fcd2b9894ca1036389d8c1d971717e2845e1244 100644 (file)
@@ -139,7 +139,7 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
         xattributes.override_redirect = True;
     }
     
-    if (HasFlag( wxNO_FULL_REPAINT_ON_RESIZE ))
+    if (!HasFlag( wxFULL_REPAINT_ON_RESIZE ))
     {
         xattributes_mask |= CWBitGravity;
         xattributes.bit_gravity = NorthWestGravity;
index 2cd523c2d42a1d02c1e0d6e42ee084df16f23e41..93c612e4e9fb2cb352c8bff207e0be8fcbc17820 100644 (file)
@@ -224,7 +224,7 @@ bool wxWindowX11::Create(wxWindow *parent, wxWindowID id,
             KeymapStateMask | FocusChangeMask | ColormapChangeMask | StructureNotifyMask |
             PropertyChangeMask | VisibilityChangeMask ;
 
-        if (HasFlag( wxNO_FULL_REPAINT_ON_RESIZE ))
+        if (!HasFlag( wxFULL_REPAINT_ON_RESIZE ))
         {
             xattributes_mask |= CWBitGravity;
             xattributes.bit_gravity = StaticGravity;
@@ -304,7 +304,7 @@ bool wxWindowX11::Create(wxWindow *parent, wxWindowID id,
             KeymapStateMask | FocusChangeMask | ColormapChangeMask | StructureNotifyMask |
             PropertyChangeMask | VisibilityChangeMask ;
 
-        if (HasFlag( wxNO_FULL_REPAINT_ON_RESIZE ))
+        if (!HasFlag( wxFULL_REPAINT_ON_RESIZE ))
         {
             xattributes_mask |= CWBitGravity;
             xattributes.bit_gravity = NorthWestGravity;