move default OnInternalIdle processing to wxWindowBase

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66633 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2011-01-07 18:15:21 +00:00
parent 1bf29304cc
commit 6a50a2c4d3
20 changed files with 16 additions and 92 deletions

View File

@@ -100,8 +100,6 @@ public:
// returns toplevel window the window belongs to // returns toplevel window the window belongs to
wxNonOwnedWindow *GetTLW() const { return m_tlw; } wxNonOwnedWindow *GetTLW() const { return m_tlw; }
void OnInternalIdle();
virtual bool IsDoubleBuffered() const { return true; } virtual bool IsDoubleBuffered() const { return true; }
protected: protected:

View File

@@ -46,8 +46,6 @@ public:
virtual wxVisualAttributes GetDefaultAttributes() const; virtual wxVisualAttributes GetDefaultAttributes() const;
virtual void OnInternalIdle();
protected: protected:
virtual wxSize DoGetBestSize() const; virtual wxSize DoGetBestSize() const;
void PostCreation(const wxSize& size); void PostCreation(const wxSize& size);

View File

@@ -59,8 +59,6 @@ public:
// implementation from now on // implementation from now on
// -------------------------- // --------------------------
void OnInternalIdle();
protected: protected:
virtual wxSize DoGetBestSize() const; virtual wxSize DoGetBestSize() const;
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const; virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;

View File

@@ -89,8 +89,6 @@ public:
// implementation from now on // implementation from now on
// -------------------------- // --------------------------
void OnInternalIdle();
protected: protected:
virtual void DoFreeze(); virtual void DoFreeze();
virtual void DoThaw(); virtual void DoThaw();

View File

@@ -138,9 +138,6 @@ public:
void ClearUpdateRegion() { m_updateRegion.Clear(); } void ClearUpdateRegion() { m_updateRegion.Clear(); }
void SetUpdateRegion(const wxRegion& region) { m_updateRegion = region; } void SetUpdateRegion(const wxRegion& region) { m_updateRegion = region; }
// Process idle (send update events)
void OnInternalIdle();
// post-creation activities // post-creation activities
void PostCreation(); void PostCreation();

View File

@@ -156,8 +156,6 @@ public:
static long MacRemoveBordersFromStyle( long style ) ; static long MacRemoveBordersFromStyle( long style ) ;
public: public:
void OnInternalIdle();
// For implementation purposes: // For implementation purposes:
// sometimes decorations make the client area smaller // sometimes decorations make the client area smaller
virtual wxPoint GetClientAreaOrigin() const; virtual wxPoint GetClientAreaOrigin() const;

View File

@@ -1370,7 +1370,7 @@ public:
// virtual function for implementing internal idle // virtual function for implementing internal idle
// behaviour // behaviour
virtual void OnInternalIdle() {} virtual void OnInternalIdle();
// call internal idle recursively // call internal idle recursively
// void ProcessInternalIdle() ; // void ProcessInternalIdle() ;

View File

@@ -2600,6 +2600,16 @@ void wxWindowBase::DoUpdateWindowUI(wxUpdateUIEvent& event)
Show(event.GetShown()); Show(event.GetShown());
} }
// ----------------------------------------------------------------------------
// Idle processing
// ----------------------------------------------------------------------------
void wxWindowBase::OnInternalIdle()
{
if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen())
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// dialog units translations // dialog units translations
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -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 // Find the wxWindow at the current mouse position, returning the mouse
// position. // position.
wxWindow* wxFindWindowAtPointer(wxPoint& pt) wxWindow* wxFindWindowAtPointer(wxPoint& pt)

View File

@@ -314,17 +314,4 @@ wxControl::GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromAdj_t widget_new,
return attr; return attr;
} }
// ----------------------------------------------------------------------------
// idle handling
// ----------------------------------------------------------------------------
void wxControl::OnInternalIdle()
{
if ( GTKShowFromOnIdle() )
return;
if ( wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen() )
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}
#endif // wxUSE_CONTROLS #endif // wxUSE_CONTROLS

View File

@@ -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 // static

View File

@@ -1144,7 +1144,7 @@ wxSize& wxTopLevelWindowGTK::GetCachedDecorSize()
void wxTopLevelWindowGTK::OnInternalIdle() void wxTopLevelWindowGTK::OnInternalIdle()
{ {
wxWindow::OnInternalIdle(); wxTopLevelWindowBase::OnInternalIdle();
// Synthetize activate events. // Synthetize activate events.
if ( g_sendActivateEvent != -1 ) if ( g_sendActivateEvent != -1 )

View File

@@ -2615,8 +2615,7 @@ void wxWindowGTK::OnInternalIdle()
m_needsStyleChange = false; m_needsStyleChange = false;
} }
if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen()) wxWindowBase::OnInternalIdle();
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
} }
void wxWindowGTK::DoGetSize( int *width, int *height ) const void wxWindowGTK::DoGetSize( int *width, int *height ) const

View File

@@ -2960,8 +2960,7 @@ void wxWindowGTK::OnInternalIdle()
} }
} }
if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen()) wxWindowBase::OnInternalIdle();
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
} }
void wxWindowGTK::DoGetSize( int *width, int *height ) const void wxWindowGTK::DoGetSize( int *width, int *height ) const

View File

@@ -1206,14 +1206,3 @@ wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
window_t *wnd = MGL_wmGetWindowAtPosition(g_winMng, pt.x, pt.y); window_t *wnd = MGL_wmGetWindowAtPosition(g_winMng, pt.x, pt.y);
return (wxWindow*)wnd->userData; return (wxWindow*)wnd->userData;
} }
// ---------------------------------------------------------------------------
// idle events processing
// ---------------------------------------------------------------------------
void wxWindowMGL::OnInternalIdle()
{
if (wxUpdateUIEvent::CanUpdate(this) && IsShown())
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}

View File

@@ -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 // accelerators
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -1507,8 +1507,7 @@ void wxWindowMSW::OnInternalIdle()
} }
#endif // !HAVE_TRACKMOUSEEVENT #endif // !HAVE_TRACKMOUSEEVENT
if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen()) wxWindowBase::OnInternalIdle();
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
} }
// Set this window to be the child of 'parent'. // Set this window to be the child of 'parent'.

View File

@@ -1087,8 +1087,6 @@ void wxWindowOS2::OnIdle(
(void)HandleWindowEvent(rEvent); (void)HandleWindowEvent(rEvent);
} }
} }
if (wxUpdateUIEvent::CanUpdate(this))
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
} // end of wxWindowOS2::OnIdle } // end of wxWindowOS2::OnIdle
// //

View File

@@ -1683,14 +1683,6 @@ wxWindow *wxWindowBase::DoFindFocus()
return wxFindWindowFromWXWidget(wxWidgetImpl::FindFocus()); 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 // Raise the window to the top of the Z order
void wxWindowMac::Raise() void wxWindowMac::Raise()
{ {

View File

@@ -1318,10 +1318,7 @@ void wxWindowX11::OnInternalIdle()
// Update invalidated regions. // Update invalidated regions.
Update(); Update();
// This calls the UI-update mechanism (querying windows for wxWindowBase::OnInternalIdle();
// menu/toolbar/control state information)
if (wxUpdateUIEvent::CanUpdate((wxWindow*) this) && IsShownOnScreen())
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
// Set the input focus if couldn't do it before // Set the input focus if couldn't do it before
if (m_needsInputFocus) if (m_needsInputFocus)