From 6a50a2c4d3b39901947b68c81973016d56da75e1 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Fri, 7 Jan 2011 18:15:21 +0000 Subject: [PATCH] move default OnInternalIdle processing to wxWindowBase git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66633 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/dfb/window.h | 2 -- include/wx/gtk/control.h | 2 -- include/wx/gtk/toolbar.h | 2 -- include/wx/mgl/window.h | 2 -- include/wx/motif/window.h | 3 --- include/wx/osx/window.h | 2 -- include/wx/window.h | 2 +- src/common/wincmn.cpp | 10 ++++++++++ src/dfb/window.cpp | 11 ----------- src/gtk/control.cpp | 13 ------------- src/gtk/toolbar.cpp | 14 -------------- src/gtk/toplevel.cpp | 2 +- src/gtk/window.cpp | 3 +-- src/gtk1/window.cpp | 3 +-- src/mgl/window.cpp | 11 ----------- src/motif/window.cpp | 8 -------- src/msw/window.cpp | 3 +-- src/os2/window.cpp | 2 -- src/osx/window_osx.cpp | 8 -------- src/x11/window.cpp | 5 +---- 20 files changed, 16 insertions(+), 92 deletions(-) diff --git a/include/wx/dfb/window.h b/include/wx/dfb/window.h index b12d07a..f6018c7 100644 --- a/include/wx/dfb/window.h +++ b/include/wx/dfb/window.h @@ -100,8 +100,6 @@ public: // returns toplevel window the window belongs to wxNonOwnedWindow *GetTLW() const { return m_tlw; } - void OnInternalIdle(); - virtual bool IsDoubleBuffered() const { return true; } protected: diff --git a/include/wx/gtk/control.h b/include/wx/gtk/control.h index 73f03e2..1643377 100644 --- a/include/wx/gtk/control.h +++ b/include/wx/gtk/control.h @@ -46,8 +46,6 @@ public: virtual wxVisualAttributes GetDefaultAttributes() const; - virtual void OnInternalIdle(); - protected: virtual wxSize DoGetBestSize() const; void PostCreation(const wxSize& size); diff --git a/include/wx/gtk/toolbar.h b/include/wx/gtk/toolbar.h index c752a8d..6b15764 100644 --- a/include/wx/gtk/toolbar.h +++ b/include/wx/gtk/toolbar.h @@ -59,8 +59,6 @@ public: // implementation from now on // -------------------------- - void OnInternalIdle(); - protected: virtual wxSize DoGetBestSize() const; virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const; diff --git a/include/wx/mgl/window.h b/include/wx/mgl/window.h index 92f50b2..8f72a27 100644 --- a/include/wx/mgl/window.h +++ b/include/wx/mgl/window.h @@ -89,8 +89,6 @@ public: // implementation from now on // -------------------------- - void OnInternalIdle(); - protected: virtual void DoFreeze(); virtual void DoThaw(); diff --git a/include/wx/motif/window.h b/include/wx/motif/window.h index 0069899..82c1793 100644 --- a/include/wx/motif/window.h +++ b/include/wx/motif/window.h @@ -138,9 +138,6 @@ public: void ClearUpdateRegion() { m_updateRegion.Clear(); } void SetUpdateRegion(const wxRegion& region) { m_updateRegion = region; } - // Process idle (send update events) - void OnInternalIdle(); - // post-creation activities void PostCreation(); diff --git a/include/wx/osx/window.h b/include/wx/osx/window.h index 875a5ef..c548f21 100644 --- a/include/wx/osx/window.h +++ b/include/wx/osx/window.h @@ -156,8 +156,6 @@ public: static long MacRemoveBordersFromStyle( long style ) ; public: - void OnInternalIdle(); - // For implementation purposes: // sometimes decorations make the client area smaller virtual wxPoint GetClientAreaOrigin() const; diff --git a/include/wx/window.h b/include/wx/window.h index 2260f8f..cb68751 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -1370,7 +1370,7 @@ public: // virtual function for implementing internal idle // behaviour - virtual void OnInternalIdle() {} + virtual void OnInternalIdle(); // call internal idle recursively // void ProcessInternalIdle() ; diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index e458f80..82e0f7a 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -2601,6 +2601,16 @@ void wxWindowBase::DoUpdateWindowUI(wxUpdateUIEvent& event) } // ---------------------------------------------------------------------------- +// Idle processing +// ---------------------------------------------------------------------------- + +void wxWindowBase::OnInternalIdle() +{ + if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen()) + UpdateWindowUI(wxUPDATE_UI_FROMIDLE); +} + +// ---------------------------------------------------------------------------- // dialog units translations // ---------------------------------------------------------------------------- diff --git a/src/dfb/window.cpp b/src/dfb/window.cpp index bfe64b1..5170765 100644 --- a/src/dfb/window.cpp +++ b/src/dfb/window.cpp @@ -1054,17 +1054,6 @@ void wxWindowDFB::HandleKeyEvent(const wxDFBWindowEvent& event_) } } -// --------------------------------------------------------------------------- -// idle events processing -// --------------------------------------------------------------------------- - -void wxWindowDFB::OnInternalIdle() -{ - if (wxUpdateUIEvent::CanUpdate(this) && IsShown()) - UpdateWindowUI(wxUPDATE_UI_FROMIDLE); -} - - // Find the wxWindow at the current mouse position, returning the mouse // position. wxWindow* wxFindWindowAtPointer(wxPoint& pt) diff --git a/src/gtk/control.cpp b/src/gtk/control.cpp index 0191a2f..7012a75 100644 --- a/src/gtk/control.cpp +++ b/src/gtk/control.cpp @@ -314,17 +314,4 @@ wxControl::GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromAdj_t widget_new, return attr; } -// ---------------------------------------------------------------------------- -// idle handling -// ---------------------------------------------------------------------------- - -void wxControl::OnInternalIdle() -{ - if ( GTKShowFromOnIdle() ) - return; - - if ( wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen() ) - UpdateWindowUI(wxUPDATE_UI_FROMIDLE); -} - #endif // wxUSE_CONTROLS diff --git a/src/gtk/toolbar.cpp b/src/gtk/toolbar.cpp index b25f775..969c7f9 100644 --- a/src/gtk/toolbar.cpp +++ b/src/gtk/toolbar.cpp @@ -748,20 +748,6 @@ void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap ) } // ---------------------------------------------------------------------------- -// wxToolBar idle handling -// ---------------------------------------------------------------------------- - -void wxToolBar::OnInternalIdle() -{ - // Check if we have to show window now - if (GTKShowFromOnIdle()) return; - - if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen()) - UpdateWindowUI(wxUPDATE_UI_FROMIDLE); -} - - -// ---------------------------------------------------------------------------- // static wxVisualAttributes diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 18d5775..4e3e560 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -1144,7 +1144,7 @@ wxSize& wxTopLevelWindowGTK::GetCachedDecorSize() void wxTopLevelWindowGTK::OnInternalIdle() { - wxWindow::OnInternalIdle(); + wxTopLevelWindowBase::OnInternalIdle(); // Synthetize activate events. if ( g_sendActivateEvent != -1 ) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 26e7dc2..85c1dfc 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2615,8 +2615,7 @@ void wxWindowGTK::OnInternalIdle() m_needsStyleChange = false; } - if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen()) - UpdateWindowUI(wxUPDATE_UI_FROMIDLE); + wxWindowBase::OnInternalIdle(); } void wxWindowGTK::DoGetSize( int *width, int *height ) const diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index dcefcff..c339054 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -2960,8 +2960,7 @@ void wxWindowGTK::OnInternalIdle() } } - if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen()) - UpdateWindowUI(wxUPDATE_UI_FROMIDLE); + wxWindowBase::OnInternalIdle(); } void wxWindowGTK::DoGetSize( int *width, int *height ) const diff --git a/src/mgl/window.cpp b/src/mgl/window.cpp index d46081e..aad3ea0 100644 --- a/src/mgl/window.cpp +++ b/src/mgl/window.cpp @@ -1206,14 +1206,3 @@ wxWindow* wxFindWindowAtPoint(const wxPoint& pt) window_t *wnd = MGL_wmGetWindowAtPosition(g_winMng, pt.x, pt.y); return (wxWindow*)wnd->userData; } - - -// --------------------------------------------------------------------------- -// idle events processing -// --------------------------------------------------------------------------- - -void wxWindowMGL::OnInternalIdle() -{ - if (wxUpdateUIEvent::CanUpdate(this) && IsShown()) - UpdateWindowUI(wxUPDATE_UI_FROMIDLE); -} diff --git a/src/motif/window.cpp b/src/motif/window.cpp index 9fa2c9e..6078beb 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -1652,14 +1652,6 @@ void wxWindow::OnSysColourChanged(wxSysColourChangedEvent& event) } } -void wxWindow::OnInternalIdle() -{ - // This calls the UI-update mechanism (querying windows for - // menu/toolbar/control state information) - if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen()) - UpdateWindowUI(wxUPDATE_UI_FROMIDLE); -} - // ---------------------------------------------------------------------------- // accelerators // ---------------------------------------------------------------------------- diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 6e3bd67..0c44257 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1507,8 +1507,7 @@ void wxWindowMSW::OnInternalIdle() } #endif // !HAVE_TRACKMOUSEEVENT - if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen()) - UpdateWindowUI(wxUPDATE_UI_FROMIDLE); + wxWindowBase::OnInternalIdle(); } // Set this window to be the child of 'parent'. diff --git a/src/os2/window.cpp b/src/os2/window.cpp index ddcc14e..2974b88 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -1087,8 +1087,6 @@ void wxWindowOS2::OnIdle( (void)HandleWindowEvent(rEvent); } } - if (wxUpdateUIEvent::CanUpdate(this)) - UpdateWindowUI(wxUPDATE_UI_FROMIDLE); } // end of wxWindowOS2::OnIdle // diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index 6fe191e..ce444b9 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -1683,14 +1683,6 @@ wxWindow *wxWindowBase::DoFindFocus() return wxFindWindowFromWXWidget(wxWidgetImpl::FindFocus()); } -void wxWindowMac::OnInternalIdle() -{ - // This calls the UI-update mechanism (querying windows for - // menu/toolbar/control state information) - if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen()) - UpdateWindowUI(wxUPDATE_UI_FROMIDLE); -} - // Raise the window to the top of the Z order void wxWindowMac::Raise() { diff --git a/src/x11/window.cpp b/src/x11/window.cpp index 7c2e5ae..e9692b8 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -1318,10 +1318,7 @@ void wxWindowX11::OnInternalIdle() // Update invalidated regions. Update(); - // This calls the UI-update mechanism (querying windows for - // menu/toolbar/control state information) - if (wxUpdateUIEvent::CanUpdate((wxWindow*) this) && IsShownOnScreen()) - UpdateWindowUI(wxUPDATE_UI_FROMIDLE); + wxWindowBase::OnInternalIdle(); // Set the input focus if couldn't do it before if (m_needsInputFocus) -- 2.7.4