From 5180055b697078e8c6ec7db485f1f1bfa3e91abd Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 9 Jul 2003 17:15:09 +0000 Subject: [PATCH] OnIdle -> OnInternalIdle git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/listctrl.h | 2 +- include/wx/generic/notebook.h | 2 +- include/wx/generic/splitter.h | 2 +- include/wx/generic/treectlg.h | 2 +- include/wx/html/htmlwin.h | 3 ++- src/generic/listctrl.cpp | 7 +++---- src/generic/logg.cpp | 2 -- src/generic/notebook.cpp | 8 +++++--- src/generic/splitter.cpp | 7 +++---- src/generic/treectlg.cpp | 5 +++-- src/html/htmlwin.cpp | 7 ++++--- 11 files changed, 24 insertions(+), 23 deletions(-) diff --git a/include/wx/generic/listctrl.h b/include/wx/generic/listctrl.h index 6a7dc88036..8fd3c33007 100644 --- a/include/wx/generic/listctrl.h +++ b/include/wx/generic/listctrl.h @@ -164,7 +164,7 @@ public: // implementation only from now on // ------------------------------- - void OnIdle( wxIdleEvent &event ); + void OnInternalIdle( ); void OnSize( wxSizeEvent &event ); // We have to hand down a few functions diff --git a/include/wx/generic/notebook.h b/include/wx/generic/notebook.h index ccb9227047..91cc13f725 100644 --- a/include/wx/generic/notebook.h +++ b/include/wx/generic/notebook.h @@ -113,7 +113,7 @@ public: // callbacks // --------- void OnSize(wxSizeEvent& event); - void OnIdle(wxIdleEvent& event); + void OnInternalIdle(); void OnSelChange(wxNotebookEvent& event); void OnSetFocus(wxFocusEvent& event); void OnNavigationKey(wxNavigationKeyEvent& event); diff --git a/include/wx/generic/splitter.h b/include/wx/generic/splitter.h index c11307d69a..e94f7a9068 100644 --- a/include/wx/generic/splitter.h +++ b/include/wx/generic/splitter.h @@ -190,7 +190,7 @@ public: void OnSize(wxSizeEvent& event); // In live mode, resize child windows in idle time - void OnIdle(wxIdleEvent& event); + void OnInternalIdle(); // Draws borders virtual void DrawBorders(wxDC& dc); diff --git a/include/wx/generic/treectlg.h b/include/wx/generic/treectlg.h index 72da30c0f2..d7856f0ea6 100644 --- a/include/wx/generic/treectlg.h +++ b/include/wx/generic/treectlg.h @@ -362,7 +362,7 @@ public: void OnKillFocus( wxFocusEvent &event ); void OnChar( wxKeyEvent &event ); void OnMouse( wxMouseEvent &event ); - void OnIdle( wxIdleEvent &event ); + void OnInternalIdle( ); // implementation helpers protected: diff --git a/include/wx/html/htmlwin.h b/include/wx/html/htmlwin.h index 8ac2730813..da9d6431a9 100644 --- a/include/wx/html/htmlwin.h +++ b/include/wx/html/htmlwin.h @@ -214,7 +214,6 @@ protected: void OnMouseMove(wxMouseEvent& event); void OnMouseDown(wxMouseEvent& event); void OnMouseUp(wxMouseEvent& event); - void OnIdle(wxIdleEvent& event); #if wxUSE_CLIPBOARD void OnKeyUp(wxKeyEvent& event); void OnDoubleClick(wxMouseEvent& event); @@ -223,6 +222,8 @@ protected: void OnMouseLeave(wxMouseEvent& event); #endif // wxUSE_CLIPBOARD + virtual void OnInternalIdle(); + // Returns new filter (will be stored into m_DefaultFilter variable) virtual wxHtmlFilter *GetDefaultFilter() {return new wxHtmlFilterPlainText;} diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 93a76fd0fd..17ae8faab9 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -4432,7 +4432,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxGenericListCtrl, wxControl) BEGIN_EVENT_TABLE(wxGenericListCtrl,wxControl) EVT_SIZE(wxGenericListCtrl::OnSize) - EVT_IDLE(wxGenericListCtrl::OnIdle) END_EVENT_TABLE() wxGenericListCtrl::wxGenericListCtrl() @@ -5035,10 +5034,10 @@ void wxGenericListCtrl::ResizeReportView(bool showHeader) } } -void wxGenericListCtrl::OnIdle( wxIdleEvent & event ) +void wxGenericListCtrl::OnInternalIdle() { - event.Skip(); - + wxWindow::OnInternalIdle(); + // do it only if needed if ( !m_mainWin->m_dirty ) return; diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index 18356d6b23..b56c4ef1cd 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -432,8 +432,6 @@ public: #endif // wxUSE_FILE void OnClear(wxCommandEvent& event); - void OnIdle(wxIdleEvent&); - // accessors wxTextCtrl *TextCtrl() const { return m_pTextCtrl; } diff --git a/src/generic/notebook.cpp b/src/generic/notebook.cpp index e64231b122..853fc8ab7d 100644 --- a/src/generic/notebook.cpp +++ b/src/generic/notebook.cpp @@ -56,7 +56,6 @@ BEGIN_EVENT_TABLE(wxNotebook, wxControl) EVT_MOUSE_EVENTS(wxNotebook::OnMouseEvent) EVT_SET_FOCUS(wxNotebook::OnSetFocus) EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey) -// EVT_IDLE(wxNotebook::OnIdle) END_EVENT_TABLE() IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl) @@ -457,8 +456,11 @@ void wxNotebook::OnSize(wxSizeEvent& event) // This was supposed to cure the non-display of the notebook // until the user resizes the window. // What's going on? -void wxNotebook::OnIdle(wxIdleEvent& event) +void wxNotebook::OnInternalIdle() { + wxWindow::OnInternalIdle(); + +#if 0 static bool s_bFirstTime = TRUE; if ( s_bFirstTime ) { /* @@ -478,7 +480,7 @@ void wxNotebook::OnIdle(wxIdleEvent& event) */ s_bFirstTime = FALSE; } - event.Skip(); +#endif } // Implementation: calculate the layout of the view rect diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index 01e143d8b8..6c5965e49a 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -50,7 +50,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxSplitterEvent, wxNotifyEvent) BEGIN_EVENT_TABLE(wxSplitterWindow, wxWindow) EVT_PAINT(wxSplitterWindow::OnPaint) EVT_SIZE(wxSplitterWindow::OnSize) - EVT_IDLE(wxSplitterWindow::OnIdle) EVT_MOUSE_EVENTS(wxSplitterWindow::OnMouseEvent) #if defined( __WXMSW__ ) || defined( __WXMAC__) @@ -156,12 +155,12 @@ void wxSplitterWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) DrawSash(dc); } -void wxSplitterWindow::OnIdle(wxIdleEvent& event) +void wxSplitterWindow::OnInternalIdle() { + wxWindow::OnInternalIdle(); + if (m_needUpdating) SizeWindows(); - - event.Skip(); } void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event) diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 9255fb67cb..b7140c589a 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -716,7 +716,6 @@ BEGIN_EVENT_TABLE(wxGenericTreeCtrl,wxScrolledWindow) EVT_CHAR (wxGenericTreeCtrl::OnChar) EVT_SET_FOCUS (wxGenericTreeCtrl::OnSetFocus) EVT_KILL_FOCUS (wxGenericTreeCtrl::OnKillFocus) - EVT_IDLE (wxGenericTreeCtrl::OnIdle) END_EVENT_TABLE() #if !defined(__WXMSW__) || defined(__WIN16__) || defined(__WXUNIVERSAL__) @@ -3158,8 +3157,10 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event ) } } -void wxGenericTreeCtrl::OnIdle( wxIdleEvent &WXUNUSED(event) ) +void wxGenericTreeCtrl::OnInternalIdle() { + wxWindow::OnInternalIdle(); + // Check if we need to select the root item // because nothing else has been selected. // Delaying it means that we can invoke event handlers diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index b2ddf59492..8afb3a1fba 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -964,8 +964,10 @@ void wxHtmlWindow::OnMouseUp(wxMouseEvent& event) -void wxHtmlWindow::OnIdle(wxIdleEvent& WXUNUSED(event)) -{ +void wxHtmlWindow::OnInternalIdle() +{ + wxWindow::OnInternalIdle(); + if (m_tmpMouseMoved && (m_Cell != NULL)) { #ifdef DEBUG_HTML_SELECTION @@ -1312,7 +1314,6 @@ BEGIN_EVENT_TABLE(wxHtmlWindow, wxScrolledWindow) EVT_LEFT_UP(wxHtmlWindow::OnMouseUp) EVT_RIGHT_UP(wxHtmlWindow::OnMouseUp) EVT_MOTION(wxHtmlWindow::OnMouseMove) - EVT_IDLE(wxHtmlWindow::OnIdle) EVT_ERASE_BACKGROUND(wxHtmlWindow::OnEraseBackground) EVT_PAINT(wxHtmlWindow::OnPaint) #if wxUSE_CLIPBOARD -- 2.47.2