From: Paul Cornett Date: Fri, 7 Jan 2011 18:15:21 +0000 (+0000) Subject: move default OnInternalIdle processing to wxWindowBase X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6a50a2c4d3b39901947b68c81973016d56da75e1?ds=inline move default OnInternalIdle processing to wxWindowBase git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66633 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/dfb/window.h b/include/wx/dfb/window.h index b12d07ab87..f6018c7c3f 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 73f03e2945..164337796c 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 c752a8dd45..6b15764910 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 92f50b208b..8f72a27476 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 0069899bff..82c1793220 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 875a5ef093..c548f2171e 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 2260f8fe3d..cb68751aad 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 e458f80cda..82e0f7a3ee 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -2600,6 +2600,16 @@ void wxWindowBase::DoUpdateWindowUI(wxUpdateUIEvent& event) Show(event.GetShown()); } +// ---------------------------------------------------------------------------- +// 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 bfe64b16f0..51707653a8 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 0191a2f919..7012a7572c 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 b25f775019..969c7f9f36 100644 --- a/src/gtk/toolbar.cpp +++ b/src/gtk/toolbar.cpp @@ -747,20 +747,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 diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 18d5775a2f..4e3e560323 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 26e7dc2b44..85c1dfc1d1 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 dcefcff70c..c339054997 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 d46081e8b1..aad3ea0e6b 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 9fa2c9e3dc..6078beb09c 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 6e3bd673e4..0c442570e2 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 ddcc14e1d0..2974b884e3 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 6fe191e359..ce444b9913 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 7c2e5ae15b..e9692b8600 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)