From 937013e0fd914d4c42f9f5ec98da665986b93dfa Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 29 Nov 2007 17:00:58 +0000 Subject: [PATCH] 1. added wxEvtHandler::SafelyProcessEvent() and wxWindow::HandleWindowEvent() to correctly handle exceptions in even handlers in wxGTK 2. use HandleWindowEvent() everywhere as more obvious and convenient shortcut for GetEventHandler()->ProcessEvent(); also for consistency with wxGTK where it's required git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50329 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/evthand.tex | 24 +++++++++ docs/latex/wx/window.tex | 7 +++ include/wx/event.h | 6 +++ include/wx/window.h | 7 +++ src/cocoa/choice.mm | 2 +- src/cocoa/combobox.mm | 4 +- src/cocoa/control.mm | 2 +- src/cocoa/notebook.mm | 2 +- src/cocoa/scrolbar.mm | 2 +- src/cocoa/slider.mm | 2 +- src/cocoa/spinbutt.mm | 2 +- src/cocoa/textctrl.mm | 2 +- src/cocoa/toplevel.mm | 6 +-- src/cocoa/window.mm | 28 +++++------ src/common/event.cpp | 37 ++++++++++++++ src/common/wincmn.cpp | 5 ++ src/dfb/nonownedwnd.cpp | 2 +- src/dfb/toplevel.cpp | 2 +- src/dfb/window.cpp | 22 ++++----- src/gtk/bmpbuttn.cpp | 2 +- src/gtk/button.cpp | 2 +- src/gtk/checkbox.cpp | 2 +- src/gtk/checklst.cpp | 2 +- src/gtk/choice.cpp | 2 +- src/gtk/clrpicker.cpp | 2 +- src/gtk/collpane.cpp | 4 +- src/gtk/combobox.cpp | 6 +-- src/gtk/dataview.cpp | 26 +++++----- src/gtk/dirdlg.cpp | 4 +- src/gtk/filedlg.cpp | 4 +- src/gtk/filepicker.cpp | 4 +- src/gtk/fontdlg.cpp | 4 +- src/gtk/fontpicker.cpp | 2 +- src/gtk/glcanvas.cpp | 6 +-- src/gtk/listbox.cpp | 10 ++-- src/gtk/mdi.cpp | 4 +- src/gtk/menu.cpp | 14 +++--- src/gtk/popupwin.cpp | 6 +-- src/gtk/radiobox.cpp | 8 +-- src/gtk/radiobut.cpp | 2 +- src/gtk/scrolbar.cpp | 8 +-- src/gtk/slider.cpp | 6 +-- src/gtk/spinbutt.cpp | 4 +- src/gtk/spinctrl.cpp | 6 +-- src/gtk/tbargtk.cpp | 2 +- src/gtk/textctrl.cpp | 8 +-- src/gtk/textentry.cpp | 2 +- src/gtk/tglbtn.cpp | 2 +- src/gtk/toplevel.cpp | 12 ++--- src/gtk/window.cpp | 36 +++++++------- src/gtk1/bmpbuttn.cpp | 2 +- src/gtk1/button.cpp | 2 +- src/gtk1/checkbox.cpp | 2 +- src/gtk1/choice.cpp | 2 +- src/gtk1/combobox.cpp | 12 ++--- src/gtk1/dialog.cpp | 2 +- src/gtk1/fontdlg.cpp | 4 +- src/gtk1/frame.cpp | 4 +- src/gtk1/glcanvas.cpp | 6 +-- src/gtk1/listbox.cpp | 18 +++---- src/gtk1/mdi.cpp | 4 +- src/gtk1/menu.cpp | 8 +-- src/gtk1/notebook.cpp | 2 +- src/gtk1/popupwin.cpp | 4 +- src/gtk1/radiobox.cpp | 6 +-- src/gtk1/radiobut.cpp | 2 +- src/gtk1/scrolbar.cpp | 6 +-- src/gtk1/slider.cpp | 6 +-- src/gtk1/spinbutt.cpp | 4 +- src/gtk1/spinctrl.cpp | 6 +-- src/gtk1/textctrl.cpp | 6 +-- src/gtk1/tglbtn.cpp | 2 +- src/gtk1/toplevel.cpp | 8 +-- src/gtk1/window.cpp | 58 +++++++++++----------- src/mac/carbon/app.cpp | 14 +++--- src/mac/carbon/checklst.cpp | 2 +- src/mac/carbon/combobox.cpp | 12 ++--- src/mac/carbon/combobxc.cpp | 6 +-- src/mac/carbon/control.cpp | 2 +- src/mac/carbon/databrow.cpp | 18 +++---- src/mac/carbon/dataview.cpp | 8 +-- src/mac/carbon/fontdlg.cpp | 2 +- src/mac/carbon/listbox.cpp | 2 +- src/mac/carbon/listctrl_mac.cpp | 20 ++++---- src/mac/carbon/menu.cpp | 10 ++-- src/mac/carbon/notebmac.cpp | 8 +-- src/mac/carbon/popupwin.cpp | 2 +- src/mac/carbon/scrolbar.cpp | 4 +- src/mac/carbon/slider.cpp | 8 +-- src/mac/carbon/spinbutt.cpp | 4 +- src/mac/carbon/spinctrl.cpp | 6 +-- src/mac/carbon/textctrl.cpp | 6 +-- src/mac/carbon/toplevel.cpp | 30 +++++------ src/mac/carbon/treectrl.cpp | 4 +- src/mac/carbon/window.cpp | 30 +++++------ src/mgl/toplevel.cpp | 2 +- src/mgl/window.cpp | 34 ++++++------- src/motif/checklst.cpp | 2 +- src/motif/combobox_native.cpp | 4 +- src/motif/control.cpp | 2 +- src/motif/evtloop.cpp | 4 +- src/motif/frame.cpp | 6 +-- src/motif/listbox.cpp | 4 +- src/motif/mdi.cpp | 14 +++--- src/motif/menu.cpp | 2 +- src/motif/menuitem.cpp | 6 +-- src/motif/scrolbar.cpp | 2 +- src/motif/slider.cpp | 4 +- src/motif/spinbutt.cpp | 4 +- src/motif/textctrl.cpp | 6 +-- src/motif/toplevel.cpp | 10 ++-- src/motif/window.cpp | 30 +++++------ src/msw/control.cpp | 4 +- src/msw/datectrl.cpp | 2 +- src/msw/dialog.cpp | 2 +- src/msw/frame.cpp | 8 +-- src/msw/listbox.cpp | 2 +- src/msw/listctrl.cpp | 4 +- src/msw/mdi.cpp | 6 +-- src/msw/notebook.cpp | 6 +-- src/msw/scrolbar.cpp | 2 +- src/msw/slider95.cpp | 4 +- src/msw/spinbutt.cpp | 4 +- src/msw/spinctrl.cpp | 8 +-- src/msw/statbr95.cpp | 2 +- src/msw/tabctrl.cpp | 2 +- src/msw/tbar95.cpp | 2 +- src/msw/textctrl.cpp | 4 +- src/msw/toplevel.cpp | 2 +- src/msw/treectrl.cpp | 14 +++--- src/msw/window.cpp | 88 ++++++++++++++++----------------- src/os2/control.cpp | 2 +- src/os2/frame.cpp | 6 +-- src/os2/listbox.cpp | 2 +- src/os2/listctrl.cpp | 2 +- src/os2/notebook.cpp | 8 +-- src/os2/scrolbar.cpp | 2 +- src/os2/slider.cpp | 4 +- src/os2/spinbutt.cpp | 2 +- src/os2/spinctrl.cpp | 10 ++-- src/os2/textctrl.cpp | 6 +-- src/os2/toplevel.cpp | 4 +- src/os2/treectrl.cpp | 4 +- src/os2/window.cpp | 52 +++++++++---------- src/palmos/control.cpp | 2 +- src/palmos/frame.cpp | 2 +- src/palmos/slider.cpp | 4 +- src/palmos/toplevel.cpp | 4 +- src/x11/app.cpp | 18 +++---- src/x11/textctrl.cpp | 2 +- src/x11/toplevel.cpp | 4 +- src/x11/window.cpp | 8 +-- 152 files changed, 638 insertions(+), 552 deletions(-) diff --git a/docs/latex/wx/evthand.tex b/docs/latex/wx/evthand.tex index a52f29a4eb..180636f90d 100644 --- a/docs/latex/wx/evthand.tex +++ b/docs/latex/wx/evthand.tex @@ -274,6 +274,30 @@ recursively applied to the parent window's event handler. If this returns true, \helpref{wxEvtHandler::SearchEventTable}{wxevthandlersearcheventtable} + +\membersection{wxEvtHandler::SafelyProcessEvent}\label{wxevthandlersafelyprocessevent} + +\func{bool}{SafelyProcessEvent}{\param{wxEvent\& }{event}} + +Processes an event by calling \helpref{ProcessEvent}{wxevthandlerprocessevent} +and handles any exceptions that occur in the process. If an exception is +thrown in event handler, \helpref{wxApp::OnExceptionInMainLoop}{wxapponexceptioninmainloop} +is called. + +\wxheading{Parameters} + +\docparam{event}{Event to process.} + +\wxheading{Return value} + +\true if the event was processed, \false if no handler was found or an +exception was thrown. + +\wxheading{See also} + +\helpref{wxWindow::HandleWindowEvent}{wxwindowhandlewindowevent} + + \membersection{wxEvtHandler::SearchEventTable}\label{wxevthandlersearcheventtable} \func{virtual bool}{SearchEventTable}{\param{wxEventTable\& }{table}, \param{wxEvent\& }{event}} diff --git a/docs/latex/wx/window.tex b/docs/latex/wx/window.tex index 334aa37ffd..0e3bbfb3e4 100644 --- a/docs/latex/wx/window.tex +++ b/docs/latex/wx/window.tex @@ -1539,6 +1539,13 @@ Returns the value previously passed to \helpref{wxWindow::SetWindowVariant}{wxwindowsetwindowvariant}. +\membersection{wxWindow::HandleWindowEvent}\label{wxwindowhandlewindowevent} + +\func{bool}{HandleWindowEvent}{\param{wxEvent\& }{event}} + +Shorthand for \texttt{\helpref{GetEventHandler}{wxwindowgeteventhandler}()->\helpref{SafelyProcessEvent}{wxevthandlersafelyprocessevent}(event)}. + + \membersection{wxWindow::HasCapture}\label{wxwindowhascapture} \constfunc{virtual bool}{HasCapture}{\void} diff --git a/include/wx/event.h b/include/wx/event.h index d63a1140ee..5e5c4177a2 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -2363,6 +2363,12 @@ public: // process an event right now virtual bool ProcessEvent(wxEvent& event); + // Process an event by calling ProcessEvent and handling any exceptions + // thrown by event handlers. It's mostly useful when processing wx events + // when called from C code (e.g. in GTK+ callback) when the exception + // wouldn't correctly propagate to wxEventLoop. + bool SafelyProcessEvent(wxEvent& event); + // add an event to be processed later virtual void AddPendingEvent(const wxEvent& event); diff --git a/include/wx/window.h b/include/wx/window.h index 334df3c2b1..852c4c3b59 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -745,6 +745,13 @@ public: // be there) bool RemoveEventHandler(wxEvtHandler *handler); + // Process an event by calling GetEventHandler()->ProcessEvent() and + // handling any exceptions thrown by event handlers. It's mostly useful + // when processing wx events when called from C code (e.g. in GTK+ + // callback) when the exception wouldn't correctly propagate to + // wxEventLoop. + bool HandleWindowEvent(wxEvent& event) const; + // validators // ---------- diff --git a/src/cocoa/choice.mm b/src/cocoa/choice.mm index 334444cdcb..51e6039a4b 100644 --- a/src/cocoa/choice.mm +++ b/src/cocoa/choice.mm @@ -122,7 +122,7 @@ void wxChoice::CocoaNotification_menuDidSendAction(WX_NSNotification notificatio event.SetInt(index); event.SetEventObject(this); event.SetString(GetStringSelection()); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } void wxChoice::DoClear() diff --git a/src/cocoa/combobox.mm b/src/cocoa/combobox.mm index 167078c5b9..c65d6b5a70 100644 --- a/src/cocoa/combobox.mm +++ b/src/cocoa/combobox.mm @@ -229,14 +229,14 @@ void wxComboBox::doWxEvent(int nEvent) event2.SetInt(GetSelection()); event2.SetEventObject(this); event2.SetString(GetStringSelection()); - GetEventHandler()->ProcessEvent(event2); + HandleWindowEvent(event2); // For consistency with MSW and GTK, also send a text updated event // After all, the text is updated when a selection is made wxCommandEvent TextEvent( wxEVT_COMMAND_TEXT_UPDATED, GetId() ); TextEvent.SetString( GetStringSelection() ); TextEvent.SetEventObject( this ); - GetEventHandler()->ProcessEvent( TextEvent ); + HandleWindowEvent( TextEvent ); } diff --git a/src/cocoa/control.mm b/src/cocoa/control.mm index 5447ea5470..afceba12cb 100644 --- a/src/cocoa/control.mm +++ b/src/cocoa/control.mm @@ -97,7 +97,7 @@ wxSize wxControl::DoGetBestSize() const bool wxControl::ProcessCommand(wxCommandEvent& event) { - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } void wxControl::CocoaSetEnabled(bool enable) diff --git a/src/cocoa/notebook.mm b/src/cocoa/notebook.mm index 7c7d648541..10e04d98e7 100644 --- a/src/cocoa/notebook.mm +++ b/src/cocoa/notebook.mm @@ -325,7 +325,7 @@ bool wxNotebook::CocoaDelegate_tabView_shouldSelectTabViewItem(WX_NSTabViewItem wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, GetId(), [GetNSTabView() indexOfTabViewItem:tabViewItem], GetSelection()); event.SetEventObject(this); - return !GetEventHandler()->ProcessEvent(event) || event.IsAllowed(); + return !HandleWindowEvent(event) || event.IsAllowed(); } #endif // wxUSE_NOTEBOOK diff --git a/src/cocoa/scrolbar.mm b/src/cocoa/scrolbar.mm index bfda3d2416..1ce04db251 100644 --- a/src/cocoa/scrolbar.mm +++ b/src/cocoa/scrolbar.mm @@ -176,7 +176,7 @@ void wxScrollBar::Cocoa_wxNSScrollerAction() wxScrollEvent event(command, GetId(), GetThumbPosition(), HasFlag(wxSB_VERTICAL)?wxVERTICAL:wxHORIZONTAL); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } #endif // wxUSE_SCROLLBAR diff --git a/src/cocoa/slider.mm b/src/cocoa/slider.mm index 888a5d809f..b198acdcb8 100644 --- a/src/cocoa/slider.mm +++ b/src/cocoa/slider.mm @@ -111,7 +111,7 @@ void wxSlider::ProcessEventType(wxEventType commandType) { wxScrollEvent event(commandType, GetId(), GetValue(), HasFlag(wxSL_VERTICAL)?wxVERTICAL:wxHORIZONTAL); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } static inline wxEventType wxSliderEventTypeForKeyFromEvent(NSEvent *theEvent) diff --git a/src/cocoa/spinbutt.mm b/src/cocoa/spinbutt.mm index a304c38be5..53ce3b29a6 100644 --- a/src/cocoa/spinbutt.mm +++ b/src/cocoa/spinbutt.mm @@ -80,7 +80,7 @@ void wxSpinButton::CocoaTarget_action() wxSpinEvent event(wxEVT_SCROLL_THUMBTRACK, GetId()); event.SetPosition(GetValue()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } #endif // wxUSE_SPINBTN diff --git a/src/cocoa/textctrl.mm b/src/cocoa/textctrl.mm index 67da0acd68..d33626cd18 100644 --- a/src/cocoa/textctrl.mm +++ b/src/cocoa/textctrl.mm @@ -102,7 +102,7 @@ void wxTextCtrl::CocoaTarget_action(void) //event.SetString(GetValue()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } void wxTextCtrl::AppendText(wxString const&) diff --git a/src/cocoa/toplevel.mm b/src/cocoa/toplevel.mm index 3e73b00ceb..626dba2773 100644 --- a/src/cocoa/toplevel.mm +++ b/src/cocoa/toplevel.mm @@ -222,7 +222,7 @@ void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void) wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey"),this); wxActivateEvent event(wxEVT_ACTIVATE, true, GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void) @@ -230,7 +230,7 @@ void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void) wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignKey"),this); wxActivateEvent event(wxEVT_ACTIVATE, false, GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeMain(void) @@ -301,7 +301,7 @@ bool wxTopLevelWindowCocoa::Show(bool show) // is shown. I doubt this will cause any problems though. wxSizeEvent event(GetSize(), GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); [m_cocoaNSWindow makeKeyAndOrderFront:m_cocoaNSWindow]; } diff --git a/src/cocoa/window.mm b/src/cocoa/window.mm index 0412529830..5fdc4548dd 100644 --- a/src/cocoa/window.mm +++ b/src/cocoa/window.mm @@ -985,7 +985,7 @@ void wxWindowCocoaScrollView::_wx_doScroller(NSScroller *sender) } wxScrollWinEvent event(commandType, scrollpos, orientation); event.SetEventObject(m_owner); - m_owner->GetEventHandler()->ProcessEvent(event); + m_owner->HandleWindowEvent(event); } void wxWindowCocoaScrollView::UpdateSizes() @@ -1010,7 +1010,7 @@ void wxWindowCocoaScrollView::Cocoa_FrameChanged(void) wxLogTrace(wxTRACE_COCOA,wxT("wxWindowCocoaScrollView=%p::Cocoa_FrameChanged for wxWindow %p"), this, m_owner); wxSizeEvent event(m_owner->GetSize(), m_owner->GetId()); event.SetEventObject(m_owner); - m_owner->GetEventHandler()->ProcessEvent(event); + m_owner->HandleWindowEvent(event); UpdateSizes(); } @@ -1191,7 +1191,7 @@ bool wxWindowCocoa::Cocoa_drawRect(const NSRect &rect) wxPaintEvent event(m_windowId); event.SetEventObject(this); - bool ret = GetEventHandler()->ProcessEvent(event); + bool ret = HandleWindowEvent(event); m_isInPaint = false; return ret; } @@ -1261,7 +1261,7 @@ bool wxWindowCocoa::Cocoa_mouseMoved(WX_NSEvent theEvent) wxMouseEvent event(wxEVT_MOTION); InitMouseEvent(event,theEvent); wxLogTrace(wxTRACE_COCOA,wxT("wxWindow=%p::Cocoa_mouseMoved @%d,%d"),this,event.m_x,event.m_y); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } void wxWindowCocoa::Cocoa_synthesizeMouseMoved() @@ -1282,7 +1282,7 @@ void wxWindowCocoa::Cocoa_synthesizeMouseMoved() event.SetId(GetId()); wxLogTrace(wxTRACE_COCOA,wxT("wxwin=%p Synthesized Mouse Moved @%d,%d"),this,event.m_x,event.m_y); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } bool wxWindowCocoa::Cocoa_mouseEntered(WX_NSEvent theEvent) @@ -1300,7 +1300,7 @@ bool wxWindowCocoa::Cocoa_mouseEntered(WX_NSEvent theEvent) wxMouseEvent event(wxEVT_ENTER_WINDOW); InitMouseEvent(event,theEvent); wxLogTrace(wxTRACE_COCOA_TrackingRect,wxT("wxwin=%p Mouse Entered TR#%d @%d,%d"),this,[theEvent trackingNumber], event.m_x,event.m_y); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } else return false; @@ -1315,7 +1315,7 @@ bool wxWindowCocoa::Cocoa_mouseExited(WX_NSEvent theEvent) wxMouseEvent event(wxEVT_LEAVE_WINDOW); InitMouseEvent(event,theEvent); wxLogTrace(wxTRACE_COCOA_TrackingRect,wxT("wxwin=%p Mouse Exited TR#%d @%d,%d"),this,[theEvent trackingNumber],event.m_x,event.m_y); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } else return false; @@ -1326,7 +1326,7 @@ bool wxWindowCocoa::Cocoa_mouseDown(WX_NSEvent theEvent) wxMouseEvent event([theEvent clickCount]<2?wxEVT_LEFT_DOWN:wxEVT_LEFT_DCLICK); InitMouseEvent(event,theEvent); wxLogTrace(wxTRACE_COCOA,wxT("Mouse Down @%d,%d num clicks=%d"),event.m_x,event.m_y,[theEvent clickCount]); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowCocoa::Cocoa_mouseDragged(WX_NSEvent theEvent) @@ -1335,7 +1335,7 @@ bool wxWindowCocoa::Cocoa_mouseDragged(WX_NSEvent theEvent) InitMouseEvent(event,theEvent); event.m_leftDown = true; wxLogTrace(wxTRACE_COCOA,wxT("Mouse Drag @%d,%d"),event.m_x,event.m_y); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowCocoa::Cocoa_mouseUp(WX_NSEvent theEvent) @@ -1343,7 +1343,7 @@ bool wxWindowCocoa::Cocoa_mouseUp(WX_NSEvent theEvent) wxMouseEvent event(wxEVT_LEFT_UP); InitMouseEvent(event,theEvent); wxLogTrace(wxTRACE_COCOA,wxT("Mouse Up @%d,%d"),event.m_x,event.m_y); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowCocoa::Cocoa_rightMouseDown(WX_NSEvent theEvent) @@ -1351,7 +1351,7 @@ bool wxWindowCocoa::Cocoa_rightMouseDown(WX_NSEvent theEvent) wxMouseEvent event([theEvent clickCount]<2?wxEVT_RIGHT_DOWN:wxEVT_RIGHT_DCLICK); InitMouseEvent(event,theEvent); wxLogDebug(wxT("Mouse Down @%d,%d num clicks=%d"),event.m_x,event.m_y,[theEvent clickCount]); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowCocoa::Cocoa_rightMouseDragged(WX_NSEvent theEvent) @@ -1360,7 +1360,7 @@ bool wxWindowCocoa::Cocoa_rightMouseDragged(WX_NSEvent theEvent) InitMouseEvent(event,theEvent); event.m_rightDown = true; wxLogDebug(wxT("Mouse Drag @%d,%d"),event.m_x,event.m_y); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowCocoa::Cocoa_rightMouseUp(WX_NSEvent theEvent) @@ -1368,7 +1368,7 @@ bool wxWindowCocoa::Cocoa_rightMouseUp(WX_NSEvent theEvent) wxMouseEvent event(wxEVT_RIGHT_UP); InitMouseEvent(event,theEvent); wxLogDebug(wxT("Mouse Up @%d,%d"),event.m_x,event.m_y); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowCocoa::Cocoa_otherMouseDown(WX_NSEvent theEvent) @@ -1401,7 +1401,7 @@ void wxWindowCocoa::Cocoa_FrameChanged(void) m_visibleTrackingRectManager->RebuildTrackingRect(); wxSizeEvent event(GetSize(), m_windowId); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } else { diff --git a/src/common/event.cpp b/src/common/event.cpp index 5654a132fb..0b196d5d72 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -25,6 +25,7 @@ #endif #include "wx/event.h" +#include "wx/evtloop.h" #ifndef WX_PRECOMP #include "wx/list.h" @@ -1314,6 +1315,42 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event) return TryParent(event); } +bool wxEvtHandler::SafelyProcessEvent(wxEvent& event) +{ +#if wxUSE_EXCEPTIONS + try + { +#endif + return ProcessEvent(event); +#if wxUSE_EXCEPTIONS + } + catch ( ... ) + { + wxEventLoopBase *loop = wxEventLoopBase::GetActive(); + try + { + if ( !wxTheApp || !wxTheApp->OnExceptionInMainLoop() ) + { + if ( loop ) + loop->Exit(); + } + //else: continue running current event loop + + return false; + } + catch ( ... ) + { + // OnExceptionInMainLoop() threw, possibly rethrowing the same + // exception again: very good, but we still need Exit() to + // be called + if ( loop ) + loop->Exit(); + throw; + } + } +#endif // wxUSE_EXCEPTIONS +} + bool wxEvtHandler::SearchEventTable(wxEventTable& table, wxEvent& event) { diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 9b95e33b7b..5c25f4f47a 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -1051,6 +1051,11 @@ bool wxWindowBase::RemoveEventHandler(wxEvtHandler *handler) return false; } +bool wxWindowBase::HandleWindowEvent(wxEvent& event) const +{ + return GetEventHandler()->SafelyProcessEvent(event); +} + // ---------------------------------------------------------------------------- // colours, fonts &c // ---------------------------------------------------------------------------- diff --git a/src/dfb/nonownedwnd.cpp b/src/dfb/nonownedwnd.cpp index 3652a13ba4..33f2777360 100644 --- a/src/dfb/nonownedwnd.cpp +++ b/src/dfb/nonownedwnd.cpp @@ -228,7 +228,7 @@ bool wxNonOwnedWindow::Show(bool show) m_sizeSet = true; wxSizeEvent event(GetSize(), GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } // make sure the window is fully painted, with all pending updates, before diff --git a/src/dfb/toplevel.cpp b/src/dfb/toplevel.cpp index cac71c9acb..8963419683 100644 --- a/src/dfb/toplevel.cpp +++ b/src/dfb/toplevel.cpp @@ -185,7 +185,7 @@ void wxTopLevelWindowDFB::HandleFocusEvent(const wxDFBWindowEvent& event_) wxActivateEvent event(wxEVT_ACTIVATE, activate, GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); // if a frame that doesn't have wx focus inside it just got focus, we // need to set focus to it (or its child): diff --git a/src/dfb/window.cpp b/src/dfb/window.cpp index 78146c966e..d30298757a 100644 --- a/src/dfb/window.cpp +++ b/src/dfb/window.cpp @@ -206,12 +206,12 @@ void wxWindowDFB::SetFocus() // notify the parent keeping track of focus for the kbd navigation // purposes that we got it wxChildFocusEvent eventFocus((wxWindow*)this); - GetEventHandler()->ProcessEvent(eventFocus); + HandleWindowEvent(eventFocus); wxFocusEvent event(wxEVT_SET_FOCUS, GetId()); event.SetEventObject(this); event.SetWindow((wxWindow*)oldFocusedWindow); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); #if wxUSE_CARET // caret needs to be informed about focus change @@ -241,7 +241,7 @@ void wxWindowDFB::DFBKillFocus() wxFocusEvent event(wxEVT_KILL_FOCUS, GetId()); event.SetEventObject(this); event.SetWindow(gs_toBeFocusedWindow); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } // ---------------------------------------------------------------------------- @@ -526,7 +526,7 @@ void wxWindowDFB::DoSetSize(int x, int y, int width, int height, int sizeFlags) wxSize newSize(width, height); wxSizeEvent event(newSize, GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } } @@ -674,7 +674,7 @@ void wxWindowDFB::PaintWindow(const wxRect& rect) wxWindowDC dc((wxWindow*)this); wxEraseEvent eventEr(m_windowId, &dc); eventEr.SetEventObject(this); - GetEventHandler()->ProcessEvent(eventEr); + HandleWindowEvent(eventEr); wxRect clientRect(GetClientRect()); @@ -683,7 +683,7 @@ void wxWindowDFB::PaintWindow(const wxRect& rect) { wxNcPaintEvent eventNc(GetId()); eventNc.SetEventObject(this); - GetEventHandler()->ProcessEvent(eventNc); + HandleWindowEvent(eventNc); } else { @@ -696,7 +696,7 @@ void wxWindowDFB::PaintWindow(const wxRect& rect) { wxPaintEvent eventPt(GetId()); eventPt.SetEventObject(this); - GetEventHandler()->ProcessEvent(eventPt); + HandleWindowEvent(eventPt); } else { @@ -1026,7 +1026,7 @@ void wxWindowDFB::HandleKeyEvent(const wxDFBWindowEvent& event_) if ( e.type == DWET_KEYUP ) { event.SetEventType(wxEVT_KEY_UP); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } else { @@ -1034,7 +1034,7 @@ void wxWindowDFB::HandleKeyEvent(const wxDFBWindowEvent& event_) event.SetEventType(wxEVT_KEY_DOWN); - if ( GetEventHandler()->ProcessEvent(event) ) + if ( HandleWindowEvent(event) ) return; // only send wxEVT_CHAR event if not processed yet: @@ -1042,7 +1042,7 @@ void wxWindowDFB::HandleKeyEvent(const wxDFBWindowEvent& event_) if ( event.m_keyCode != 0 ) { event.SetEventType(wxEVT_CHAR); - if ( GetEventHandler()->ProcessEvent(event) ) + if ( HandleWindowEvent(event) ) return; } @@ -1057,7 +1057,7 @@ void wxWindowDFB::HandleKeyEvent(const wxDFBWindowEvent& event_) // Ctrl-TAB changes the (parent) window, i.e. switch notebook page: navEvent.SetWindowChange(event.m_controlDown); navEvent.SetCurrentFocus(wxStaticCast(this, wxWindow)); - GetParent()->GetEventHandler()->ProcessEvent(navEvent); + GetParent()->HandleWindowEvent(navEvent); } } } diff --git a/src/gtk/bmpbuttn.cpp b/src/gtk/bmpbuttn.cpp index 3130b8d23c..2954d03cf7 100644 --- a/src/gtk/bmpbuttn.cpp +++ b/src/gtk/bmpbuttn.cpp @@ -40,7 +40,7 @@ static void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitma wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId()); event.SetEventObject(button); - button->GetEventHandler()->ProcessEvent(event); + button->HandleWindowEvent(event); } } diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index 12e0807e50..cfa49892f7 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -44,7 +44,7 @@ static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton * wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId()); event.SetEventObject(button); - button->GetEventHandler()->ProcessEvent(event); + button->HandleWindowEvent(event); } } diff --git a/src/gtk/checkbox.cpp b/src/gtk/checkbox.cpp index 1e25d81b9d..1e4bcf5922 100644 --- a/src/gtk/checkbox.cpp +++ b/src/gtk/checkbox.cpp @@ -84,7 +84,7 @@ static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb) wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, cb->GetId()); event.SetInt(cb->Get3StateValue()); event.SetEventObject(cb); - cb->GetEventHandler()->ProcessEvent(event); + cb->HandleWindowEvent(event); } } diff --git a/src/gtk/checklst.cpp b/src/gtk/checklst.cpp index 2c7f866733..4a43959036 100644 --- a/src/gtk/checklst.cpp +++ b/src/gtk/checklst.cpp @@ -37,7 +37,7 @@ static void gtk_checklist_toggled(GtkCellRendererToggle * WXUNUSED(renderer), new_event.SetInt( gtk_tree_path_get_indices(path)[0] ); gtk_tree_path_free(path); listbox->Check( new_event.GetInt(), !listbox->IsChecked(new_event.GetInt())); - listbox->GetEventHandler()->ProcessEvent( new_event ); + listbox->HandleWindowEvent( new_event ); } } diff --git a/src/gtk/choice.cpp b/src/gtk/choice.cpp index 2e160d2287..294d977377 100644 --- a/src/gtk/choice.cpp +++ b/src/gtk/choice.cpp @@ -62,7 +62,7 @@ static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice * else if ( choice->HasClientUntypedData() ) event.SetClientData( choice->GetClientData(n) ); - choice->GetEventHandler()->ProcessEvent(event); + choice->HandleWindowEvent(event); } } diff --git a/src/gtk/clrpicker.cpp b/src/gtk/clrpicker.cpp index 57272a0e88..de19aa7c4d 100644 --- a/src/gtk/clrpicker.cpp +++ b/src/gtk/clrpicker.cpp @@ -43,7 +43,7 @@ static void gtk_clrbutton_setcolor_callback(GtkColorButton *widget, // fire the colour-changed event wxColourPickerEvent event(p, p->GetId(), p->GetColour()); - p->GetEventHandler()->ProcessEvent(event); + p->HandleWindowEvent(event); } } diff --git a/src/gtk/collpane.cpp b/src/gtk/collpane.cpp index 2702156f34..f50d3b270c 100644 --- a/src/gtk/collpane.cpp +++ b/src/gtk/collpane.cpp @@ -102,7 +102,7 @@ gtk_collapsiblepane_expanded_callback(GObject * WXUNUSED(object), { // fire an event wxCollapsiblePaneEvent ev(p, p->GetId(), p->IsCollapsed()); - p->GetEventHandler()->ProcessEvent(ev); + p->HandleWindowEvent(ev); // the user asked to explicitely handle the resizing itself... return; @@ -143,7 +143,7 @@ gtk_collapsiblepane_expanded_callback(GObject * WXUNUSED(object), // fire an event wxCollapsiblePaneEvent ev(p, p->GetId(), p->IsCollapsed()); - p->GetEventHandler()->ProcessEvent(ev); + p->HandleWindowEvent(ev); } } diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index eb6ffdd427..d64524fbe0 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -36,7 +36,7 @@ gtkcombobox_text_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *comb wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, combo->GetId() ); event.SetString( combo->GetValue() ); event.SetEventObject( combo ); - combo->GetEventHandler()->ProcessEvent( event ); + combo->HandleWindowEvent( event ); } static void @@ -51,7 +51,7 @@ gtkcombobox_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo ) event.SetInt( combo->GetSelection() ); event.SetString( combo->GetStringSelection() ); event.SetEventObject( combo ); - combo->GetEventHandler()->ProcessEvent( event ); + combo->HandleWindowEvent( event ); } } @@ -386,7 +386,7 @@ void wxComboBox::OnChar( wxKeyEvent &event ) eventEnter.SetInt( GetSelection() ); eventEnter.SetEventObject( this ); - if ( GetEventHandler()->ProcessEvent(eventEnter) ) + if ( HandleWindowEvent(eventEnter) ) { // Catch GTK event so that GTK doesn't open the drop // down list upon RETURN. diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 202d581a52..6cb1646fbe 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -642,7 +642,7 @@ void wxgtk_tree_model_set_sort_column_id (GtkTreeSortable *sortable, wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, dv->GetId() ); event.SetDataViewColumn( gs_lastLeftClickHeader ); event.SetModel( dv->GetModel() ); - dv->GetEventHandler()->ProcessEvent( event ); + dv->HandleWindowEvent( event ); } gs_lastLeftClickHeader = NULL; @@ -1212,7 +1212,7 @@ wxgtk_cell_editable_editing_done( GtkCellEditable *editable, event.SetModel( dv->GetModel() ); wxDataViewItem item( s_user_data ); event.SetItem( item ); - dv->GetEventHandler()->ProcessEvent( event ); + dv->HandleWindowEvent( event ); } static void @@ -1230,7 +1230,7 @@ wxgtk_renderer_editing_started( GtkCellRenderer *cell, GtkCellEditable *editable gtk_tree_path_free( tree_path ); wxDataViewItem item( iter.user_data ); event.SetItem( item ); - dv->GetEventHandler()->ProcessEvent( event ); + dv->HandleWindowEvent( event ); if (GTK_IS_CELL_EDITABLE(editable)) { @@ -2068,7 +2068,7 @@ gtk_dataview_header_button_press_callback( GtkWidget *widget, wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK, dv->GetId() ); event.SetDataViewColumn( column ); event.SetModel( dv->GetModel() ); - if (dv->GetEventHandler()->ProcessEvent( event )) + if (dv->HandleWindowEvent( event )) return FALSE; } @@ -2078,7 +2078,7 @@ gtk_dataview_header_button_press_callback( GtkWidget *widget, wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, dv->GetId() ); event.SetDataViewColumn( column ); event.SetModel( dv->GetModel() ); - if (dv->GetEventHandler()->ProcessEvent( event )) + if (dv->HandleWindowEvent( event )) return FALSE; } @@ -2654,7 +2654,7 @@ bool wxDataViewCtrlInternal::ItemChanged( const wxDataViewItem &item ) event.SetEventObject( m_owner ); event.SetModel( m_owner->GetModel() ); event.SetItem( item ); - m_owner->GetEventHandler()->ProcessEvent( event ); + m_owner->HandleWindowEvent( event ); return true; } @@ -2667,7 +2667,7 @@ bool wxDataViewCtrlInternal::ValueChanged( const wxDataViewItem &item, unsigned event.SetColumn( col ); event.SetDataViewColumn( GetOwner()->GetColumn(col) ); event.SetItem( item ); - m_owner->GetEventHandler()->ProcessEvent( event ); + m_owner->HandleWindowEvent( event ); return true; } @@ -3120,7 +3120,7 @@ wxdataview_selection_changed_callback( GtkTreeSelection* selection, wxDataViewCt wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, dv->GetId() ); event.SetItem( dv->GetSelection() ); event.SetModel( dv->GetModel() ); - dv->GetEventHandler()->ProcessEvent( event ); + dv->HandleWindowEvent( event ); } static void @@ -3134,7 +3134,7 @@ wxdataview_row_activated_callback( GtkTreeView* treeview, GtkTreePath *path, wxDataViewItem item( (void*) iter.user_data );; event.SetItem( item ); event.SetModel( dv->GetModel() ); - dv->GetEventHandler()->ProcessEvent( event ); + dv->HandleWindowEvent( event ); } static gboolean @@ -3146,7 +3146,7 @@ wxdataview_test_expand_row_callback( GtkTreeView* treeview, GtkTreeIter* iter, wxDataViewItem item( (void*) iter->user_data );; event.SetItem( item ); event.SetModel( dv->GetModel() ); - dv->GetEventHandler()->ProcessEvent( event ); + dv->HandleWindowEvent( event ); return !event.IsAllowed(); } @@ -3160,7 +3160,7 @@ wxdataview_row_expanded_callback( GtkTreeView* treeview, GtkTreeIter* iter, wxDataViewItem item( (void*) iter->user_data );; event.SetItem( item ); event.SetModel( dv->GetModel() ); - dv->GetEventHandler()->ProcessEvent( event ); + dv->HandleWindowEvent( event ); } static gboolean @@ -3172,7 +3172,7 @@ wxdataview_test_collapse_row_callback( GtkTreeView* treeview, GtkTreeIter* iter, wxDataViewItem item( (void*) iter->user_data );; event.SetItem( item ); event.SetModel( dv->GetModel() ); - dv->GetEventHandler()->ProcessEvent( event ); + dv->HandleWindowEvent( event ); return !event.IsAllowed(); } @@ -3186,7 +3186,7 @@ wxdataview_row_collapsed_callback( GtkTreeView* treeview, GtkTreeIter* iter, wxDataViewItem item( (void*) iter->user_data );; event.SetItem( item ); event.SetModel( dv->GetModel() ); - dv->GetEventHandler()->ProcessEvent( event ); + dv->HandleWindowEvent( event ); } //----------------------------------------------------------------------------- diff --git a/src/gtk/dirdlg.cpp b/src/gtk/dirdlg.cpp index 8613388d29..7874ff5773 100644 --- a/src/gtk/dirdlg.cpp +++ b/src/gtk/dirdlg.cpp @@ -49,7 +49,7 @@ static void gtk_dirdialog_ok_callback(GtkWidget *widget, wxDirDialog *dialog) wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK); event.SetEventObject(dialog); - dialog->GetEventHandler()->ProcessEvent(event); + dialog->HandleWindowEvent(event); } } @@ -63,7 +63,7 @@ static void gtk_dirdialog_cancel_callback(GtkWidget *WXUNUSED(w), { wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL); event.SetEventObject(dialog); - dialog->GetEventHandler()->ProcessEvent(event); + dialog->HandleWindowEvent(event); } } diff --git a/src/gtk/filedlg.cpp b/src/gtk/filedlg.cpp index 77abe908a5..835e2d0c6b 100644 --- a/src/gtk/filedlg.cpp +++ b/src/gtk/filedlg.cpp @@ -80,7 +80,7 @@ static void gtk_filedialog_ok_callback(GtkWidget *widget, wxFileDialog *dialog) wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK); event.SetEventObject(dialog); - dialog->GetEventHandler()->ProcessEvent(event); + dialog->HandleWindowEvent(event); } } @@ -96,7 +96,7 @@ gtk_filedialog_cancel_callback(GtkWidget * WXUNUSED(w), wxFileDialog *dialog) { wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL); event.SetEventObject(dialog); - dialog->GetEventHandler()->ProcessEvent(event); + dialog->HandleWindowEvent(event); } static void gtk_filedialog_response_callback(GtkWidget *w, diff --git a/src/gtk/filepicker.cpp b/src/gtk/filepicker.cpp index 841d47c106..d1f18c726f 100644 --- a/src/gtk/filepicker.cpp +++ b/src/gtk/filepicker.cpp @@ -120,7 +120,7 @@ void wxFileButton::OnDialogOK(wxCommandEvent& ev) // ...and fire an event wxFileDirPickerEvent event(wxEVT_COMMAND_FILEPICKER_CHANGED, this, GetId(), m_path); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } } @@ -172,7 +172,7 @@ static void gtk_dirbutton_currentfolderchanged_callback(GtkFileChooserButton *wi // ...and fire an event wxFileDirPickerEvent event(wxEVT_COMMAND_DIRPICKER_CHANGED, p, p->GetId(), p->GetPath()); - p->GetEventHandler()->ProcessEvent(event); + p->HandleWindowEvent(event); } } diff --git a/src/gtk/fontdlg.cpp b/src/gtk/fontdlg.cpp index cb99b9c398..50f971d756 100644 --- a/src/gtk/fontdlg.cpp +++ b/src/gtk/fontdlg.cpp @@ -60,7 +60,7 @@ void gtk_fontdialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFontDialog *dial wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK); event.SetEventObject( dialog ); - dialog->GetEventHandler()->ProcessEvent( event ); + dialog->HandleWindowEvent( event ); } } @@ -74,7 +74,7 @@ void gtk_fontdialog_cancel_callback( GtkWidget *WXUNUSED(w), wxFontDialog *dialo { wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL); event.SetEventObject( dialog ); - dialog->GetEventHandler()->ProcessEvent( event ); + dialog->HandleWindowEvent( event ); } } diff --git a/src/gtk/fontpicker.cpp b/src/gtk/fontpicker.cpp index a0e12a4978..00b1181bc9 100644 --- a/src/gtk/fontpicker.cpp +++ b/src/gtk/fontpicker.cpp @@ -42,7 +42,7 @@ static void gtk_fontbutton_setfont_callback(GtkFontButton *widget, // fire the colour-changed event wxFontPickerEvent event(p, p->GetId(), p->GetSelectedFont()); - p->GetEventHandler()->ProcessEvent(event); + p->HandleWindowEvent(event); } } diff --git a/src/gtk/glcanvas.cpp b/src/gtk/glcanvas.cpp index df96d5d8c8..909c5c02e2 100644 --- a/src/gtk/glcanvas.cpp +++ b/src/gtk/glcanvas.cpp @@ -54,7 +54,7 @@ gtk_glwindow_map_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win ) { wxPaintEvent event( win->GetId() ); event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); win->m_exposed = false; win->GetUpdateRegion().Clear(); @@ -96,7 +96,7 @@ gtk_glcanvas_size_callback(GtkWidget *WXUNUSED(widget), wxSizeEvent event( wxSize(win->m_width,win->m_height), win->GetId() ); event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } } @@ -242,7 +242,7 @@ void wxGLCanvas::OnInternalIdle() { wxPaintEvent event( GetId() ); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); m_exposed = false; GetUpdateRegion().Clear(); diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index ac6c9272e2..0f28034f81 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -104,7 +104,7 @@ gtk_listbox_row_activated_callback(GtkTreeView * WXUNUSED(treeview), event.SetInt(-1); } - listbox->GetEventHandler()->ProcessEvent( event ); + listbox->HandleWindowEvent( event ); } } @@ -135,7 +135,7 @@ gtk_listitem_changed_callback(GtkTreeSelection * WXUNUSED(selection), event.SetExtraLong( 0 ); event.SetInt( -1 ); - listbox->GetEventHandler()->ProcessEvent( event ); + listbox->HandleWindowEvent( event ); return; } @@ -145,7 +145,7 @@ gtk_listitem_changed_callback(GtkTreeSelection * WXUNUSED(selection), event.SetExtraLong( 1 ); event.SetInt( selections[0] ); - listbox->GetEventHandler()->ProcessEvent( event ); + listbox->HandleWindowEvent( event ); } } else @@ -157,7 +157,7 @@ gtk_listitem_changed_callback(GtkTreeSelection * WXUNUSED(selection), event.SetExtraLong( 0 ); event.SetInt( -1 ); - listbox->GetEventHandler()->ProcessEvent( event ); + listbox->HandleWindowEvent( event ); return; } @@ -178,7 +178,7 @@ gtk_listitem_changed_callback(GtkTreeSelection * WXUNUSED(selection), else if ( listbox->HasClientUntypedData() ) event.SetClientData( gtk_tree_entry_get_userdata(entry) ); - listbox->GetEventHandler()->ProcessEvent( event ); + listbox->HandleWindowEvent( event ); g_object_unref (entry); } diff --git a/src/gtk/mdi.cpp b/src/gtk/mdi.cpp index 5d3a4efbee..ef4c027e25 100644 --- a/src/gtk/mdi.cpp +++ b/src/gtk/mdi.cpp @@ -39,7 +39,7 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget), { wxActivateEvent event1( wxEVT_ACTIVATE, false, child->GetId() ); event1.SetEventObject( child); - child->GetEventHandler()->ProcessEvent( event1 ); + child->HandleWindowEvent( event1 ); } // send activate event to new child @@ -71,7 +71,7 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget), wxActivateEvent event2( wxEVT_ACTIVATE, true, child->GetId() ); event2.SetEventObject( child); - child->GetEventHandler()->ProcessEvent( event2 ); + child->HandleWindowEvent( event2 ); } } diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 42eb67b220..71dc66a136 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -60,12 +60,12 @@ static void DoCommonMenuCallbackCode(wxMenu *menu, wxMenuEvent& event) event.SetEventObject( menu ); wxEvtHandler* handler = menu->GetEventHandler(); - if (handler && handler->ProcessEvent(event)) + if (handler && handler->SafelyProcessEvent(event)) return; wxWindow *win = menu->GetInvokingWindow(); if (win) - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } extern "C" { @@ -573,7 +573,7 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu ) if (item->IsCheckable()) commandEvent.SetInt(item->IsChecked()); - frame->GetEventHandler()->ProcessEvent(commandEvent); + frame->HandleWindowEvent(commandEvent); } else { @@ -601,11 +601,11 @@ static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu ) event.SetEventObject( menu ); wxEvtHandler* handler = menu->GetEventHandler(); - if (handler && handler->ProcessEvent(event)) + if (handler && handler->SafelyProcessEvent(event)) return; wxWindow *win = menu->GetInvokingWindow(); - if (win) win->GetEventHandler()->ProcessEvent( event ); + if (win) win->HandleWindowEvent( event ); } } @@ -627,12 +627,12 @@ static void gtk_menu_nolight_callback( GtkWidget *widget, wxMenu *menu ) event.SetEventObject( menu ); wxEvtHandler* handler = menu->GetEventHandler(); - if (handler && handler->ProcessEvent(event)) + if (handler && handler->SafelyProcessEvent(event)) return; wxWindow *win = menu->GetInvokingWindow(); if (win) - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } } diff --git a/src/gtk/popupwin.cpp b/src/gtk/popupwin.cpp index e82b1a4b25..a41e193842 100644 --- a/src/gtk/popupwin.cpp +++ b/src/gtk/popupwin.cpp @@ -53,7 +53,7 @@ static gint gtk_popup_button_press (GtkWidget *widget, GdkEvent *gdk_event, wxPo wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() ); event.SetEventObject( win ); - (void)win->GetEventHandler()->ProcessEvent( event ); + (void)win->HandleWindowEvent( event ); return TRUE; } @@ -227,7 +227,7 @@ void wxPopupWindow::DoSetSize( int x, int y, int width, int height, int sizeFlag gtk_widget_set_size_request( m_widget, m_width, m_height ); wxSizeEvent event(GetSize(), GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } } @@ -237,7 +237,7 @@ bool wxPopupWindow::Show( bool show ) { wxSizeEvent event(GetSize(), GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } bool ret = wxWindow::Show( show ); diff --git a/src/gtk/radiobox.cpp b/src/gtk/radiobox.cpp index 418c82be3e..67d698b214 100644 --- a/src/gtk/radiobox.cpp +++ b/src/gtk/radiobox.cpp @@ -67,7 +67,7 @@ static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioBo event.SetInt( rb->GetSelection() ); event.SetString( rb->GetStringSelection() ); event.SetEventObject( rb ); - rb->GetEventHandler()->ProcessEvent(event); + rb->HandleWindowEvent(event); } } @@ -92,7 +92,7 @@ static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_ // CTRL-TAB changes the (parent) window, i.e. switch notebook page new_event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) ); new_event.SetCurrentFocus( rb ); - return rb->GetParent()->GetEventHandler()->ProcessEvent( new_event ); + return rb->GetParent()->HandleWindowEvent(new_event); } if ((gdk_event->keyval != GDK_Up) && @@ -156,7 +156,7 @@ static gint gtk_radiobutton_focus_in( GtkWidget * WXUNUSED(widget), // never stop the signal emission, it seems to break the kbd handling // inside the radiobox - (void)win->GetEventHandler()->ProcessEvent( event ); + (void)win->HandleWindowEvent( event ); } return FALSE; @@ -658,7 +658,7 @@ void wxRadioBox::OnInternalIdle() wxFocusEvent event( wxEVT_KILL_FOCUS, GetId() ); event.SetEventObject( this ); - (void)GetEventHandler()->ProcessEvent( event ); + (void)HandleWindowEvent( event ); } } diff --git a/src/gtk/radiobut.cpp b/src/gtk/radiobut.cpp index a1a5e23c29..c4ac7d1175 100644 --- a/src/gtk/radiobut.cpp +++ b/src/gtk/radiobut.cpp @@ -41,7 +41,7 @@ void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioButton *r wxCommandEvent event( wxEVT_COMMAND_RADIOBUTTON_SELECTED, rb->GetId()); event.SetInt( rb->GetValue() ); event.SetEventObject( rb ); - rb->GetEventHandler()->ProcessEvent( event ); + rb->HandleWindowEvent( event ); } } diff --git a/src/gtk/scrolbar.cpp b/src/gtk/scrolbar.cpp index a9aa6021e9..413e8fbe3c 100644 --- a/src/gtk/scrolbar.cpp +++ b/src/gtk/scrolbar.cpp @@ -38,14 +38,14 @@ gtk_value_changed(GtkRange* range, wxScrollBar* win) // first send the specific event for the user action wxScrollEvent evtSpec(eventType, id, value, orient); evtSpec.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(evtSpec); + win->HandleWindowEvent(evtSpec); if (!win->m_isScrolling) { // and if it's over also send a general "changed" event wxScrollEvent evtChanged(wxEVT_SCROLL_CHANGED, id, value, orient); evtChanged.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(evtChanged); + win->HandleWindowEvent(evtChanged); } } } @@ -82,11 +82,11 @@ gtk_event_after(GtkRange* range, GdkEvent* event, wxScrollBar* win) wxScrollEvent evtRel(wxEVT_SCROLL_THUMBRELEASE, id, value, orient); evtRel.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(evtRel); + win->HandleWindowEvent(evtRel); wxScrollEvent evtChanged(wxEVT_SCROLL_CHANGED, id, value, orient); evtChanged.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(evtChanged); + win->HandleWindowEvent(evtChanged); } } } diff --git a/src/gtk/slider.cpp b/src/gtk/slider.cpp index 77db144529..6440262ee4 100644 --- a/src/gtk/slider.cpp +++ b/src/gtk/slider.cpp @@ -46,7 +46,7 @@ ProcessScrollEvent(wxSlider *win, wxEventType evtType) { wxScrollEvent event( evtType, win->GetId(), value, orient ); event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } // but, in any case, except if we're dragging the slider (and so the change @@ -55,14 +55,14 @@ ProcessScrollEvent(wxSlider *win, wxEventType evtType) { wxScrollEvent event(wxEVT_SCROLL_CHANGED, win->GetId(), value, orient); event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } // and also generate a command event for compatibility wxCommandEvent event( wxEVT_COMMAND_SLIDER_UPDATED, win->GetId() ); event.SetEventObject( win ); event.SetInt( value ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } static inline wxEventType GtkScrollTypeToWx(int scrollType) diff --git a/src/gtk/spinbutt.cpp b/src/gtk/spinbutt.cpp index ea7478c519..b886fbc324 100644 --- a/src/gtk/spinbutt.cpp +++ b/src/gtk/spinbutt.cpp @@ -48,7 +48,7 @@ gtk_value_changed(GtkSpinButton* spinbutton, wxSpinButton* win) event.SetPosition(pos); event.SetEventObject(win); - if ((win->GetEventHandler()->ProcessEvent( event )) && + if ((win->HandleWindowEvent( event )) && !event.IsAllowed() ) { /* program has vetoed */ @@ -64,7 +64,7 @@ gtk_value_changed(GtkSpinButton* spinbutton, wxSpinButton* win) wxSpinEvent event2(wxEVT_SCROLL_THUMBTRACK, win->GetId()); event2.SetPosition(pos); event2.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(event2); + win->HandleWindowEvent(event2); } } diff --git a/src/gtk/spinctrl.cpp b/src/gtk/spinctrl.cpp index 5f8406cbe0..cc7b511f0a 100644 --- a/src/gtk/spinctrl.cpp +++ b/src/gtk/spinctrl.cpp @@ -51,7 +51,7 @@ gtk_value_changed(GtkSpinButton* spinbutton, wxSpinCtrl* win) // values in range 5..50 is then, ummm, quite challenging (hint: you can't // enter 1!) (VZ) event.SetInt(win->m_pos); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } } @@ -72,7 +72,7 @@ gtk_changed(GtkSpinButton* spinbutton, wxSpinCtrl* win) // see above event.SetInt(win->m_pos); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } } @@ -260,7 +260,7 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event ) GtkSpinButton *gsb = GTK_SPIN_BUTTON(m_widget); wxString val = wxGTK_CONV_BACK( gtk_entry_get_text( &gsb->entry ) ); evt.SetString( val ); - if (GetEventHandler()->ProcessEvent(evt)) return; + if (HandleWindowEvent(evt)) return; } event.Skip(); diff --git a/src/gtk/tbargtk.cpp b/src/gtk/tbargtk.cpp index b403ca69d6..68b72f8fbc 100644 --- a/src/gtk/tbargtk.cpp +++ b/src/gtk/tbargtk.cpp @@ -278,7 +278,7 @@ static gboolean gtk_toolbar_dropdown_lclick_callback(GtkWidget *widget, if (!tool->IsEnabled()) return FALSE; wxCommandEvent evt(wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED, tool->GetId() ); - if ( tbar->GetEventHandler()->ProcessEvent(evt) ) + if ( tbar->HandleWindowEvent(evt) ) { return TRUE; } diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index cfb354c9f4..e511ce39c3 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -526,7 +526,7 @@ handle_text_clipboard_callback( GtkWidget *widget, wxTextCtrl *win, { wxClipboardTextEvent event( eventType, win->GetId() ); event.SetEventObject( win ); - if ( win->GetEventHandler()->ProcessEvent( event ) ) + if ( win->HandleWindowEvent( event ) ) { // don't let the default processing to take place if we did something // ourselves in the event handler @@ -1527,7 +1527,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &key_event ) wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); event.SetEventObject(this); event.SetString(GetValue()); - if ( GetEventHandler()->ProcessEvent(event) ) + if ( HandleWindowEvent(event) ) return; } } @@ -1823,8 +1823,8 @@ void wxTextCtrl::OnUrlMouseEvent(wxMouseEvent& event) InitCommandEvent(url_event); // Is that a good idea? Seems not (pleasure with gtk_text_view_start_selection_drag) - //event.Skip(!GetEventHandler()->ProcessEvent(url_event)); - GetEventHandler()->ProcessEvent(url_event); + //event.Skip(!HandleWindowEvent(url_event)); + HandleWindowEvent(url_event); } bool wxTextCtrl::GTKProcessEvent(wxEvent& event) const diff --git a/src/gtk/textentry.cpp b/src/gtk/textentry.cpp index 2d1f868666..f96aa09b50 100644 --- a/src/gtk/textentry.cpp +++ b/src/gtk/textentry.cpp @@ -313,7 +313,7 @@ void wxTextEntry::SendMaxLenEvent() wxCommandEvent event(wxEVT_COMMAND_TEXT_MAXLEN, win->GetId()); event.SetEventObject(win); event.SetString(GetValue()); - win->GetEventHandler()->ProcessEvent(event); + win->HandleWindowEvent(event); } #endif // wxUSE_TEXTCTRL || wxUSE_COMBOBOX diff --git a/src/gtk/tglbtn.cpp b/src/gtk/tglbtn.cpp index 734b351d26..120e9d75fa 100644 --- a/src/gtk/tglbtn.cpp +++ b/src/gtk/tglbtn.cpp @@ -37,7 +37,7 @@ static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxTog wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, cb->GetId()); event.SetInt(cb->GetValue()); event.SetEventObject(cb); - cb->GetEventHandler()->ProcessEvent(event); + cb->HandleWindowEvent(event); } } diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 8e590cc653..c024778629 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -163,7 +163,7 @@ static gboolean gtk_frame_focus_in_callback( GtkWidget *widget, wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame); wxActivateEvent event(wxEVT_ACTIVATE, true, g_activeFrame->GetId()); event.SetEventObject(g_activeFrame); - g_activeFrame->GetEventHandler()->ProcessEvent(event); + g_activeFrame->HandleWindowEvent(event); return FALSE; } @@ -193,7 +193,7 @@ gboolean gtk_frame_focus_out_callback(GtkWidget * WXUNUSED(widget), wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame); wxActivateEvent event(wxEVT_ACTIVATE, false, g_activeFrame->GetId()); event.SetEventObject(g_activeFrame); - g_activeFrame->GetEventHandler()->ProcessEvent(event); + g_activeFrame->HandleWindowEvent(event); g_activeFrame = NULL; } @@ -246,7 +246,7 @@ size_allocate(GtkWidget*, GtkAllocation* alloc, wxTopLevelWindowGTK* win) { wxSizeEvent event(size, win->GetId()); event.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(event); + win->HandleWindowEvent(event); } // else the window is currently unmapped, don't generate size events } @@ -309,7 +309,7 @@ gtk_frame_configure_callback( GtkWidget* widget, win->m_y = point.y; wxMoveEvent mevent(point, win->GetId()); mevent.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( mevent ); + win->HandleWindowEvent( mevent ); return FALSE; } @@ -823,7 +823,7 @@ bool wxTopLevelWindowGTK::Show( bool show ) // top down), before the initial size_allocate signals occur. wxSizeEvent event(GetSize(), GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } bool change = wxTopLevelWindowBase::Show(show); @@ -908,7 +908,7 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si GetClientSize(&m_oldClientWidth, &m_oldClientHeight); wxSizeEvent event(GetSize(), GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } } diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index e7ef905f4e..5a6d9f2b49 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -914,7 +914,7 @@ gtk_window_key_press_callback( GtkWidget *widget, if( wxTranslateGTKKeyEventToWx(event, win, gdk_event) ) { // Emit KEY_DOWN event - ret = win->GetEventHandler()->ProcessEvent( event ); + ret = win->HandleWindowEvent( event ); } else { @@ -950,7 +950,7 @@ gtk_window_key_press_callback( GtkWidget *widget, if (command != -1) { wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command ); - ret = ancestor->GetEventHandler()->ProcessEvent( command_event ); + ret = ancestor->HandleWindowEvent( command_event ); break; } if (ancestor->IsTopLevel()) @@ -1009,13 +1009,13 @@ gtk_window_key_press_callback( GtkWidget *widget, if (parent) { event.SetEventType( wxEVT_CHAR_HOOK ); - ret = parent->GetEventHandler()->ProcessEvent( event ); + ret = parent->HandleWindowEvent( event ); } if (!ret) { event.SetEventType(wxEVT_CHAR); - ret = win->GetEventHandler()->ProcessEvent( event ); + ret = win->HandleWindowEvent( event ); } } } @@ -1085,13 +1085,13 @@ gtk_wxwindow_commit_cb (GtkIMContext * WXUNUSED(context), if (parent) { event.SetEventType( wxEVT_CHAR_HOOK ); - ret = parent->GetEventHandler()->ProcessEvent( event ); + ret = parent->HandleWindowEvent( event ); } if (!ret) { event.SetEventType(wxEVT_CHAR); - ret = window->GetEventHandler()->ProcessEvent( event ); + ret = window->HandleWindowEvent( event ); } } } @@ -1272,7 +1272,7 @@ wxWindowGTK *FindWindowForMouseEvent(wxWindowGTK *win, wxCoord& x, wxCoord& y) bool wxWindowGTK::GTKProcessEvent(wxEvent& event) const { // nothing special at this level - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } int wxWindowGTK::GTKCallbackCommonPrologue(GdkEventAny *event) const @@ -1319,12 +1319,12 @@ static bool DoSendFocusEvents(wxWindow *win) // Notify the parent keeping track of focus for the kbd navigation // purposes that we got it. wxChildFocusEvent eventChildFocus(win); - (void)win->GetEventHandler()->ProcessEvent(eventChildFocus); + (void)win->HandleWindowEvent(eventChildFocus); wxFocusEvent eventFocus(wxEVT_SET_FOCUS, win->GetId()); eventFocus.SetEventObject(win); - return win->GetEventHandler()->ProcessEvent(eventFocus); + return win->HandleWindowEvent(eventFocus); } // all event handlers must have C linkage as they're called from GTK+ C code @@ -2019,7 +2019,7 @@ gtk_window_grab_broken( GtkWidget*, { wxMouseCaptureLostEvent evt( win->GetId() ); evt.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( evt ); + win->HandleWindowEvent( evt ); } return false; } @@ -2660,7 +2660,7 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags { wxSizeEvent event( wxSize(m_width,m_height), GetId() ); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); } } } @@ -2678,7 +2678,7 @@ bool wxWindowGTK::GtkShowFromOnIdle() gtk_widget_show( m_widget ); wxShowEvent eventShow(GetId(), true); eventShow.SetEventObject(this); - GetEventHandler()->ProcessEvent(eventShow); + HandleWindowEvent(eventShow); m_showOnIdle = false; return true; } @@ -2918,7 +2918,7 @@ bool wxWindowGTK::Show( bool show ) gtk_widget_show( m_widget ); wxShowEvent eventShow(GetId(), show); eventShow.SetEventObject(this); - GetEventHandler()->ProcessEvent(eventShow); + HandleWindowEvent(eventShow); } } else @@ -2926,7 +2926,7 @@ bool wxWindowGTK::Show( bool show ) gtk_widget_hide( m_widget ); wxShowEvent eventShow(GetId(), show); eventShow.SetEventObject(this); - GetEventHandler()->ProcessEvent(eventShow); + HandleWindowEvent(eventShow); } return true; @@ -3669,16 +3669,16 @@ void wxWindowGTK::GtkSendPaintEvents() wxEraseEvent erase_event( GetId(), &dc ); erase_event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(erase_event); + HandleWindowEvent(erase_event); } wxNcPaintEvent nc_paint_event( GetId() ); nc_paint_event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( nc_paint_event ); + HandleWindowEvent( nc_paint_event ); wxPaintEvent paint_event( GetId() ); paint_event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( paint_event ); + HandleWindowEvent( paint_event ); m_clipPaintRegion = false; @@ -4012,7 +4012,7 @@ void wxWindowGTK::GTKReleaseMouseAndNotify() DoReleaseMouse(); wxMouseCaptureLostEvent evt(GetId()); evt.SetEventObject( this ); - GetEventHandler()->ProcessEvent( evt ); + HandleWindowEvent( evt ); } /* static */ diff --git a/src/gtk1/bmpbuttn.cpp b/src/gtk1/bmpbuttn.cpp index 62f3509404..a814ea7a31 100644 --- a/src/gtk1/bmpbuttn.cpp +++ b/src/gtk1/bmpbuttn.cpp @@ -50,7 +50,7 @@ static void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitma wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId()); event.SetEventObject(button); - button->GetEventHandler()->ProcessEvent(event); + button->HandleWindowEvent(event); } } diff --git a/src/gtk1/button.cpp b/src/gtk1/button.cpp index 6d71384052..a388cc3474 100644 --- a/src/gtk1/button.cpp +++ b/src/gtk1/button.cpp @@ -55,7 +55,7 @@ static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton * wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId()); event.SetEventObject(button); - button->GetEventHandler()->ProcessEvent(event); + button->HandleWindowEvent(event); } } diff --git a/src/gtk1/checkbox.cpp b/src/gtk1/checkbox.cpp index c61796d946..4bd1fd35af 100644 --- a/src/gtk1/checkbox.cpp +++ b/src/gtk1/checkbox.cpp @@ -50,7 +50,7 @@ static void gtk_checkbox_toggled_callback(GtkWidget *WXUNUSED(widget), wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, cb->GetId()); event.SetInt(cb->GetValue()); event.SetEventObject(cb); - cb->GetEventHandler()->ProcessEvent(event); + cb->HandleWindowEvent(event); } } diff --git a/src/gtk1/choice.cpp b/src/gtk1/choice.cpp index 0d50df554f..836a62ec62 100644 --- a/src/gtk1/choice.cpp +++ b/src/gtk1/choice.cpp @@ -78,7 +78,7 @@ static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice * else if ( choice->HasClientUntypedData() ) event.SetClientData( choice->GetClientData(n) ); - choice->GetEventHandler()->ProcessEvent(event); + choice->HandleWindowEvent(event); } } diff --git a/src/gtk1/combobox.cpp b/src/gtk1/combobox.cpp index 27a72b2bcb..352310b904 100644 --- a/src/gtk1/combobox.cpp +++ b/src/gtk1/combobox.cpp @@ -59,7 +59,7 @@ gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo ) wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, combo->GetId() ); event.SetString( combo->GetValue() ); event.SetEventObject( combo ); - combo->GetEventHandler()->ProcessEvent( event ); + combo->HandleWindowEvent( event ); } } @@ -91,13 +91,13 @@ gtk_popup_hide_callback(GtkCombo *WXUNUSED(gtk_combo), wxComboBox *combo) event.SetInt( curSelection ); event.SetString( combo->GetStringSelection() ); event.SetEventObject( combo ); - combo->GetEventHandler()->ProcessEvent( event ); + combo->HandleWindowEvent( event ); // for consistency with the other ports, send TEXT event wxCommandEvent event2( wxEVT_COMMAND_TEXT_UPDATED, combo->GetId() ); event2.SetString( combo->GetStringSelection() ); event2.SetEventObject( combo ); - combo->GetEventHandler()->ProcessEvent( event2 ); + combo->HandleWindowEvent( event2 ); } } } @@ -154,14 +154,14 @@ gtk_combo_select_child_callback( GtkList *WXUNUSED(list), GtkWidget *WXUNUSED(wi event.SetInt( curSelection ); event.SetString( combo->GetStringSelection() ); event.SetEventObject( combo ); - combo->GetEventHandler()->ProcessEvent( event ); + combo->HandleWindowEvent( event ); // for consistency with the other ports, don't generate text update // events while the user is browsing the combobox neither wxCommandEvent event2( wxEVT_COMMAND_TEXT_UPDATED, combo->GetId() ); event2.SetString( combo->GetValue() ); event2.SetEventObject( combo ); - combo->GetEventHandler()->ProcessEvent( event2 ); + combo->HandleWindowEvent( event2 ); } } } @@ -789,7 +789,7 @@ void wxComboBox::OnChar( wxKeyEvent &event ) eventEnter.SetInt( GetSelection() ); eventEnter.SetEventObject( this ); - if (!GetEventHandler()->ProcessEvent( eventEnter )) + if (!HandleWindowEvent( eventEnter )) { // This will invoke the dialog default action, such // as the clicking the default button. diff --git a/src/gtk1/dialog.cpp b/src/gtk1/dialog.cpp index 5a1129b0e2..f791d2d087 100644 --- a/src/gtk1/dialog.cpp +++ b/src/gtk1/dialog.cpp @@ -141,7 +141,7 @@ void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL); cancelEvent.SetEventObject( this ); - GetEventHandler()->ProcessEvent(cancelEvent); + HandleWindowEvent(cancelEvent); s_closing.DeleteObject(this); } diff --git a/src/gtk1/fontdlg.cpp b/src/gtk1/fontdlg.cpp index 8b5a91689f..03d12f1e9f 100644 --- a/src/gtk1/fontdlg.cpp +++ b/src/gtk1/fontdlg.cpp @@ -84,7 +84,7 @@ void gtk_fontdialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFontDialog *dial wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK); event.SetEventObject( dialog ); - dialog->GetEventHandler()->ProcessEvent( event ); + dialog->HandleWindowEvent( event ); } } @@ -101,7 +101,7 @@ void gtk_fontdialog_cancel_callback( GtkWidget *WXUNUSED(w), wxFontDialog *dialo wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL); event.SetEventObject( dialog ); - dialog->GetEventHandler()->ProcessEvent( event ); + dialog->HandleWindowEvent( event ); } } diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 493ab61166..f929afc8e2 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -495,7 +495,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), // send size event to frame wxSizeEvent event( wxSize(m_width,m_height), GetId() ); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); #if wxUSE_STATUSBAR // send size event to status bar @@ -503,7 +503,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), { wxSizeEvent event2( wxSize(m_frameStatusBar->m_width,m_frameStatusBar->m_height), m_frameStatusBar->GetId() ); event2.SetEventObject( m_frameStatusBar ); - m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 ); + m_frameStatusBar->HandleWindowEvent( event2 ); } #endif // wxUSE_STATUSBAR diff --git a/src/gtk1/glcanvas.cpp b/src/gtk1/glcanvas.cpp index e865645b87..4f8a411d78 100644 --- a/src/gtk1/glcanvas.cpp +++ b/src/gtk1/glcanvas.cpp @@ -68,7 +68,7 @@ gtk_glwindow_map_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win ) { wxPaintEvent event( win->GetId() ); event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); win->GetUpdateRegion().Clear(); @@ -126,7 +126,7 @@ gtk_glcanvas_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, w wxSizeEvent event( wxSize(win->m_width,win->m_height), win->GetId() ); event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } } @@ -271,7 +271,7 @@ void wxGLCanvas::OnInternalIdle() { wxPaintEvent event( GetId() ); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); GetUpdateRegion().Clear(); } diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp index 2af807102d..9c89f4584c 100644 --- a/src/gtk1/listbox.cpp +++ b/src/gtk1/listbox.cpp @@ -110,12 +110,12 @@ static gint gtk_listitem_focus_in_callback( GtkWidget *WXUNUSED(widget), win->m_hasFocus = true; wxChildFocusEvent eventChildFocus(win); - (void)win->GetEventHandler()->ProcessEvent(eventChildFocus); + (void)win->HandleWindowEvent(eventChildFocus); wxFocusEvent eventFocus(wxEVT_SET_FOCUS, win->GetId()); eventFocus.SetEventObject(win); - (void)win->GetEventHandler()->ProcessEvent(eventFocus); + (void)win->HandleWindowEvent(eventFocus); } return FALSE; @@ -149,7 +149,7 @@ static gint gtk_listitem_focus_out_callback( GtkWidget *WXUNUSED(widget), // process it too as otherwise bad things happen, especially in GTK2 // where the text control simply aborts the program if it doesn't get // the matching focus out event - (void)win->GetEventHandler()->ProcessEvent( event ); + (void)win->HandleWindowEvent( event ); } return FALSE; @@ -202,7 +202,7 @@ gtk_listbox_button_release_callback( GtkWidget * WXUNUSED(widget), event.SetInt(n); - listbox->GetEventHandler()->ProcessEvent( event ); + listbox->HandleWindowEvent( event ); return FALSE; } @@ -237,7 +237,7 @@ gtk_listbox_button_press_callback( GtkWidget *widget, wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, listbox->GetId() ); event.SetEventObject( listbox ); event.SetInt( sel ); - listbox->GetEventHandler()->ProcessEvent( event ); + listbox->HandleWindowEvent( event ); } #endif // wxUSE_CHECKLISTBOX @@ -288,7 +288,7 @@ gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxLis /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */ new_event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) ); new_event.SetCurrentFocus( listbox ); - ret = listbox->GetEventHandler()->ProcessEvent( new_event ); + ret = listbox->HandleWindowEvent( new_event ); } if ((gdk_event->keyval == GDK_Return) && (!ret)) @@ -309,7 +309,7 @@ gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxLis wxCommandEvent new_event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, listbox->GetId() ); new_event.SetEventObject( listbox ); new_event.SetInt( sel ); - ret = listbox->GetEventHandler()->ProcessEvent( new_event ); + ret = listbox->HandleWindowEvent( new_event ); } #endif // wxUSE_CHECKLISTBOX @@ -347,7 +347,7 @@ gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxLis n = -1; } new_event.SetInt(n); - listbox->GetEventHandler()->ProcessEvent( new_event ); + listbox->HandleWindowEvent( new_event ); } } @@ -412,7 +412,7 @@ static void gtk_listitem_select_cb( GtkWidget *widget, // No longer required with new code in wxLB_SINGLE // listbox->GetEventHandler()->AddPendingEvent( event ); - listbox->GetEventHandler()->ProcessEvent( event ); + listbox->HandleWindowEvent( event ); } extern "C" { diff --git a/src/gtk1/mdi.cpp b/src/gtk1/mdi.cpp index 295aef91fb..e906cb600b 100644 --- a/src/gtk1/mdi.cpp +++ b/src/gtk1/mdi.cpp @@ -66,7 +66,7 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget), { wxActivateEvent event1( wxEVT_ACTIVATE, false, child->GetId() ); event1.SetEventObject( child); - child->GetEventHandler()->ProcessEvent( event1 ); + child->HandleWindowEvent( event1 ); } // send activate event to new child @@ -100,7 +100,7 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget), wxActivateEvent event2( wxEVT_ACTIVATE, true, child->GetId() ); event2.SetEventObject( child); - child->GetEventHandler()->ProcessEvent( event2 ); + child->HandleWindowEvent( event2 ); } } diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp index 7fbcb2cfb5..62906a4709 100644 --- a/src/gtk1/menu.cpp +++ b/src/gtk1/menu.cpp @@ -143,7 +143,7 @@ static void DoCommonMenuCallbackCode(wxMenu *menu, wxMenuEvent& event) wxWindow *win = menu->GetInvokingWindow(); if (win) - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } extern "C" { @@ -632,7 +632,7 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu ) commandEvent.SetInt(item->IsChecked()); commandEvent.SetEventObject(menu); - frame->GetEventHandler()->ProcessEvent(commandEvent); + frame->HandleWindowEvent(commandEvent); } else { @@ -666,7 +666,7 @@ static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu ) return; wxWindow *win = menu->GetInvokingWindow(); - if (win) win->GetEventHandler()->ProcessEvent( event ); + if (win) win->HandleWindowEvent( event ); } } @@ -695,7 +695,7 @@ static void gtk_menu_nolight_callback( GtkWidget *widget, wxMenu *menu ) wxWindow *win = menu->GetInvokingWindow(); if (win) - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } } diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp index ddc1c86ddf..b5d0a93d56 100644 --- a/src/gtk1/notebook.cpp +++ b/src/gtk1/notebook.cpp @@ -249,7 +249,7 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk event.SetCurrentFocus( notebook ); wxNotebookPage *client = notebook->GetPage(sel); - if ( !client->GetEventHandler()->ProcessEvent( event ) ) + if ( !client->HandleWindowEvent( event ) ) { client->SetFocus(); } diff --git a/src/gtk1/popupwin.cpp b/src/gtk1/popupwin.cpp index 77c4044882..26ed0610b5 100644 --- a/src/gtk1/popupwin.cpp +++ b/src/gtk1/popupwin.cpp @@ -62,7 +62,7 @@ static gint gtk_popup_button_press (GtkWidget *widget, GdkEvent *gdk_event, wxPo wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() ); event.SetEventObject( win ); - (void)win->GetEventHandler()->ProcessEvent( event ); + (void)win->HandleWindowEvent( event ); return TRUE; } @@ -337,7 +337,7 @@ void wxPopupWindow::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int wxSizeEvent event( wxSize(m_width,m_height), GetId() ); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); } void wxPopupWindow::OnInternalIdle() diff --git a/src/gtk1/radiobox.cpp b/src/gtk1/radiobox.cpp index 7d906ebce7..7aab3d84f8 100644 --- a/src/gtk1/radiobox.cpp +++ b/src/gtk1/radiobox.cpp @@ -57,7 +57,7 @@ static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioBo event.SetInt( rb->GetSelection() ); event.SetString( rb->GetStringSelection() ); event.SetEventObject( rb ); - rb->GetEventHandler()->ProcessEvent(event); + rb->HandleWindowEvent(event); } } @@ -133,7 +133,7 @@ static gint gtk_radiobutton_focus_in( GtkWidget *WXUNUSED(widget), // never stop the signal emission, it seems to break the kbd handling // inside the radiobox - (void)win->GetEventHandler()->ProcessEvent( event ); + (void)win->HandleWindowEvent( event ); } return FALSE; @@ -586,7 +586,7 @@ void wxRadioBox::OnInternalIdle() wxFocusEvent event( wxEVT_KILL_FOCUS, GetId() ); event.SetEventObject( this ); - (void)GetEventHandler()->ProcessEvent( event ); + (void)HandleWindowEvent( event ); } if (g_delayedFocus == this) diff --git a/src/gtk1/radiobut.cpp b/src/gtk1/radiobut.cpp index 278cfbabd2..9367e3fde1 100644 --- a/src/gtk1/radiobut.cpp +++ b/src/gtk1/radiobut.cpp @@ -52,7 +52,7 @@ void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioButton *r wxCommandEvent event( wxEVT_COMMAND_RADIOBUTTON_SELECTED, rb->GetId()); event.SetInt( rb->GetValue() ); event.SetEventObject( rb ); - rb->GetEventHandler()->ProcessEvent( event ); + rb->HandleWindowEvent( event ); } } diff --git a/src/gtk1/scrolbar.cpp b/src/gtk1/scrolbar.cpp index b2ef2c4cf1..ea6a98e71f 100644 --- a/src/gtk1/scrolbar.cpp +++ b/src/gtk1/scrolbar.cpp @@ -70,13 +70,13 @@ static void gtk_scrollbar_callback( GtkAdjustment *adjust, { wxScrollEvent event( g_currentUpDownEvent, win->GetId(), value, orient ); event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } // throw other event (wxEVT_SCROLL_THUMBTRACK) wxScrollEvent event( command, win->GetId(), value, orient ); event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); /* wxCommandEvent cevent( wxEVT_COMMAND_SCROLLBAR_UPDATED, win->GetId() ); @@ -149,7 +149,7 @@ gtk_scrollbar_button_release_callback( GtkRange *WXUNUSED(widget), wxScrollEvent event( command, win->GetId(), value, orient ); event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } win->m_isScrolling = false; diff --git a/src/gtk1/slider.cpp b/src/gtk1/slider.cpp index e0070f21ed..f704d40817 100644 --- a/src/gtk1/slider.cpp +++ b/src/gtk1/slider.cpp @@ -54,19 +54,19 @@ ProcessScrollEvent(wxSlider *win, wxEventType evtType, double dvalue) int value = (int)(dvalue < 0 ? dvalue - 0.5 : dvalue + 0.5); wxScrollEvent event( evtType, win->GetId(), value, orient ); event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); if ( evtType != wxEVT_SCROLL_THUMBTRACK ) { wxScrollEvent event2(wxEVT_SCROLL_CHANGED, win->GetId(), value, orient); event2.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event2 ); + win->HandleWindowEvent( event2 ); } wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, win->GetId() ); cevent.SetEventObject( win ); cevent.SetInt( value ); - win->GetEventHandler()->ProcessEvent( cevent ); + win->HandleWindowEvent( cevent ); } //----------------------------------------------------------------------------- diff --git a/src/gtk1/spinbutt.cpp b/src/gtk1/spinbutt.cpp index 84e55b4d93..250fda3d2a 100644 --- a/src/gtk1/spinbutt.cpp +++ b/src/gtk1/spinbutt.cpp @@ -66,7 +66,7 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi event.SetPosition( value ); event.SetEventObject( win ); - if ((win->GetEventHandler()->ProcessEvent( event )) && + if ((win->HandleWindowEvent( event )) && !event.IsAllowed() ) { /* program has vetoed */ @@ -94,7 +94,7 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi wxSpinEvent event2( command, win->GetId()); event2.SetPosition( value ); event2.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event2 ); + win->HandleWindowEvent( event2 ); } } } diff --git a/src/gtk1/spinctrl.cpp b/src/gtk1/spinctrl.cpp index e2a7824071..f0beb6ac45 100644 --- a/src/gtk1/spinctrl.cpp +++ b/src/gtk1/spinctrl.cpp @@ -60,7 +60,7 @@ static void gtk_spinctrl_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win // values in range 5..50 is then, ummm, quite challenging (hint: you can't // enter 1!) (VZ) event.SetInt( (int)ceil(win->m_adjust->value) ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } } @@ -82,7 +82,7 @@ gtk_spinctrl_text_changed_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win // see above event.SetInt( (int)ceil(win->m_adjust->value) ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } } @@ -283,7 +283,7 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event ) GtkSpinButton *gsb = GTK_SPIN_BUTTON(m_widget); wxString val = wxGTK_CONV_BACK( gtk_entry_get_text( &gsb->entry ) ); evt.SetString( val ); - if (GetEventHandler()->ProcessEvent(evt)) return; + if (HandleWindowEvent(evt)) return; } event.Skip(); diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 06460bd944..1df0a5b8b1 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -119,7 +119,7 @@ gtk_insert_text_callback(GtkEditable *editable, wxCommandEvent event(wxEVT_COMMAND_TEXT_MAXLEN, win->GetId()); event.SetEventObject(win); event.SetString(win->GetValue()); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } } } @@ -145,7 +145,7 @@ gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win ) wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, win->GetId() ); event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } } @@ -999,7 +999,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &key_event ) wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); event.SetEventObject(this); event.SetString(GetValue()); - if (GetEventHandler()->ProcessEvent(event)) return; + if (HandleWindowEvent(event)) return; } if ((key_event.GetKeyCode() == WXK_RETURN) && !(m_windowStyle & wxTE_MULTILINE)) diff --git a/src/gtk1/tglbtn.cpp b/src/gtk1/tglbtn.cpp index 78b4a596c9..a4f9d6da9e 100644 --- a/src/gtk1/tglbtn.cpp +++ b/src/gtk1/tglbtn.cpp @@ -43,7 +43,7 @@ static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxTog wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, cb->GetId()); event.SetInt(cb->GetValue()); event.SetEventObject(cb); - cb->GetEventHandler()->ProcessEvent(event); + cb->HandleWindowEvent(event); } } diff --git a/src/gtk1/toplevel.cpp b/src/gtk1/toplevel.cpp index a6f76dadc7..0a690c2e07 100644 --- a/src/gtk1/toplevel.cpp +++ b/src/gtk1/toplevel.cpp @@ -159,7 +159,7 @@ static gint gtk_frame_focus_in_callback( GtkWidget *widget, wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame); wxActivateEvent event(wxEVT_ACTIVATE, true, g_activeFrame->GetId()); event.SetEventObject(g_activeFrame); - g_activeFrame->GetEventHandler()->ProcessEvent(event); + g_activeFrame->HandleWindowEvent(event); return FALSE; } @@ -191,7 +191,7 @@ static gint gtk_frame_focus_out_callback( GtkWidget *WXUNUSED(widget), wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame); wxActivateEvent event(wxEVT_ACTIVATE, false, g_activeFrame->GetId()); event.SetEventObject(g_activeFrame); - g_activeFrame->GetEventHandler()->ProcessEvent(event); + g_activeFrame->HandleWindowEvent(event); g_activeFrame = NULL; } @@ -291,7 +291,7 @@ gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WX wxMoveEvent mevent( wxPoint(win->m_x,win->m_y), win->GetId() ); mevent.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( mevent ); + win->HandleWindowEvent( mevent ); return FALSE; } @@ -1020,7 +1020,7 @@ void wxTopLevelWindowGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), // send size event to frame wxSizeEvent event( wxSize(m_width,m_height), GetId() ); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); m_resizing = false; } diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 6836677cc8..a2e39a0d66 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -1066,7 +1066,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, if ( wxTranslateGTKKeyEventToWx(event, win, gdk_event) ) { // Emit KEY_DOWN event - ret = win->GetEventHandler()->ProcessEvent( event ); + ret = win->HandleWindowEvent( event ); } else { @@ -1122,12 +1122,12 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, if (parent) { event.SetEventType( wxEVT_CHAR_HOOK ); - ret = parent->GetEventHandler()->ProcessEvent( event ); + ret = parent->HandleWindowEvent( event ); } if (!ret) { event.SetEventType(wxEVT_CHAR); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } } return true; @@ -1146,7 +1146,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, if (command != -1) { wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command ); - ret = ancestor->GetEventHandler()->ProcessEvent( command_event ); + ret = ancestor->HandleWindowEvent( command_event ); break; } if (ancestor->IsTopLevel()) @@ -1191,13 +1191,13 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, if (parent) { event.SetEventType( wxEVT_CHAR_HOOK ); - ret = parent->GetEventHandler()->ProcessEvent( event ); + ret = parent->HandleWindowEvent( event ); } if (!ret) { event.SetEventType(wxEVT_CHAR); - ret = win->GetEventHandler()->ProcessEvent( event ); + ret = win->HandleWindowEvent( event ); } } } @@ -1227,7 +1227,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, // CTRL-TAB changes the (parent) window, i.e. switch notebook page new_event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) ); new_event.SetCurrentFocus( win ); - ret = win->GetParent()->GetEventHandler()->ProcessEvent( new_event ); + ret = win->GetParent()->HandleWindowEvent( new_event ); } // generate wxID_CANCEL if has been pressed (typically in dialogs) @@ -1263,7 +1263,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, { wxCommandEvent eventClick(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL); eventClick.SetEventObject(btnCancel); - ret = btnCancel->GetEventHandler()->ProcessEvent(eventClick); + ret = btnCancel->HandleWindowEvent(eventClick); } } @@ -1304,7 +1304,7 @@ static gint gtk_window_key_release_callback( GtkWidget *widget, return FALSE; } - if ( !win->GetEventHandler()->ProcessEvent( event ) ) + if ( !win->HandleWindowEvent( event ) ) return FALSE; gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_release_event" ); @@ -1616,7 +1616,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, } } - if (win->GetEventHandler()->ProcessEvent( event )) + if (win->HandleWindowEvent( event )) { gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_press_event" ); g_lastMouseEvent = NULL; @@ -1638,7 +1638,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, win->GetId(), win->ClientToScreen(event.GetPosition())); evtCtx.SetEventObject(win); - return win->GetEventHandler()->ProcessEvent(evtCtx); + return win->HandleWindowEvent(evtCtx); } return FALSE; @@ -1701,7 +1701,7 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, if ( !g_captureWindow ) win = FindWindowForMouseEvent(win, event.m_x, event.m_y); - if (win->GetEventHandler()->ProcessEvent( event )) + if (win->HandleWindowEvent( event )) { gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_release_event" ); return TRUE; @@ -1771,7 +1771,7 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, : wxEVT_LEAVE_WINDOW); InitMouseEvent(win, eventM, gdk_event); eventM.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(eventM); + win->HandleWindowEvent(eventM); } } else // no capture @@ -1779,7 +1779,7 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, win = FindWindowForMouseEvent(win, event.m_x, event.m_y); } - bool ret = win->GetEventHandler()->ProcessEvent( event ); + bool ret = win->HandleWindowEvent( event ); g_lastMouseEvent = NULL; if ( ret ) @@ -1802,12 +1802,12 @@ static bool DoSendFocusEvents(wxWindow *win) // Notify the parent keeping track of focus for the kbd navigation // purposes that we got it. wxChildFocusEvent eventChildFocus(win); - (void)win->GetEventHandler()->ProcessEvent(eventChildFocus); + (void)win->HandleWindowEvent(eventChildFocus); wxFocusEvent eventFocus(wxEVT_SET_FOCUS, win->GetId()); eventFocus.SetEventObject(win); - return win->GetEventHandler()->ProcessEvent(eventFocus); + return win->HandleWindowEvent(eventFocus); } extern "C" { @@ -1908,7 +1908,7 @@ static gint gtk_window_focus_out_callback( GtkWidget *WXUNUSED(widget), // process it too as otherwise bad things happen, especially in GTK2 // where the text control simply aborts the program if it doesn't get // the matching focus out event - (void)win->GetEventHandler()->ProcessEvent( event ); + (void)win->HandleWindowEvent( event ); } return FALSE; @@ -1950,7 +1950,7 @@ gint gtk_window_enter_callback( GtkWidget *widget, event.m_x = x + pt.x; event.m_y = y + pt.y; - if (win->GetEventHandler()->ProcessEvent( event )) + if (win->HandleWindowEvent( event )) { gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "enter_notify_event" ); return TRUE; @@ -2002,7 +2002,7 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_ event.m_x = x + pt.x; event.m_y = y + pt.y; - if (win->GetEventHandler()->ProcessEvent( event )) + if (win->HandleWindowEvent( event )) { gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "leave_notify_event" ); return TRUE; @@ -2042,7 +2042,7 @@ static void gtk_window_vscroll_callback( GtkAdjustment *adjust, wxScrollWinEvent event( command, value, wxVERTICAL ); event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } } @@ -2075,7 +2075,7 @@ static void gtk_window_hscroll_callback( GtkAdjustment *adjust, wxScrollWinEvent event( command, value, wxHORIZONTAL ); event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } } @@ -2141,7 +2141,7 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *widget, wxScrollWinEvent event( command, value, dir ); event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } win->m_isScrolling = false; @@ -2179,7 +2179,7 @@ gtk_window_realized_callback( GtkWidget *WXUNUSED(widget), wxWindow *win ) wxWindowCreateEvent event( win ); event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); return FALSE; } @@ -2213,7 +2213,7 @@ void gtk_window_size_callback( GtkWidget *WXUNUSED(widget), { wxSizeEvent event( win->GetSize(), win->GetId() ); event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + win->HandleWindowEvent( event ); } } } @@ -2917,7 +2917,7 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags { wxSizeEvent event( wxSize(m_width,m_height), GetId() ); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); } m_resizing = false; @@ -3208,7 +3208,7 @@ bool wxWindowGTK::Show( bool show ) wxShowEvent eventShow(GetId(), show); eventShow.SetEventObject(this); - GetEventHandler()->ProcessEvent(eventShow); + HandleWindowEvent(eventShow); return true; } @@ -3596,7 +3596,7 @@ void wxWindowGTK::GtkSendPaintEvents() wxEraseEvent erase_event( GetId(), &dc ); erase_event.SetEventObject( this ); - if (!GetEventHandler()->ProcessEvent(erase_event) && GetBackgroundStyle() != wxBG_STYLE_CUSTOM) + if (!HandleWindowEvent(erase_event) && GetBackgroundStyle() != wxBG_STYLE_CUSTOM) { if (!g_eraseGC) { @@ -3618,11 +3618,11 @@ void wxWindowGTK::GtkSendPaintEvents() wxNcPaintEvent nc_paint_event( GetId() ); nc_paint_event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( nc_paint_event ); + HandleWindowEvent( nc_paint_event ); wxPaintEvent paint_event( GetId() ); paint_event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( paint_event ); + HandleWindowEvent( paint_event ); m_clipPaintRegion = false; diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index 1120af3662..4a2bf61873 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -586,7 +586,7 @@ wxMacAppMenuEventHandler( EventHandlerCallRef WXUNUSED(handler), { wxWindow *win = menu->GetInvokingWindow(); if (win) - win->GetEventHandler()->ProcessEvent(wxevent); + win->HandleWindowEvent(wxevent); } } } @@ -1408,7 +1408,7 @@ bool wxApp::MacSendKeyDownEvent( wxWindow* focus , long keymessage , long modifi wxKeyEvent event(wxEVT_KEY_DOWN) ; MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ; - handled = focus->GetEventHandler()->ProcessEvent( event ) ; + handled = focus->HandleWindowEvent( event ) ; if ( handled && event.GetSkipped() ) handled = false ; @@ -1455,7 +1455,7 @@ bool wxApp::MacSendKeyUpEvent( wxWindow* focus , long keymessage , long modifier bool handled; wxKeyEvent event( wxEVT_KEY_UP ) ; MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ; - handled = focus->GetEventHandler()->ProcessEvent( event ) ; + handled = focus->HandleWindowEvent( event ) ; return handled ; } @@ -1476,7 +1476,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers if (tlw) { event.SetEventType( wxEVT_CHAR_HOOK ); - handled = tlw->GetEventHandler()->ProcessEvent( event ); + handled = tlw->HandleWindowEvent( event ); if ( handled && event.GetSkipped() ) handled = false ; } @@ -1485,7 +1485,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers { event.SetEventType( wxEVT_CHAR ); event.Skip( false ) ; - handled = focus->GetEventHandler()->ProcessEvent( event ) ; + handled = focus->HandleWindowEvent( event ) ; } if ( !handled && (keyval == WXK_TAB) ) @@ -1501,7 +1501,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */ new_event.SetWindowChange( event.ControlDown() ); new_event.SetCurrentFocus( focus ); - handled = focus->GetParent()->GetEventHandler()->ProcessEvent( new_event ); + handled = focus->GetParent()->HandleWindowEvent( new_event ); if ( handled && new_event.GetSkipped() ) handled = false ; } @@ -1540,7 +1540,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers // generate wxID_CANCEL if command-. or has been pressed (typically in dialogs) wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL); new_event.SetEventObject( focus ); - handled = focus->GetEventHandler()->ProcessEvent( new_event ); + handled = focus->HandleWindowEvent( new_event ); } } #endif diff --git a/src/mac/carbon/checklst.cpp b/src/mac/carbon/checklst.cpp index 1505803cc8..5f0fecb5e2 100644 --- a/src/mac/carbon/checklst.cpp +++ b/src/mac/carbon/checklst.cpp @@ -222,7 +222,7 @@ public : wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, checklist->GetId() ); event.SetInt( owner->GetLineFromItem( this ) ); event.SetEventObject( checklist ); - checklist->GetEventHandler()->ProcessEvent( event ); + checklist->HandleWindowEvent( event ); } break; diff --git a/src/mac/carbon/combobox.cpp b/src/mac/carbon/combobox.cpp index 3f7ca169d5..4db3c45a02 100644 --- a/src/mac/carbon/combobox.cpp +++ b/src/mac/carbon/combobox.cpp @@ -83,14 +83,14 @@ protected: NavEvent.SetWindowChange(false); // Get the parent of the combo and have it process the navigation? - if (m_cb->GetParent()->GetEventHandler()->ProcessEvent(NavEvent)) + if (m_cb->GetParent()->HandleWindowEvent(NavEvent)) return; } // send the event to the combobox class in case the user has bound EVT_CHAR wxKeyEvent kevt(event); kevt.SetEventObject(m_cb); - if (m_cb->GetEventHandler()->ProcessEvent(kevt)) + if (m_cb->HandleWindowEvent(kevt)) // If the event was handled and not skipped then we're done return; @@ -103,7 +103,7 @@ protected: // This will invoke the dialog default action, // such as the clicking the default button. - if (!m_cb->GetEventHandler()->ProcessEvent( event )) + if (!m_cb->HandleWindowEvent( event )) { wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow); if ( tlw && tlw->GetDefaultItem() ) @@ -128,7 +128,7 @@ protected: { event.SetEventObject(m_cb); event.SetId(m_cb->GetId()); - if (! m_cb->GetEventHandler()->ProcessEvent(event)) + if (! m_cb->HandleWindowEvent(event)) event.Skip(); } @@ -136,7 +136,7 @@ protected: { event.SetEventObject(m_cb); event.SetId(m_cb->GetId()); - if (! m_cb->GetEventHandler()->ProcessEvent(event)) + if (! m_cb->HandleWindowEvent(event)) event.Skip(); } @@ -144,7 +144,7 @@ protected: { event.SetEventObject(m_cb); event.SetId(m_cb->GetId()); - if (! m_cb->GetEventHandler()->ProcessEvent(event)) + if (! m_cb->HandleWindowEvent(event)) event.Skip(); } diff --git a/src/mac/carbon/combobxc.cpp b/src/mac/carbon/combobxc.cpp index 670cbf7b6d..6bb1dd4b48 100644 --- a/src/mac/carbon/combobxc.cpp +++ b/src/mac/carbon/combobxc.cpp @@ -65,7 +65,7 @@ static pascal OSStatus wxMacComboBoxEventHandler( EventHandlerCallRef handler , event.SetInt( cb->GetSelection() ); event.SetString( cb->GetStringSelection() ); event.SetEventObject( cb ); - cb->GetEventHandler()->ProcessEvent( event ); + cb->HandleWindowEvent( event ); } break; default : @@ -126,7 +126,7 @@ protected: event.SetInt( 0 ); event.SetString( value ); event.SetEventObject( m_cb ); - m_cb->GetEventHandler()->ProcessEvent( event ); + m_cb->HandleWindowEvent( event ); } else { @@ -141,7 +141,7 @@ protected: event.SetInt( m_cb->GetCount() - 1 ); event.SetString( value ); event.SetEventObject( m_cb ); - m_cb->GetEventHandler()->ProcessEvent( event ); + m_cb->HandleWindowEvent( event ); } // This will invoke the dialog default action, such diff --git a/src/mac/carbon/control.cpp b/src/mac/carbon/control.cpp index 5b004c794a..f787ea9812 100644 --- a/src/mac/carbon/control.cpp +++ b/src/mac/carbon/control.cpp @@ -78,7 +78,7 @@ bool wxControl::ProcessCommand( wxCommandEvent &event ) // Tries: // 1) OnCommand, starting at this window and working up parent hierarchy // 2) OnCommand then calls ProcessEvent to search the event tables. - return GetEventHandler()->ProcessEvent( event ); + return HandleWindowEvent( event ); } void wxControl::OnKeyDown( wxKeyEvent &WXUNUSED(event) ) diff --git a/src/mac/carbon/databrow.cpp b/src/mac/carbon/databrow.cpp index 930effca50..5da1756663 100644 --- a/src/mac/carbon/databrow.cpp +++ b/src/mac/carbon/databrow.cpp @@ -738,7 +738,7 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc( dataViewEvent.SetEventObject(dataViewCtrlPtr); dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast(itemID))); // finally send the equivalent wxWidget event: - dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); + dataViewCtrlPtr->HandleWindowEvent(dataViewEvent); // opening the container is allowed if not vetoed: return ::SetDataBrowserItemDataBooleanValue(itemData,dataViewEvent.IsAllowed()); } /* block */ @@ -754,7 +754,7 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc( dataViewEvent.SetEventObject(dataViewCtrlPtr); dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast(itemID))); // finally send the equivalent wxWidget event: - dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); + dataViewCtrlPtr->HandleWindowEvent(dataViewEvent); // opening the container is allowed if not vetoed: return ::SetDataBrowserItemDataBooleanValue(itemData,dataViewEvent.IsAllowed()); } /* block */ @@ -792,7 +792,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da dataViewEvent.SetEventObject(dataViewCtrlPtr); dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast(itemID))); // finally send the equivalent wxWidget event: - dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); + dataViewCtrlPtr->HandleWindowEvent(dataViewEvent); } /* block */ break; case kDataBrowserContainerOpened: @@ -803,7 +803,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da dataViewEvent.SetEventObject(dataViewCtrlPtr); dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast(itemID))); // finally send the equivalent wxWidget event: - dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); + dataViewCtrlPtr->HandleWindowEvent(dataViewEvent); // add children to the expanded container: dataViewCtrlPtr->AddChildrenLevel(wxDataViewItem(reinterpret_cast(itemID))); } /* block */ @@ -826,7 +826,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da dataViewEvent.SetDataViewColumn(dataViewCtrlPtr->GetColumnPtr(propertyID)); } /* if */ // finally send the equivalent wxWidget event: - dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); + dataViewCtrlPtr->HandleWindowEvent(dataViewEvent); } /* block */ break; case kDataBrowserEditStopped: @@ -847,7 +847,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da dataViewEvent.SetDataViewColumn(dataViewCtrlPtr->GetColumnPtr(propertyID)); } /* if */ // finally send the equivalent wxWidget event: - dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); + dataViewCtrlPtr->HandleWindowEvent(dataViewEvent); } /* block */ break; case kDataBrowserItemAdded: @@ -862,7 +862,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da dataViewEvent.SetEventObject(dataViewCtrlPtr); dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast(itemID))); // finally send the equivalent wxWidget event: - dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); + dataViewCtrlPtr->HandleWindowEvent(dataViewEvent); } /* block */ break; case kDataBrowserItemRemoved: @@ -877,7 +877,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da dataViewEvent.SetEventObject(dataViewCtrlPtr); dataViewEvent.SetModel (dataViewCtrlPtr->GetModel()); // finally send the equivalent wxWidget event: - dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); + dataViewCtrlPtr->HandleWindowEvent(dataViewEvent); } /* block */ break; case kDataBrowserUserStateChanged: @@ -918,7 +918,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da dataViewEvent.SetColumn(columnIndex); dataViewEvent.SetDataViewColumn(columnPtr); // finally send the equivalent wxWidget event: - dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); + dataViewCtrlPtr->HandleWindowEvent(dataViewEvent); } /* if */ } /* if */ } /* if */ diff --git a/src/mac/carbon/dataview.cpp b/src/mac/carbon/dataview.cpp index dc95fa24c1..6e2c855c20 100644 --- a/src/mac/carbon/dataview.cpp +++ b/src/mac/carbon/dataview.cpp @@ -84,7 +84,7 @@ static pascal OSStatus wxMacDataViewCtrlEventHandler(EventHandlerCallRef handler DataViewEvent.SetColumn(columnIndex); DataViewEvent.SetDataViewColumn(DataViewCtrlPtr->GetColumn(columnIndex)); // finally sent the equivalent wxWidget event: - DataViewCtrlPtr->GetEventHandler()->ProcessEvent(DataViewEvent); + DataViewCtrlPtr->HandleWindowEvent(DataViewEvent); return ::CallNextEventHandler(handler,EventReference); } /* if */ else @@ -238,7 +238,7 @@ public: dataViewEvent.SetEventObject(dataViewCtrlPtr); dataViewEvent.SetItem(item); // sent the equivalent wxWidget event: - dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); + dataViewCtrlPtr->HandleWindowEvent(dataViewEvent); // done return true; } /* if */ @@ -270,7 +270,7 @@ public: for (size_t i=0; i(itemIDs[i])); - dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); + dataViewCtrlPtr->HandleWindowEvent(dataViewEvent); } /* for */ } /* if */ // release allocated array space: @@ -357,7 +357,7 @@ public: dataViewEvent.SetColumn(col); dataViewEvent.SetItem(item); // send the equivalent wxWidget event: - dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); + dataViewCtrlPtr->HandleWindowEvent(dataViewEvent); // done return true; } /* if */ diff --git a/src/mac/carbon/fontdlg.cpp b/src/mac/carbon/fontdlg.cpp index c0a58e2c56..b6be431de3 100644 --- a/src/mac/carbon/fontdlg.cpp +++ b/src/mac/carbon/fontdlg.cpp @@ -357,7 +357,7 @@ void wxFontColourSwatchCtrl::OnMouseEvent(wxMouseEvent& event) Refresh(); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId()); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } } diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp index 08b4ba77ef..ee803cb958 100644 --- a/src/mac/carbon/listbox.cpp +++ b/src/mac/carbon/listbox.cpp @@ -447,7 +447,7 @@ void wxMacListBoxItem::Notification(wxMacDataItemBrowserControl *owner , // direct notification is not always having the listbox GetSelection() // having in synch with event, so use wxPostEvent instead - // list->GetEventHandler()->ProcessEvent(event); + // list->HandleWindowEvent(event); wxPostEvent( list->GetEventHandler(), event ); } diff --git a/src/mac/carbon/listctrl_mac.cpp b/src/mac/carbon/listctrl_mac.cpp index 66046b29ca..ba97e1840b 100644 --- a/src/mac/carbon/listctrl_mac.cpp +++ b/src/mac/carbon/listctrl_mac.cpp @@ -152,7 +152,7 @@ static pascal OSStatus wxMacListCtrlEventHandler( EventHandlerCallRef handler , // FIXME: we can't use the sort property for virtual listctrls // so we need to find a better way to determine which column was clicked... if (!window->IsVirtual()) - window->GetEventHandler()->ProcessEvent( le ); + window->HandleWindowEvent( le ); } result = CallNextEventHandler(handler, event); break; @@ -305,7 +305,7 @@ bool wxMacListCtrlEventDelegate::ProcessEvent( wxEvent& event ) if ( !event.IsKindOf( CLASSINFO( wxCommandEvent ) ) ) { - if (m_list->GetEventHandler()->ProcessEvent( event )) + if (m_list->HandleWindowEvent( event )) return true; } return wxEvtHandler::ProcessEvent(event); @@ -648,7 +648,7 @@ void wxListCtrl::FireMouseEvent(wxEventType eventType, wxPoint position) le.m_itemIndex = item; le.m_item.m_itemId = item; GetItem(le.m_item); - GetEventHandler()->ProcessEvent(le); + HandleWindowEvent(le); } } @@ -697,7 +697,7 @@ void wxListCtrl::OnChar(wxKeyEvent& event) le.m_itemIndex = m_current; le.m_item.m_itemId = m_current; GetItem(le.m_item); - GetEventHandler()->ProcessEvent(le); + HandleWindowEvent(le); } } event.Skip(); @@ -1743,7 +1743,7 @@ bool wxListCtrl::DeleteItem(long item) wxListEvent event( wxEVT_COMMAND_LIST_DELETE_ITEM, GetId() ); event.SetEventObject( this ); event.m_itemIndex = item; - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); } return true; @@ -1760,7 +1760,7 @@ bool wxListCtrl::DeleteAllItems() m_dbImpl->MacClear(); wxListEvent event( wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, GetId() ); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); } return true; } @@ -1834,7 +1834,7 @@ wxTextCtrl* wxListCtrl::EditLabel(long item, wxClassInfo* textControlClass) le.m_col = 0; GetItem( le.m_item ); - if ( GetParent()->GetEventHandler()->ProcessEvent( le ) && !le.IsAllowed() ) + if ( GetParent()->HandleWindowEvent( le ) && !le.IsAllowed() ) { // vetoed by user code return NULL; @@ -2033,7 +2033,7 @@ long wxListCtrl::InsertItem(wxListItem& info) wxListEvent event( wxEVT_COMMAND_LIST_INSERT_ITEM, GetId() ); event.SetEventObject( this ); event.m_itemIndex = info.m_itemId; - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); return info.m_itemId; } return -1; @@ -2200,7 +2200,7 @@ bool wxListCtrl::OnRenameAccept(long itemEdit, const wxString& value) GetItem( le.m_item ); le.m_item.m_text = value; - return !GetEventHandler()->ProcessEvent( le ) || + return !HandleWindowEvent( le ) || le.IsAllowed(); } @@ -2215,7 +2215,7 @@ void wxListCtrl::OnRenameCancelled(long itemEdit) le.m_itemIndex = itemEdit; GetItem( le.m_item ); - GetEventHandler()->ProcessEvent( le ); + HandleWindowEvent( le ); } // ---------------------------------------------------------------------------- diff --git a/src/mac/carbon/menu.cpp b/src/mac/carbon/menu.cpp index 0635f895d9..01cf83e70e 100644 --- a/src/mac/carbon/menu.cpp +++ b/src/mac/carbon/menu.cpp @@ -374,13 +374,13 @@ bool wxMenu::ProcessCommand(wxCommandEvent & event) // Try the menu's event handler if ( /* !processed && */ GetEventHandler()) - processed = GetEventHandler()->ProcessEvent(event); + processed = HandleWindowEvent(event); // Try the window the menu was popped up from // (and up through the hierarchy) wxWindow *win = GetInvokingWindow(); if ( !processed && win ) - processed = win->GetEventHandler()->ProcessEvent(event); + processed = win->HandleWindowEvent(event); return processed; } @@ -567,7 +567,7 @@ wxInt32 wxMenu::MacHandleCommandProcess( wxMenuItem* item, int id, wxWindow* tar event.SetEventObject(targetWindow); event.SetInt(item->IsCheckable() ? item->IsChecked() : -1); - if ( targetWindow->GetEventHandler()->ProcessEvent(event) ) + if ( targetWindow->HandleWindowEvent(event) ) result = noErr ; } } @@ -601,7 +601,7 @@ wxInt32 wxMenu::MacHandleCommandUpdateStatus(wxMenuItem* WXUNUSED(item), wxWindow *win = menu->GetInvokingWindow(); if ( win ) { - processed = win->GetEventHandler()->ProcessEvent(event); + processed = win->HandleWindowEvent(event); break; } @@ -611,7 +611,7 @@ wxInt32 wxMenu::MacHandleCommandUpdateStatus(wxMenuItem* WXUNUSED(item), if ( !processed && targetWindow != NULL) { - processed = targetWindow->GetEventHandler()->ProcessEvent(event); + processed = targetWindow->HandleWindowEvent(event); } if ( processed ) diff --git a/src/mac/carbon/notebmac.cpp b/src/mac/carbon/notebmac.cpp index bbdff77f02..746e0464f3 100644 --- a/src/mac/carbon/notebmac.cpp +++ b/src/mac/carbon/notebmac.cpp @@ -509,7 +509,7 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event) event.SetEventObject( this ); wxWindow *page = m_pages[m_nSelection]; - if ( !page->GetEventHandler()->ProcessEvent( event ) ) + if ( !page->HandleWindowEvent( event ) ) { page->SetFocus(); } @@ -527,7 +527,7 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event) if ( parent ) { event.SetCurrentFocus( this ); - parent->GetEventHandler()->ProcessEvent( event ); + parent->HandleWindowEvent( event ); } } } @@ -594,7 +594,7 @@ wxInt32 wxNotebook::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTR wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId, newSel , m_nSelection ); changing.SetEventObject( this ); - GetEventHandler()->ProcessEvent( changing ); + HandleWindowEvent( changing ); if ( changing.IsAllowed() ) { @@ -602,7 +602,7 @@ wxInt32 wxNotebook::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTR wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId, newSel, m_nSelection ); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); } else { diff --git a/src/mac/carbon/popupwin.cpp b/src/mac/carbon/popupwin.cpp index f3f91de491..4049f00430 100644 --- a/src/mac/carbon/popupwin.cpp +++ b/src/mac/carbon/popupwin.cpp @@ -153,7 +153,7 @@ bool wxPopupWindow::Show(bool show) // because apps expect a size event to occur at this moment wxSizeEvent event(GetSize() , m_windowId); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } else { diff --git a/src/mac/carbon/scrolbar.cpp b/src/mac/carbon/scrolbar.cpp index e26fa27eef..c7c1263451 100644 --- a/src/mac/carbon/scrolbar.cpp +++ b/src/mac/carbon/scrolbar.cpp @@ -165,7 +165,7 @@ void wxScrollBar::MacHandleControlClick( WXWidget WXUNUSED(control), wxInt16 con // this is hardcoded window->MacOnScroll( event ); else - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); } wxInt32 wxScrollBar::MacControlHit( WXEVENTHANDLERREF WXUNUSED(handler), WXEVENTREF mevent ) @@ -221,7 +221,7 @@ wxInt32 wxScrollBar::MacControlHit( WXEVENTHANDLERREF WXUNUSED(handler), WXEVENT // this is hardcoded window->MacOnScroll( event ); else - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); return noErr; } diff --git a/src/mac/carbon/slider.cpp b/src/mac/carbon/slider.cpp index 484c775e73..ced51f397e 100644 --- a/src/mac/carbon/slider.cpp +++ b/src/mac/carbon/slider.cpp @@ -307,12 +307,12 @@ void wxSlider::MacHandleControlClick(WXWidget WXUNUSED(control), wxScrollEvent event( wxEVT_SCROLL_THUMBTRACK, m_windowId ); event.SetPosition( value ); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, m_windowId ); cevent.SetInt( value ); cevent.SetEventObject( this ); - GetEventHandler()->ProcessEvent( cevent ); + HandleWindowEvent( cevent ); } wxInt32 wxSlider::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler), @@ -327,13 +327,13 @@ wxInt32 wxSlider::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler), wxScrollEvent event( wxEVT_SCROLL_THUMBRELEASE, m_windowId ); event.SetPosition( value ); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, m_windowId ); cevent.SetInt( value ); cevent.SetEventObject( this ); - GetEventHandler()->ProcessEvent( cevent ); + HandleWindowEvent( cevent ); return noErr; } diff --git a/src/mac/carbon/spinbutt.cpp b/src/mac/carbon/spinbutt.cpp index 850e708252..02ed2e9423 100644 --- a/src/mac/carbon/spinbutt.cpp +++ b/src/mac/carbon/spinbutt.cpp @@ -133,7 +133,7 @@ void wxSpinButton::MacHandleValueChanged( int inc ) event.SetPosition( m_value ); event.SetEventObject( this ); - if ((GetEventHandler()->ProcessEvent( event )) && !event.IsAllowed()) + if ((HandleWindowEvent( event )) && !event.IsAllowed()) m_value = oldValue; m_peer->SetValue( m_value ); @@ -145,7 +145,7 @@ void wxSpinButton::MacHandleValueChanged( int inc ) wxSpinEvent event2( scrollEvent, GetId() ); event2.SetPosition( m_value ); event2.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event2 ); + HandleWindowEvent( event2 ); } } diff --git a/src/mac/carbon/spinctrl.cpp b/src/mac/carbon/spinctrl.cpp index 478fdfc1e0..47c2332911 100644 --- a/src/mac/carbon/spinctrl.cpp +++ b/src/mac/carbon/spinctrl.cpp @@ -88,7 +88,7 @@ protected: wxCommandEvent event(wxEVT_COMMAND_SPINCTRL_UPDATED, m_spin->GetId()); event.SetEventObject(m_spin); event.SetInt(l); - m_spin->GetEventHandler()->ProcessEvent(event); + m_spin->HandleWindowEvent(event); m_spin->m_oldValue = l; } @@ -116,7 +116,7 @@ protected: event.SetString(m_spin->GetText()->GetValue()); event.SetInt(val); - m_spin->GetEventHandler()->ProcessEvent(event); + m_spin->HandleWindowEvent(event); } event.Skip(); @@ -166,7 +166,7 @@ protected: event.SetEventObject(m_spin); event.SetInt(pos); - m_spin->GetEventHandler()->ProcessEvent(event); + m_spin->HandleWindowEvent(event); m_spin->m_oldValue = pos; } diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index 46c842a1a7..89ab18889a 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -518,7 +518,7 @@ void wxTextCtrl::Cut() wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, m_windowId ); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); } } @@ -532,7 +532,7 @@ void wxTextCtrl::Paste() wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, m_windowId ); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); } } @@ -847,7 +847,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); event.SetEventObject( this ); event.SetString( GetValue() ); - if ( GetEventHandler()->ProcessEvent(event) ) + if ( HandleWindowEvent(event) ) return; } diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index 778bd56588..3d0ab6b202 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -211,25 +211,25 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event { event.m_keyCode = WXK_CONTROL ; event.SetEventType( ( modifiers & controlKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; + focus->HandleWindowEvent( event ) ; } if ( /* focus && */ (modifiers ^ wxApp::s_lastModifiers ) & shiftKey ) { event.m_keyCode = WXK_SHIFT ; event.SetEventType( ( modifiers & shiftKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; + focus->HandleWindowEvent( event ) ; } if ( /* focus && */ (modifiers ^ wxApp::s_lastModifiers ) & optionKey ) { event.m_keyCode = WXK_ALT ; event.SetEventType( ( modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; + focus->HandleWindowEvent( event ) ; } if ( /* focus && */ (modifiers ^ wxApp::s_lastModifiers ) & cmdKey ) { event.m_keyCode = WXK_COMMAND ; event.SetEventType( ( modifiers & cmdKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; + focus->HandleWindowEvent( event ) ; } wxApp::s_lastModifiers = modifiers ; @@ -485,7 +485,7 @@ wxMacTopLevelMouseEventHandler(EventHandlerCallRef WXUNUSED(handler), wxToolTip::RelayEvent( g_MacLastWindow , eventleave); #endif - g_MacLastWindow->GetEventHandler()->ProcessEvent(eventleave); + g_MacLastWindow->HandleWindowEvent(eventleave); } if ( currentMouseWindow ) @@ -500,7 +500,7 @@ wxMacTopLevelMouseEventHandler(EventHandlerCallRef WXUNUSED(handler), wxToolTip::RelayEvent( currentMouseWindow , evententer ); #endif - currentMouseWindow->GetEventHandler()->ProcessEvent(evententer); + currentMouseWindow->HandleWindowEvent(evententer); } g_MacLastWindow = currentMouseWindow ; @@ -532,7 +532,7 @@ wxMacTopLevelMouseEventHandler(EventHandlerCallRef WXUNUSED(handler), wxToolTip::RelayEvent( currentMouseWindow , wxevent ); #endif - if ( currentMouseWindow->GetEventHandler()->ProcessEvent(wxevent) ) + if ( currentMouseWindow->HandleWindowEvent(wxevent) ) { if ((currentMouseWindowParent != NULL) && (currentMouseWindowParent->GetChildren().Find(currentMouseWindow) == NULL)) @@ -616,7 +616,7 @@ wxMacTopLevelWindowEventHandler(EventHandlerCallRef WXUNUSED(handler), wxActivateEvent wxevent(wxEVT_ACTIVATE, true , toplevelWindow->GetId()); wxevent.SetTimestamp( cEvent.GetTicks() ) ; wxevent.SetEventObject(toplevelWindow); - toplevelWindow->GetEventHandler()->ProcessEvent(wxevent); + toplevelWindow->HandleWindowEvent(wxevent); // we still sending an eventNotHandledErr in order to allow for default processing } break ; @@ -627,7 +627,7 @@ wxMacTopLevelWindowEventHandler(EventHandlerCallRef WXUNUSED(handler), wxActivateEvent wxevent(wxEVT_ACTIVATE, false , toplevelWindow->GetId()); wxevent.SetTimestamp( cEvent.GetTicks() ) ; wxevent.SetEventObject(toplevelWindow); - toplevelWindow->GetEventHandler()->ProcessEvent(wxevent); + toplevelWindow->HandleWindowEvent(wxevent); // we still sending an eventNotHandledErr in order to allow for default processing } break ; @@ -661,7 +661,7 @@ wxMacTopLevelWindowEventHandler(EventHandlerCallRef WXUNUSED(handler), wxSizeEvent event( r.GetSize() , toplevelWindow->GetId() ) ; event.SetEventObject( toplevelWindow ) ; - toplevelWindow->GetEventHandler()->ProcessEvent(event) ; + toplevelWindow->HandleWindowEvent(event) ; toplevelWindow->wxWindowMac::MacSuperChangedPosition() ; // like this only children will be notified } @@ -669,7 +669,7 @@ wxMacTopLevelWindowEventHandler(EventHandlerCallRef WXUNUSED(handler), { wxMoveEvent event( r.GetLeftTop() , toplevelWindow->GetId() ) ; event.SetEventObject( toplevelWindow ) ; - toplevelWindow->GetEventHandler()->ProcessEvent(event) ; + toplevelWindow->HandleWindowEvent(event) ; } result = noErr ; @@ -697,7 +697,7 @@ wxMacTopLevelWindowEventHandler(EventHandlerCallRef WXUNUSED(handler), wxSizeEvent wxevent( r , toplevelWindow->GetId() ) ; wxevent.SetEventObject( toplevelWindow ) ; wxRect adjustR = r ; - if ( toplevelWindow->GetEventHandler()->ProcessEvent(wxevent) ) + if ( toplevelWindow->HandleWindowEvent(wxevent) ) adjustR = wxevent.GetRect() ; if ( toplevelWindow->GetMaxWidth() != -1 && adjustR.GetWidth() > toplevelWindow->GetMaxWidth() ) @@ -1256,7 +1256,7 @@ void wxTopLevelWindowMac::DoMacCreateRealWindow( } wxWindowCreateEvent event(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } void wxTopLevelWindowMac::ClearBackground() @@ -1333,7 +1333,7 @@ bool wxTopLevelWindowMac::Show(bool show) // because apps expect a size event to occur at this moment wxSizeEvent event(GetSize() , m_windowId); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } else { @@ -1416,7 +1416,7 @@ bool wxTopLevelWindowMac::ShowWithEffect(wxShowEffect effect, // because apps expect a size event to occur at this moment wxSizeEvent event(GetSize() , m_windowId); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); return true; } diff --git a/src/mac/carbon/treectrl.cpp b/src/mac/carbon/treectrl.cpp index 7977dabef9..82a90b0854 100644 --- a/src/mac/carbon/treectrl.cpp +++ b/src/mac/carbon/treectrl.cpp @@ -308,13 +308,13 @@ bool wxTreeCtrl::ExpandItem(long item, int action) bIsExpanded ? wxEVT_COMMAND_TREE_ITEM_EXPANDING : wxEVT_COMMAND_TREE_ITEM_COLLAPSING); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); event.SetEventType( bIsExpanded ? wxEVT_COMMAND_TREE_ITEM_EXPANDED : wxEVT_COMMAND_TREE_ITEM_COLLAPSED); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } return bOk; diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index fd02b9947c..6c158e6acd 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -334,7 +334,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl inKillFocusEvent = true ; wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId()); event.SetEventObject(thisWindow); - thisWindow->GetEventHandler()->ProcessEvent(event) ; + thisWindow->HandleWindowEvent(event) ; inKillFocusEvent = false ; } } @@ -344,7 +344,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl // panel wants to track the window which was the last to have focus in it wxLogTrace(_T("Focus"), _T("focus set(%p)"), wx_static_cast(void*, thisWindow)); wxChildFocusEvent eventFocus((wxWindow*)thisWindow); - thisWindow->GetEventHandler()->ProcessEvent(eventFocus); + thisWindow->HandleWindowEvent(eventFocus); #if wxUSE_CARET if ( thisWindow->GetCaret() ) @@ -353,7 +353,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl wxFocusEvent event(wxEVT_SET_FOCUS, thisWindow->GetId()); event.SetEventObject(thisWindow); - thisWindow->GetEventHandler()->ProcessEvent(event) ; + thisWindow->HandleWindowEvent(event) ; } } break; @@ -423,7 +423,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl inKillFocusEvent = true ; wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId()); event.SetEventObject(thisWindow); - thisWindow->GetEventHandler()->ProcessEvent(event) ; + thisWindow->HandleWindowEvent(event) ; inKillFocusEvent = false ; } } @@ -432,7 +432,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl // panel wants to track the window which was the last to have focus in it wxLogTrace(_T("Focus"), _T("focus set(%p)"), wx_static_cast(void*, thisWindow)); wxChildFocusEvent eventFocus((wxWindow*)thisWindow); - thisWindow->GetEventHandler()->ProcessEvent(eventFocus); + thisWindow->HandleWindowEvent(eventFocus); #if wxUSE_CARET if ( thisWindow->GetCaret() ) @@ -441,7 +441,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl wxFocusEvent event(wxEVT_SET_FOCUS, thisWindow->GetId()); event.SetEventObject(thisWindow); - thisWindow->GetEventHandler()->ProcessEvent(event) ; + thisWindow->HandleWindowEvent(event) ; } #endif } @@ -1775,7 +1775,7 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height) wxPoint point(actualX, actualY); wxMoveEvent event(point, m_windowId); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event) ; + HandleWindowEvent(event) ; } if ( doResize ) @@ -1784,7 +1784,7 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height) wxSize size(actualWidth, actualHeight); wxSizeEvent event(size, m_windowId); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } } } @@ -2388,7 +2388,7 @@ void wxWindowMac::DoUpdateScrollbarVisibility() { wxSizeEvent event(GetSize(), m_windowId); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } } @@ -2500,7 +2500,7 @@ void wxWindowMac::MacOnScroll( wxScrollEvent &event ) else if (event.GetEventType() == wxEVT_SCROLL_THUMBRELEASE) wevent.SetEventType( wxEVT_SCROLLWIN_THUMBRELEASE ); - GetEventHandler()->ProcessEvent(wevent); + HandleWindowEvent(wevent); } } @@ -2545,7 +2545,7 @@ bool wxWindowMac::MacSetupCursor( const wxPoint& pt ) { wxSetCursorEvent event( pt.x , pt.y ); - bool processedEvtSetCursor = GetEventHandler()->ProcessEvent(event); + bool processedEvtSetCursor = HandleWindowEvent(event); if ( processedEvtSetCursor && event.HasCursor() ) { cursor = event.GetCursor() ; @@ -2763,7 +2763,7 @@ bool wxWindowMac::MacDoRedraw( void* updatergnr , long time ) wxEraseEvent eevent( GetId(), dc ); eevent.SetEventObject( this ); - GetEventHandler()->ProcessEvent( eevent ); + HandleWindowEvent( eevent ); delete dc ; } @@ -2781,7 +2781,7 @@ bool wxWindowMac::MacDoRedraw( void* updatergnr , long time ) wxPaintEvent event; event.SetTimestamp(time); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); handled = true ; } @@ -2820,7 +2820,7 @@ bool wxWindowMac::MacDoRedraw( void* updatergnr , long time ) // paint custom borders wxNcPaintEvent eventNc( child->GetId() ); eventNc.SetEventObject( child ); - if ( !child->GetEventHandler()->ProcessEvent( eventNc ) ) + if ( !child->HandleWindowEvent( eventNc ) ) { child->MacPaintBorders(0, 0) ; } @@ -3155,7 +3155,7 @@ void wxWindowMac::OnMouseEvent( wxMouseEvent &event ) wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU, this->GetId(), this->ClientToScreen(event.GetPosition())); - if ( ! GetEventHandler()->ProcessEvent(evtCtx) ) + if ( ! HandleWindowEvent(evtCtx) ) event.Skip() ; } else diff --git a/src/mgl/toplevel.cpp b/src/mgl/toplevel.cpp index ebb4bacd10..d2ede3f43c 100644 --- a/src/mgl/toplevel.cpp +++ b/src/mgl/toplevel.cpp @@ -152,7 +152,7 @@ bool wxTopLevelWindowMGL::Show(bool show) m_sizeSet = true; wxSizeEvent event(GetSize(), GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } if ( ret && show && CanAcceptFocus() ) diff --git a/src/mgl/window.cpp b/src/mgl/window.cpp index 082e7dc7c8..587ed4cd58 100644 --- a/src/mgl/window.cpp +++ b/src/mgl/window.cpp @@ -235,12 +235,12 @@ static ibool MGLAPI wxWindowMouseHandler(window_t *wnd, event_t *e) event2.SetEventObject(gs_windowUnderMouse); event2.SetEventType(wxEVT_LEAVE_WINDOW); - gs_windowUnderMouse->GetEventHandler()->ProcessEvent(event2); + gs_windowUnderMouse->HandleWindowEvent(event2); } wxMouseEvent event3(event); event3.SetEventType(wxEVT_ENTER_WINDOW); - win->GetEventHandler()->ProcessEvent(event3); + win->HandleWindowEvent(event3); gs_windowUnderMouse = win; } @@ -257,7 +257,7 @@ static ibool MGLAPI wxWindowMouseHandler(window_t *wnd, event_t *e) wxMouseEvent evt(inside ? wxEVT_ENTER_WINDOW : wxEVT_LEAVE_WINDOW); evt.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(evt); + win->HandleWindowEvent(evt); gs_windowUnderMouse = inside ? win : NULL; } } @@ -276,7 +276,7 @@ static ibool MGLAPI wxWindowMouseHandler(window_t *wnd, event_t *e) else { event.SetEventType(type); - return win->GetEventHandler()->ProcessEvent(event); + return win->HandleWindowEvent(event); } } @@ -471,7 +471,7 @@ static ibool MGLAPI wxWindowKeybHandler(window_t *wnd, event_t *e) if ( e->what == EVT_KEYUP ) { event.SetEventType(wxEVT_KEY_UP); - return win->GetEventHandler()->ProcessEvent(event); + return win->HandleWindowEvent(event); } else { @@ -481,7 +481,7 @@ static ibool MGLAPI wxWindowKeybHandler(window_t *wnd, event_t *e) event.SetEventType(wxEVT_KEY_DOWN); event2 = event; - ret = win->GetEventHandler()->ProcessEvent(event); + ret = win->HandleWindowEvent(event); // wxMSW doesn't send char events with Alt pressed // Only send wxEVT_CHAR event if not processed yet. Thus, ALT-x @@ -490,7 +490,7 @@ static ibool MGLAPI wxWindowKeybHandler(window_t *wnd, event_t *e) if ( !ret && event2.m_keyCode != 0 ) { event2.SetEventType(wxEVT_CHAR); - ret = win->GetEventHandler()->ProcessEvent(event2); + ret = win->HandleWindowEvent(event2); } // Synthetize navigation key event, but do it only if the TAB key @@ -505,7 +505,7 @@ static ibool MGLAPI wxWindowKeybHandler(window_t *wnd, event_t *e) // Ctrl-TAB changes the (parent) window, i.e. switch notebook page: navEvent.SetWindowChange(event.m_controlDown); navEvent.SetCurrentFocus(wxStaticCast(win, wxWindow)); - ret = win->GetParent()->GetEventHandler()->ProcessEvent(navEvent); + ret = win->HandleWindowEvent(navEvent); } // Finally, process special meaning keys that are usually @@ -695,24 +695,24 @@ void wxWindowMGL::SetFocus() { wxActivateEvent event(wxEVT_ACTIVATE, false, gs_activeFrame->GetId()); event.SetEventObject(gs_activeFrame); - gs_activeFrame->GetEventHandler()->ProcessEvent(event); + gs_activeFrame->HandleWindowEvent(event); } gs_activeFrame = active; wxActivateEvent event(wxEVT_ACTIVATE, true, gs_activeFrame->GetId()); event.SetEventObject(gs_activeFrame); - gs_activeFrame->GetEventHandler()->ProcessEvent(event); + gs_activeFrame->HandleWindowEvent(event); } // notify the parent keeping track of focus for the kbd navigation // purposes that we got it wxChildFocusEvent eventFocus((wxWindow*)this); - GetEventHandler()->ProcessEvent(eventFocus); + HandleWindowEvent(eventFocus); wxFocusEvent event(wxEVT_SET_FOCUS, GetId()); event.SetEventObject(this); event.SetWindow((wxWindow*)oldFocusedWindow); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); #if wxUSE_CARET // caret needs to be informed about focus change @@ -741,7 +741,7 @@ void wxWindowMGL::KillFocus() wxFocusEvent event(wxEVT_KILL_FOCUS, GetId()); event.SetEventObject(this); event.SetWindow(gs_toBeFocusedWindow); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } // ---------------------------------------------------------------------------- @@ -1056,7 +1056,7 @@ void wxWindowMGL::DoSetSize(int x, int y, int width, int height, int sizeFlags) wxSize newSize(width, height); wxSizeEvent event(newSize, GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } } @@ -1175,17 +1175,17 @@ void wxWindowMGL::HandlePaint(MGLDevCtx *dc) wxWindowDC dc((wxWindow*)this); wxEraseEvent eventEr(m_windowId, &dc); eventEr.SetEventObject(this); - GetEventHandler()->ProcessEvent(eventEr); + HandleWindowEvent(eventEr); } m_eraseBackground = -1; wxNcPaintEvent eventNc(GetId()); eventNc.SetEventObject(this); - GetEventHandler()->ProcessEvent(eventNc); + HandleWindowEvent(eventNc); wxPaintEvent eventPt(GetId()); eventPt.SetEventObject(this); - GetEventHandler()->ProcessEvent(eventPt); + HandleWindowEvent(eventPt); #if wxUSE_CARET if ( caret ) diff --git a/src/motif/checklst.cpp b/src/motif/checklst.cpp index b0e22aaefe..ff83d6d2c5 100644 --- a/src/motif/checklst.cpp +++ b/src/motif/checklst.cpp @@ -141,7 +141,7 @@ void wxCheckListBox::DoToggleItem( int n, int x ) event.SetEventObject(this); event.SetString(GetString(n)); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } } diff --git a/src/motif/combobox_native.cpp b/src/motif/combobox_native.cpp index 1cadd49e94..af01743d78 100644 --- a/src/motif/combobox_native.cpp +++ b/src/motif/combobox_native.cpp @@ -306,7 +306,7 @@ void wxComboBoxCallback (Widget WXUNUSED(w), XtPointer clientData, event.SetClientData( item->GetClientData(idx) ); event.SetExtraLong(true); event.SetEventObject(item); - item->GetEventHandler()->ProcessEvent(event); + item->HandleWindowEvent(event); break; } case XmCR_VALUE_CHANGED: @@ -316,7 +316,7 @@ void wxComboBoxCallback (Widget WXUNUSED(w), XtPointer clientData, event.SetString( item->GetValue() ); event.SetExtraLong(true); event.SetEventObject(item); - item->GetEventHandler()->ProcessEvent(event); + item->HandleWindowEvent(event); break; } default: diff --git a/src/motif/control.cpp b/src/motif/control.cpp index 3d6cdf909c..0924e49ef4 100644 --- a/src/motif/control.cpp +++ b/src/motif/control.cpp @@ -102,7 +102,7 @@ wxString wxControl::GetLabel() const bool wxControl::ProcessCommand(wxCommandEvent & event) { - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } wxSize wxControl::DoGetBestSize() const diff --git a/src/motif/evtloop.cpp b/src/motif/evtloop.cpp index a3e4b54dea..fa1db8c84c 100644 --- a/src/motif/evtloop.cpp +++ b/src/motif/evtloop.cpp @@ -302,7 +302,7 @@ bool CheckForKeyDown(XEvent* event) wxKeyEvent keyEvent(wxEVT_KEY_DOWN); wxTranslateKeyEvent(keyEvent, win, (Widget) 0, event); - return win->GetEventHandler()->ProcessEvent( keyEvent ); + return win->HandleWindowEvent( keyEvent ); } return false; @@ -328,7 +328,7 @@ bool CheckForKeyUp(XEvent* event) wxKeyEvent keyEvent(wxEVT_KEY_UP); wxTranslateKeyEvent(keyEvent, win, (Widget) 0, event); - return win->GetEventHandler()->ProcessEvent( keyEvent ); + return win->HandleWindowEvent( keyEvent ); } return false; diff --git a/src/motif/frame.cpp b/src/motif/frame.cpp index c81a189d97..87af9ad8ef 100644 --- a/src/motif/frame.cpp +++ b/src/motif/frame.cpp @@ -182,7 +182,7 @@ bool wxFrame::Create(wxWindow *parent, wxSizeEvent sizeEvent(newSize, GetId()); sizeEvent.SetEventObject(this); - GetEventHandler()->ProcessEvent(sizeEvent); + HandleWindowEvent(sizeEvent); return true; } @@ -384,7 +384,7 @@ void wxFrame::DoSetClientSize(int width, int height) wxSizeEvent sizeEvent(newSize, GetId()); sizeEvent.SetEventObject(this); - GetEventHandler()->ProcessEvent(sizeEvent); + HandleWindowEvent(sizeEvent); } @@ -536,7 +536,7 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) { wxSysColourChangedEvent event2; event2.SetEventObject( m_frameStatusBar ); - m_frameStatusBar->GetEventHandler()->ProcessEvent(event2); + m_frameStatusBar->HandleWindowEvent(event2); } // Propagate the event to the non-top-level children diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp index 3d138f6435..f23c8b7611 100644 --- a/src/motif/listbox.cpp +++ b/src/motif/listbox.cpp @@ -490,7 +490,7 @@ void wxListBoxCallback (Widget WXUNUSED(w), XtPointer clientData, item->DoToggleItem( n, x ); #endif case XmCR_DEFAULT_ACTION: - item->GetEventHandler()->ProcessEvent(event); + item->HandleWindowEvent(event); break; case XmCR_EXTENDED_SELECT: switch (cbs->selection_type) @@ -499,7 +499,7 @@ void wxListBoxCallback (Widget WXUNUSED(w), XtPointer clientData, case XmADDITION: case XmMODIFICATION: item->DoToggleItem( n, x ); - item->GetEventHandler()->ProcessEvent(event); + item->HandleWindowEvent(event); break; } break; diff --git a/src/motif/mdi.cpp b/src/motif/mdi.cpp index fe31aa958a..2f18487ea4 100644 --- a/src/motif/mdi.cpp +++ b/src/motif/mdi.cpp @@ -238,7 +238,7 @@ bool wxMDIParentFrame::ProcessEvent(wxEvent& event) bool res = false; if (m_activeChild && event.IsKindOf(CLASSINFO(wxCommandEvent))) { - res = m_activeChild->GetEventHandler()->ProcessEvent(event); + res = m_activeChild->HandleWindowEvent(event); } if (!res) @@ -365,7 +365,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, { wxActivateEvent event(wxEVT_ACTIVATE, false, oldActiveChild->GetId()); event.SetEventObject( oldActiveChild ); - oldActiveChild->GetEventHandler()->ProcessEvent(event); + oldActiveChild->HandleWindowEvent(event); } // This is the currently active child @@ -460,12 +460,12 @@ void wxMDIChildFrame::OnRaise() { wxActivateEvent event(wxEVT_ACTIVATE, false, oldActiveChild->GetId()); event.SetEventObject( oldActiveChild ); - oldActiveChild->GetEventHandler()->ProcessEvent(event); + oldActiveChild->HandleWindowEvent(event); } wxActivateEvent event(wxEVT_ACTIVATE, true, this->GetId()); event.SetEventObject( this ); - this->GetEventHandler()->ProcessEvent(event); + this->HandleWindowEvent(event); } void wxMDIChildFrame::OnLower() @@ -477,7 +477,7 @@ void wxMDIChildFrame::OnLower() { wxActivateEvent event(wxEVT_ACTIVATE, false, oldActiveChild->GetId()); event.SetEventObject( oldActiveChild ); - oldActiveChild->GetEventHandler()->ProcessEvent(event); + oldActiveChild->HandleWindowEvent(event); } // TODO: unfortunately we don't now know which is the top-most child, // so make the active child NULL. @@ -697,7 +697,7 @@ void wxMDIClientWindow::OnPageChanged(wxNotebookEvent& event) { wxActivateEvent event(wxEVT_ACTIVATE, false, oldChild->GetId()); event.SetEventObject( oldChild ); - oldChild->GetEventHandler()->ProcessEvent(event); + oldChild->HandleWindowEvent(event); } } if (event.GetSelection() != -1) @@ -707,7 +707,7 @@ void wxMDIClientWindow::OnPageChanged(wxNotebookEvent& event) { wxActivateEvent event(wxEVT_ACTIVATE, true, activeChild->GetId()); event.SetEventObject( activeChild ); - activeChild->GetEventHandler()->ProcessEvent(event); + activeChild->HandleWindowEvent(event); if (activeChild->GetMDIParentFrame()) { diff --git a/src/motif/menu.cpp b/src/motif/menu.cpp index 81ce9a4e00..ed09c4e47d 100644 --- a/src/motif/menu.cpp +++ b/src/motif/menu.cpp @@ -167,7 +167,7 @@ bool wxMenu::ProcessCommand(wxCommandEvent & event) // Try the menu's event handler if ( !processed && GetEventHandler()) { - processed = GetEventHandler()->ProcessEvent(event); + processed = HandleWindowEvent(event); } // Try the window the menu was popped up from (and up // through the hierarchy) diff --git a/src/motif/menuitem.cpp b/src/motif/menuitem.cpp index 6ac3fba445..6fbfb08465 100644 --- a/src/motif/menuitem.cpp +++ b/src/motif/menuitem.cpp @@ -366,7 +366,7 @@ void wxMenuItemCallback (Widget WXUNUSED(w), XtPointer clientData, event.SetEventObject(item->GetMenuBar()->GetMenuBarFrame()); item->GetMenuBar()->GetMenuBarFrame() - ->GetEventHandler()->ProcessEvent(event); + ->HandleWindowEvent(event); } // this is the child of a popup menu else if (item->GetTopMenu()) @@ -398,7 +398,7 @@ void wxMenuItemArmCallback (Widget WXUNUSED(w), XtPointer clientData, menuEvent.SetEventObject(item->GetMenuBar()->GetMenuBarFrame()); item->GetMenuBar()->GetMenuBarFrame() - ->GetEventHandler()->ProcessEvent(menuEvent); + ->HandleWindowEvent(menuEvent); } } } @@ -418,7 +418,7 @@ wxMenuItemDisarmCallback (Widget WXUNUSED(w), XtPointer clientData, menuEvent.SetEventObject(item->GetMenuBar()->GetMenuBarFrame()); item->GetMenuBar()->GetMenuBarFrame() - ->GetEventHandler()->ProcessEvent(menuEvent); + ->HandleWindowEvent(menuEvent); } } } diff --git a/src/motif/scrolbar.cpp b/src/motif/scrolbar.cpp index 9c35d48ea3..d54a1f1d80 100644 --- a/src/motif/scrolbar.cpp +++ b/src/motif/scrolbar.cpp @@ -184,5 +184,5 @@ static void wxScrollBarCallback(Widget widget, XtPointer clientData, wxScrollEvent event(eventType, scrollBar->GetId(), cbs->value, orientation); event.SetEventObject(scrollBar); - scrollBar->GetEventHandler()->ProcessEvent(event); + scrollBar->HandleWindowEvent(event); } diff --git a/src/motif/slider.cpp b/src/motif/slider.cpp index 6b012f2964..192b4633e8 100644 --- a/src/motif/slider.cpp +++ b/src/motif/slider.cpp @@ -221,13 +221,13 @@ void wxSliderCallback (Widget widget, XtPointer clientData, XtVaGetValues (widget, XmNvalue, &commandInt, NULL); event.SetInt(commandInt); event.SetEventObject(slider); - slider->GetEventHandler()->ProcessEvent(event); + slider->HandleWindowEvent(event); // Also send a wxCommandEvent for compatibility. wxCommandEvent event2(wxEVT_COMMAND_SLIDER_UPDATED, slider->GetId()); event2.SetEventObject(slider); event2.SetInt( event.GetInt() ); - slider->GetEventHandler()->ProcessEvent(event2); + slider->HandleWindowEvent(event2); } #endif // wxUSE_SLIDER diff --git a/src/motif/spinbutt.cpp b/src/motif/spinbutt.cpp index abee5b0bb6..9b978d0e14 100644 --- a/src/motif/spinbutt.cpp +++ b/src/motif/spinbutt.cpp @@ -352,7 +352,7 @@ void wxSpinButton::Increment( int delta ) event.SetPosition( npos ); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); if( event.IsAllowed() ) { @@ -360,7 +360,7 @@ void wxSpinButton::Increment( int delta ) event.SetEventType( wxEVT_SCROLL_THUMBTRACK ); event.SetPosition( m_pos ); - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); } } diff --git a/src/motif/textctrl.cpp b/src/motif/textctrl.cpp index aeafee2200..7d9b41ed0b 100644 --- a/src/motif/textctrl.cpp +++ b/src/motif/textctrl.cpp @@ -471,7 +471,7 @@ void wxTextCtrl::DoSendEvents(void *wxcbs, long keycode) // the character passed through) cbs->doit = False; - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); if ( !InSetValue() && m_processedDefault ) { @@ -667,7 +667,7 @@ wxTextWindowGainFocusProc (Widget w, XtPointer clientData, XmAnyCallbackStruct * wxTextCtrl *tw = (wxTextCtrl *) clientData; wxFocusEvent event(wxEVT_SET_FOCUS, tw->GetId()); event.SetEventObject(tw); - tw->GetEventHandler()->ProcessEvent(event); + tw->HandleWindowEvent(event); } static void @@ -679,7 +679,7 @@ wxTextWindowLoseFocusProc (Widget w, XtPointer clientData, XmAnyCallbackStruct * wxTextCtrl *tw = (wxTextCtrl *) clientData; wxFocusEvent event(wxEVT_KILL_FOCUS, tw->GetId()); event.SetEventObject(tw); - tw->GetEventHandler()->ProcessEvent(event); + tw->HandleWindowEvent(event); } static void wxTextWindowActivateProc(Widget w, XtPointer clientData, diff --git a/src/motif/toplevel.cpp b/src/motif/toplevel.cpp index 35af4ecfe6..f21849c3d5 100644 --- a/src/motif/toplevel.cpp +++ b/src/motif/toplevel.cpp @@ -372,7 +372,7 @@ static void wxCloseTLWCallback( Widget WXUNUSED(widget), XtPointer client_data, closeEvent.SetEventObject( tlw ); // May delete the dialog (with delayed deletion) - tlw->GetEventHandler()->ProcessEvent(closeEvent); + tlw->HandleWindowEvent(closeEvent); } void wxTLWEventHandler( Widget wid, @@ -391,7 +391,7 @@ void wxTLWEventHandler( Widget wid, { wxevent.SetEventObject( tlw ); wxevent.SetId( tlw->GetId() ); - tlw->GetEventHandler()->ProcessEvent( wxevent ); + tlw->HandleWindowEvent( wxevent ); } else { @@ -405,7 +405,7 @@ void wxTLWEventHandler( Widget wid, keyEvent.SetEventObject( tlw ); keyEvent.SetId( tlw->GetId() ); keyEvent.SetEventType( wxEVT_CHAR_HOOK ); - if( tlw->GetEventHandler()->ProcessEvent( keyEvent ) ) + if( tlw->HandleWindowEvent( keyEvent ) ) { *continueToDispatch = False; return; @@ -417,10 +417,10 @@ void wxTLWEventHandler( Widget wid, keyEvent.SetEventType( wxEVT_KEY_DOWN ); // Only process OnChar if OnKeyDown didn't swallow it - if( !tlw->GetEventHandler()->ProcessEvent( keyEvent ) ) + if( !tlw->HandleWindowEvent( keyEvent ) ) { keyEvent.SetEventType( wxEVT_CHAR ); - tlw->GetEventHandler()->ProcessEvent( keyEvent ); + tlw->HandleWindowEvent( keyEvent ); } } } diff --git a/src/motif/window.cpp b/src/motif/window.cpp index 17373e001a..2b95c17412 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -1622,11 +1622,11 @@ void wxWindow::DoPaint() // Set an erase event first wxEraseEvent eraseEvent(GetId(), &dc); eraseEvent.SetEventObject(this); - GetEventHandler()->ProcessEvent(eraseEvent); + HandleWindowEvent(eraseEvent); wxPaintEvent event(GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); m_needsRefresh = false; } @@ -1648,7 +1648,7 @@ void wxWindow::OnSysColourChanged(wxSysColourChangedEvent& event) { wxSysColourChangedEvent event2; event.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(event2); + win->HandleWindowEvent(event2); } node = node->GetNext(); @@ -1708,7 +1708,7 @@ bool wxWindow::ProcessAccelerator(wxKeyEvent& event) // If ProcessEvent returns true (it was handled), then // the calling code will skip the event handling. - return frame->GetEventHandler()->ProcessEvent(commandEvent); + return frame->HandleWindowEvent(commandEvent); } } #endif @@ -1727,7 +1727,7 @@ bool wxWindow::ProcessAccelerator(wxKeyEvent& event) { wxCommandEvent commandEvent (wxEVT_COMMAND_BUTTON_CLICKED, child->GetId()); commandEvent.SetEventObject(child); - return child->GetEventHandler()->ProcessEvent(commandEvent); + return child->HandleWindowEvent(commandEvent); } return false; @@ -1913,7 +1913,7 @@ void wxWidgetResizeProc(Widget w, XConfigureEvent *WXUNUSED(event), wxSize newSize(win->GetSize()); wxSizeEvent sizeEvent(newSize, win->GetId()); sizeEvent.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(sizeEvent); + win->HandleWindowEvent(sizeEvent); } } @@ -1999,7 +1999,7 @@ static void wxCanvasInputEvent(Widget drawingArea, wxMouseEvent wxevent(0); if (wxTranslateMouseEvent(wxevent, canvas, drawingArea, xevent)) { - canvas->GetEventHandler()->ProcessEvent(wxevent); + canvas->HandleWindowEvent(wxevent); } break; } @@ -2016,7 +2016,7 @@ static void wxCanvasInputEvent(Widget drawingArea, if (parent) { event.SetEventType(wxEVT_CHAR_HOOK); - if (parent->GetEventHandler()->ProcessEvent(event)) + if (parent->HandleWindowEvent(event)) return; } @@ -2025,10 +2025,10 @@ static void wxCanvasInputEvent(Widget drawingArea, event.SetEventType(wxEVT_KEY_DOWN); // Only process OnChar if OnKeyDown didn't swallow it - if (!canvas->GetEventHandler()->ProcessEvent (event)) + if (!canvas->HandleWindowEvent (event)) { event.SetEventType(wxEVT_CHAR); - canvas->GetEventHandler()->ProcessEvent (event); + canvas->HandleWindowEvent (event); } } break; @@ -2038,7 +2038,7 @@ static void wxCanvasInputEvent(Widget drawingArea, wxKeyEvent event (wxEVT_KEY_UP); if (wxTranslateKeyEvent (event, canvas, (Widget) 0, xevent)) { - canvas->GetEventHandler()->ProcessEvent (event); + canvas->HandleWindowEvent (event); } break; } @@ -2048,7 +2048,7 @@ static void wxCanvasInputEvent(Widget drawingArea, { wxFocusEvent event(wxEVT_SET_FOCUS, canvas->GetId()); event.SetEventObject(canvas); - canvas->GetEventHandler()->ProcessEvent(event); + canvas->HandleWindowEvent(event); } break; } @@ -2058,7 +2058,7 @@ static void wxCanvasInputEvent(Widget drawingArea, { wxFocusEvent event(wxEVT_KILL_FOCUS, canvas->GetId()); event.SetEventObject(canvas); - canvas->GetEventHandler()->ProcessEvent(event); + canvas->HandleWindowEvent(event); } break; } @@ -2080,7 +2080,7 @@ static void wxPanelItemEventHandler(Widget wid, wxMouseEvent wxevent(0); if (wxTranslateMouseEvent(wxevent, window, wid, event)) { - window->GetEventHandler()->ProcessEvent(wxevent); + window->HandleWindowEvent(wxevent); } } @@ -2158,7 +2158,7 @@ static void wxScrollBarCallback(Widget scrollbar, cbs->value, orientation); event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent(event); + win->HandleWindowEvent(event); } // For repainting arbitrary windows diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 7ead340643..fa9989fb1c 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -315,7 +315,7 @@ wxControl::GetCompositeControlsDefaultAttributes(wxWindowVariant WXUNUSED(varian bool wxControl::ProcessCommand(wxCommandEvent& event) { - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxControl::MSWOnNotify(int idCtrl, @@ -363,7 +363,7 @@ bool wxControl::MSWOnNotify(int idCtrl, event.SetEventType(eventType); event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd) diff --git a/src/msw/datectrl.cpp b/src/msw/datectrl.cpp index 58a3b435c2..3a694a227e 100644 --- a/src/msw/datectrl.cpp +++ b/src/msw/datectrl.cpp @@ -354,7 +354,7 @@ wxDatePickerCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) { m_date = dt; wxDateEvent event(this, dt, wxEVT_DATE_CHANGED); - if ( GetEventHandler()->ProcessEvent(event) ) + if ( HandleWindowEvent(event) ) { *result = 0; return true; diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index e009c383df..0b4174a8d0 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -349,7 +349,7 @@ bool wxDialog::DoOK() wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetAffirmativeId()); event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } #endif // __POCKETPC__ diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 245c466534..b976a678c5 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -497,7 +497,7 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) { wxSysColourChangedEvent event2; event2.SetEventObject( m_frameStatusBar ); - m_frameStatusBar->GetEventHandler()->ProcessEvent(event2); + m_frameStatusBar->HandleWindowEvent(event2); } #endif // wxUSE_STATUSBAR @@ -1019,7 +1019,7 @@ bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu) wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, item); event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxFrame::HandleMenuLoop(const wxEventType& evtType, WXWORD isPopup) @@ -1029,7 +1029,7 @@ bool wxFrame::HandleMenuLoop(const wxEventType& evtType, WXWORD isPopup) wxMenuEvent event(evtType, isPopup ? -1 : 0); event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxFrame::HandleInitMenuPopup(WXHMENU hMenu) @@ -1051,7 +1051,7 @@ bool wxFrame::HandleInitMenuPopup(WXHMENU hMenu) wxMenuEvent event(wxEVT_MENU_OPEN, 0, menu); event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } #endif // wxUSE_MENUS diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index b68359e3e2..fd421c8467 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -658,7 +658,7 @@ bool wxListBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) event.SetInt(n); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } // ---------------------------------------------------------------------------- diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 281d6c9efb..6f22017cff 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -2146,7 +2146,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) // focus event from here and the selection one // below event.SetEventType(eventType); - (void)GetEventHandler()->ProcessEvent(event); + (void)HandleWindowEvent(event); } else // no focus event to send { @@ -2418,7 +2418,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) event.SetEventType(eventType); - bool processed = GetEventHandler()->ProcessEvent(event); + bool processed = HandleWindowEvent(event); // post processing // --------------- diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 774ee9b4a3..6300654e8f 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -515,7 +515,7 @@ bool wxMDIParentFrame::HandleActivate(int state, bool minimized, WXHWND activate { wxActivateEvent event(wxEVT_ACTIVATE, true, m_currentChild->GetId()); event.SetEventObject( m_currentChild ); - if ( m_currentChild->GetEventHandler()->ProcessEvent(event) ) + if ( m_currentChild->HandleWindowEvent(event) ) processed = true; } @@ -853,7 +853,7 @@ void wxMDIChildFrame::DoSetClientSize(int width, int height) wxSize size(width, height); wxSizeEvent event(size, m_windowId); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } // Unlike other wxTopLevelWindowBase, the mdi child's "GetPosition" is not the @@ -1103,7 +1103,7 @@ bool wxMDIChildFrame::HandleMDIActivate(long WXUNUSED(activate), ResetWindowStyle((void *)NULL); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxMDIChildFrame::HandleWindowPosChanging(void *pos) diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 6c4342ed91..91fb5b93a2 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -1143,7 +1143,7 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event) event.SetEventObject(this); wxWindow *page = m_pages[m_nSelection]; - if ( !page->GetEventHandler()->ProcessEvent(event) ) + if ( !page->HandleWindowEvent(event) ) { page->SetFocus(); } @@ -1167,7 +1167,7 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event) else if ( parent ) { event.SetCurrentFocus(this); - parent->GetEventHandler()->ProcessEvent(event); + parent->HandleWindowEvent(event); } } } @@ -1441,7 +1441,7 @@ bool wxNotebook::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM* result) event.SetEventObject(this); event.SetInt(idCtrl); - bool processed = GetEventHandler()->ProcessEvent(event); + bool processed = HandleWindowEvent(event); *result = !event.IsAllowed(); return processed; } diff --git a/src/msw/scrolbar.cpp b/src/msw/scrolbar.cpp index d892916568..a3868bbb02 100644 --- a/src/msw/scrolbar.cpp +++ b/src/msw/scrolbar.cpp @@ -231,7 +231,7 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, event.SetPosition(position); event.SetEventObject( this ); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } void wxScrollBar::SetThumbPosition(int viewStart) diff --git a/src/msw/slider95.cpp b/src/msw/slider95.cpp index 8bef10518a..3a0dbfb80e 100644 --- a/src/msw/slider95.cpp +++ b/src/msw/slider95.cpp @@ -364,13 +364,13 @@ bool wxSlider::MSWOnScroll(int WXUNUSED(orientation), wxScrollEvent event(scrollEvent, m_windowId); event.SetPosition(newPos); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, GetId() ); cevent.SetInt( newPos ); cevent.SetEventObject( this ); - return GetEventHandler()->ProcessEvent( cevent ); + return HandleWindowEvent( cevent ); } void wxSlider::Command (wxCommandEvent & event) diff --git a/src/msw/spinbutt.cpp b/src/msw/spinbutt.cpp index 4b3f25570c..1695f13436 100644 --- a/src/msw/spinbutt.cpp +++ b/src/msw/spinbutt.cpp @@ -308,7 +308,7 @@ bool wxSpinButton::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, event.SetPosition((short)pos); // cast is important for negative values! event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxSpinButton::MSWOnNotify(int WXUNUSED(idCtrl), WXLPARAM lParam, WXLPARAM *result) @@ -324,7 +324,7 @@ bool wxSpinButton::MSWOnNotify(int WXUNUSED(idCtrl), WXLPARAM lParam, WXLPARAM * event.SetPosition(lpnmud->iPos + lpnmud->iDelta); event.SetEventObject(this); - bool processed = GetEventHandler()->ProcessEvent(event); + bool processed = HandleWindowEvent(event); *result = event.IsAllowed() ? 0 : 1; diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 1b9910d66f..ff3afaf8c8 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -207,7 +207,7 @@ bool wxSpinCtrl::ProcessTextCommand(WXWORD cmd, WXWORD WXUNUSED(id)) wxString val = wxGetWindowText(m_hwndBuddy); event.SetString(val); event.SetInt(GetValue()); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } // not processed @@ -225,7 +225,7 @@ void wxSpinCtrl::OnChar(wxKeyEvent& event) wxString val = wxGetWindowText(m_hwndBuddy); event.SetString(val); event.SetInt(GetValue()); - if ( GetEventHandler()->ProcessEvent(event) ) + if ( HandleWindowEvent(event) ) return; break; } @@ -241,7 +241,7 @@ void wxSpinCtrl::OnChar(wxKeyEvent& event) eventNav.SetWindowChange(event.ControlDown()); eventNav.SetEventObject(this); - if ( GetParent()->GetEventHandler()->ProcessEvent(eventNav) ) + if ( GetParent()->HandleWindowEvent(eventNav) ) return; } break; @@ -571,7 +571,7 @@ void wxSpinCtrl::SendSpinUpdate(int value) event.SetEventObject(this); event.SetInt(value); - (void)GetEventHandler()->ProcessEvent(event); + (void)HandleWindowEvent(event); m_oldValue = value; } diff --git a/src/msw/statbr95.cpp b/src/msw/statbr95.cpp index 9b310fcf23..d87e65c515 100644 --- a/src/msw/statbr95.cpp +++ b/src/msw/statbr95.cpp @@ -373,7 +373,7 @@ void wxStatusBar95::DoMoveWindow(int x, int y, int width, int height) { wxSizeEvent event(GetClientSize(), m_windowId); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } } diff --git a/src/msw/tabctrl.cpp b/src/msw/tabctrl.cpp index d55fd09bca..02a8285cc4 100644 --- a/src/msw/tabctrl.cpp +++ b/src/msw/tabctrl.cpp @@ -149,7 +149,7 @@ bool wxTabCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) event.SetInt(idCtrl) ; event.SetSelection(idCtrl); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } // Responds to colour changes, and passes event on to children. diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index b12dd40b5f..be1e998141 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -1235,7 +1235,7 @@ bool wxToolBar::MSWOnNotify(int WXUNUSED(idCtrl), LPNMTOOLBAR tbhdr = (LPNMTOOLBAR)lParam; wxCommandEvent evt(wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED, tbhdr->iItem); - if ( GetEventHandler()->ProcessEvent(evt) ) + if ( HandleWindowEvent(evt) ) { // Event got handled, don't display default popup menu return false; diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 16a0ef075b..fc8676db3f 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -1784,7 +1784,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); InitCommandEvent(event); event.SetString(GetValue()); - if ( GetEventHandler()->ProcessEvent(event) ) + if ( HandleWindowEvent(event) ) if ( !HasFlag(wxTE_MULTILINE) ) return; //else: multiline controls need Enter for themselves @@ -1935,7 +1935,7 @@ bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) : wxEVT_SET_FOCUS, m_windowId); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } break; diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 86ac85d33e..712dce2272 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -933,7 +933,7 @@ bool wxTopLevelWindowMSW::ShowFullScreen(bool show, long style) // finally send an event allowing the window to relayout itself &c wxSizeEvent event(rect.GetSize(), GetId()); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); } else // stop showing full screen { diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 63019b5e22..8c48543587 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -1665,7 +1665,7 @@ void wxTreeCtrl::DoExpand(const wxTreeItemId& item, int flag) : IDX_COLLAPSE] [IDX_DONE], this, item); - (void)GetEventHandler()->ProcessEvent(event); + (void)HandleWindowEvent(event); } //else: change didn't took place, so do nothing at all } @@ -1727,7 +1727,7 @@ void wxTreeCtrl::SelectItem(const wxTreeItemId& item, bool select) _T("SelectItem(false) works only for multiselect") ); wxTreeEvent event(wxEVT_COMMAND_TREE_SEL_CHANGING, this, item); - if ( !GetEventHandler()->ProcessEvent(event) || event.IsAllowed() ) + if ( !HandleWindowEvent(event) || event.IsAllowed() ) { if ( HasFlag(wxTR_MULTIPLE) ) { @@ -1748,7 +1748,7 @@ void wxTreeCtrl::SelectItem(const wxTreeItemId& item, bool select) } event.SetEventType(wxEVT_COMMAND_TREE_SEL_CHANGED); - (void)GetEventHandler()->ProcessEvent(event); + (void)HandleWindowEvent(event); } //else: program vetoed the change } @@ -2041,7 +2041,7 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara event.m_pointDrag = pt; - if ( GetEventHandler()->ProcessEvent(event) ) + if ( HandleWindowEvent(event) ) processed = true; //else: continue with generating wxEVT_CONTEXT_MENU in base class code } @@ -2280,7 +2280,7 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara wxTreeEvent event(wxEVT_COMMAND_TREE_END_DRAG, this, htItem); event.m_pointDrag = wxPoint(x, y); - (void)GetEventHandler()->ProcessEvent(event); + (void)HandleWindowEvent(event); // if we don't do it, the tree seems to think that 2 items // are selected simultaneously which is quite weird @@ -2632,7 +2632,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) wxTreeEvent event2(wxEVT_COMMAND_TREE_ITEM_ACTIVATED, this, item); - (void)GetEventHandler()->ProcessEvent(event2); + (void)HandleWindowEvent(event2); } } break; @@ -2849,7 +2849,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) if ( event.m_item.IsOk() ) event.SetClientObject(GetItemData(event.m_item)); - bool processed = GetEventHandler()->ProcessEvent(event); + bool processed = HandleWindowEvent(event); // post processing switch ( hdr->code ) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 0666271639..25f5de9c7d 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1211,7 +1211,7 @@ void wxWindowMSW::SubclassWin(WXHWND hWnd) // we're officially created now, send the event wxWindowCreateEvent event((wxWindow *)this); - (void)GetEventHandler()->ProcessEvent(event); + (void)HandleWindowEvent(event); } void wxWindowMSW::UnsubclassWin() @@ -2433,7 +2433,7 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg) // map Enter presses into button presses on PDAs wxJoystickEvent event(wxEVT_JOY_BUTTON_DOWN); event.SetEventObject(this); - if ( GetEventHandler()->ProcessEvent(event) ) + if ( HandleWindowEvent(event) ) return true; #endif // __WXWINCE__ } @@ -2451,7 +2451,7 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg) event.SetFromTab(bFromTab); event.SetEventObject(this); - if ( GetEventHandler()->ProcessEvent(event) ) + if ( HandleWindowEvent(event) ) { // as we don't call IsDialogMessage(), which would take of // this by default, we need to manually send this message @@ -2944,7 +2944,7 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU, GetId(), pt); evtCtx.SetEventObject(this); - if (GetEventHandler()->ProcessEvent(evtCtx)) + if (HandleWindowEvent(evtCtx)) { processed = true; return true; @@ -3332,14 +3332,14 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l ); helpEvent.SetEventObject(this); - GetEventHandler()->ProcessEvent(helpEvent); + HandleWindowEvent(helpEvent); #ifndef __WXWINCE__ } else if ( info->iContextType == HELPINFO_MENUITEM ) { wxHelpEvent helpEvent(wxEVT_HELP, info->iCtrlId); helpEvent.SetEventObject(this); - GetEventHandler()->ProcessEvent(helpEvent); + HandleWindowEvent(helpEvent); } else // unknown help event? @@ -3372,7 +3372,7 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l win = this; evtCtx.SetEventObject(win); - processed = win->GetEventHandler()->ProcessEvent(evtCtx); + processed = win->HandleWindowEvent(evtCtx); } break; #endif @@ -3965,7 +3965,7 @@ bool wxWindowMSW::HandleActivate(int state, m_windowId); event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowMSW::HandleSetFocus(WXHWND hwnd) @@ -3980,7 +3980,7 @@ bool wxWindowMSW::HandleSetFocus(WXHWND hwnd) // notify the parent keeping track of focus for the kbd navigation // purposes that we got it wxChildFocusEvent eventFocus((wxWindow *)this); - (void)GetEventHandler()->ProcessEvent(eventFocus); + (void)HandleWindowEvent(eventFocus); #if wxUSE_CARET // Deal with caret @@ -4005,7 +4005,7 @@ bool wxWindowMSW::HandleSetFocus(WXHWND hwnd) // wxFindWinFromHandle() may return NULL, it is ok event.SetWindow(wxFindWinFromHandle(hwnd)); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowMSW::HandleKillFocus(WXHWND hwnd) @@ -4041,7 +4041,7 @@ bool wxWindowMSW::HandleKillFocus(WXHWND hwnd) // wxFindWinFromHandle() may return NULL, it is ok event.SetWindow(wxFindWinFromHandle(hwnd)); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } // --------------------------------------------------------------------------- @@ -4067,7 +4067,7 @@ bool wxWindowMSW::HandleShow(bool show, int WXUNUSED(status)) wxShowEvent event(GetId(), show); event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowMSW::HandleInitDialog(WXHWND WXUNUSED(hWndFocus)) @@ -4075,7 +4075,7 @@ bool wxWindowMSW::HandleInitDialog(WXHWND WXUNUSED(hWndFocus)) wxInitDialogEvent event(GetId()); event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowMSW::HandleDropFiles(WXWPARAM wParam) @@ -4115,7 +4115,7 @@ bool wxWindowMSW::HandleDropFiles(WXWPARAM wParam) event.m_pos.x = dropPoint.x; event.m_pos.y = dropPoint.y; - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); #endif } @@ -4158,7 +4158,7 @@ bool wxWindowMSW::HandleSetCursor(WXHWND WXUNUSED(hWnd), ScreenToClient(&x, &y); wxSetCursorEvent event(x, y); - bool processedEvtSetCursor = GetEventHandler()->ProcessEvent(event); + bool processedEvtSetCursor = HandleWindowEvent(event); if ( processedEvtSetCursor && event.HasCursor() ) { hcursor = GetHcursorOf(event.GetCursor()); @@ -4254,7 +4254,7 @@ bool wxWindowMSW::HandlePower(WXWPARAM WXUNUSED_IN_WINCE(wParam), // TODO: notify about PBTF_APMRESUMEFROMFAILURE in case of resume events? wxPowerEvent event(evtType); - if ( !GetEventHandler()->ProcessEvent(event) ) + if ( !HandleWindowEvent(event) ) return false; *vetoed = event.IsVetoed(); @@ -4404,7 +4404,7 @@ bool wxWindowMSW::HandleSysColorChange() wxSysColourChangedEvent event; event.SetEventObject(this); - (void)GetEventHandler()->ProcessEvent(event); + (void)HandleWindowEvent(event); // always let the system carry on the default processing to allow the // native controls to react to the colours update @@ -4416,7 +4416,7 @@ bool wxWindowMSW::HandleDisplayChange() wxDisplayChangedEvent event; event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } #ifndef __WXMICROWIN__ @@ -4480,7 +4480,7 @@ bool wxWindowMSW::HandlePaletteChanged(WXHWND hWndPalChange) event.SetEventObject(this); event.SetChangedWindow(wxFindWinFromHandle(hWndPalChange)); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowMSW::HandleCaptureChanged(WXHWND hWndGainedCapture) @@ -4492,7 +4492,7 @@ bool wxWindowMSW::HandleCaptureChanged(WXHWND hWndGainedCapture) wxWindow *win = wxFindWinFromHandle(hWndGainedCapture); wxMouseCaptureChangedEvent event(GetId(), win); event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowMSW::HandleSettingChange(WXWPARAM wParam, WXLPARAM lParam) @@ -4547,7 +4547,7 @@ bool wxWindowMSW::HandleQueryNewPalette() wxQueryNewPaletteEvent event(GetId()); event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event) && event.GetPaletteRealized(); + return HandleWindowEvent(event) && event.GetPaletteRealized(); } // Responds to colour changes: passes event on to children. @@ -4663,14 +4663,14 @@ bool wxWindowMSW::HandlePaint() wxPaintEvent event(m_windowId); event.SetEventObject(this); - bool processed = GetEventHandler()->ProcessEvent(event); + bool processed = HandleWindowEvent(event); // note that we must generate NC event after the normal one as otherwise // BeginPaint() will happily overwrite our decorations with the background // colour wxNcPaintEvent eventNc(m_windowId); eventNc.SetEventObject(this); - GetEventHandler()->ProcessEvent(eventNc); + HandleWindowEvent(eventNc); // don't keep an HRGN we don't need any longer (GetUpdateRegion() can only // be called from inside the event handlers called above) @@ -4702,7 +4702,7 @@ bool wxWindowMSW::HandleEraseBkgnd(WXHDC hdc) wxEraseEvent event(m_windowId, &dc); event.SetEventObject(this); - bool rc = GetEventHandler()->ProcessEvent(event); + bool rc = HandleWindowEvent(event); // must be called manually as ~wxDC doesn't do anything for wxDCTemp dc.SelectOldObjects(hdc); @@ -4841,7 +4841,7 @@ bool wxWindowMSW::HandleMinimize() wxIconizeEvent event(m_windowId); event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowMSW::HandleMaximize() @@ -4849,7 +4849,7 @@ bool wxWindowMSW::HandleMaximize() wxMaximizeEvent event(m_windowId); event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowMSW::HandleMove(int x, int y) @@ -4858,7 +4858,7 @@ bool wxWindowMSW::HandleMove(int x, int y) wxMoveEvent event(point, m_windowId); event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowMSW::HandleMoving(wxRect& rect) @@ -4866,7 +4866,7 @@ bool wxWindowMSW::HandleMoving(wxRect& rect) wxMoveEvent event(rect, m_windowId); event.SetEventObject(this); - bool rc = GetEventHandler()->ProcessEvent(event); + bool rc = HandleWindowEvent(event); if (rc) rect = event.GetRect(); return rc; @@ -4878,7 +4878,7 @@ bool wxWindowMSW::HandleEnterSizeMove() event.SetEventType(wxEVT_MOVE_START); event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowMSW::HandleExitSizeMove() @@ -4887,7 +4887,7 @@ bool wxWindowMSW::HandleExitSizeMove() event.SetEventType(wxEVT_MOVE_END); event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam) @@ -4949,7 +4949,7 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam) wxSizeEvent event(GetSize(), m_windowId); event.SetEventObject(this); - processed = GetEventHandler()->ProcessEvent(event); + processed = HandleWindowEvent(event); } #if USE_DEFERRED_SIZING @@ -4989,7 +4989,7 @@ bool wxWindowMSW::HandleSizing(wxRect& rect) wxSizeEvent event(rect, m_windowId); event.SetEventObject(this); - bool rc = GetEventHandler()->ProcessEvent(event); + bool rc = HandleWindowEvent(event); if (rc) rect = event.GetRect(); return rc; @@ -5090,7 +5090,7 @@ bool wxWindowMSW::HandleCommand(WXWORD id_, WXWORD cmd, WXHWND control) event.SetId(id); event.SetInt(id); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } else { @@ -5262,7 +5262,7 @@ bool wxWindowMSW::HandleMouseEvent(WXUINT msg, int x, int y, WXUINT flags) wxMouseEvent event(eventsMouse[msg - WM_MOUSEMOVE]); InitMouseEvent(event, x, y, flags); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowMSW::HandleMouseMove(int x, int y, WXUINT flags) @@ -5319,7 +5319,7 @@ bool wxWindowMSW::HandleMouseMove(int x, int y, WXUINT flags) wxMouseEvent event(wxEVT_ENTER_WINDOW); InitMouseEvent(event, x, y, flags); - (void)GetEventHandler()->ProcessEvent(event); + (void)HandleWindowEvent(event); } } #ifdef HAVE_TRACKMOUSEEVENT @@ -5388,7 +5388,7 @@ bool wxWindowMSW::HandleMouseWheel(WXWPARAM wParam, WXLPARAM lParam) } event.m_linesPerAction = s_linesPerRotation; - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); #else // !wxUSE_MOUSEWHEEL wxUnusedVar(wParam); @@ -5435,7 +5435,7 @@ void wxWindowMSW::GenerateMouseLeave() wxMouseEvent event(wxEVT_LEAVE_WINDOW); InitMouseEvent(event, pt.x, pt.y, state); - (void)GetEventHandler()->ProcessEvent(event); + (void)HandleWindowEvent(event); } // --------------------------------------------------------------------------- @@ -5522,7 +5522,7 @@ bool wxWindowMSW::HandleChar(WXWPARAM wParam, WXLPARAM lParam, bool isASCII) event.m_altDown = false; } - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowMSW::HandleKeyDown(WXWPARAM wParam, WXLPARAM lParam) @@ -5536,7 +5536,7 @@ bool wxWindowMSW::HandleKeyDown(WXWPARAM wParam, WXLPARAM lParam) } wxKeyEvent event(CreateKeyEvent(wxEVT_KEY_DOWN, id, lParam, wParam)); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxWindowMSW::HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam) @@ -5550,7 +5550,7 @@ bool wxWindowMSW::HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam) } wxKeyEvent event(CreateKeyEvent(wxEVT_KEY_UP, id, lParam, wParam)); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } #if wxUSE_MENUS @@ -5633,7 +5633,7 @@ bool wxWindowMSW::HandleClipboardEvent( WXUINT nMsg ) evt.SetEventObject(this); - return GetEventHandler()->ProcessEvent(evt); + return HandleWindowEvent(evt); } #endif // wxUSE_MENUS @@ -5719,7 +5719,7 @@ bool wxWindowMSW::HandleJoystickEvent(WXUINT msg, int x, int y, WXUINT flags) event.SetPosition(wxPoint(x, y)); event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); #else wxUnusedVar(msg); wxUnusedVar(x); @@ -5806,7 +5806,7 @@ bool wxWindowMSW::MSWOnScroll(int orientation, WXWORD wParam, return false; } - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } // ---------------------------------------------------------------------------- @@ -6945,7 +6945,7 @@ bool wxWindowMSW::HandleHotKey(WXWPARAM wParam, WXLPARAM lParam) event.m_altDown = (win_modifiers & MOD_ALT) != 0; event.m_metaDown = (win_modifiers & MOD_WIN) != 0; - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } #endif // wxUSE_ACCEL diff --git a/src/os2/control.cpp b/src/os2/control.cpp index 63650453c8..2b425b0e44 100644 --- a/src/os2/control.cpp +++ b/src/os2/control.cpp @@ -184,7 +184,7 @@ wxSize wxControl::DoGetBestSize() const bool wxControl::ProcessCommand(wxCommandEvent& event) { - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } WXHBRUSH wxControl::OnCtlColor(WXHDC hWxDC, diff --git a/src/os2/frame.cpp b/src/os2/frame.cpp index 53860bb6e7..567fa20eb6 100644 --- a/src/os2/frame.cpp +++ b/src/os2/frame.cpp @@ -433,7 +433,7 @@ void wxFrame::OnSysColourChanged( wxSysColourChangedEvent vEvent2; vEvent2.SetEventObject(m_frameStatusBar); - m_frameStatusBar->GetEventHandler()->ProcessEvent(vEvent2); + m_frameStatusBar->HandleWindowEvent(vEvent2); } #endif //wxUSE_STATUSBAR @@ -570,7 +570,7 @@ bool wxFrame::ShowFullScreen( bool bShow, long lStyle ) wxSize sz( nWidth, nHeight ); wxSizeEvent vEvent( sz, GetId() ); - GetEventHandler()->ProcessEvent(vEvent); + HandleWindowEvent(vEvent); return true; } else @@ -1051,7 +1051,7 @@ bool wxFrame::HandleMenuSelect( WXWORD nItem, wxMenuEvent vEvent(wxEVT_MENU_HIGHLIGHT, nItem); vEvent.SetEventObject(this); - GetEventHandler()->ProcessEvent(vEvent); // return value would be ignored by PM + HandleWindowEvent(vEvent); // return value would be ignored by PM } else { diff --git a/src/os2/listbox.cpp b/src/os2/listbox.cpp index 7d226adb3b..e8a6013682 100644 --- a/src/os2/listbox.cpp +++ b/src/os2/listbox.cpp @@ -660,7 +660,7 @@ bool wxListBox::OS2Command( n = -1; } vEvent.SetInt(n); - return GetEventHandler()->ProcessEvent(vEvent); + return HandleWindowEvent(vEvent); } // end of wxListBox::OS2Command // ---------------------------------------------------------------------------- diff --git a/src/os2/listctrl.cpp b/src/os2/listctrl.cpp index 1c8a4a0d4d..e51c44e271 100644 --- a/src/os2/listctrl.cpp +++ b/src/os2/listctrl.cpp @@ -2750,7 +2750,7 @@ MRESULT wxListCtrl::OS2WindowProc( WXUINT uMsg, // } vEvent.SetEventType(vEventType); - bProcessed = GetEventHandler()->ProcessEvent(vEvent); + bProcessed = HandleWindowEvent(vEvent); break; } if (!bProcessed) diff --git a/src/os2/notebook.cpp b/src/os2/notebook.cpp index d29206949e..eaf16c77fa 100644 --- a/src/os2/notebook.cpp +++ b/src/os2/notebook.cpp @@ -223,14 +223,14 @@ int wxNotebook::SetSelection( size_t nPage ) vEvent.SetSelection(nPage); vEvent.SetOldSelection(m_nSelection); vEvent.SetEventObject(this); - if (!GetEventHandler()->ProcessEvent(vEvent) || vEvent.IsAllowed()) + if (!HandleWindowEvent(vEvent) || vEvent.IsAllowed()) { // // Program allows the page change // vEvent.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED); - GetEventHandler()->ProcessEvent(vEvent); + HandleWindowEvent(vEvent); ::WinSendMsg( GetHWND() ,BKM_TURNTOPAGE @@ -800,7 +800,7 @@ void wxNotebook::OnNavigationKey ( wxWindow* pPage = m_pages[m_nSelection]; - if (!pPage->GetEventHandler()->ProcessEvent(rEvent)) + if (!pPage->HandleWindowEvent(rEvent)) { pPage->SetFocus(); } @@ -822,7 +822,7 @@ void wxNotebook::OnNavigationKey ( if (pParent) { rEvent.SetCurrentFocus(this); - pParent->GetEventHandler()->ProcessEvent(rEvent); + pParent->HandleWindowEvent(rEvent); } } } diff --git a/src/os2/scrolbar.cpp b/src/os2/scrolbar.cpp index 2f8a96dc82..a89d53de3e 100644 --- a/src/os2/scrolbar.cpp +++ b/src/os2/scrolbar.cpp @@ -225,7 +225,7 @@ bool wxScrollBar::OS2OnScroll ( int WXUNUSED(nOrientation), vEvent.SetOrientation(IsVertical() ? wxVERTICAL : wxHORIZONTAL); vEvent.SetPosition(nPosition); vEvent.SetEventObject(this); - return GetEventHandler()->ProcessEvent(vEvent); + return HandleWindowEvent(vEvent); } // end of wxScrollBar::OS2OnScroll void wxScrollBar::SetThumbPosition ( int nViewStart ) diff --git a/src/os2/slider.cpp b/src/os2/slider.cpp index eec25e5f92..b9864249f5 100644 --- a/src/os2/slider.cpp +++ b/src/os2/slider.cpp @@ -972,13 +972,13 @@ bool wxSlider::OS2OnScroll( int WXUNUSED(nOrientation), vEvent.SetPosition(nNewPos); vEvent.SetEventObject(this); - GetEventHandler()->ProcessEvent(vEvent); + HandleWindowEvent(vEvent); wxCommandEvent vCevent( wxEVT_COMMAND_SLIDER_UPDATED, GetId() ); vCevent.SetInt(nNewPos); vCevent.SetEventObject(this); - return (GetEventHandler()->ProcessEvent(vCevent)); + return (HandleWindowEvent(vCevent)); } // end of wxSlider::OS2OnScroll void wxSlider::SetLineSize( int nLineSize ) diff --git a/src/os2/spinbutt.cpp b/src/os2/spinbutt.cpp index c176baa141..a7b3237f25 100644 --- a/src/os2/spinbutt.cpp +++ b/src/os2/spinbutt.cpp @@ -194,7 +194,7 @@ bool wxSpinButton::OS2OnScroll( int WXUNUSED(nOrientation), vEvent.SetPosition(nVal); vEvent.SetEventObject(this); - return(GetEventHandler()->ProcessEvent(vEvent)); + return(HandleWindowEvent(vEvent)); } // end of wxSpinButton::OS2OnScroll bool wxSpinButton::OS2Command( WXUINT WXUNUSED(uCmd), diff --git a/src/os2/spinctrl.cpp b/src/os2/spinctrl.cpp index 2aeef5f3d7..1777cda78b 100644 --- a/src/os2/spinctrl.cpp +++ b/src/os2/spinctrl.cpp @@ -333,7 +333,7 @@ void wxSpinCtrl::OnChar ( InitCommandEvent(vEvent); vEvent.SetString(sVal); vEvent.SetInt(GetValue()); - if (GetEventHandler()->ProcessEvent(vEvent)) + if (HandleWindowEvent(vEvent)) return; break; } @@ -351,7 +351,7 @@ void wxSpinCtrl::OnChar ( vEventNav.SetDirection(!rEvent.ShiftDown()); vEventNav.SetWindowChange(rEvent.ControlDown()); vEventNav.SetEventObject(this); - if (GetParent()->GetEventHandler()->ProcessEvent(vEventNav)) + if (GetParent()->HandleWindowEvent(vEventNav)) return; } break; @@ -373,7 +373,7 @@ void wxSpinCtrl::OnSpinChange( vEvent.SetEventObject(this); vEvent.SetInt(rEventSpin.GetPosition()); - (void)GetEventHandler()->ProcessEvent(vEvent); + (void)HandleWindowEvent(vEvent); if (rEventSpin.GetSkipped()) { vEvent.Skip(); @@ -406,7 +406,7 @@ bool wxSpinCtrl::ProcessTextCommand( WXWORD wCmd, vEvent.SetString(sVal); vEvent.SetInt(GetValue()); - return (GetEventHandler()->ProcessEvent(vEvent)); + return (HandleWindowEvent(vEvent)); } case SPBN_SETFOCUS: @@ -417,7 +417,7 @@ bool wxSpinCtrl::ProcessTextCommand( WXWORD wCmd, ); vEvent.SetEventObject(this); - return(GetEventHandler()->ProcessEvent(vEvent)); + return(HandleWindowEvent(vEvent)); } default: break; diff --git a/src/os2/textctrl.cpp b/src/os2/textctrl.cpp index 1c7014d733..88178bf957 100644 --- a/src/os2/textctrl.cpp +++ b/src/os2/textctrl.cpp @@ -1049,7 +1049,7 @@ void wxTextCtrl::OnChar( wxCommandEvent vEvent(wxEVT_COMMAND_TEXT_ENTER, m_windowId); vEvent.SetEventObject(this); - if ( GetEventHandler()->ProcessEvent(vEvent)) + if ( HandleWindowEvent(vEvent)) return; } //else: multiline controls need Enter for themselves @@ -1071,7 +1071,7 @@ void wxTextCtrl::OnChar( vEventNav.SetWindowChange(false); vEventNav.SetEventObject(this); - if ( GetEventHandler()->ProcessEvent(vEventNav) ) + if ( HandleWindowEvent(vEventNav) ) return; } break; @@ -1095,7 +1095,7 @@ bool wxTextCtrl::OS2Command( ); vEvent.SetEventObject(this); - GetEventHandler()->ProcessEvent(vEvent); + HandleWindowEvent(vEvent); } break; diff --git a/src/os2/toplevel.cpp b/src/os2/toplevel.cpp index a22fed882d..fde6f06b6f 100644 --- a/src/os2/toplevel.cpp +++ b/src/os2/toplevel.cpp @@ -790,7 +790,7 @@ bool wxTopLevelWindowOS2::Show( bool bShow ) ::WinEnableWindow(m_hFrame, TRUE); vEvent.SetEventObject(this); - GetEventHandler()->ProcessEvent(vEvent); + HandleWindowEvent(vEvent); } else { @@ -965,7 +965,7 @@ bool wxTopLevelWindowOS2::ShowFullScreen( bool bShow, wxSize full( nWidth, nHeight ); wxSizeEvent vEvent( full, GetId() ); - GetEventHandler()->ProcessEvent(vEvent); + HandleWindowEvent(vEvent); return true; } else diff --git a/src/os2/treectrl.cpp b/src/os2/treectrl.cpp index 4b1c943dba..6ccf144ddb 100644 --- a/src/os2/treectrl.cpp +++ b/src/os2/treectrl.cpp @@ -1591,7 +1591,7 @@ void wxTreeCtrl::Delete ( delete (wxTreeItemAttr *)m_vAttrs.Delete((long)rItem.m_pItem); } vEvent.SetEventType(vEventType); - GetEventHandler()->ProcessEvent(vEvent); + HandleWindowEvent(vEvent); } // end of wxTreeCtrl::Delete // delete all children (but don't delete the item itself) @@ -2058,7 +2058,7 @@ MRESULT wxTreeCtrl::OS2WindowProc ( break; } vEvent.SetEventType(vEventType); - bProcessed = GetEventHandler()->ProcessEvent(vEvent); + bProcessed = HandleWindowEvent(vEvent); break; } if (!bProcessed) diff --git a/src/os2/window.cpp b/src/os2/window.cpp index 3250350bc3..d8449e47a0 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -1082,7 +1082,7 @@ void wxWindowOS2::OnIdle( ,vPoint.y ,nState ); - (void)GetEventHandler()->ProcessEvent(rEvent); + (void)HandleWindowEvent(rEvent); } } if (wxUpdateUIEvent::CanUpdate(this)) @@ -1620,7 +1620,7 @@ void wxWindowOS2::DoSetClientSize( int nWidth, wxSize size( nWidth, nHeight ); wxSizeEvent vEvent( size, m_windowId ); vEvent.SetEventObject(this); - GetEventHandler()->ProcessEvent(vEvent); + HandleWindowEvent(vEvent); } // end of wxWindowOS2::DoSetClientSize // --------------------------------------------------------------------------- @@ -2001,7 +2001,7 @@ bool wxWindowOS2::OS2ProcessMessage( WXMSG* pMsg ) vEvent.SetWindowChange(bWindowChange); vEvent.SetEventObject(this); - if (GetEventHandler()->ProcessEvent(vEvent)) + if (HandleWindowEvent(vEvent)) { wxButton* pBtn = wxDynamicCast(FindFocus(), wxButton); @@ -3027,7 +3027,7 @@ bool wxWindowOS2::HandleCreate( WXLPCREATESTRUCT WXUNUSED(vCs), { wxWindowCreateEvent vEvent((wxWindow*)this); - (void)GetEventHandler()->ProcessEvent(vEvent); + (void)HandleWindowEvent(vEvent); *pbMayCreate = true; return true; } // end of wxWindowOS2::HandleCreate @@ -3036,7 +3036,7 @@ bool wxWindowOS2::HandleDestroy() { wxWindowDestroyEvent vEvent((wxWindow*)this); vEvent.SetId(GetId()); - (void)GetEventHandler()->ProcessEvent(vEvent); + (void)HandleWindowEvent(vEvent); // // Delete our drop target if we've got one @@ -3075,7 +3075,7 @@ bool wxWindowOS2::HandleActivate( ,m_windowId ); vEvent.SetEventObject(this); - return GetEventHandler()->ProcessEvent(vEvent); + return HandleWindowEvent(vEvent); } // end of wxWindowOS2::HandleActivate bool wxWindowOS2::HandleSetFocus( WXHWND WXUNUSED(hWnd) ) @@ -3085,7 +3085,7 @@ bool wxWindowOS2::HandleSetFocus( WXHWND WXUNUSED(hWnd) ) // purposes that we got it // wxChildFocusEvent vEventFocus((wxWindow *)this); - (void)GetEventHandler()->ProcessEvent(vEventFocus); + (void)HandleWindowEvent(vEventFocus); #if wxUSE_CARET // @@ -3109,7 +3109,7 @@ bool wxWindowOS2::HandleSetFocus( WXHWND WXUNUSED(hWnd) ) wxFocusEvent vEvent(wxEVT_SET_FOCUS, m_windowId); vEvent.SetEventObject(this); - return GetEventHandler()->ProcessEvent(vEvent); + return HandleWindowEvent(vEvent); } // end of wxWindowOS2::HandleSetFocus bool wxWindowOS2::HandleKillFocus( WXHWND hWnd ) @@ -3156,7 +3156,7 @@ bool wxWindowOS2::HandleKillFocus( WXHWND hWnd ) // wxFindWinFromHandle() may return NULL, it is ok // vEvent.SetWindow(wxFindWinFromHandle(hWnd)); - return GetEventHandler()->ProcessEvent(vEvent); + return HandleWindowEvent(vEvent); } // end of wxWindowOS2::HandleKillFocus // --------------------------------------------------------------------------- @@ -3171,7 +3171,7 @@ bool wxWindowOS2::HandleShow( wxShowEvent vEvent(GetId(), bShow); vEvent.SetEventObject(this); - return GetEventHandler()->ProcessEvent(vEvent); + return HandleWindowEvent(vEvent); } // end of wxWindowOS2::HandleShow bool wxWindowOS2::HandleInitDialog( WXHWND WXUNUSED(hWndFocus) ) @@ -3179,7 +3179,7 @@ bool wxWindowOS2::HandleInitDialog( WXHWND WXUNUSED(hWndFocus) ) wxInitDialogEvent vEvent(GetId()); vEvent.SetEventObject(this); - return GetEventHandler()->ProcessEvent(vEvent); + return HandleWindowEvent(vEvent); } // end of wxWindowOS2::HandleInitDialog bool wxWindowOS2::HandleEndDrag(WXWPARAM WXUNUSED(wParam)) @@ -3416,7 +3416,7 @@ bool wxWindowOS2::HandleSysColorChange() wxSysColourChangedEvent vEvent; vEvent.SetEventObject(this); - return GetEventHandler()->ProcessEvent(vEvent); + return HandleWindowEvent(vEvent); } // end of wxWindowOS2::HandleSysColorChange bool wxWindowOS2::HandleCtlColor( WXHBRUSH* WXUNUSED(phBrush) ) @@ -3449,7 +3449,7 @@ bool wxWindowOS2::HandlePaletteChanged() vEvent.SetEventObject(this); vEvent.SetChangedWindow(wxFindWinFromHandle(hWndPalChange)); - return GetEventHandler()->ProcessEvent(vEvent); + return HandleWindowEvent(vEvent); } // end of wxWindowOS2::HandlePaletteChanged // @@ -3473,7 +3473,7 @@ void wxWindowOS2::OnSysColourChanged( wxSysColourChangedEvent vEvent; rEvent.SetEventObject(pWin); - pWin->GetEventHandler()->ProcessEvent(vEvent); + pWin->HandleWindowEvent(vEvent); } node = node->GetNext(); } @@ -3558,7 +3558,7 @@ bool wxWindowOS2::HandlePaint() m_updateRegion = wxRegion(hRgn, hPS); vEvent.SetEventObject(this); - bProcessed = GetEventHandler()->ProcessEvent(vEvent); + bProcessed = HandleWindowEvent(vEvent); if (!bProcessed && IsKindOf(CLASSINFO(wxPanel)) && @@ -3681,7 +3681,7 @@ bool wxWindowOS2::HandleEraseBkgnd( WXHDC hDC ) vEvent.SetEventObject(this); - rc = GetEventHandler()->ProcessEvent(vEvent); + rc = HandleWindowEvent(vEvent); vDC.m_hPS = NULLHANDLE; return true; @@ -3707,7 +3707,7 @@ bool wxWindowOS2::HandleMinimize() wxIconizeEvent vEvent(m_windowId); vEvent.SetEventObject(this); - return GetEventHandler()->ProcessEvent(vEvent); + return HandleWindowEvent(vEvent); } // end of wxWindowOS2::HandleMinimize bool wxWindowOS2::HandleMaximize() @@ -3715,7 +3715,7 @@ bool wxWindowOS2::HandleMaximize() wxMaximizeEvent vEvent(m_windowId); vEvent.SetEventObject(this); - return GetEventHandler()->ProcessEvent(vEvent); + return HandleWindowEvent(vEvent); } // end of wxWindowOS2::HandleMaximize bool wxWindowOS2::HandleMove( int nX, int nY ) @@ -3724,7 +3724,7 @@ bool wxWindowOS2::HandleMove( int nX, int nY ) wxMoveEvent vEvent(pt, m_windowId); vEvent.SetEventObject(this); - return GetEventHandler()->ProcessEvent(vEvent); + return HandleWindowEvent(vEvent); } // end of wxWindowOS2::HandleMove bool wxWindowOS2::HandleSize( int nWidth, @@ -3735,7 +3735,7 @@ bool wxWindowOS2::HandleSize( int nWidth, wxSizeEvent vEvent(sz, m_windowId); vEvent.SetEventObject(this); - return GetEventHandler()->ProcessEvent(vEvent); + return HandleWindowEvent(vEvent); } // end of wxWindowOS2::HandleSize bool wxWindowOS2::HandleGetMinMaxInfo( PSWP pSwp ) @@ -3880,7 +3880,7 @@ bool wxWindowOS2::HandleMouseEvent( WXUINT uMsg, ,uFlags ); - bProcessed = GetEventHandler()->ProcessEvent(vEvent); + bProcessed = HandleWindowEvent(vEvent); if (!bProcessed) { HPOINTER hCursor = (HPOINTER)GetCursor().GetHCURSOR(); @@ -3914,7 +3914,7 @@ bool wxWindowOS2::HandleMouseMove( int nX, ,uFlags ); - (void)GetEventHandler()->ProcessEvent(vEvent); + (void)HandleWindowEvent(vEvent); } return HandleMouseEvent( WM_MOUSEMOVE ,nX @@ -4036,7 +4036,7 @@ bool wxWindowOS2::HandleChar( WXWPARAM WXUNUSED(wParam), vEvent.m_controlDown = true; } - return (GetEventHandler()->ProcessEvent(vEvent)); + return (HandleWindowEvent(vEvent)); } bool wxWindowOS2::HandleKeyDown( WXWPARAM wParam, @@ -4060,7 +4060,7 @@ bool wxWindowOS2::HandleKeyDown( WXWPARAM wParam, ,(MPARAM)wParam )); - if (GetEventHandler()->ProcessEvent(vEvent)) + if (HandleWindowEvent(vEvent)) { return true; } @@ -4089,7 +4089,7 @@ bool wxWindowOS2::HandleKeyUp( WXWPARAM wParam, ,(MPARAM)wParam )); - if (GetEventHandler()->ProcessEvent(vEvent)) + if (HandleWindowEvent(vEvent)) return true; } return false; @@ -4155,7 +4155,7 @@ bool wxWindowOS2::OS2OnScroll( int nOrientation, default: return false; } - return GetEventHandler()->ProcessEvent(vEvent); + return HandleWindowEvent(vEvent); } // end of wxWindowOS2::OS2OnScroll // diff --git a/src/palmos/control.cpp b/src/palmos/control.cpp index 2211ff1537..89c50c48ac 100644 --- a/src/palmos/control.cpp +++ b/src/palmos/control.cpp @@ -501,7 +501,7 @@ wxControl::GetCompositeControlsDefaultAttributes(wxWindowVariant WXUNUSED(varian bool wxControl::ProcessCommand(wxCommandEvent& event) { - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } void wxControl::OnEraseBackground(wxEraseEvent& event) diff --git a/src/palmos/frame.cpp b/src/palmos/frame.cpp index 92e7cea81d..da9e70ede7 100644 --- a/src/palmos/frame.cpp +++ b/src/palmos/frame.cpp @@ -222,7 +222,7 @@ bool wxFrame::HandleMenuSelect(WXEVENTPTR event) wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, item); commandEvent.SetEventObject(this); - GetEventHandler()->ProcessEvent(commandEvent); + HandleWindowEvent(commandEvent); return true; } diff --git a/src/palmos/slider.cpp b/src/palmos/slider.cpp index 72bb092ca1..22b64317c5 100644 --- a/src/palmos/slider.cpp +++ b/src/palmos/slider.cpp @@ -308,7 +308,7 @@ bool wxSlider::SendUpdatedEvent() wxScrollEvent eventWxTrack(wxEVT_SCROLL_THUMBRELEASE, GetId()); eventWxTrack.SetPosition(m_oldPos); eventWxTrack.SetEventObject(this); - bool handled = GetEventHandler()->ProcessEvent(eventWxTrack); + bool handled = HandleWindowEvent(eventWxTrack); // then slider event if position changed if( m_oldValue != m_oldPos ) @@ -339,7 +339,7 @@ bool wxSlider::SendScrollEvent(WXEVENTPTR event) wxScrollEvent eventWx(wxEVT_SCROLL_THUMBTRACK, GetId()); eventWx.SetPosition(newPos); eventWx.SetEventObject(this); - return GetEventHandler()->ProcessEvent(eventWx); + return HandleWindowEvent(eventWx); } void wxSlider::Command (wxCommandEvent & event) diff --git a/src/palmos/toplevel.cpp b/src/palmos/toplevel.cpp index 2093565f33..8f28b50904 100644 --- a/src/palmos/toplevel.cpp +++ b/src/palmos/toplevel.cpp @@ -171,7 +171,7 @@ bool wxTopLevelWindowPalm::Show(bool show) wxPaintEvent event(m_windowId); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); return true; } @@ -330,7 +330,7 @@ bool wxTopLevelWindowPalm::HandleSize(WXEVENTPTR event) palmEvent->data.winResized.newBounds.extent.y); wxSizeEvent eventWx(newSize,GetId()); eventWx.SetEventObject(this); - return GetEventHandler()->ProcessEvent(eventWx); + return HandleWindowEvent(eventWx); } void wxTopLevelWindowPalm::OnActivate(wxActivateEvent& event) diff --git a/src/x11/app.cpp b/src/x11/app.cpp index c7ec2a5de7..dad65db005 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -388,14 +388,14 @@ bool wxApp::ProcessXEvent(WXEvent* _event) // wxLogDebug( "OnKey from %s", win->GetName().c_str() ); // We didn't process wxEVT_KEY_DOWN, so send wxEVT_CHAR - if (win->GetEventHandler()->ProcessEvent( keyEvent )) + if (win->HandleWindowEvent( keyEvent )) return true; keyEvent.SetEventType(wxEVT_CHAR); // Do the translation again, retaining the ASCII // code. if (wxTranslateKeyEvent(keyEvent, win, window, event, true) && - win->GetEventHandler()->ProcessEvent( keyEvent )) + win->HandleWindowEvent( keyEvent )) return true; if ( (keyEvent.m_keyCode == WXK_TAB) && @@ -408,7 +408,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event) /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */ new_event.SetWindowChange( keyEvent.ControlDown() ); new_event.SetCurrentFocus( win ); - return win->GetParent()->GetEventHandler()->ProcessEvent( new_event ); + return win->GetParent()->HandleWindowEvent( new_event ); } return false; @@ -421,7 +421,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event) wxKeyEvent keyEvent(wxEVT_KEY_UP); wxTranslateKeyEvent(keyEvent, win, window, event); - return win->GetEventHandler()->ProcessEvent( keyEvent ); + return win->HandleWindowEvent( keyEvent ); } case ConfigureNotify: { @@ -445,7 +445,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event) wxSizeEvent sizeEvent( wxSize(XConfigureEventGetWidth(event), XConfigureEventGetHeight(event)), win->GetId() ); sizeEvent.SetEventObject( win ); - return win->GetEventHandler()->ProcessEvent( sizeEvent ); + return win->HandleWindowEvent( sizeEvent ); } } return false; @@ -505,7 +505,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event) wxSizeEvent sizeEvent(sz, win->GetId()); sizeEvent.SetEventObject(win); - return win->GetEventHandler()->ProcessEvent( sizeEvent ); + return win->HandleWindowEvent( sizeEvent ); } #endif #endif @@ -570,7 +570,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event) #endif wxMouseEvent wxevent; wxTranslateMouseEvent(wxevent, win, window, event); - return win->GetEventHandler()->ProcessEvent( wxevent ); + return win->HandleWindowEvent( wxevent ); } case FocusIn: #if !wxUSE_NANOX @@ -596,7 +596,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event) focusEvent.SetWindow( g_prevFocus ); g_prevFocus = NULL; - return win->GetEventHandler()->ProcessEvent(focusEvent); + return win->HandleWindowEvent(focusEvent); } } return false; @@ -613,7 +613,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event) focusEvent.SetEventObject(win); focusEvent.SetWindow( g_nextFocus ); g_nextFocus = NULL; - return win->GetEventHandler()->ProcessEvent(focusEvent); + return win->HandleWindowEvent(focusEvent); } return false; diff --git a/src/x11/textctrl.cpp b/src/x11/textctrl.cpp index 02692fea0f..ffb7b41301 100644 --- a/src/x11/textctrl.cpp +++ b/src/x11/textctrl.cpp @@ -1901,7 +1901,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &event ) wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); event.SetEventObject(this); event.SetString(GetValue()); - if (GetEventHandler()->ProcessEvent(event)) return; + if (HandleWindowEvent(event)) return; } if (IsSingleLine()) diff --git a/src/x11/toplevel.cpp b/src/x11/toplevel.cpp index 384b7ae317..9d16c98353 100644 --- a/src/x11/toplevel.cpp +++ b/src/x11/toplevel.cpp @@ -268,7 +268,7 @@ void wxTopLevelWindowX11::OnInternalIdle() { wxSizeEvent event( GetClientSize(), GetId() ); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); + HandleWindowEvent( event ); m_needResizeInIdle = false; } @@ -285,7 +285,7 @@ bool wxTopLevelWindowX11::Show(bool show) wxSizeEvent event(GetSize(), GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + HandleWindowEvent(event); m_needResizeInIdle = false; } diff --git a/src/x11/window.cpp b/src/x11/window.cpp index d7bac60b2a..0c69ed36f6 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -1211,7 +1211,7 @@ void wxWindowX11::SendEraseEvents() wxEraseEvent erase_event( GetId(), &dc ); erase_event.SetEventObject( this ); - if (!GetEventHandler()->ProcessEvent(erase_event) ) + if (!HandleWindowEvent(erase_event) ) { Display *xdisplay = wxGlobalDisplay(); Window xwindow = (Window) GetClientAreaWindow(); @@ -1237,7 +1237,7 @@ void wxWindowX11::SendPaintEvents() wxPaintEvent paint_event( GetId() ); paint_event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( paint_event ); + HandleWindowEvent( paint_event ); m_updateRegion.Clear(); @@ -1279,7 +1279,7 @@ void wxWindowX11::SendNcPaintEvents() wxNcPaintEvent nc_paint_event( GetId() ); nc_paint_event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( nc_paint_event ); + HandleWindowEvent( nc_paint_event ); m_updateNcArea = false; } @@ -1300,7 +1300,7 @@ void wxWindowX11::OnSysColourChanged(wxSysColourChangedEvent& event) { wxSysColourChangedEvent event2; event.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(event2); + win->HandleWindowEvent(event2); } node = node->GetNext(); -- 2.45.2