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
This commit is contained in:
Václav Slavík
2007-11-29 17:00:58 +00:00
parent 787f0fc4f3
commit 937013e0fd
152 changed files with 638 additions and 552 deletions

View File

@@ -274,6 +274,30 @@ recursively applied to the parent window's event handler. If this returns true,
\helpref{wxEvtHandler::SearchEventTable}{wxevthandlersearcheventtable} \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} \membersection{wxEvtHandler::SearchEventTable}\label{wxevthandlersearcheventtable}
\func{virtual bool}{SearchEventTable}{\param{wxEventTable\& }{table}, \param{wxEvent\& }{event}} \func{virtual bool}{SearchEventTable}{\param{wxEventTable\& }{table}, \param{wxEvent\& }{event}}

View File

@@ -1539,6 +1539,13 @@ Returns the value previously passed to
\helpref{wxWindow::SetWindowVariant}{wxwindowsetwindowvariant}. \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} \membersection{wxWindow::HasCapture}\label{wxwindowhascapture}
\constfunc{virtual bool}{HasCapture}{\void} \constfunc{virtual bool}{HasCapture}{\void}

View File

@@ -2363,6 +2363,12 @@ public:
// process an event right now // process an event right now
virtual bool ProcessEvent(wxEvent& event); 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 // add an event to be processed later
virtual void AddPendingEvent(const wxEvent& event); virtual void AddPendingEvent(const wxEvent& event);

View File

@@ -745,6 +745,13 @@ public:
// be there) // be there)
bool RemoveEventHandler(wxEvtHandler *handler); 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 // validators
// ---------- // ----------

View File

@@ -122,7 +122,7 @@ void wxChoice::CocoaNotification_menuDidSendAction(WX_NSNotification notificatio
event.SetInt(index); event.SetInt(index);
event.SetEventObject(this); event.SetEventObject(this);
event.SetString(GetStringSelection()); event.SetString(GetStringSelection());
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
void wxChoice::DoClear() void wxChoice::DoClear()

View File

@@ -229,14 +229,14 @@ void wxComboBox::doWxEvent(int nEvent)
event2.SetInt(GetSelection()); event2.SetInt(GetSelection());
event2.SetEventObject(this); event2.SetEventObject(this);
event2.SetString(GetStringSelection()); event2.SetString(GetStringSelection());
GetEventHandler()->ProcessEvent(event2); HandleWindowEvent(event2);
// For consistency with MSW and GTK, also send a text updated event // For consistency with MSW and GTK, also send a text updated event
// After all, the text is updated when a selection is made // After all, the text is updated when a selection is made
wxCommandEvent TextEvent( wxEVT_COMMAND_TEXT_UPDATED, GetId() ); wxCommandEvent TextEvent( wxEVT_COMMAND_TEXT_UPDATED, GetId() );
TextEvent.SetString( GetStringSelection() ); TextEvent.SetString( GetStringSelection() );
TextEvent.SetEventObject( this ); TextEvent.SetEventObject( this );
GetEventHandler()->ProcessEvent( TextEvent ); HandleWindowEvent( TextEvent );
} }

View File

@@ -97,7 +97,7 @@ wxSize wxControl::DoGetBestSize() const
bool wxControl::ProcessCommand(wxCommandEvent& event) bool wxControl::ProcessCommand(wxCommandEvent& event)
{ {
return GetEventHandler()->ProcessEvent(event); return HandleWindowEvent(event);
} }
void wxControl::CocoaSetEnabled(bool enable) void wxControl::CocoaSetEnabled(bool enable)

View File

@@ -325,7 +325,7 @@ bool wxNotebook::CocoaDelegate_tabView_shouldSelectTabViewItem(WX_NSTabViewItem
wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, GetId(), wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, GetId(),
[GetNSTabView() indexOfTabViewItem:tabViewItem], GetSelection()); [GetNSTabView() indexOfTabViewItem:tabViewItem], GetSelection());
event.SetEventObject(this); event.SetEventObject(this);
return !GetEventHandler()->ProcessEvent(event) || event.IsAllowed(); return !HandleWindowEvent(event) || event.IsAllowed();
} }
#endif // wxUSE_NOTEBOOK #endif // wxUSE_NOTEBOOK

View File

@@ -176,7 +176,7 @@ void wxScrollBar::Cocoa_wxNSScrollerAction()
wxScrollEvent event(command, GetId(), GetThumbPosition(), wxScrollEvent event(command, GetId(), GetThumbPosition(),
HasFlag(wxSB_VERTICAL)?wxVERTICAL:wxHORIZONTAL); HasFlag(wxSB_VERTICAL)?wxVERTICAL:wxHORIZONTAL);
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
#endif // wxUSE_SCROLLBAR #endif // wxUSE_SCROLLBAR

View File

@@ -111,7 +111,7 @@ void wxSlider::ProcessEventType(wxEventType commandType)
{ {
wxScrollEvent event(commandType, GetId(), GetValue(), HasFlag(wxSL_VERTICAL)?wxVERTICAL:wxHORIZONTAL); wxScrollEvent event(commandType, GetId(), GetValue(), HasFlag(wxSL_VERTICAL)?wxVERTICAL:wxHORIZONTAL);
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
static inline wxEventType wxSliderEventTypeForKeyFromEvent(NSEvent *theEvent) static inline wxEventType wxSliderEventTypeForKeyFromEvent(NSEvent *theEvent)

View File

@@ -80,7 +80,7 @@ void wxSpinButton::CocoaTarget_action()
wxSpinEvent event(wxEVT_SCROLL_THUMBTRACK, GetId()); wxSpinEvent event(wxEVT_SCROLL_THUMBTRACK, GetId());
event.SetPosition(GetValue()); event.SetPosition(GetValue());
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
#endif // wxUSE_SPINBTN #endif // wxUSE_SPINBTN

View File

@@ -102,7 +102,7 @@ void wxTextCtrl::CocoaTarget_action(void)
//event.SetString(GetValue()); //event.SetString(GetValue());
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
void wxTextCtrl::AppendText(wxString const&) void wxTextCtrl::AppendText(wxString const&)

View File

@@ -222,7 +222,7 @@ void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void)
wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey"),this); wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey"),this);
wxActivateEvent event(wxEVT_ACTIVATE, true, GetId()); wxActivateEvent event(wxEVT_ACTIVATE, true, GetId());
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void) void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void)
@@ -230,7 +230,7 @@ void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void)
wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignKey"),this); wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignKey"),this);
wxActivateEvent event(wxEVT_ACTIVATE, false, GetId()); wxActivateEvent event(wxEVT_ACTIVATE, false, GetId());
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeMain(void) void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeMain(void)
@@ -301,7 +301,7 @@ bool wxTopLevelWindowCocoa::Show(bool show)
// is shown. I doubt this will cause any problems though. // is shown. I doubt this will cause any problems though.
wxSizeEvent event(GetSize(), GetId()); wxSizeEvent event(GetSize(), GetId());
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
[m_cocoaNSWindow makeKeyAndOrderFront:m_cocoaNSWindow]; [m_cocoaNSWindow makeKeyAndOrderFront:m_cocoaNSWindow];
} }

View File

@@ -985,7 +985,7 @@ void wxWindowCocoaScrollView::_wx_doScroller(NSScroller *sender)
} }
wxScrollWinEvent event(commandType, scrollpos, orientation); wxScrollWinEvent event(commandType, scrollpos, orientation);
event.SetEventObject(m_owner); event.SetEventObject(m_owner);
m_owner->GetEventHandler()->ProcessEvent(event); m_owner->HandleWindowEvent(event);
} }
void wxWindowCocoaScrollView::UpdateSizes() 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); wxLogTrace(wxTRACE_COCOA,wxT("wxWindowCocoaScrollView=%p::Cocoa_FrameChanged for wxWindow %p"), this, m_owner);
wxSizeEvent event(m_owner->GetSize(), m_owner->GetId()); wxSizeEvent event(m_owner->GetSize(), m_owner->GetId());
event.SetEventObject(m_owner); event.SetEventObject(m_owner);
m_owner->GetEventHandler()->ProcessEvent(event); m_owner->HandleWindowEvent(event);
UpdateSizes(); UpdateSizes();
} }
@@ -1191,7 +1191,7 @@ bool wxWindowCocoa::Cocoa_drawRect(const NSRect &rect)
wxPaintEvent event(m_windowId); wxPaintEvent event(m_windowId);
event.SetEventObject(this); event.SetEventObject(this);
bool ret = GetEventHandler()->ProcessEvent(event); bool ret = HandleWindowEvent(event);
m_isInPaint = false; m_isInPaint = false;
return ret; return ret;
} }
@@ -1261,7 +1261,7 @@ bool wxWindowCocoa::Cocoa_mouseMoved(WX_NSEvent theEvent)
wxMouseEvent event(wxEVT_MOTION); wxMouseEvent event(wxEVT_MOTION);
InitMouseEvent(event,theEvent); InitMouseEvent(event,theEvent);
wxLogTrace(wxTRACE_COCOA,wxT("wxWindow=%p::Cocoa_mouseMoved @%d,%d"),this,event.m_x,event.m_y); 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() void wxWindowCocoa::Cocoa_synthesizeMouseMoved()
@@ -1282,7 +1282,7 @@ void wxWindowCocoa::Cocoa_synthesizeMouseMoved()
event.SetId(GetId()); event.SetId(GetId());
wxLogTrace(wxTRACE_COCOA,wxT("wxwin=%p Synthesized Mouse Moved @%d,%d"),this,event.m_x,event.m_y); 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) bool wxWindowCocoa::Cocoa_mouseEntered(WX_NSEvent theEvent)
@@ -1300,7 +1300,7 @@ bool wxWindowCocoa::Cocoa_mouseEntered(WX_NSEvent theEvent)
wxMouseEvent event(wxEVT_ENTER_WINDOW); wxMouseEvent event(wxEVT_ENTER_WINDOW);
InitMouseEvent(event,theEvent); 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); 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 else
return false; return false;
@@ -1315,7 +1315,7 @@ bool wxWindowCocoa::Cocoa_mouseExited(WX_NSEvent theEvent)
wxMouseEvent event(wxEVT_LEAVE_WINDOW); wxMouseEvent event(wxEVT_LEAVE_WINDOW);
InitMouseEvent(event,theEvent); 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); 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 else
return false; return false;
@@ -1326,7 +1326,7 @@ bool wxWindowCocoa::Cocoa_mouseDown(WX_NSEvent theEvent)
wxMouseEvent event([theEvent clickCount]<2?wxEVT_LEFT_DOWN:wxEVT_LEFT_DCLICK); wxMouseEvent event([theEvent clickCount]<2?wxEVT_LEFT_DOWN:wxEVT_LEFT_DCLICK);
InitMouseEvent(event,theEvent); InitMouseEvent(event,theEvent);
wxLogTrace(wxTRACE_COCOA,wxT("Mouse Down @%d,%d num clicks=%d"),event.m_x,event.m_y,[theEvent clickCount]); 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) bool wxWindowCocoa::Cocoa_mouseDragged(WX_NSEvent theEvent)
@@ -1335,7 +1335,7 @@ bool wxWindowCocoa::Cocoa_mouseDragged(WX_NSEvent theEvent)
InitMouseEvent(event,theEvent); InitMouseEvent(event,theEvent);
event.m_leftDown = true; event.m_leftDown = true;
wxLogTrace(wxTRACE_COCOA,wxT("Mouse Drag @%d,%d"),event.m_x,event.m_y); 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) bool wxWindowCocoa::Cocoa_mouseUp(WX_NSEvent theEvent)
@@ -1343,7 +1343,7 @@ bool wxWindowCocoa::Cocoa_mouseUp(WX_NSEvent theEvent)
wxMouseEvent event(wxEVT_LEFT_UP); wxMouseEvent event(wxEVT_LEFT_UP);
InitMouseEvent(event,theEvent); InitMouseEvent(event,theEvent);
wxLogTrace(wxTRACE_COCOA,wxT("Mouse Up @%d,%d"),event.m_x,event.m_y); 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) 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); wxMouseEvent event([theEvent clickCount]<2?wxEVT_RIGHT_DOWN:wxEVT_RIGHT_DCLICK);
InitMouseEvent(event,theEvent); InitMouseEvent(event,theEvent);
wxLogDebug(wxT("Mouse Down @%d,%d num clicks=%d"),event.m_x,event.m_y,[theEvent clickCount]); 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) bool wxWindowCocoa::Cocoa_rightMouseDragged(WX_NSEvent theEvent)
@@ -1360,7 +1360,7 @@ bool wxWindowCocoa::Cocoa_rightMouseDragged(WX_NSEvent theEvent)
InitMouseEvent(event,theEvent); InitMouseEvent(event,theEvent);
event.m_rightDown = true; event.m_rightDown = true;
wxLogDebug(wxT("Mouse Drag @%d,%d"),event.m_x,event.m_y); 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) bool wxWindowCocoa::Cocoa_rightMouseUp(WX_NSEvent theEvent)
@@ -1368,7 +1368,7 @@ bool wxWindowCocoa::Cocoa_rightMouseUp(WX_NSEvent theEvent)
wxMouseEvent event(wxEVT_RIGHT_UP); wxMouseEvent event(wxEVT_RIGHT_UP);
InitMouseEvent(event,theEvent); InitMouseEvent(event,theEvent);
wxLogDebug(wxT("Mouse Up @%d,%d"),event.m_x,event.m_y); 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) bool wxWindowCocoa::Cocoa_otherMouseDown(WX_NSEvent theEvent)
@@ -1401,7 +1401,7 @@ void wxWindowCocoa::Cocoa_FrameChanged(void)
m_visibleTrackingRectManager->RebuildTrackingRect(); m_visibleTrackingRectManager->RebuildTrackingRect();
wxSizeEvent event(GetSize(), m_windowId); wxSizeEvent event(GetSize(), m_windowId);
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
else else
{ {

View File

@@ -25,6 +25,7 @@
#endif #endif
#include "wx/event.h" #include "wx/event.h"
#include "wx/evtloop.h"
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/list.h" #include "wx/list.h"
@@ -1314,6 +1315,42 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event)
return TryParent(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) bool wxEvtHandler::SearchEventTable(wxEventTable& table, wxEvent& event)
{ {

View File

@@ -1051,6 +1051,11 @@ bool wxWindowBase::RemoveEventHandler(wxEvtHandler *handler)
return false; return false;
} }
bool wxWindowBase::HandleWindowEvent(wxEvent& event) const
{
return GetEventHandler()->SafelyProcessEvent(event);
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// colours, fonts &c // colours, fonts &c
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -228,7 +228,7 @@ bool wxNonOwnedWindow::Show(bool show)
m_sizeSet = true; m_sizeSet = true;
wxSizeEvent event(GetSize(), GetId()); wxSizeEvent event(GetSize(), GetId());
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
// make sure the window is fully painted, with all pending updates, before // make sure the window is fully painted, with all pending updates, before

View File

@@ -185,7 +185,7 @@ void wxTopLevelWindowDFB::HandleFocusEvent(const wxDFBWindowEvent& event_)
wxActivateEvent event(wxEVT_ACTIVATE, activate, GetId()); wxActivateEvent event(wxEVT_ACTIVATE, activate, GetId());
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
// if a frame that doesn't have wx focus inside it just got focus, we // if a frame that doesn't have wx focus inside it just got focus, we
// need to set focus to it (or its child): // need to set focus to it (or its child):

View File

@@ -206,12 +206,12 @@ void wxWindowDFB::SetFocus()
// notify the parent keeping track of focus for the kbd navigation // notify the parent keeping track of focus for the kbd navigation
// purposes that we got it // purposes that we got it
wxChildFocusEvent eventFocus((wxWindow*)this); wxChildFocusEvent eventFocus((wxWindow*)this);
GetEventHandler()->ProcessEvent(eventFocus); HandleWindowEvent(eventFocus);
wxFocusEvent event(wxEVT_SET_FOCUS, GetId()); wxFocusEvent event(wxEVT_SET_FOCUS, GetId());
event.SetEventObject(this); event.SetEventObject(this);
event.SetWindow((wxWindow*)oldFocusedWindow); event.SetWindow((wxWindow*)oldFocusedWindow);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
#if wxUSE_CARET #if wxUSE_CARET
// caret needs to be informed about focus change // caret needs to be informed about focus change
@@ -241,7 +241,7 @@ void wxWindowDFB::DFBKillFocus()
wxFocusEvent event(wxEVT_KILL_FOCUS, GetId()); wxFocusEvent event(wxEVT_KILL_FOCUS, GetId());
event.SetEventObject(this); event.SetEventObject(this);
event.SetWindow(gs_toBeFocusedWindow); 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); wxSize newSize(width, height);
wxSizeEvent event(newSize, GetId()); wxSizeEvent event(newSize, GetId());
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
} }
@@ -674,7 +674,7 @@ void wxWindowDFB::PaintWindow(const wxRect& rect)
wxWindowDC dc((wxWindow*)this); wxWindowDC dc((wxWindow*)this);
wxEraseEvent eventEr(m_windowId, &dc); wxEraseEvent eventEr(m_windowId, &dc);
eventEr.SetEventObject(this); eventEr.SetEventObject(this);
GetEventHandler()->ProcessEvent(eventEr); HandleWindowEvent(eventEr);
wxRect clientRect(GetClientRect()); wxRect clientRect(GetClientRect());
@@ -683,7 +683,7 @@ void wxWindowDFB::PaintWindow(const wxRect& rect)
{ {
wxNcPaintEvent eventNc(GetId()); wxNcPaintEvent eventNc(GetId());
eventNc.SetEventObject(this); eventNc.SetEventObject(this);
GetEventHandler()->ProcessEvent(eventNc); HandleWindowEvent(eventNc);
} }
else else
{ {
@@ -696,7 +696,7 @@ void wxWindowDFB::PaintWindow(const wxRect& rect)
{ {
wxPaintEvent eventPt(GetId()); wxPaintEvent eventPt(GetId());
eventPt.SetEventObject(this); eventPt.SetEventObject(this);
GetEventHandler()->ProcessEvent(eventPt); HandleWindowEvent(eventPt);
} }
else else
{ {
@@ -1026,7 +1026,7 @@ void wxWindowDFB::HandleKeyEvent(const wxDFBWindowEvent& event_)
if ( e.type == DWET_KEYUP ) if ( e.type == DWET_KEYUP )
{ {
event.SetEventType(wxEVT_KEY_UP); event.SetEventType(wxEVT_KEY_UP);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
else else
{ {
@@ -1034,7 +1034,7 @@ void wxWindowDFB::HandleKeyEvent(const wxDFBWindowEvent& event_)
event.SetEventType(wxEVT_KEY_DOWN); event.SetEventType(wxEVT_KEY_DOWN);
if ( GetEventHandler()->ProcessEvent(event) ) if ( HandleWindowEvent(event) )
return; return;
// only send wxEVT_CHAR event if not processed yet: // only send wxEVT_CHAR event if not processed yet:
@@ -1042,7 +1042,7 @@ void wxWindowDFB::HandleKeyEvent(const wxDFBWindowEvent& event_)
if ( event.m_keyCode != 0 ) if ( event.m_keyCode != 0 )
{ {
event.SetEventType(wxEVT_CHAR); event.SetEventType(wxEVT_CHAR);
if ( GetEventHandler()->ProcessEvent(event) ) if ( HandleWindowEvent(event) )
return; return;
} }
@@ -1057,7 +1057,7 @@ void wxWindowDFB::HandleKeyEvent(const wxDFBWindowEvent& event_)
// Ctrl-TAB changes the (parent) window, i.e. switch notebook page: // Ctrl-TAB changes the (parent) window, i.e. switch notebook page:
navEvent.SetWindowChange(event.m_controlDown); navEvent.SetWindowChange(event.m_controlDown);
navEvent.SetCurrentFocus(wxStaticCast(this, wxWindow)); navEvent.SetCurrentFocus(wxStaticCast(this, wxWindow));
GetParent()->GetEventHandler()->ProcessEvent(navEvent); GetParent()->HandleWindowEvent(navEvent);
} }
} }
} }

View File

@@ -40,7 +40,7 @@ static void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitma
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId()); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
event.SetEventObject(button); event.SetEventObject(button);
button->GetEventHandler()->ProcessEvent(event); button->HandleWindowEvent(event);
} }
} }

View File

@@ -44,7 +44,7 @@ static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId()); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
event.SetEventObject(button); event.SetEventObject(button);
button->GetEventHandler()->ProcessEvent(event); button->HandleWindowEvent(event);
} }
} }

View File

@@ -84,7 +84,7 @@ static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb)
wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, cb->GetId()); wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, cb->GetId());
event.SetInt(cb->Get3StateValue()); event.SetInt(cb->Get3StateValue());
event.SetEventObject(cb); event.SetEventObject(cb);
cb->GetEventHandler()->ProcessEvent(event); cb->HandleWindowEvent(event);
} }
} }

View File

@@ -37,7 +37,7 @@ static void gtk_checklist_toggled(GtkCellRendererToggle * WXUNUSED(renderer),
new_event.SetInt( gtk_tree_path_get_indices(path)[0] ); new_event.SetInt( gtk_tree_path_get_indices(path)[0] );
gtk_tree_path_free(path); gtk_tree_path_free(path);
listbox->Check( new_event.GetInt(), !listbox->IsChecked(new_event.GetInt())); listbox->Check( new_event.GetInt(), !listbox->IsChecked(new_event.GetInt()));
listbox->GetEventHandler()->ProcessEvent( new_event ); listbox->HandleWindowEvent( new_event );
} }
} }

View File

@@ -62,7 +62,7 @@ static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice *
else if ( choice->HasClientUntypedData() ) else if ( choice->HasClientUntypedData() )
event.SetClientData( choice->GetClientData(n) ); event.SetClientData( choice->GetClientData(n) );
choice->GetEventHandler()->ProcessEvent(event); choice->HandleWindowEvent(event);
} }
} }

View File

@@ -43,7 +43,7 @@ static void gtk_clrbutton_setcolor_callback(GtkColorButton *widget,
// fire the colour-changed event // fire the colour-changed event
wxColourPickerEvent event(p, p->GetId(), p->GetColour()); wxColourPickerEvent event(p, p->GetId(), p->GetColour());
p->GetEventHandler()->ProcessEvent(event); p->HandleWindowEvent(event);
} }
} }

View File

@@ -102,7 +102,7 @@ gtk_collapsiblepane_expanded_callback(GObject * WXUNUSED(object),
{ {
// fire an event // fire an event
wxCollapsiblePaneEvent ev(p, p->GetId(), p->IsCollapsed()); wxCollapsiblePaneEvent ev(p, p->GetId(), p->IsCollapsed());
p->GetEventHandler()->ProcessEvent(ev); p->HandleWindowEvent(ev);
// the user asked to explicitely handle the resizing itself... // the user asked to explicitely handle the resizing itself...
return; return;
@@ -143,7 +143,7 @@ gtk_collapsiblepane_expanded_callback(GObject * WXUNUSED(object),
// fire an event // fire an event
wxCollapsiblePaneEvent ev(p, p->GetId(), p->IsCollapsed()); wxCollapsiblePaneEvent ev(p, p->GetId(), p->IsCollapsed());
p->GetEventHandler()->ProcessEvent(ev); p->HandleWindowEvent(ev);
} }
} }

View File

@@ -36,7 +36,7 @@ gtkcombobox_text_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *comb
wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, combo->GetId() ); wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, combo->GetId() );
event.SetString( combo->GetValue() ); event.SetString( combo->GetValue() );
event.SetEventObject( combo ); event.SetEventObject( combo );
combo->GetEventHandler()->ProcessEvent( event ); combo->HandleWindowEvent( event );
} }
static void static void
@@ -51,7 +51,7 @@ gtkcombobox_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo )
event.SetInt( combo->GetSelection() ); event.SetInt( combo->GetSelection() );
event.SetString( combo->GetStringSelection() ); event.SetString( combo->GetStringSelection() );
event.SetEventObject( combo ); event.SetEventObject( combo );
combo->GetEventHandler()->ProcessEvent( event ); combo->HandleWindowEvent( event );
} }
} }
@@ -386,7 +386,7 @@ void wxComboBox::OnChar( wxKeyEvent &event )
eventEnter.SetInt( GetSelection() ); eventEnter.SetInt( GetSelection() );
eventEnter.SetEventObject( this ); eventEnter.SetEventObject( this );
if ( GetEventHandler()->ProcessEvent(eventEnter) ) if ( HandleWindowEvent(eventEnter) )
{ {
// Catch GTK event so that GTK doesn't open the drop // Catch GTK event so that GTK doesn't open the drop
// down list upon RETURN. // down list upon RETURN.

View File

@@ -642,7 +642,7 @@ void wxgtk_tree_model_set_sort_column_id (GtkTreeSortable *sortable,
wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, dv->GetId() ); wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, dv->GetId() );
event.SetDataViewColumn( gs_lastLeftClickHeader ); event.SetDataViewColumn( gs_lastLeftClickHeader );
event.SetModel( dv->GetModel() ); event.SetModel( dv->GetModel() );
dv->GetEventHandler()->ProcessEvent( event ); dv->HandleWindowEvent( event );
} }
gs_lastLeftClickHeader = NULL; gs_lastLeftClickHeader = NULL;
@@ -1212,7 +1212,7 @@ wxgtk_cell_editable_editing_done( GtkCellEditable *editable,
event.SetModel( dv->GetModel() ); event.SetModel( dv->GetModel() );
wxDataViewItem item( s_user_data ); wxDataViewItem item( s_user_data );
event.SetItem( item ); event.SetItem( item );
dv->GetEventHandler()->ProcessEvent( event ); dv->HandleWindowEvent( event );
} }
static void static void
@@ -1230,7 +1230,7 @@ wxgtk_renderer_editing_started( GtkCellRenderer *cell, GtkCellEditable *editable
gtk_tree_path_free( tree_path ); gtk_tree_path_free( tree_path );
wxDataViewItem item( iter.user_data ); wxDataViewItem item( iter.user_data );
event.SetItem( item ); event.SetItem( item );
dv->GetEventHandler()->ProcessEvent( event ); dv->HandleWindowEvent( event );
if (GTK_IS_CELL_EDITABLE(editable)) 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() ); wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK, dv->GetId() );
event.SetDataViewColumn( column ); event.SetDataViewColumn( column );
event.SetModel( dv->GetModel() ); event.SetModel( dv->GetModel() );
if (dv->GetEventHandler()->ProcessEvent( event )) if (dv->HandleWindowEvent( event ))
return FALSE; 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() ); wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, dv->GetId() );
event.SetDataViewColumn( column ); event.SetDataViewColumn( column );
event.SetModel( dv->GetModel() ); event.SetModel( dv->GetModel() );
if (dv->GetEventHandler()->ProcessEvent( event )) if (dv->HandleWindowEvent( event ))
return FALSE; return FALSE;
} }
@@ -2654,7 +2654,7 @@ bool wxDataViewCtrlInternal::ItemChanged( const wxDataViewItem &item )
event.SetEventObject( m_owner ); event.SetEventObject( m_owner );
event.SetModel( m_owner->GetModel() ); event.SetModel( m_owner->GetModel() );
event.SetItem( item ); event.SetItem( item );
m_owner->GetEventHandler()->ProcessEvent( event ); m_owner->HandleWindowEvent( event );
return true; return true;
} }
@@ -2667,7 +2667,7 @@ bool wxDataViewCtrlInternal::ValueChanged( const wxDataViewItem &item, unsigned
event.SetColumn( col ); event.SetColumn( col );
event.SetDataViewColumn( GetOwner()->GetColumn(col) ); event.SetDataViewColumn( GetOwner()->GetColumn(col) );
event.SetItem( item ); event.SetItem( item );
m_owner->GetEventHandler()->ProcessEvent( event ); m_owner->HandleWindowEvent( event );
return true; return true;
} }
@@ -3120,7 +3120,7 @@ wxdataview_selection_changed_callback( GtkTreeSelection* selection, wxDataViewCt
wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, dv->GetId() ); wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, dv->GetId() );
event.SetItem( dv->GetSelection() ); event.SetItem( dv->GetSelection() );
event.SetModel( dv->GetModel() ); event.SetModel( dv->GetModel() );
dv->GetEventHandler()->ProcessEvent( event ); dv->HandleWindowEvent( event );
} }
static void static void
@@ -3134,7 +3134,7 @@ wxdataview_row_activated_callback( GtkTreeView* treeview, GtkTreePath *path,
wxDataViewItem item( (void*) iter.user_data );; wxDataViewItem item( (void*) iter.user_data );;
event.SetItem( item ); event.SetItem( item );
event.SetModel( dv->GetModel() ); event.SetModel( dv->GetModel() );
dv->GetEventHandler()->ProcessEvent( event ); dv->HandleWindowEvent( event );
} }
static gboolean static gboolean
@@ -3146,7 +3146,7 @@ wxdataview_test_expand_row_callback( GtkTreeView* treeview, GtkTreeIter* iter,
wxDataViewItem item( (void*) iter->user_data );; wxDataViewItem item( (void*) iter->user_data );;
event.SetItem( item ); event.SetItem( item );
event.SetModel( dv->GetModel() ); event.SetModel( dv->GetModel() );
dv->GetEventHandler()->ProcessEvent( event ); dv->HandleWindowEvent( event );
return !event.IsAllowed(); return !event.IsAllowed();
} }
@@ -3160,7 +3160,7 @@ wxdataview_row_expanded_callback( GtkTreeView* treeview, GtkTreeIter* iter,
wxDataViewItem item( (void*) iter->user_data );; wxDataViewItem item( (void*) iter->user_data );;
event.SetItem( item ); event.SetItem( item );
event.SetModel( dv->GetModel() ); event.SetModel( dv->GetModel() );
dv->GetEventHandler()->ProcessEvent( event ); dv->HandleWindowEvent( event );
} }
static gboolean static gboolean
@@ -3172,7 +3172,7 @@ wxdataview_test_collapse_row_callback( GtkTreeView* treeview, GtkTreeIter* iter,
wxDataViewItem item( (void*) iter->user_data );; wxDataViewItem item( (void*) iter->user_data );;
event.SetItem( item ); event.SetItem( item );
event.SetModel( dv->GetModel() ); event.SetModel( dv->GetModel() );
dv->GetEventHandler()->ProcessEvent( event ); dv->HandleWindowEvent( event );
return !event.IsAllowed(); return !event.IsAllowed();
} }
@@ -3186,7 +3186,7 @@ wxdataview_row_collapsed_callback( GtkTreeView* treeview, GtkTreeIter* iter,
wxDataViewItem item( (void*) iter->user_data );; wxDataViewItem item( (void*) iter->user_data );;
event.SetItem( item ); event.SetItem( item );
event.SetModel( dv->GetModel() ); event.SetModel( dv->GetModel() );
dv->GetEventHandler()->ProcessEvent( event ); dv->HandleWindowEvent( event );
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@@ -49,7 +49,7 @@ static void gtk_dirdialog_ok_callback(GtkWidget *widget, wxDirDialog *dialog)
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
event.SetEventObject(dialog); 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); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
event.SetEventObject(dialog); event.SetEventObject(dialog);
dialog->GetEventHandler()->ProcessEvent(event); dialog->HandleWindowEvent(event);
} }
} }

View File

@@ -80,7 +80,7 @@ static void gtk_filedialog_ok_callback(GtkWidget *widget, wxFileDialog *dialog)
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
event.SetEventObject(dialog); 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); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
event.SetEventObject(dialog); event.SetEventObject(dialog);
dialog->GetEventHandler()->ProcessEvent(event); dialog->HandleWindowEvent(event);
} }
static void gtk_filedialog_response_callback(GtkWidget *w, static void gtk_filedialog_response_callback(GtkWidget *w,

View File

@@ -120,7 +120,7 @@ void wxFileButton::OnDialogOK(wxCommandEvent& ev)
// ...and fire an event // ...and fire an event
wxFileDirPickerEvent event(wxEVT_COMMAND_FILEPICKER_CHANGED, this, GetId(), m_path); 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 // ...and fire an event
wxFileDirPickerEvent event(wxEVT_COMMAND_DIRPICKER_CHANGED, p, p->GetId(), p->GetPath()); wxFileDirPickerEvent event(wxEVT_COMMAND_DIRPICKER_CHANGED, p, p->GetId(), p->GetPath());
p->GetEventHandler()->ProcessEvent(event); p->HandleWindowEvent(event);
} }
} }

View File

@@ -60,7 +60,7 @@ void gtk_fontdialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFontDialog *dial
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
event.SetEventObject( dialog ); 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); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
event.SetEventObject( dialog ); event.SetEventObject( dialog );
dialog->GetEventHandler()->ProcessEvent( event ); dialog->HandleWindowEvent( event );
} }
} }

View File

@@ -42,7 +42,7 @@ static void gtk_fontbutton_setfont_callback(GtkFontButton *widget,
// fire the colour-changed event // fire the colour-changed event
wxFontPickerEvent event(p, p->GetId(), p->GetSelectedFont()); wxFontPickerEvent event(p, p->GetId(), p->GetSelectedFont());
p->GetEventHandler()->ProcessEvent(event); p->HandleWindowEvent(event);
} }
} }

View File

@@ -54,7 +54,7 @@ gtk_glwindow_map_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win )
{ {
wxPaintEvent event( win->GetId() ); wxPaintEvent event( win->GetId() );
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
win->m_exposed = false; win->m_exposed = false;
win->GetUpdateRegion().Clear(); 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() ); wxSizeEvent event( wxSize(win->m_width,win->m_height), win->GetId() );
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
} }
} }
@@ -242,7 +242,7 @@ void wxGLCanvas::OnInternalIdle()
{ {
wxPaintEvent event( GetId() ); wxPaintEvent event( GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event ); HandleWindowEvent( event );
m_exposed = false; m_exposed = false;
GetUpdateRegion().Clear(); GetUpdateRegion().Clear();

View File

@@ -104,7 +104,7 @@ gtk_listbox_row_activated_callback(GtkTreeView * WXUNUSED(treeview),
event.SetInt(-1); 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.SetExtraLong( 0 );
event.SetInt( -1 ); event.SetInt( -1 );
listbox->GetEventHandler()->ProcessEvent( event ); listbox->HandleWindowEvent( event );
return; return;
} }
@@ -145,7 +145,7 @@ gtk_listitem_changed_callback(GtkTreeSelection * WXUNUSED(selection),
event.SetExtraLong( 1 ); event.SetExtraLong( 1 );
event.SetInt( selections[0] ); event.SetInt( selections[0] );
listbox->GetEventHandler()->ProcessEvent( event ); listbox->HandleWindowEvent( event );
} }
} }
else else
@@ -157,7 +157,7 @@ gtk_listitem_changed_callback(GtkTreeSelection * WXUNUSED(selection),
event.SetExtraLong( 0 ); event.SetExtraLong( 0 );
event.SetInt( -1 ); event.SetInt( -1 );
listbox->GetEventHandler()->ProcessEvent( event ); listbox->HandleWindowEvent( event );
return; return;
} }
@@ -178,7 +178,7 @@ gtk_listitem_changed_callback(GtkTreeSelection * WXUNUSED(selection),
else if ( listbox->HasClientUntypedData() ) else if ( listbox->HasClientUntypedData() )
event.SetClientData( gtk_tree_entry_get_userdata(entry) ); event.SetClientData( gtk_tree_entry_get_userdata(entry) );
listbox->GetEventHandler()->ProcessEvent( event ); listbox->HandleWindowEvent( event );
g_object_unref (entry); g_object_unref (entry);
} }

View File

@@ -39,7 +39,7 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
{ {
wxActivateEvent event1( wxEVT_ACTIVATE, false, child->GetId() ); wxActivateEvent event1( wxEVT_ACTIVATE, false, child->GetId() );
event1.SetEventObject( child); event1.SetEventObject( child);
child->GetEventHandler()->ProcessEvent( event1 ); child->HandleWindowEvent( event1 );
} }
// send activate event to new child // 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() ); wxActivateEvent event2( wxEVT_ACTIVATE, true, child->GetId() );
event2.SetEventObject( child); event2.SetEventObject( child);
child->GetEventHandler()->ProcessEvent( event2 ); child->HandleWindowEvent( event2 );
} }
} }

View File

@@ -60,12 +60,12 @@ static void DoCommonMenuCallbackCode(wxMenu *menu, wxMenuEvent& event)
event.SetEventObject( menu ); event.SetEventObject( menu );
wxEvtHandler* handler = menu->GetEventHandler(); wxEvtHandler* handler = menu->GetEventHandler();
if (handler && handler->ProcessEvent(event)) if (handler && handler->SafelyProcessEvent(event))
return; return;
wxWindow *win = menu->GetInvokingWindow(); wxWindow *win = menu->GetInvokingWindow();
if (win) if (win)
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
} }
extern "C" { extern "C" {
@@ -573,7 +573,7 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
if (item->IsCheckable()) if (item->IsCheckable())
commandEvent.SetInt(item->IsChecked()); commandEvent.SetInt(item->IsChecked());
frame->GetEventHandler()->ProcessEvent(commandEvent); frame->HandleWindowEvent(commandEvent);
} }
else else
{ {
@@ -601,11 +601,11 @@ static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu )
event.SetEventObject( menu ); event.SetEventObject( menu );
wxEvtHandler* handler = menu->GetEventHandler(); wxEvtHandler* handler = menu->GetEventHandler();
if (handler && handler->ProcessEvent(event)) if (handler && handler->SafelyProcessEvent(event))
return; return;
wxWindow *win = menu->GetInvokingWindow(); 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 ); event.SetEventObject( menu );
wxEvtHandler* handler = menu->GetEventHandler(); wxEvtHandler* handler = menu->GetEventHandler();
if (handler && handler->ProcessEvent(event)) if (handler && handler->SafelyProcessEvent(event))
return; return;
wxWindow *win = menu->GetInvokingWindow(); wxWindow *win = menu->GetInvokingWindow();
if (win) if (win)
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
} }
} }

View File

@@ -53,7 +53,7 @@ static gint gtk_popup_button_press (GtkWidget *widget, GdkEvent *gdk_event, wxPo
wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() ); wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
event.SetEventObject( win ); event.SetEventObject( win );
(void)win->GetEventHandler()->ProcessEvent( event ); (void)win->HandleWindowEvent( event );
return TRUE; 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 ); gtk_widget_set_size_request( m_widget, m_width, m_height );
wxSizeEvent event(GetSize(), GetId()); wxSizeEvent event(GetSize(), GetId());
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
} }
@@ -237,7 +237,7 @@ bool wxPopupWindow::Show( bool show )
{ {
wxSizeEvent event(GetSize(), GetId()); wxSizeEvent event(GetSize(), GetId());
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
bool ret = wxWindow::Show( show ); bool ret = wxWindow::Show( show );

View File

@@ -67,7 +67,7 @@ static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioBo
event.SetInt( rb->GetSelection() ); event.SetInt( rb->GetSelection() );
event.SetString( rb->GetStringSelection() ); event.SetString( rb->GetStringSelection() );
event.SetEventObject( rb ); 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 // CTRL-TAB changes the (parent) window, i.e. switch notebook page
new_event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) ); new_event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) );
new_event.SetCurrentFocus( rb ); new_event.SetCurrentFocus( rb );
return rb->GetParent()->GetEventHandler()->ProcessEvent( new_event ); return rb->GetParent()->HandleWindowEvent(new_event);
} }
if ((gdk_event->keyval != GDK_Up) && 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 // never stop the signal emission, it seems to break the kbd handling
// inside the radiobox // inside the radiobox
(void)win->GetEventHandler()->ProcessEvent( event ); (void)win->HandleWindowEvent( event );
} }
return FALSE; return FALSE;
@@ -658,7 +658,7 @@ void wxRadioBox::OnInternalIdle()
wxFocusEvent event( wxEVT_KILL_FOCUS, GetId() ); wxFocusEvent event( wxEVT_KILL_FOCUS, GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
(void)GetEventHandler()->ProcessEvent( event ); (void)HandleWindowEvent( event );
} }
} }

View File

@@ -41,7 +41,7 @@ void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioButton *r
wxCommandEvent event( wxEVT_COMMAND_RADIOBUTTON_SELECTED, rb->GetId()); wxCommandEvent event( wxEVT_COMMAND_RADIOBUTTON_SELECTED, rb->GetId());
event.SetInt( rb->GetValue() ); event.SetInt( rb->GetValue() );
event.SetEventObject( rb ); event.SetEventObject( rb );
rb->GetEventHandler()->ProcessEvent( event ); rb->HandleWindowEvent( event );
} }
} }

View File

@@ -38,14 +38,14 @@ gtk_value_changed(GtkRange* range, wxScrollBar* win)
// first send the specific event for the user action // first send the specific event for the user action
wxScrollEvent evtSpec(eventType, id, value, orient); wxScrollEvent evtSpec(eventType, id, value, orient);
evtSpec.SetEventObject(win); evtSpec.SetEventObject(win);
win->GetEventHandler()->ProcessEvent(evtSpec); win->HandleWindowEvent(evtSpec);
if (!win->m_isScrolling) if (!win->m_isScrolling)
{ {
// and if it's over also send a general "changed" event // and if it's over also send a general "changed" event
wxScrollEvent evtChanged(wxEVT_SCROLL_CHANGED, id, value, orient); wxScrollEvent evtChanged(wxEVT_SCROLL_CHANGED, id, value, orient);
evtChanged.SetEventObject(win); 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); wxScrollEvent evtRel(wxEVT_SCROLL_THUMBRELEASE, id, value, orient);
evtRel.SetEventObject(win); evtRel.SetEventObject(win);
win->GetEventHandler()->ProcessEvent(evtRel); win->HandleWindowEvent(evtRel);
wxScrollEvent evtChanged(wxEVT_SCROLL_CHANGED, id, value, orient); wxScrollEvent evtChanged(wxEVT_SCROLL_CHANGED, id, value, orient);
evtChanged.SetEventObject(win); evtChanged.SetEventObject(win);
win->GetEventHandler()->ProcessEvent(evtChanged); win->HandleWindowEvent(evtChanged);
} }
} }
} }

View File

@@ -46,7 +46,7 @@ ProcessScrollEvent(wxSlider *win, wxEventType evtType)
{ {
wxScrollEvent event( evtType, win->GetId(), value, orient ); wxScrollEvent event( evtType, win->GetId(), value, orient );
event.SetEventObject( win ); 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 // 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); wxScrollEvent event(wxEVT_SCROLL_CHANGED, win->GetId(), value, orient);
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
} }
// and also generate a command event for compatibility // and also generate a command event for compatibility
wxCommandEvent event( wxEVT_COMMAND_SLIDER_UPDATED, win->GetId() ); wxCommandEvent event( wxEVT_COMMAND_SLIDER_UPDATED, win->GetId() );
event.SetEventObject( win ); event.SetEventObject( win );
event.SetInt( value ); event.SetInt( value );
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
} }
static inline wxEventType GtkScrollTypeToWx(int scrollType) static inline wxEventType GtkScrollTypeToWx(int scrollType)

View File

@@ -48,7 +48,7 @@ gtk_value_changed(GtkSpinButton* spinbutton, wxSpinButton* win)
event.SetPosition(pos); event.SetPosition(pos);
event.SetEventObject(win); event.SetEventObject(win);
if ((win->GetEventHandler()->ProcessEvent( event )) && if ((win->HandleWindowEvent( event )) &&
!event.IsAllowed() ) !event.IsAllowed() )
{ {
/* program has vetoed */ /* program has vetoed */
@@ -64,7 +64,7 @@ gtk_value_changed(GtkSpinButton* spinbutton, wxSpinButton* win)
wxSpinEvent event2(wxEVT_SCROLL_THUMBTRACK, win->GetId()); wxSpinEvent event2(wxEVT_SCROLL_THUMBTRACK, win->GetId());
event2.SetPosition(pos); event2.SetPosition(pos);
event2.SetEventObject(win); event2.SetEventObject(win);
win->GetEventHandler()->ProcessEvent(event2); win->HandleWindowEvent(event2);
} }
} }

View File

@@ -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 // values in range 5..50 is then, ummm, quite challenging (hint: you can't
// enter 1!) (VZ) // enter 1!) (VZ)
event.SetInt(win->m_pos); event.SetInt(win->m_pos);
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
} }
} }
@@ -72,7 +72,7 @@ gtk_changed(GtkSpinButton* spinbutton, wxSpinCtrl* win)
// see above // see above
event.SetInt(win->m_pos); 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); GtkSpinButton *gsb = GTK_SPIN_BUTTON(m_widget);
wxString val = wxGTK_CONV_BACK( gtk_entry_get_text( &gsb->entry ) ); wxString val = wxGTK_CONV_BACK( gtk_entry_get_text( &gsb->entry ) );
evt.SetString( val ); evt.SetString( val );
if (GetEventHandler()->ProcessEvent(evt)) return; if (HandleWindowEvent(evt)) return;
} }
event.Skip(); event.Skip();

View File

@@ -278,7 +278,7 @@ static gboolean gtk_toolbar_dropdown_lclick_callback(GtkWidget *widget,
if (!tool->IsEnabled()) return FALSE; if (!tool->IsEnabled()) return FALSE;
wxCommandEvent evt(wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED, tool->GetId() ); wxCommandEvent evt(wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED, tool->GetId() );
if ( tbar->GetEventHandler()->ProcessEvent(evt) ) if ( tbar->HandleWindowEvent(evt) )
{ {
return TRUE; return TRUE;
} }

View File

@@ -526,7 +526,7 @@ handle_text_clipboard_callback( GtkWidget *widget, wxTextCtrl *win,
{ {
wxClipboardTextEvent event( eventType, win->GetId() ); wxClipboardTextEvent event( eventType, win->GetId() );
event.SetEventObject( win ); 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 // don't let the default processing to take place if we did something
// ourselves in the event handler // ourselves in the event handler
@@ -1527,7 +1527,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &key_event )
wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
event.SetEventObject(this); event.SetEventObject(this);
event.SetString(GetValue()); event.SetString(GetValue());
if ( GetEventHandler()->ProcessEvent(event) ) if ( HandleWindowEvent(event) )
return; return;
} }
} }
@@ -1823,8 +1823,8 @@ void wxTextCtrl::OnUrlMouseEvent(wxMouseEvent& event)
InitCommandEvent(url_event); InitCommandEvent(url_event);
// Is that a good idea? Seems not (pleasure with gtk_text_view_start_selection_drag) // Is that a good idea? Seems not (pleasure with gtk_text_view_start_selection_drag)
//event.Skip(!GetEventHandler()->ProcessEvent(url_event)); //event.Skip(!HandleWindowEvent(url_event));
GetEventHandler()->ProcessEvent(url_event); HandleWindowEvent(url_event);
} }
bool wxTextCtrl::GTKProcessEvent(wxEvent& event) const bool wxTextCtrl::GTKProcessEvent(wxEvent& event) const

View File

@@ -313,7 +313,7 @@ void wxTextEntry::SendMaxLenEvent()
wxCommandEvent event(wxEVT_COMMAND_TEXT_MAXLEN, win->GetId()); wxCommandEvent event(wxEVT_COMMAND_TEXT_MAXLEN, win->GetId());
event.SetEventObject(win); event.SetEventObject(win);
event.SetString(GetValue()); event.SetString(GetValue());
win->GetEventHandler()->ProcessEvent(event); win->HandleWindowEvent(event);
} }
#endif // wxUSE_TEXTCTRL || wxUSE_COMBOBOX #endif // wxUSE_TEXTCTRL || wxUSE_COMBOBOX

View File

@@ -37,7 +37,7 @@ static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxTog
wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, cb->GetId()); wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, cb->GetId());
event.SetInt(cb->GetValue()); event.SetInt(cb->GetValue());
event.SetEventObject(cb); event.SetEventObject(cb);
cb->GetEventHandler()->ProcessEvent(event); cb->HandleWindowEvent(event);
} }
} }

View File

@@ -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); wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame);
wxActivateEvent event(wxEVT_ACTIVATE, true, g_activeFrame->GetId()); wxActivateEvent event(wxEVT_ACTIVATE, true, g_activeFrame->GetId());
event.SetEventObject(g_activeFrame); event.SetEventObject(g_activeFrame);
g_activeFrame->GetEventHandler()->ProcessEvent(event); g_activeFrame->HandleWindowEvent(event);
return FALSE; 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); wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame);
wxActivateEvent event(wxEVT_ACTIVATE, false, g_activeFrame->GetId()); wxActivateEvent event(wxEVT_ACTIVATE, false, g_activeFrame->GetId());
event.SetEventObject(g_activeFrame); event.SetEventObject(g_activeFrame);
g_activeFrame->GetEventHandler()->ProcessEvent(event); g_activeFrame->HandleWindowEvent(event);
g_activeFrame = NULL; g_activeFrame = NULL;
} }
@@ -246,7 +246,7 @@ size_allocate(GtkWidget*, GtkAllocation* alloc, wxTopLevelWindowGTK* win)
{ {
wxSizeEvent event(size, win->GetId()); wxSizeEvent event(size, win->GetId());
event.SetEventObject(win); event.SetEventObject(win);
win->GetEventHandler()->ProcessEvent(event); win->HandleWindowEvent(event);
} }
// else the window is currently unmapped, don't generate size events // 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; win->m_y = point.y;
wxMoveEvent mevent(point, win->GetId()); wxMoveEvent mevent(point, win->GetId());
mevent.SetEventObject( win ); mevent.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( mevent ); win->HandleWindowEvent( mevent );
return FALSE; return FALSE;
} }
@@ -823,7 +823,7 @@ bool wxTopLevelWindowGTK::Show( bool show )
// top down), before the initial size_allocate signals occur. // top down), before the initial size_allocate signals occur.
wxSizeEvent event(GetSize(), GetId()); wxSizeEvent event(GetSize(), GetId());
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
bool change = wxTopLevelWindowBase::Show(show); 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); GetClientSize(&m_oldClientWidth, &m_oldClientHeight);
wxSizeEvent event(GetSize(), GetId()); wxSizeEvent event(GetSize(), GetId());
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
} }

View File

@@ -914,7 +914,7 @@ gtk_window_key_press_callback( GtkWidget *widget,
if( wxTranslateGTKKeyEventToWx(event, win, gdk_event) ) if( wxTranslateGTKKeyEventToWx(event, win, gdk_event) )
{ {
// Emit KEY_DOWN event // Emit KEY_DOWN event
ret = win->GetEventHandler()->ProcessEvent( event ); ret = win->HandleWindowEvent( event );
} }
else else
{ {
@@ -950,7 +950,7 @@ gtk_window_key_press_callback( GtkWidget *widget,
if (command != -1) if (command != -1)
{ {
wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command ); wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
ret = ancestor->GetEventHandler()->ProcessEvent( command_event ); ret = ancestor->HandleWindowEvent( command_event );
break; break;
} }
if (ancestor->IsTopLevel()) if (ancestor->IsTopLevel())
@@ -1009,13 +1009,13 @@ gtk_window_key_press_callback( GtkWidget *widget,
if (parent) if (parent)
{ {
event.SetEventType( wxEVT_CHAR_HOOK ); event.SetEventType( wxEVT_CHAR_HOOK );
ret = parent->GetEventHandler()->ProcessEvent( event ); ret = parent->HandleWindowEvent( event );
} }
if (!ret) if (!ret)
{ {
event.SetEventType(wxEVT_CHAR); 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) if (parent)
{ {
event.SetEventType( wxEVT_CHAR_HOOK ); event.SetEventType( wxEVT_CHAR_HOOK );
ret = parent->GetEventHandler()->ProcessEvent( event ); ret = parent->HandleWindowEvent( event );
} }
if (!ret) if (!ret)
{ {
event.SetEventType(wxEVT_CHAR); 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 bool wxWindowGTK::GTKProcessEvent(wxEvent& event) const
{ {
// nothing special at this level // nothing special at this level
return GetEventHandler()->ProcessEvent(event); return HandleWindowEvent(event);
} }
int wxWindowGTK::GTKCallbackCommonPrologue(GdkEventAny *event) const 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 // Notify the parent keeping track of focus for the kbd navigation
// purposes that we got it. // purposes that we got it.
wxChildFocusEvent eventChildFocus(win); wxChildFocusEvent eventChildFocus(win);
(void)win->GetEventHandler()->ProcessEvent(eventChildFocus); (void)win->HandleWindowEvent(eventChildFocus);
wxFocusEvent eventFocus(wxEVT_SET_FOCUS, win->GetId()); wxFocusEvent eventFocus(wxEVT_SET_FOCUS, win->GetId());
eventFocus.SetEventObject(win); 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 // 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() ); wxMouseCaptureLostEvent evt( win->GetId() );
evt.SetEventObject( win ); evt.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( evt ); win->HandleWindowEvent( evt );
} }
return false; 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() ); wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event ); HandleWindowEvent( event );
} }
} }
} }
@@ -2678,7 +2678,7 @@ bool wxWindowGTK::GtkShowFromOnIdle()
gtk_widget_show( m_widget ); gtk_widget_show( m_widget );
wxShowEvent eventShow(GetId(), true); wxShowEvent eventShow(GetId(), true);
eventShow.SetEventObject(this); eventShow.SetEventObject(this);
GetEventHandler()->ProcessEvent(eventShow); HandleWindowEvent(eventShow);
m_showOnIdle = false; m_showOnIdle = false;
return true; return true;
} }
@@ -2918,7 +2918,7 @@ bool wxWindowGTK::Show( bool show )
gtk_widget_show( m_widget ); gtk_widget_show( m_widget );
wxShowEvent eventShow(GetId(), show); wxShowEvent eventShow(GetId(), show);
eventShow.SetEventObject(this); eventShow.SetEventObject(this);
GetEventHandler()->ProcessEvent(eventShow); HandleWindowEvent(eventShow);
} }
} }
else else
@@ -2926,7 +2926,7 @@ bool wxWindowGTK::Show( bool show )
gtk_widget_hide( m_widget ); gtk_widget_hide( m_widget );
wxShowEvent eventShow(GetId(), show); wxShowEvent eventShow(GetId(), show);
eventShow.SetEventObject(this); eventShow.SetEventObject(this);
GetEventHandler()->ProcessEvent(eventShow); HandleWindowEvent(eventShow);
} }
return true; return true;
@@ -3669,16 +3669,16 @@ void wxWindowGTK::GtkSendPaintEvents()
wxEraseEvent erase_event( GetId(), &dc ); wxEraseEvent erase_event( GetId(), &dc );
erase_event.SetEventObject( this ); erase_event.SetEventObject( this );
GetEventHandler()->ProcessEvent(erase_event); HandleWindowEvent(erase_event);
} }
wxNcPaintEvent nc_paint_event( GetId() ); wxNcPaintEvent nc_paint_event( GetId() );
nc_paint_event.SetEventObject( this ); nc_paint_event.SetEventObject( this );
GetEventHandler()->ProcessEvent( nc_paint_event ); HandleWindowEvent( nc_paint_event );
wxPaintEvent paint_event( GetId() ); wxPaintEvent paint_event( GetId() );
paint_event.SetEventObject( this ); paint_event.SetEventObject( this );
GetEventHandler()->ProcessEvent( paint_event ); HandleWindowEvent( paint_event );
m_clipPaintRegion = false; m_clipPaintRegion = false;
@@ -4012,7 +4012,7 @@ void wxWindowGTK::GTKReleaseMouseAndNotify()
DoReleaseMouse(); DoReleaseMouse();
wxMouseCaptureLostEvent evt(GetId()); wxMouseCaptureLostEvent evt(GetId());
evt.SetEventObject( this ); evt.SetEventObject( this );
GetEventHandler()->ProcessEvent( evt ); HandleWindowEvent( evt );
} }
/* static */ /* static */

View File

@@ -50,7 +50,7 @@ static void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitma
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId()); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
event.SetEventObject(button); event.SetEventObject(button);
button->GetEventHandler()->ProcessEvent(event); button->HandleWindowEvent(event);
} }
} }

View File

@@ -55,7 +55,7 @@ static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId()); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
event.SetEventObject(button); event.SetEventObject(button);
button->GetEventHandler()->ProcessEvent(event); button->HandleWindowEvent(event);
} }
} }

View File

@@ -50,7 +50,7 @@ static void gtk_checkbox_toggled_callback(GtkWidget *WXUNUSED(widget),
wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, cb->GetId()); wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, cb->GetId());
event.SetInt(cb->GetValue()); event.SetInt(cb->GetValue());
event.SetEventObject(cb); event.SetEventObject(cb);
cb->GetEventHandler()->ProcessEvent(event); cb->HandleWindowEvent(event);
} }
} }

View File

@@ -78,7 +78,7 @@ static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice *
else if ( choice->HasClientUntypedData() ) else if ( choice->HasClientUntypedData() )
event.SetClientData( choice->GetClientData(n) ); event.SetClientData( choice->GetClientData(n) );
choice->GetEventHandler()->ProcessEvent(event); choice->HandleWindowEvent(event);
} }
} }

View File

@@ -59,7 +59,7 @@ gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo )
wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, combo->GetId() ); wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, combo->GetId() );
event.SetString( combo->GetValue() ); event.SetString( combo->GetValue() );
event.SetEventObject( combo ); 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.SetInt( curSelection );
event.SetString( combo->GetStringSelection() ); event.SetString( combo->GetStringSelection() );
event.SetEventObject( combo ); event.SetEventObject( combo );
combo->GetEventHandler()->ProcessEvent( event ); combo->HandleWindowEvent( event );
// for consistency with the other ports, send TEXT event // for consistency with the other ports, send TEXT event
wxCommandEvent event2( wxEVT_COMMAND_TEXT_UPDATED, combo->GetId() ); wxCommandEvent event2( wxEVT_COMMAND_TEXT_UPDATED, combo->GetId() );
event2.SetString( combo->GetStringSelection() ); event2.SetString( combo->GetStringSelection() );
event2.SetEventObject( combo ); 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.SetInt( curSelection );
event.SetString( combo->GetStringSelection() ); event.SetString( combo->GetStringSelection() );
event.SetEventObject( combo ); event.SetEventObject( combo );
combo->GetEventHandler()->ProcessEvent( event ); combo->HandleWindowEvent( event );
// for consistency with the other ports, don't generate text update // for consistency with the other ports, don't generate text update
// events while the user is browsing the combobox neither // events while the user is browsing the combobox neither
wxCommandEvent event2( wxEVT_COMMAND_TEXT_UPDATED, combo->GetId() ); wxCommandEvent event2( wxEVT_COMMAND_TEXT_UPDATED, combo->GetId() );
event2.SetString( combo->GetValue() ); event2.SetString( combo->GetValue() );
event2.SetEventObject( combo ); event2.SetEventObject( combo );
combo->GetEventHandler()->ProcessEvent( event2 ); combo->HandleWindowEvent( event2 );
} }
} }
} }
@@ -789,7 +789,7 @@ void wxComboBox::OnChar( wxKeyEvent &event )
eventEnter.SetInt( GetSelection() ); eventEnter.SetInt( GetSelection() );
eventEnter.SetEventObject( this ); eventEnter.SetEventObject( this );
if (!GetEventHandler()->ProcessEvent( eventEnter )) if (!HandleWindowEvent( eventEnter ))
{ {
// This will invoke the dialog default action, such // This will invoke the dialog default action, such
// as the clicking the default button. // as the clicking the default button.

View File

@@ -141,7 +141,7 @@ void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL); wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
cancelEvent.SetEventObject( this ); cancelEvent.SetEventObject( this );
GetEventHandler()->ProcessEvent(cancelEvent); HandleWindowEvent(cancelEvent);
s_closing.DeleteObject(this); s_closing.DeleteObject(this);
} }

View File

@@ -84,7 +84,7 @@ void gtk_fontdialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFontDialog *dial
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
event.SetEventObject( dialog ); 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); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
event.SetEventObject( dialog ); event.SetEventObject( dialog );
dialog->GetEventHandler()->ProcessEvent( event ); dialog->HandleWindowEvent( event );
} }
} }

View File

@@ -495,7 +495,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
// send size event to frame // send size event to frame
wxSizeEvent event( wxSize(m_width,m_height), GetId() ); wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event ); HandleWindowEvent( event );
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
// send size event to status bar // 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() ); wxSizeEvent event2( wxSize(m_frameStatusBar->m_width,m_frameStatusBar->m_height), m_frameStatusBar->GetId() );
event2.SetEventObject( m_frameStatusBar ); event2.SetEventObject( m_frameStatusBar );
m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 ); m_frameStatusBar->HandleWindowEvent( event2 );
} }
#endif // wxUSE_STATUSBAR #endif // wxUSE_STATUSBAR

View File

@@ -68,7 +68,7 @@ gtk_glwindow_map_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win )
{ {
wxPaintEvent event( win->GetId() ); wxPaintEvent event( win->GetId() );
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
win->GetUpdateRegion().Clear(); 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() ); wxSizeEvent event( wxSize(win->m_width,win->m_height), win->GetId() );
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
} }
} }
@@ -271,7 +271,7 @@ void wxGLCanvas::OnInternalIdle()
{ {
wxPaintEvent event( GetId() ); wxPaintEvent event( GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event ); HandleWindowEvent( event );
GetUpdateRegion().Clear(); GetUpdateRegion().Clear();
} }

View File

@@ -110,12 +110,12 @@ static gint gtk_listitem_focus_in_callback( GtkWidget *WXUNUSED(widget),
win->m_hasFocus = true; win->m_hasFocus = true;
wxChildFocusEvent eventChildFocus(win); wxChildFocusEvent eventChildFocus(win);
(void)win->GetEventHandler()->ProcessEvent(eventChildFocus); (void)win->HandleWindowEvent(eventChildFocus);
wxFocusEvent eventFocus(wxEVT_SET_FOCUS, win->GetId()); wxFocusEvent eventFocus(wxEVT_SET_FOCUS, win->GetId());
eventFocus.SetEventObject(win); eventFocus.SetEventObject(win);
(void)win->GetEventHandler()->ProcessEvent(eventFocus); (void)win->HandleWindowEvent(eventFocus);
} }
return FALSE; 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 // process it too as otherwise bad things happen, especially in GTK2
// where the text control simply aborts the program if it doesn't get // where the text control simply aborts the program if it doesn't get
// the matching focus out event // the matching focus out event
(void)win->GetEventHandler()->ProcessEvent( event ); (void)win->HandleWindowEvent( event );
} }
return FALSE; return FALSE;
@@ -202,7 +202,7 @@ gtk_listbox_button_release_callback( GtkWidget * WXUNUSED(widget),
event.SetInt(n); event.SetInt(n);
listbox->GetEventHandler()->ProcessEvent( event ); listbox->HandleWindowEvent( event );
return FALSE; return FALSE;
} }
@@ -237,7 +237,7 @@ gtk_listbox_button_press_callback( GtkWidget *widget,
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, listbox->GetId() ); wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, listbox->GetId() );
event.SetEventObject( listbox ); event.SetEventObject( listbox );
event.SetInt( sel ); event.SetInt( sel );
listbox->GetEventHandler()->ProcessEvent( event ); listbox->HandleWindowEvent( event );
} }
#endif // wxUSE_CHECKLISTBOX #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 */ /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */
new_event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) ); new_event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) );
new_event.SetCurrentFocus( listbox ); new_event.SetCurrentFocus( listbox );
ret = listbox->GetEventHandler()->ProcessEvent( new_event ); ret = listbox->HandleWindowEvent( new_event );
} }
if ((gdk_event->keyval == GDK_Return) && (!ret)) 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() ); wxCommandEvent new_event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, listbox->GetId() );
new_event.SetEventObject( listbox ); new_event.SetEventObject( listbox );
new_event.SetInt( sel ); new_event.SetInt( sel );
ret = listbox->GetEventHandler()->ProcessEvent( new_event ); ret = listbox->HandleWindowEvent( new_event );
} }
#endif // wxUSE_CHECKLISTBOX #endif // wxUSE_CHECKLISTBOX
@@ -347,7 +347,7 @@ gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxLis
n = -1; n = -1;
} }
new_event.SetInt(n); 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 // No longer required with new code in wxLB_SINGLE
// listbox->GetEventHandler()->AddPendingEvent( event ); // listbox->GetEventHandler()->AddPendingEvent( event );
listbox->GetEventHandler()->ProcessEvent( event ); listbox->HandleWindowEvent( event );
} }
extern "C" { extern "C" {

View File

@@ -66,7 +66,7 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
{ {
wxActivateEvent event1( wxEVT_ACTIVATE, false, child->GetId() ); wxActivateEvent event1( wxEVT_ACTIVATE, false, child->GetId() );
event1.SetEventObject( child); event1.SetEventObject( child);
child->GetEventHandler()->ProcessEvent( event1 ); child->HandleWindowEvent( event1 );
} }
// send activate event to new child // 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() ); wxActivateEvent event2( wxEVT_ACTIVATE, true, child->GetId() );
event2.SetEventObject( child); event2.SetEventObject( child);
child->GetEventHandler()->ProcessEvent( event2 ); child->HandleWindowEvent( event2 );
} }
} }

View File

@@ -143,7 +143,7 @@ static void DoCommonMenuCallbackCode(wxMenu *menu, wxMenuEvent& event)
wxWindow *win = menu->GetInvokingWindow(); wxWindow *win = menu->GetInvokingWindow();
if (win) if (win)
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
} }
extern "C" { extern "C" {
@@ -632,7 +632,7 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
commandEvent.SetInt(item->IsChecked()); commandEvent.SetInt(item->IsChecked());
commandEvent.SetEventObject(menu); commandEvent.SetEventObject(menu);
frame->GetEventHandler()->ProcessEvent(commandEvent); frame->HandleWindowEvent(commandEvent);
} }
else else
{ {
@@ -666,7 +666,7 @@ static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu )
return; return;
wxWindow *win = menu->GetInvokingWindow(); 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(); wxWindow *win = menu->GetInvokingWindow();
if (win) if (win)
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
} }
} }

View File

@@ -249,7 +249,7 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk
event.SetCurrentFocus( notebook ); event.SetCurrentFocus( notebook );
wxNotebookPage *client = notebook->GetPage(sel); wxNotebookPage *client = notebook->GetPage(sel);
if ( !client->GetEventHandler()->ProcessEvent( event ) ) if ( !client->HandleWindowEvent( event ) )
{ {
client->SetFocus(); client->SetFocus();
} }

View File

@@ -62,7 +62,7 @@ static gint gtk_popup_button_press (GtkWidget *widget, GdkEvent *gdk_event, wxPo
wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() ); wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
event.SetEventObject( win ); event.SetEventObject( win );
(void)win->GetEventHandler()->ProcessEvent( event ); (void)win->HandleWindowEvent( event );
return TRUE; 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() ); wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event ); HandleWindowEvent( event );
} }
void wxPopupWindow::OnInternalIdle() void wxPopupWindow::OnInternalIdle()

View File

@@ -57,7 +57,7 @@ static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioBo
event.SetInt( rb->GetSelection() ); event.SetInt( rb->GetSelection() );
event.SetString( rb->GetStringSelection() ); event.SetString( rb->GetStringSelection() );
event.SetEventObject( rb ); 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 // never stop the signal emission, it seems to break the kbd handling
// inside the radiobox // inside the radiobox
(void)win->GetEventHandler()->ProcessEvent( event ); (void)win->HandleWindowEvent( event );
} }
return FALSE; return FALSE;
@@ -586,7 +586,7 @@ void wxRadioBox::OnInternalIdle()
wxFocusEvent event( wxEVT_KILL_FOCUS, GetId() ); wxFocusEvent event( wxEVT_KILL_FOCUS, GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
(void)GetEventHandler()->ProcessEvent( event ); (void)HandleWindowEvent( event );
} }
if (g_delayedFocus == this) if (g_delayedFocus == this)

View File

@@ -52,7 +52,7 @@ void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioButton *r
wxCommandEvent event( wxEVT_COMMAND_RADIOBUTTON_SELECTED, rb->GetId()); wxCommandEvent event( wxEVT_COMMAND_RADIOBUTTON_SELECTED, rb->GetId());
event.SetInt( rb->GetValue() ); event.SetInt( rb->GetValue() );
event.SetEventObject( rb ); event.SetEventObject( rb );
rb->GetEventHandler()->ProcessEvent( event ); rb->HandleWindowEvent( event );
} }
} }

View File

@@ -70,13 +70,13 @@ static void gtk_scrollbar_callback( GtkAdjustment *adjust,
{ {
wxScrollEvent event( g_currentUpDownEvent, win->GetId(), value, orient ); wxScrollEvent event( g_currentUpDownEvent, win->GetId(), value, orient );
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
} }
// throw other event (wxEVT_SCROLL_THUMBTRACK) // throw other event (wxEVT_SCROLL_THUMBTRACK)
wxScrollEvent event( command, win->GetId(), value, orient ); wxScrollEvent event( command, win->GetId(), value, orient );
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
/* /*
wxCommandEvent cevent( wxEVT_COMMAND_SCROLLBAR_UPDATED, win->GetId() ); 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 ); wxScrollEvent event( command, win->GetId(), value, orient );
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
} }
win->m_isScrolling = false; win->m_isScrolling = false;

View File

@@ -54,19 +54,19 @@ ProcessScrollEvent(wxSlider *win, wxEventType evtType, double dvalue)
int value = (int)(dvalue < 0 ? dvalue - 0.5 : dvalue + 0.5); int value = (int)(dvalue < 0 ? dvalue - 0.5 : dvalue + 0.5);
wxScrollEvent event( evtType, win->GetId(), value, orient ); wxScrollEvent event( evtType, win->GetId(), value, orient );
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
if ( evtType != wxEVT_SCROLL_THUMBTRACK ) if ( evtType != wxEVT_SCROLL_THUMBTRACK )
{ {
wxScrollEvent event2(wxEVT_SCROLL_CHANGED, win->GetId(), value, orient); wxScrollEvent event2(wxEVT_SCROLL_CHANGED, win->GetId(), value, orient);
event2.SetEventObject( win ); event2.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event2 ); win->HandleWindowEvent( event2 );
} }
wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, win->GetId() ); wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, win->GetId() );
cevent.SetEventObject( win ); cevent.SetEventObject( win );
cevent.SetInt( value ); cevent.SetInt( value );
win->GetEventHandler()->ProcessEvent( cevent ); win->HandleWindowEvent( cevent );
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@@ -66,7 +66,7 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi
event.SetPosition( value ); event.SetPosition( value );
event.SetEventObject( win ); event.SetEventObject( win );
if ((win->GetEventHandler()->ProcessEvent( event )) && if ((win->HandleWindowEvent( event )) &&
!event.IsAllowed() ) !event.IsAllowed() )
{ {
/* program has vetoed */ /* program has vetoed */
@@ -94,7 +94,7 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi
wxSpinEvent event2( command, win->GetId()); wxSpinEvent event2( command, win->GetId());
event2.SetPosition( value ); event2.SetPosition( value );
event2.SetEventObject( win ); event2.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event2 ); win->HandleWindowEvent( event2 );
} }
} }
} }

View File

@@ -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 // values in range 5..50 is then, ummm, quite challenging (hint: you can't
// enter 1!) (VZ) // enter 1!) (VZ)
event.SetInt( (int)ceil(win->m_adjust->value) ); 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 // see above
event.SetInt( (int)ceil(win->m_adjust->value) ); 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); GtkSpinButton *gsb = GTK_SPIN_BUTTON(m_widget);
wxString val = wxGTK_CONV_BACK( gtk_entry_get_text( &gsb->entry ) ); wxString val = wxGTK_CONV_BACK( gtk_entry_get_text( &gsb->entry ) );
evt.SetString( val ); evt.SetString( val );
if (GetEventHandler()->ProcessEvent(evt)) return; if (HandleWindowEvent(evt)) return;
} }
event.Skip(); event.Skip();

View File

@@ -119,7 +119,7 @@ gtk_insert_text_callback(GtkEditable *editable,
wxCommandEvent event(wxEVT_COMMAND_TEXT_MAXLEN, win->GetId()); wxCommandEvent event(wxEVT_COMMAND_TEXT_MAXLEN, win->GetId());
event.SetEventObject(win); event.SetEventObject(win);
event.SetString(win->GetValue()); 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() ); wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, win->GetId() );
event.SetEventObject( win ); 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); wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
event.SetEventObject(this); event.SetEventObject(this);
event.SetString(GetValue()); event.SetString(GetValue());
if (GetEventHandler()->ProcessEvent(event)) return; if (HandleWindowEvent(event)) return;
} }
if ((key_event.GetKeyCode() == WXK_RETURN) && !(m_windowStyle & wxTE_MULTILINE)) if ((key_event.GetKeyCode() == WXK_RETURN) && !(m_windowStyle & wxTE_MULTILINE))

View File

@@ -43,7 +43,7 @@ static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxTog
wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, cb->GetId()); wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, cb->GetId());
event.SetInt(cb->GetValue()); event.SetInt(cb->GetValue());
event.SetEventObject(cb); event.SetEventObject(cb);
cb->GetEventHandler()->ProcessEvent(event); cb->HandleWindowEvent(event);
} }
} }

View File

@@ -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); wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame);
wxActivateEvent event(wxEVT_ACTIVATE, true, g_activeFrame->GetId()); wxActivateEvent event(wxEVT_ACTIVATE, true, g_activeFrame->GetId());
event.SetEventObject(g_activeFrame); event.SetEventObject(g_activeFrame);
g_activeFrame->GetEventHandler()->ProcessEvent(event); g_activeFrame->HandleWindowEvent(event);
return FALSE; 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); wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame);
wxActivateEvent event(wxEVT_ACTIVATE, false, g_activeFrame->GetId()); wxActivateEvent event(wxEVT_ACTIVATE, false, g_activeFrame->GetId());
event.SetEventObject(g_activeFrame); event.SetEventObject(g_activeFrame);
g_activeFrame->GetEventHandler()->ProcessEvent(event); g_activeFrame->HandleWindowEvent(event);
g_activeFrame = NULL; 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() ); wxMoveEvent mevent( wxPoint(win->m_x,win->m_y), win->GetId() );
mevent.SetEventObject( win ); mevent.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( mevent ); win->HandleWindowEvent( mevent );
return FALSE; return FALSE;
} }
@@ -1020,7 +1020,7 @@ void wxTopLevelWindowGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
// send size event to frame // send size event to frame
wxSizeEvent event( wxSize(m_width,m_height), GetId() ); wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event ); HandleWindowEvent( event );
m_resizing = false; m_resizing = false;
} }

View File

@@ -1066,7 +1066,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
if ( wxTranslateGTKKeyEventToWx(event, win, gdk_event) ) if ( wxTranslateGTKKeyEventToWx(event, win, gdk_event) )
{ {
// Emit KEY_DOWN event // Emit KEY_DOWN event
ret = win->GetEventHandler()->ProcessEvent( event ); ret = win->HandleWindowEvent( event );
} }
else else
{ {
@@ -1122,12 +1122,12 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
if (parent) if (parent)
{ {
event.SetEventType( wxEVT_CHAR_HOOK ); event.SetEventType( wxEVT_CHAR_HOOK );
ret = parent->GetEventHandler()->ProcessEvent( event ); ret = parent->HandleWindowEvent( event );
} }
if (!ret) if (!ret)
{ {
event.SetEventType(wxEVT_CHAR); event.SetEventType(wxEVT_CHAR);
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
} }
} }
return true; return true;
@@ -1146,7 +1146,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
if (command != -1) if (command != -1)
{ {
wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command ); wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
ret = ancestor->GetEventHandler()->ProcessEvent( command_event ); ret = ancestor->HandleWindowEvent( command_event );
break; break;
} }
if (ancestor->IsTopLevel()) if (ancestor->IsTopLevel())
@@ -1191,13 +1191,13 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
if (parent) if (parent)
{ {
event.SetEventType( wxEVT_CHAR_HOOK ); event.SetEventType( wxEVT_CHAR_HOOK );
ret = parent->GetEventHandler()->ProcessEvent( event ); ret = parent->HandleWindowEvent( event );
} }
if (!ret) if (!ret)
{ {
event.SetEventType(wxEVT_CHAR); 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 // CTRL-TAB changes the (parent) window, i.e. switch notebook page
new_event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) ); new_event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) );
new_event.SetCurrentFocus( win ); new_event.SetCurrentFocus( win );
ret = win->GetParent()->GetEventHandler()->ProcessEvent( new_event ); ret = win->GetParent()->HandleWindowEvent( new_event );
} }
// generate wxID_CANCEL if <esc> has been pressed (typically in dialogs) // generate wxID_CANCEL if <esc> 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); wxCommandEvent eventClick(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
eventClick.SetEventObject(btnCancel); 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; return FALSE;
} }
if ( !win->GetEventHandler()->ProcessEvent( event ) ) if ( !win->HandleWindowEvent( event ) )
return FALSE; return FALSE;
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_release_event" ); 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" ); gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_press_event" );
g_lastMouseEvent = NULL; g_lastMouseEvent = NULL;
@@ -1638,7 +1638,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget,
win->GetId(), win->GetId(),
win->ClientToScreen(event.GetPosition())); win->ClientToScreen(event.GetPosition()));
evtCtx.SetEventObject(win); evtCtx.SetEventObject(win);
return win->GetEventHandler()->ProcessEvent(evtCtx); return win->HandleWindowEvent(evtCtx);
} }
return FALSE; return FALSE;
@@ -1701,7 +1701,7 @@ static gint gtk_window_button_release_callback( GtkWidget *widget,
if ( !g_captureWindow ) if ( !g_captureWindow )
win = FindWindowForMouseEvent(win, event.m_x, event.m_y); 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" ); gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_release_event" );
return TRUE; return TRUE;
@@ -1771,7 +1771,7 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget,
: wxEVT_LEAVE_WINDOW); : wxEVT_LEAVE_WINDOW);
InitMouseEvent(win, eventM, gdk_event); InitMouseEvent(win, eventM, gdk_event);
eventM.SetEventObject(win); eventM.SetEventObject(win);
win->GetEventHandler()->ProcessEvent(eventM); win->HandleWindowEvent(eventM);
} }
} }
else // no capture 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); win = FindWindowForMouseEvent(win, event.m_x, event.m_y);
} }
bool ret = win->GetEventHandler()->ProcessEvent( event ); bool ret = win->HandleWindowEvent( event );
g_lastMouseEvent = NULL; g_lastMouseEvent = NULL;
if ( ret ) if ( ret )
@@ -1802,12 +1802,12 @@ static bool DoSendFocusEvents(wxWindow *win)
// Notify the parent keeping track of focus for the kbd navigation // Notify the parent keeping track of focus for the kbd navigation
// purposes that we got it. // purposes that we got it.
wxChildFocusEvent eventChildFocus(win); wxChildFocusEvent eventChildFocus(win);
(void)win->GetEventHandler()->ProcessEvent(eventChildFocus); (void)win->HandleWindowEvent(eventChildFocus);
wxFocusEvent eventFocus(wxEVT_SET_FOCUS, win->GetId()); wxFocusEvent eventFocus(wxEVT_SET_FOCUS, win->GetId());
eventFocus.SetEventObject(win); eventFocus.SetEventObject(win);
return win->GetEventHandler()->ProcessEvent(eventFocus); return win->HandleWindowEvent(eventFocus);
} }
extern "C" { 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 // process it too as otherwise bad things happen, especially in GTK2
// where the text control simply aborts the program if it doesn't get // where the text control simply aborts the program if it doesn't get
// the matching focus out event // the matching focus out event
(void)win->GetEventHandler()->ProcessEvent( event ); (void)win->HandleWindowEvent( event );
} }
return FALSE; return FALSE;
@@ -1950,7 +1950,7 @@ gint gtk_window_enter_callback( GtkWidget *widget,
event.m_x = x + pt.x; event.m_x = x + pt.x;
event.m_y = y + pt.y; 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" ); gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "enter_notify_event" );
return TRUE; return TRUE;
@@ -2002,7 +2002,7 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_
event.m_x = x + pt.x; event.m_x = x + pt.x;
event.m_y = y + pt.y; 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" ); gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "leave_notify_event" );
return TRUE; return TRUE;
@@ -2042,7 +2042,7 @@ static void gtk_window_vscroll_callback( GtkAdjustment *adjust,
wxScrollWinEvent event( command, value, wxVERTICAL ); wxScrollWinEvent event( command, value, wxVERTICAL );
event.SetEventObject( win ); 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 ); wxScrollWinEvent event( command, value, wxHORIZONTAL );
event.SetEventObject( win ); 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 ); wxScrollWinEvent event( command, value, dir );
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
} }
win->m_isScrolling = false; win->m_isScrolling = false;
@@ -2179,7 +2179,7 @@ gtk_window_realized_callback( GtkWidget *WXUNUSED(widget), wxWindow *win )
wxWindowCreateEvent event( win ); wxWindowCreateEvent event( win );
event.SetEventObject( win ); event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event ); win->HandleWindowEvent( event );
return FALSE; return FALSE;
} }
@@ -2213,7 +2213,7 @@ void gtk_window_size_callback( GtkWidget *WXUNUSED(widget),
{ {
wxSizeEvent event( win->GetSize(), win->GetId() ); wxSizeEvent event( win->GetSize(), win->GetId() );
event.SetEventObject( win ); 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() ); wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event ); HandleWindowEvent( event );
} }
m_resizing = false; m_resizing = false;
@@ -3208,7 +3208,7 @@ bool wxWindowGTK::Show( bool show )
wxShowEvent eventShow(GetId(), show); wxShowEvent eventShow(GetId(), show);
eventShow.SetEventObject(this); eventShow.SetEventObject(this);
GetEventHandler()->ProcessEvent(eventShow); HandleWindowEvent(eventShow);
return true; return true;
} }
@@ -3596,7 +3596,7 @@ void wxWindowGTK::GtkSendPaintEvents()
wxEraseEvent erase_event( GetId(), &dc ); wxEraseEvent erase_event( GetId(), &dc );
erase_event.SetEventObject( this ); erase_event.SetEventObject( this );
if (!GetEventHandler()->ProcessEvent(erase_event) && GetBackgroundStyle() != wxBG_STYLE_CUSTOM) if (!HandleWindowEvent(erase_event) && GetBackgroundStyle() != wxBG_STYLE_CUSTOM)
{ {
if (!g_eraseGC) if (!g_eraseGC)
{ {
@@ -3618,11 +3618,11 @@ void wxWindowGTK::GtkSendPaintEvents()
wxNcPaintEvent nc_paint_event( GetId() ); wxNcPaintEvent nc_paint_event( GetId() );
nc_paint_event.SetEventObject( this ); nc_paint_event.SetEventObject( this );
GetEventHandler()->ProcessEvent( nc_paint_event ); HandleWindowEvent( nc_paint_event );
wxPaintEvent paint_event( GetId() ); wxPaintEvent paint_event( GetId() );
paint_event.SetEventObject( this ); paint_event.SetEventObject( this );
GetEventHandler()->ProcessEvent( paint_event ); HandleWindowEvent( paint_event );
m_clipPaintRegion = false; m_clipPaintRegion = false;

View File

@@ -586,7 +586,7 @@ wxMacAppMenuEventHandler( EventHandlerCallRef WXUNUSED(handler),
{ {
wxWindow *win = menu->GetInvokingWindow(); wxWindow *win = menu->GetInvokingWindow();
if (win) 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) ; wxKeyEvent event(wxEVT_KEY_DOWN) ;
MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ; MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ;
handled = focus->GetEventHandler()->ProcessEvent( event ) ; handled = focus->HandleWindowEvent( event ) ;
if ( handled && event.GetSkipped() ) if ( handled && event.GetSkipped() )
handled = false ; handled = false ;
@@ -1455,7 +1455,7 @@ bool wxApp::MacSendKeyUpEvent( wxWindow* focus , long keymessage , long modifier
bool handled; bool handled;
wxKeyEvent event( wxEVT_KEY_UP ) ; wxKeyEvent event( wxEVT_KEY_UP ) ;
MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ; MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ;
handled = focus->GetEventHandler()->ProcessEvent( event ) ; handled = focus->HandleWindowEvent( event ) ;
return handled ; return handled ;
} }
@@ -1476,7 +1476,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers
if (tlw) if (tlw)
{ {
event.SetEventType( wxEVT_CHAR_HOOK ); event.SetEventType( wxEVT_CHAR_HOOK );
handled = tlw->GetEventHandler()->ProcessEvent( event ); handled = tlw->HandleWindowEvent( event );
if ( handled && event.GetSkipped() ) if ( handled && event.GetSkipped() )
handled = false ; handled = false ;
} }
@@ -1485,7 +1485,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers
{ {
event.SetEventType( wxEVT_CHAR ); event.SetEventType( wxEVT_CHAR );
event.Skip( false ) ; event.Skip( false ) ;
handled = focus->GetEventHandler()->ProcessEvent( event ) ; handled = focus->HandleWindowEvent( event ) ;
} }
if ( !handled && (keyval == WXK_TAB) ) 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 */ /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */
new_event.SetWindowChange( event.ControlDown() ); new_event.SetWindowChange( event.ControlDown() );
new_event.SetCurrentFocus( focus ); new_event.SetCurrentFocus( focus );
handled = focus->GetParent()->GetEventHandler()->ProcessEvent( new_event ); handled = focus->GetParent()->HandleWindowEvent( new_event );
if ( handled && new_event.GetSkipped() ) if ( handled && new_event.GetSkipped() )
handled = false ; handled = false ;
} }
@@ -1540,7 +1540,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers
// generate wxID_CANCEL if command-. or <esc> has been pressed (typically in dialogs) // generate wxID_CANCEL if command-. or <esc> has been pressed (typically in dialogs)
wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL); wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL);
new_event.SetEventObject( focus ); new_event.SetEventObject( focus );
handled = focus->GetEventHandler()->ProcessEvent( new_event ); handled = focus->HandleWindowEvent( new_event );
} }
} }
#endif #endif

View File

@@ -222,7 +222,7 @@ public :
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, checklist->GetId() ); wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, checklist->GetId() );
event.SetInt( owner->GetLineFromItem( this ) ); event.SetInt( owner->GetLineFromItem( this ) );
event.SetEventObject( checklist ); event.SetEventObject( checklist );
checklist->GetEventHandler()->ProcessEvent( event ); checklist->HandleWindowEvent( event );
} }
break; break;

View File

@@ -83,14 +83,14 @@ protected:
NavEvent.SetWindowChange(false); NavEvent.SetWindowChange(false);
// Get the parent of the combo and have it process the navigation? // 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; return;
} }
// send the event to the combobox class in case the user has bound EVT_CHAR // send the event to the combobox class in case the user has bound EVT_CHAR
wxKeyEvent kevt(event); wxKeyEvent kevt(event);
kevt.SetEventObject(m_cb); 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 // If the event was handled and not skipped then we're done
return; return;
@@ -103,7 +103,7 @@ protected:
// This will invoke the dialog default action, // This will invoke the dialog default action,
// such as the clicking the default button. // such as the clicking the default button.
if (!m_cb->GetEventHandler()->ProcessEvent( event )) if (!m_cb->HandleWindowEvent( event ))
{ {
wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow); wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
if ( tlw && tlw->GetDefaultItem() ) if ( tlw && tlw->GetDefaultItem() )
@@ -128,7 +128,7 @@ protected:
{ {
event.SetEventObject(m_cb); event.SetEventObject(m_cb);
event.SetId(m_cb->GetId()); event.SetId(m_cb->GetId());
if (! m_cb->GetEventHandler()->ProcessEvent(event)) if (! m_cb->HandleWindowEvent(event))
event.Skip(); event.Skip();
} }
@@ -136,7 +136,7 @@ protected:
{ {
event.SetEventObject(m_cb); event.SetEventObject(m_cb);
event.SetId(m_cb->GetId()); event.SetId(m_cb->GetId());
if (! m_cb->GetEventHandler()->ProcessEvent(event)) if (! m_cb->HandleWindowEvent(event))
event.Skip(); event.Skip();
} }
@@ -144,7 +144,7 @@ protected:
{ {
event.SetEventObject(m_cb); event.SetEventObject(m_cb);
event.SetId(m_cb->GetId()); event.SetId(m_cb->GetId());
if (! m_cb->GetEventHandler()->ProcessEvent(event)) if (! m_cb->HandleWindowEvent(event))
event.Skip(); event.Skip();
} }

View File

@@ -65,7 +65,7 @@ static pascal OSStatus wxMacComboBoxEventHandler( EventHandlerCallRef handler ,
event.SetInt( cb->GetSelection() ); event.SetInt( cb->GetSelection() );
event.SetString( cb->GetStringSelection() ); event.SetString( cb->GetStringSelection() );
event.SetEventObject( cb ); event.SetEventObject( cb );
cb->GetEventHandler()->ProcessEvent( event ); cb->HandleWindowEvent( event );
} }
break; break;
default : default :
@@ -126,7 +126,7 @@ protected:
event.SetInt( 0 ); event.SetInt( 0 );
event.SetString( value ); event.SetString( value );
event.SetEventObject( m_cb ); event.SetEventObject( m_cb );
m_cb->GetEventHandler()->ProcessEvent( event ); m_cb->HandleWindowEvent( event );
} }
else else
{ {
@@ -141,7 +141,7 @@ protected:
event.SetInt( m_cb->GetCount() - 1 ); event.SetInt( m_cb->GetCount() - 1 );
event.SetString( value ); event.SetString( value );
event.SetEventObject( m_cb ); event.SetEventObject( m_cb );
m_cb->GetEventHandler()->ProcessEvent( event ); m_cb->HandleWindowEvent( event );
} }
// This will invoke the dialog default action, such // This will invoke the dialog default action, such

View File

@@ -78,7 +78,7 @@ bool wxControl::ProcessCommand( wxCommandEvent &event )
// Tries: // Tries:
// 1) OnCommand, starting at this window and working up parent hierarchy // 1) OnCommand, starting at this window and working up parent hierarchy
// 2) OnCommand then calls ProcessEvent to search the event tables. // 2) OnCommand then calls ProcessEvent to search the event tables.
return GetEventHandler()->ProcessEvent( event ); return HandleWindowEvent( event );
} }
void wxControl::OnKeyDown( wxKeyEvent &WXUNUSED(event) ) void wxControl::OnKeyDown( wxKeyEvent &WXUNUSED(event) )

View File

@@ -738,7 +738,7 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc(
dataViewEvent.SetEventObject(dataViewCtrlPtr); dataViewEvent.SetEventObject(dataViewCtrlPtr);
dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID))); dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
// finally send the equivalent wxWidget event: // finally send the equivalent wxWidget event:
dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
// opening the container is allowed if not vetoed: // opening the container is allowed if not vetoed:
return ::SetDataBrowserItemDataBooleanValue(itemData,dataViewEvent.IsAllowed()); return ::SetDataBrowserItemDataBooleanValue(itemData,dataViewEvent.IsAllowed());
} /* block */ } /* block */
@@ -754,7 +754,7 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc(
dataViewEvent.SetEventObject(dataViewCtrlPtr); dataViewEvent.SetEventObject(dataViewCtrlPtr);
dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID))); dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
// finally send the equivalent wxWidget event: // finally send the equivalent wxWidget event:
dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
// opening the container is allowed if not vetoed: // opening the container is allowed if not vetoed:
return ::SetDataBrowserItemDataBooleanValue(itemData,dataViewEvent.IsAllowed()); return ::SetDataBrowserItemDataBooleanValue(itemData,dataViewEvent.IsAllowed());
} /* block */ } /* block */
@@ -792,7 +792,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
dataViewEvent.SetEventObject(dataViewCtrlPtr); dataViewEvent.SetEventObject(dataViewCtrlPtr);
dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID))); dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
// finally send the equivalent wxWidget event: // finally send the equivalent wxWidget event:
dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
} /* block */ } /* block */
break; break;
case kDataBrowserContainerOpened: case kDataBrowserContainerOpened:
@@ -803,7 +803,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
dataViewEvent.SetEventObject(dataViewCtrlPtr); dataViewEvent.SetEventObject(dataViewCtrlPtr);
dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID))); dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
// finally send the equivalent wxWidget event: // finally send the equivalent wxWidget event:
dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
// add children to the expanded container: // add children to the expanded container:
dataViewCtrlPtr->AddChildrenLevel(wxDataViewItem(reinterpret_cast<void*>(itemID))); dataViewCtrlPtr->AddChildrenLevel(wxDataViewItem(reinterpret_cast<void*>(itemID)));
} /* block */ } /* block */
@@ -826,7 +826,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
dataViewEvent.SetDataViewColumn(dataViewCtrlPtr->GetColumnPtr(propertyID)); dataViewEvent.SetDataViewColumn(dataViewCtrlPtr->GetColumnPtr(propertyID));
} /* if */ } /* if */
// finally send the equivalent wxWidget event: // finally send the equivalent wxWidget event:
dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
} /* block */ } /* block */
break; break;
case kDataBrowserEditStopped: case kDataBrowserEditStopped:
@@ -847,7 +847,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
dataViewEvent.SetDataViewColumn(dataViewCtrlPtr->GetColumnPtr(propertyID)); dataViewEvent.SetDataViewColumn(dataViewCtrlPtr->GetColumnPtr(propertyID));
} /* if */ } /* if */
// finally send the equivalent wxWidget event: // finally send the equivalent wxWidget event:
dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
} /* block */ } /* block */
break; break;
case kDataBrowserItemAdded: case kDataBrowserItemAdded:
@@ -862,7 +862,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
dataViewEvent.SetEventObject(dataViewCtrlPtr); dataViewEvent.SetEventObject(dataViewCtrlPtr);
dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID))); dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
// finally send the equivalent wxWidget event: // finally send the equivalent wxWidget event:
dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
} /* block */ } /* block */
break; break;
case kDataBrowserItemRemoved: case kDataBrowserItemRemoved:
@@ -877,7 +877,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
dataViewEvent.SetEventObject(dataViewCtrlPtr); dataViewEvent.SetEventObject(dataViewCtrlPtr);
dataViewEvent.SetModel (dataViewCtrlPtr->GetModel()); dataViewEvent.SetModel (dataViewCtrlPtr->GetModel());
// finally send the equivalent wxWidget event: // finally send the equivalent wxWidget event:
dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
} /* block */ } /* block */
break; break;
case kDataBrowserUserStateChanged: case kDataBrowserUserStateChanged:
@@ -918,7 +918,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
dataViewEvent.SetColumn(columnIndex); dataViewEvent.SetColumn(columnIndex);
dataViewEvent.SetDataViewColumn(columnPtr); dataViewEvent.SetDataViewColumn(columnPtr);
// finally send the equivalent wxWidget event: // finally send the equivalent wxWidget event:
dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
} /* if */ } /* if */
} /* if */ } /* if */
} /* if */ } /* if */

View File

@@ -84,7 +84,7 @@ static pascal OSStatus wxMacDataViewCtrlEventHandler(EventHandlerCallRef handler
DataViewEvent.SetColumn(columnIndex); DataViewEvent.SetColumn(columnIndex);
DataViewEvent.SetDataViewColumn(DataViewCtrlPtr->GetColumn(columnIndex)); DataViewEvent.SetDataViewColumn(DataViewCtrlPtr->GetColumn(columnIndex));
// finally sent the equivalent wxWidget event: // finally sent the equivalent wxWidget event:
DataViewCtrlPtr->GetEventHandler()->ProcessEvent(DataViewEvent); DataViewCtrlPtr->HandleWindowEvent(DataViewEvent);
return ::CallNextEventHandler(handler,EventReference); return ::CallNextEventHandler(handler,EventReference);
} /* if */ } /* if */
else else
@@ -238,7 +238,7 @@ public:
dataViewEvent.SetEventObject(dataViewCtrlPtr); dataViewEvent.SetEventObject(dataViewCtrlPtr);
dataViewEvent.SetItem(item); dataViewEvent.SetItem(item);
// sent the equivalent wxWidget event: // sent the equivalent wxWidget event:
dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
// done // done
return true; return true;
} /* if */ } /* if */
@@ -270,7 +270,7 @@ public:
for (size_t i=0; i<noOfEntries; ++i) for (size_t i=0; i<noOfEntries; ++i)
{ {
dataViewEvent.SetItem(reinterpret_cast<void*>(itemIDs[i])); dataViewEvent.SetItem(reinterpret_cast<void*>(itemIDs[i]));
dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
} /* for */ } /* for */
} /* if */ } /* if */
// release allocated array space: // release allocated array space:
@@ -357,7 +357,7 @@ public:
dataViewEvent.SetColumn(col); dataViewEvent.SetColumn(col);
dataViewEvent.SetItem(item); dataViewEvent.SetItem(item);
// send the equivalent wxWidget event: // send the equivalent wxWidget event:
dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent); dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
// done // done
return true; return true;
} /* if */ } /* if */

View File

@@ -357,7 +357,7 @@ void wxFontColourSwatchCtrl::OnMouseEvent(wxMouseEvent& event)
Refresh(); Refresh();
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId()); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
} }

View File

@@ -447,7 +447,7 @@ void wxMacListBoxItem::Notification(wxMacDataItemBrowserControl *owner ,
// direct notification is not always having the listbox GetSelection() // direct notification is not always having the listbox GetSelection()
// having in synch with event, so use wxPostEvent instead // having in synch with event, so use wxPostEvent instead
// list->GetEventHandler()->ProcessEvent(event); // list->HandleWindowEvent(event);
wxPostEvent( list->GetEventHandler(), event ); wxPostEvent( list->GetEventHandler(), event );
} }

View File

@@ -152,7 +152,7 @@ static pascal OSStatus wxMacListCtrlEventHandler( EventHandlerCallRef handler ,
// FIXME: we can't use the sort property for virtual listctrls // 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... // so we need to find a better way to determine which column was clicked...
if (!window->IsVirtual()) if (!window->IsVirtual())
window->GetEventHandler()->ProcessEvent( le ); window->HandleWindowEvent( le );
} }
result = CallNextEventHandler(handler, event); result = CallNextEventHandler(handler, event);
break; break;
@@ -305,7 +305,7 @@ bool wxMacListCtrlEventDelegate::ProcessEvent( wxEvent& event )
if ( !event.IsKindOf( CLASSINFO( wxCommandEvent ) ) ) if ( !event.IsKindOf( CLASSINFO( wxCommandEvent ) ) )
{ {
if (m_list->GetEventHandler()->ProcessEvent( event )) if (m_list->HandleWindowEvent( event ))
return true; return true;
} }
return wxEvtHandler::ProcessEvent(event); return wxEvtHandler::ProcessEvent(event);
@@ -648,7 +648,7 @@ void wxListCtrl::FireMouseEvent(wxEventType eventType, wxPoint position)
le.m_itemIndex = item; le.m_itemIndex = item;
le.m_item.m_itemId = item; le.m_item.m_itemId = item;
GetItem(le.m_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_itemIndex = m_current;
le.m_item.m_itemId = m_current; le.m_item.m_itemId = m_current;
GetItem(le.m_item); GetItem(le.m_item);
GetEventHandler()->ProcessEvent(le); HandleWindowEvent(le);
} }
} }
event.Skip(); event.Skip();
@@ -1743,7 +1743,7 @@ bool wxListCtrl::DeleteItem(long item)
wxListEvent event( wxEVT_COMMAND_LIST_DELETE_ITEM, GetId() ); wxListEvent event( wxEVT_COMMAND_LIST_DELETE_ITEM, GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
event.m_itemIndex = item; event.m_itemIndex = item;
GetEventHandler()->ProcessEvent( event ); HandleWindowEvent( event );
} }
return true; return true;
@@ -1760,7 +1760,7 @@ bool wxListCtrl::DeleteAllItems()
m_dbImpl->MacClear(); m_dbImpl->MacClear();
wxListEvent event( wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, GetId() ); wxListEvent event( wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event ); HandleWindowEvent( event );
} }
return true; return true;
} }
@@ -1834,7 +1834,7 @@ wxTextCtrl* wxListCtrl::EditLabel(long item, wxClassInfo* textControlClass)
le.m_col = 0; le.m_col = 0;
GetItem( le.m_item ); GetItem( le.m_item );
if ( GetParent()->GetEventHandler()->ProcessEvent( le ) && !le.IsAllowed() ) if ( GetParent()->HandleWindowEvent( le ) && !le.IsAllowed() )
{ {
// vetoed by user code // vetoed by user code
return NULL; return NULL;
@@ -2033,7 +2033,7 @@ long wxListCtrl::InsertItem(wxListItem& info)
wxListEvent event( wxEVT_COMMAND_LIST_INSERT_ITEM, GetId() ); wxListEvent event( wxEVT_COMMAND_LIST_INSERT_ITEM, GetId() );
event.SetEventObject( this ); event.SetEventObject( this );
event.m_itemIndex = info.m_itemId; event.m_itemIndex = info.m_itemId;
GetEventHandler()->ProcessEvent( event ); HandleWindowEvent( event );
return info.m_itemId; return info.m_itemId;
} }
return -1; return -1;
@@ -2200,7 +2200,7 @@ bool wxListCtrl::OnRenameAccept(long itemEdit, const wxString& value)
GetItem( le.m_item ); GetItem( le.m_item );
le.m_item.m_text = value; le.m_item.m_text = value;
return !GetEventHandler()->ProcessEvent( le ) || return !HandleWindowEvent( le ) ||
le.IsAllowed(); le.IsAllowed();
} }
@@ -2215,7 +2215,7 @@ void wxListCtrl::OnRenameCancelled(long itemEdit)
le.m_itemIndex = itemEdit; le.m_itemIndex = itemEdit;
GetItem( le.m_item ); GetItem( le.m_item );
GetEventHandler()->ProcessEvent( le ); HandleWindowEvent( le );
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -374,13 +374,13 @@ bool wxMenu::ProcessCommand(wxCommandEvent & event)
// Try the menu's event handler // Try the menu's event handler
if ( /* !processed && */ GetEventHandler()) if ( /* !processed && */ GetEventHandler())
processed = GetEventHandler()->ProcessEvent(event); processed = HandleWindowEvent(event);
// Try the window the menu was popped up from // Try the window the menu was popped up from
// (and up through the hierarchy) // (and up through the hierarchy)
wxWindow *win = GetInvokingWindow(); wxWindow *win = GetInvokingWindow();
if ( !processed && win ) if ( !processed && win )
processed = win->GetEventHandler()->ProcessEvent(event); processed = win->HandleWindowEvent(event);
return processed; return processed;
} }
@@ -567,7 +567,7 @@ wxInt32 wxMenu::MacHandleCommandProcess( wxMenuItem* item, int id, wxWindow* tar
event.SetEventObject(targetWindow); event.SetEventObject(targetWindow);
event.SetInt(item->IsCheckable() ? item->IsChecked() : -1); event.SetInt(item->IsCheckable() ? item->IsChecked() : -1);
if ( targetWindow->GetEventHandler()->ProcessEvent(event) ) if ( targetWindow->HandleWindowEvent(event) )
result = noErr ; result = noErr ;
} }
} }
@@ -601,7 +601,7 @@ wxInt32 wxMenu::MacHandleCommandUpdateStatus(wxMenuItem* WXUNUSED(item),
wxWindow *win = menu->GetInvokingWindow(); wxWindow *win = menu->GetInvokingWindow();
if ( win ) if ( win )
{ {
processed = win->GetEventHandler()->ProcessEvent(event); processed = win->HandleWindowEvent(event);
break; break;
} }
@@ -611,7 +611,7 @@ wxInt32 wxMenu::MacHandleCommandUpdateStatus(wxMenuItem* WXUNUSED(item),
if ( !processed && targetWindow != NULL) if ( !processed && targetWindow != NULL)
{ {
processed = targetWindow->GetEventHandler()->ProcessEvent(event); processed = targetWindow->HandleWindowEvent(event);
} }
if ( processed ) if ( processed )

View File

@@ -509,7 +509,7 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
event.SetEventObject( this ); event.SetEventObject( this );
wxWindow *page = m_pages[m_nSelection]; wxWindow *page = m_pages[m_nSelection];
if ( !page->GetEventHandler()->ProcessEvent( event ) ) if ( !page->HandleWindowEvent( event ) )
{ {
page->SetFocus(); page->SetFocus();
} }
@@ -527,7 +527,7 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
if ( parent ) if ( parent )
{ {
event.SetCurrentFocus( this ); 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, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId,
newSel , m_nSelection ); newSel , m_nSelection );
changing.SetEventObject( this ); changing.SetEventObject( this );
GetEventHandler()->ProcessEvent( changing ); HandleWindowEvent( changing );
if ( changing.IsAllowed() ) if ( changing.IsAllowed() )
{ {
@@ -602,7 +602,7 @@ wxInt32 wxNotebook::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTR
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId,
newSel, m_nSelection ); newSel, m_nSelection );
event.SetEventObject( this ); event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event ); HandleWindowEvent( event );
} }
else else
{ {

View File

@@ -153,7 +153,7 @@ bool wxPopupWindow::Show(bool show)
// because apps expect a size event to occur at this moment // because apps expect a size event to occur at this moment
wxSizeEvent event(GetSize() , m_windowId); wxSizeEvent event(GetSize() , m_windowId);
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
else else
{ {

View File

@@ -165,7 +165,7 @@ void wxScrollBar::MacHandleControlClick( WXWidget WXUNUSED(control), wxInt16 con
// this is hardcoded // this is hardcoded
window->MacOnScroll( event ); window->MacOnScroll( event );
else else
GetEventHandler()->ProcessEvent( event ); HandleWindowEvent( event );
} }
wxInt32 wxScrollBar::MacControlHit( WXEVENTHANDLERREF WXUNUSED(handler), WXEVENTREF mevent ) wxInt32 wxScrollBar::MacControlHit( WXEVENTHANDLERREF WXUNUSED(handler), WXEVENTREF mevent )
@@ -221,7 +221,7 @@ wxInt32 wxScrollBar::MacControlHit( WXEVENTHANDLERREF WXUNUSED(handler), WXEVENT
// this is hardcoded // this is hardcoded
window->MacOnScroll( event ); window->MacOnScroll( event );
else else
GetEventHandler()->ProcessEvent( event ); HandleWindowEvent( event );
return noErr; return noErr;
} }

View File

@@ -307,12 +307,12 @@ void wxSlider::MacHandleControlClick(WXWidget WXUNUSED(control),
wxScrollEvent event( wxEVT_SCROLL_THUMBTRACK, m_windowId ); wxScrollEvent event( wxEVT_SCROLL_THUMBTRACK, m_windowId );
event.SetPosition( value ); event.SetPosition( value );
event.SetEventObject( this ); event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event ); HandleWindowEvent( event );
wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, m_windowId ); wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, m_windowId );
cevent.SetInt( value ); cevent.SetInt( value );
cevent.SetEventObject( this ); cevent.SetEventObject( this );
GetEventHandler()->ProcessEvent( cevent ); HandleWindowEvent( cevent );
} }
wxInt32 wxSlider::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler), wxInt32 wxSlider::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler),
@@ -327,13 +327,13 @@ wxInt32 wxSlider::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler),
wxScrollEvent event( wxEVT_SCROLL_THUMBRELEASE, m_windowId ); wxScrollEvent event( wxEVT_SCROLL_THUMBRELEASE, m_windowId );
event.SetPosition( value ); event.SetPosition( value );
event.SetEventObject( this ); event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event ); HandleWindowEvent( event );
wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, m_windowId ); wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, m_windowId );
cevent.SetInt( value ); cevent.SetInt( value );
cevent.SetEventObject( this ); cevent.SetEventObject( this );
GetEventHandler()->ProcessEvent( cevent ); HandleWindowEvent( cevent );
return noErr; return noErr;
} }

View File

@@ -133,7 +133,7 @@ void wxSpinButton::MacHandleValueChanged( int inc )
event.SetPosition( m_value ); event.SetPosition( m_value );
event.SetEventObject( this ); event.SetEventObject( this );
if ((GetEventHandler()->ProcessEvent( event )) && !event.IsAllowed()) if ((HandleWindowEvent( event )) && !event.IsAllowed())
m_value = oldValue; m_value = oldValue;
m_peer->SetValue( m_value ); m_peer->SetValue( m_value );
@@ -145,7 +145,7 @@ void wxSpinButton::MacHandleValueChanged( int inc )
wxSpinEvent event2( scrollEvent, GetId() ); wxSpinEvent event2( scrollEvent, GetId() );
event2.SetPosition( m_value ); event2.SetPosition( m_value );
event2.SetEventObject( this ); event2.SetEventObject( this );
GetEventHandler()->ProcessEvent( event2 ); HandleWindowEvent( event2 );
} }
} }

View File

@@ -88,7 +88,7 @@ protected:
wxCommandEvent event(wxEVT_COMMAND_SPINCTRL_UPDATED, m_spin->GetId()); wxCommandEvent event(wxEVT_COMMAND_SPINCTRL_UPDATED, m_spin->GetId());
event.SetEventObject(m_spin); event.SetEventObject(m_spin);
event.SetInt(l); event.SetInt(l);
m_spin->GetEventHandler()->ProcessEvent(event); m_spin->HandleWindowEvent(event);
m_spin->m_oldValue = l; m_spin->m_oldValue = l;
} }
@@ -116,7 +116,7 @@ protected:
event.SetString(m_spin->GetText()->GetValue()); event.SetString(m_spin->GetText()->GetValue());
event.SetInt(val); event.SetInt(val);
m_spin->GetEventHandler()->ProcessEvent(event); m_spin->HandleWindowEvent(event);
} }
event.Skip(); event.Skip();
@@ -166,7 +166,7 @@ protected:
event.SetEventObject(m_spin); event.SetEventObject(m_spin);
event.SetInt(pos); event.SetInt(pos);
m_spin->GetEventHandler()->ProcessEvent(event); m_spin->HandleWindowEvent(event);
m_spin->m_oldValue = pos; m_spin->m_oldValue = pos;
} }

View File

@@ -518,7 +518,7 @@ void wxTextCtrl::Cut()
wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, m_windowId ); wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, m_windowId );
event.SetEventObject( this ); event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event ); HandleWindowEvent( event );
} }
} }
@@ -532,7 +532,7 @@ void wxTextCtrl::Paste()
wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, m_windowId ); wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, m_windowId );
event.SetEventObject( this ); 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); wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
event.SetEventObject( this ); event.SetEventObject( this );
event.SetString( GetValue() ); event.SetString( GetValue() );
if ( GetEventHandler()->ProcessEvent(event) ) if ( HandleWindowEvent(event) )
return; return;
} }

View File

@@ -211,25 +211,25 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event
{ {
event.m_keyCode = WXK_CONTROL ; event.m_keyCode = WXK_CONTROL ;
event.SetEventType( ( modifiers & controlKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; event.SetEventType( ( modifiers & controlKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
focus->GetEventHandler()->ProcessEvent( event ) ; focus->HandleWindowEvent( event ) ;
} }
if ( /* focus && */ (modifiers ^ wxApp::s_lastModifiers ) & shiftKey ) if ( /* focus && */ (modifiers ^ wxApp::s_lastModifiers ) & shiftKey )
{ {
event.m_keyCode = WXK_SHIFT ; event.m_keyCode = WXK_SHIFT ;
event.SetEventType( ( modifiers & shiftKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; event.SetEventType( ( modifiers & shiftKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
focus->GetEventHandler()->ProcessEvent( event ) ; focus->HandleWindowEvent( event ) ;
} }
if ( /* focus && */ (modifiers ^ wxApp::s_lastModifiers ) & optionKey ) if ( /* focus && */ (modifiers ^ wxApp::s_lastModifiers ) & optionKey )
{ {
event.m_keyCode = WXK_ALT ; event.m_keyCode = WXK_ALT ;
event.SetEventType( ( modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; event.SetEventType( ( modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
focus->GetEventHandler()->ProcessEvent( event ) ; focus->HandleWindowEvent( event ) ;
} }
if ( /* focus && */ (modifiers ^ wxApp::s_lastModifiers ) & cmdKey ) if ( /* focus && */ (modifiers ^ wxApp::s_lastModifiers ) & cmdKey )
{ {
event.m_keyCode = WXK_COMMAND ; event.m_keyCode = WXK_COMMAND ;
event.SetEventType( ( modifiers & cmdKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; event.SetEventType( ( modifiers & cmdKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
focus->GetEventHandler()->ProcessEvent( event ) ; focus->HandleWindowEvent( event ) ;
} }
wxApp::s_lastModifiers = modifiers ; wxApp::s_lastModifiers = modifiers ;
@@ -485,7 +485,7 @@ wxMacTopLevelMouseEventHandler(EventHandlerCallRef WXUNUSED(handler),
wxToolTip::RelayEvent( g_MacLastWindow , eventleave); wxToolTip::RelayEvent( g_MacLastWindow , eventleave);
#endif #endif
g_MacLastWindow->GetEventHandler()->ProcessEvent(eventleave); g_MacLastWindow->HandleWindowEvent(eventleave);
} }
if ( currentMouseWindow ) if ( currentMouseWindow )
@@ -500,7 +500,7 @@ wxMacTopLevelMouseEventHandler(EventHandlerCallRef WXUNUSED(handler),
wxToolTip::RelayEvent( currentMouseWindow , evententer ); wxToolTip::RelayEvent( currentMouseWindow , evententer );
#endif #endif
currentMouseWindow->GetEventHandler()->ProcessEvent(evententer); currentMouseWindow->HandleWindowEvent(evententer);
} }
g_MacLastWindow = currentMouseWindow ; g_MacLastWindow = currentMouseWindow ;
@@ -532,7 +532,7 @@ wxMacTopLevelMouseEventHandler(EventHandlerCallRef WXUNUSED(handler),
wxToolTip::RelayEvent( currentMouseWindow , wxevent ); wxToolTip::RelayEvent( currentMouseWindow , wxevent );
#endif #endif
if ( currentMouseWindow->GetEventHandler()->ProcessEvent(wxevent) ) if ( currentMouseWindow->HandleWindowEvent(wxevent) )
{ {
if ((currentMouseWindowParent != NULL) && if ((currentMouseWindowParent != NULL) &&
(currentMouseWindowParent->GetChildren().Find(currentMouseWindow) == NULL)) (currentMouseWindowParent->GetChildren().Find(currentMouseWindow) == NULL))
@@ -616,7 +616,7 @@ wxMacTopLevelWindowEventHandler(EventHandlerCallRef WXUNUSED(handler),
wxActivateEvent wxevent(wxEVT_ACTIVATE, true , toplevelWindow->GetId()); wxActivateEvent wxevent(wxEVT_ACTIVATE, true , toplevelWindow->GetId());
wxevent.SetTimestamp( cEvent.GetTicks() ) ; wxevent.SetTimestamp( cEvent.GetTicks() ) ;
wxevent.SetEventObject(toplevelWindow); wxevent.SetEventObject(toplevelWindow);
toplevelWindow->GetEventHandler()->ProcessEvent(wxevent); toplevelWindow->HandleWindowEvent(wxevent);
// we still sending an eventNotHandledErr in order to allow for default processing // we still sending an eventNotHandledErr in order to allow for default processing
} }
break ; break ;
@@ -627,7 +627,7 @@ wxMacTopLevelWindowEventHandler(EventHandlerCallRef WXUNUSED(handler),
wxActivateEvent wxevent(wxEVT_ACTIVATE, false , toplevelWindow->GetId()); wxActivateEvent wxevent(wxEVT_ACTIVATE, false , toplevelWindow->GetId());
wxevent.SetTimestamp( cEvent.GetTicks() ) ; wxevent.SetTimestamp( cEvent.GetTicks() ) ;
wxevent.SetEventObject(toplevelWindow); wxevent.SetEventObject(toplevelWindow);
toplevelWindow->GetEventHandler()->ProcessEvent(wxevent); toplevelWindow->HandleWindowEvent(wxevent);
// we still sending an eventNotHandledErr in order to allow for default processing // we still sending an eventNotHandledErr in order to allow for default processing
} }
break ; break ;
@@ -661,7 +661,7 @@ wxMacTopLevelWindowEventHandler(EventHandlerCallRef WXUNUSED(handler),
wxSizeEvent event( r.GetSize() , toplevelWindow->GetId() ) ; wxSizeEvent event( r.GetSize() , toplevelWindow->GetId() ) ;
event.SetEventObject( toplevelWindow ) ; event.SetEventObject( toplevelWindow ) ;
toplevelWindow->GetEventHandler()->ProcessEvent(event) ; toplevelWindow->HandleWindowEvent(event) ;
toplevelWindow->wxWindowMac::MacSuperChangedPosition() ; // like this only children will be notified toplevelWindow->wxWindowMac::MacSuperChangedPosition() ; // like this only children will be notified
} }
@@ -669,7 +669,7 @@ wxMacTopLevelWindowEventHandler(EventHandlerCallRef WXUNUSED(handler),
{ {
wxMoveEvent event( r.GetLeftTop() , toplevelWindow->GetId() ) ; wxMoveEvent event( r.GetLeftTop() , toplevelWindow->GetId() ) ;
event.SetEventObject( toplevelWindow ) ; event.SetEventObject( toplevelWindow ) ;
toplevelWindow->GetEventHandler()->ProcessEvent(event) ; toplevelWindow->HandleWindowEvent(event) ;
} }
result = noErr ; result = noErr ;
@@ -697,7 +697,7 @@ wxMacTopLevelWindowEventHandler(EventHandlerCallRef WXUNUSED(handler),
wxSizeEvent wxevent( r , toplevelWindow->GetId() ) ; wxSizeEvent wxevent( r , toplevelWindow->GetId() ) ;
wxevent.SetEventObject( toplevelWindow ) ; wxevent.SetEventObject( toplevelWindow ) ;
wxRect adjustR = r ; wxRect adjustR = r ;
if ( toplevelWindow->GetEventHandler()->ProcessEvent(wxevent) ) if ( toplevelWindow->HandleWindowEvent(wxevent) )
adjustR = wxevent.GetRect() ; adjustR = wxevent.GetRect() ;
if ( toplevelWindow->GetMaxWidth() != -1 && adjustR.GetWidth() > toplevelWindow->GetMaxWidth() ) if ( toplevelWindow->GetMaxWidth() != -1 && adjustR.GetWidth() > toplevelWindow->GetMaxWidth() )
@@ -1256,7 +1256,7 @@ void wxTopLevelWindowMac::DoMacCreateRealWindow(
} }
wxWindowCreateEvent event(this); wxWindowCreateEvent event(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
void wxTopLevelWindowMac::ClearBackground() void wxTopLevelWindowMac::ClearBackground()
@@ -1333,7 +1333,7 @@ bool wxTopLevelWindowMac::Show(bool show)
// because apps expect a size event to occur at this moment // because apps expect a size event to occur at this moment
wxSizeEvent event(GetSize() , m_windowId); wxSizeEvent event(GetSize() , m_windowId);
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
else else
{ {
@@ -1416,7 +1416,7 @@ bool wxTopLevelWindowMac::ShowWithEffect(wxShowEffect effect,
// because apps expect a size event to occur at this moment // because apps expect a size event to occur at this moment
wxSizeEvent event(GetSize() , m_windowId); wxSizeEvent event(GetSize() , m_windowId);
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
return true; return true;
} }

View File

@@ -308,13 +308,13 @@ bool wxTreeCtrl::ExpandItem(long item, int action)
bIsExpanded bIsExpanded
? wxEVT_COMMAND_TREE_ITEM_EXPANDING ? wxEVT_COMMAND_TREE_ITEM_EXPANDING
: wxEVT_COMMAND_TREE_ITEM_COLLAPSING); : wxEVT_COMMAND_TREE_ITEM_COLLAPSING);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
event.SetEventType( event.SetEventType(
bIsExpanded bIsExpanded
? wxEVT_COMMAND_TREE_ITEM_EXPANDED ? wxEVT_COMMAND_TREE_ITEM_EXPANDED
: wxEVT_COMMAND_TREE_ITEM_COLLAPSED); : wxEVT_COMMAND_TREE_ITEM_COLLAPSED);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
return bOk; return bOk;

View File

@@ -334,7 +334,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl
inKillFocusEvent = true ; inKillFocusEvent = true ;
wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId()); wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId());
event.SetEventObject(thisWindow); event.SetEventObject(thisWindow);
thisWindow->GetEventHandler()->ProcessEvent(event) ; thisWindow->HandleWindowEvent(event) ;
inKillFocusEvent = false ; 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 // 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)); wxLogTrace(_T("Focus"), _T("focus set(%p)"), wx_static_cast(void*, thisWindow));
wxChildFocusEvent eventFocus((wxWindow*)thisWindow); wxChildFocusEvent eventFocus((wxWindow*)thisWindow);
thisWindow->GetEventHandler()->ProcessEvent(eventFocus); thisWindow->HandleWindowEvent(eventFocus);
#if wxUSE_CARET #if wxUSE_CARET
if ( thisWindow->GetCaret() ) if ( thisWindow->GetCaret() )
@@ -353,7 +353,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl
wxFocusEvent event(wxEVT_SET_FOCUS, thisWindow->GetId()); wxFocusEvent event(wxEVT_SET_FOCUS, thisWindow->GetId());
event.SetEventObject(thisWindow); event.SetEventObject(thisWindow);
thisWindow->GetEventHandler()->ProcessEvent(event) ; thisWindow->HandleWindowEvent(event) ;
} }
} }
break; break;
@@ -423,7 +423,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl
inKillFocusEvent = true ; inKillFocusEvent = true ;
wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId()); wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId());
event.SetEventObject(thisWindow); event.SetEventObject(thisWindow);
thisWindow->GetEventHandler()->ProcessEvent(event) ; thisWindow->HandleWindowEvent(event) ;
inKillFocusEvent = false ; 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 // 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)); wxLogTrace(_T("Focus"), _T("focus set(%p)"), wx_static_cast(void*, thisWindow));
wxChildFocusEvent eventFocus((wxWindow*)thisWindow); wxChildFocusEvent eventFocus((wxWindow*)thisWindow);
thisWindow->GetEventHandler()->ProcessEvent(eventFocus); thisWindow->HandleWindowEvent(eventFocus);
#if wxUSE_CARET #if wxUSE_CARET
if ( thisWindow->GetCaret() ) if ( thisWindow->GetCaret() )
@@ -441,7 +441,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl
wxFocusEvent event(wxEVT_SET_FOCUS, thisWindow->GetId()); wxFocusEvent event(wxEVT_SET_FOCUS, thisWindow->GetId());
event.SetEventObject(thisWindow); event.SetEventObject(thisWindow);
thisWindow->GetEventHandler()->ProcessEvent(event) ; thisWindow->HandleWindowEvent(event) ;
} }
#endif #endif
} }
@@ -1775,7 +1775,7 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
wxPoint point(actualX, actualY); wxPoint point(actualX, actualY);
wxMoveEvent event(point, m_windowId); wxMoveEvent event(point, m_windowId);
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event) ; HandleWindowEvent(event) ;
} }
if ( doResize ) if ( doResize )
@@ -1784,7 +1784,7 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
wxSize size(actualWidth, actualHeight); wxSize size(actualWidth, actualHeight);
wxSizeEvent event(size, m_windowId); wxSizeEvent event(size, m_windowId);
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
} }
} }
@@ -2388,7 +2388,7 @@ void wxWindowMac::DoUpdateScrollbarVisibility()
{ {
wxSizeEvent event(GetSize(), m_windowId); wxSizeEvent event(GetSize(), m_windowId);
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
} }
@@ -2500,7 +2500,7 @@ void wxWindowMac::MacOnScroll( wxScrollEvent &event )
else if (event.GetEventType() == wxEVT_SCROLL_THUMBRELEASE) else if (event.GetEventType() == wxEVT_SCROLL_THUMBRELEASE)
wevent.SetEventType( wxEVT_SCROLLWIN_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 ); wxSetCursorEvent event( pt.x , pt.y );
bool processedEvtSetCursor = GetEventHandler()->ProcessEvent(event); bool processedEvtSetCursor = HandleWindowEvent(event);
if ( processedEvtSetCursor && event.HasCursor() ) if ( processedEvtSetCursor && event.HasCursor() )
{ {
cursor = event.GetCursor() ; cursor = event.GetCursor() ;
@@ -2763,7 +2763,7 @@ bool wxWindowMac::MacDoRedraw( void* updatergnr , long time )
wxEraseEvent eevent( GetId(), dc ); wxEraseEvent eevent( GetId(), dc );
eevent.SetEventObject( this ); eevent.SetEventObject( this );
GetEventHandler()->ProcessEvent( eevent ); HandleWindowEvent( eevent );
delete dc ; delete dc ;
} }
@@ -2781,7 +2781,7 @@ bool wxWindowMac::MacDoRedraw( void* updatergnr , long time )
wxPaintEvent event; wxPaintEvent event;
event.SetTimestamp(time); event.SetTimestamp(time);
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
handled = true ; handled = true ;
} }
@@ -2820,7 +2820,7 @@ bool wxWindowMac::MacDoRedraw( void* updatergnr , long time )
// paint custom borders // paint custom borders
wxNcPaintEvent eventNc( child->GetId() ); wxNcPaintEvent eventNc( child->GetId() );
eventNc.SetEventObject( child ); eventNc.SetEventObject( child );
if ( !child->GetEventHandler()->ProcessEvent( eventNc ) ) if ( !child->HandleWindowEvent( eventNc ) )
{ {
child->MacPaintBorders(0, 0) ; child->MacPaintBorders(0, 0) ;
} }
@@ -3155,7 +3155,7 @@ void wxWindowMac::OnMouseEvent( wxMouseEvent &event )
wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU, wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU,
this->GetId(), this->GetId(),
this->ClientToScreen(event.GetPosition())); this->ClientToScreen(event.GetPosition()));
if ( ! GetEventHandler()->ProcessEvent(evtCtx) ) if ( ! HandleWindowEvent(evtCtx) )
event.Skip() ; event.Skip() ;
} }
else else

View File

@@ -152,7 +152,7 @@ bool wxTopLevelWindowMGL::Show(bool show)
m_sizeSet = true; m_sizeSet = true;
wxSizeEvent event(GetSize(), GetId()); wxSizeEvent event(GetSize(), GetId());
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
if ( ret && show && CanAcceptFocus() ) if ( ret && show && CanAcceptFocus() )

View File

@@ -235,12 +235,12 @@ static ibool MGLAPI wxWindowMouseHandler(window_t *wnd, event_t *e)
event2.SetEventObject(gs_windowUnderMouse); event2.SetEventObject(gs_windowUnderMouse);
event2.SetEventType(wxEVT_LEAVE_WINDOW); event2.SetEventType(wxEVT_LEAVE_WINDOW);
gs_windowUnderMouse->GetEventHandler()->ProcessEvent(event2); gs_windowUnderMouse->HandleWindowEvent(event2);
} }
wxMouseEvent event3(event); wxMouseEvent event3(event);
event3.SetEventType(wxEVT_ENTER_WINDOW); event3.SetEventType(wxEVT_ENTER_WINDOW);
win->GetEventHandler()->ProcessEvent(event3); win->HandleWindowEvent(event3);
gs_windowUnderMouse = win; gs_windowUnderMouse = win;
} }
@@ -257,7 +257,7 @@ static ibool MGLAPI wxWindowMouseHandler(window_t *wnd, event_t *e)
wxMouseEvent evt(inside ? wxMouseEvent evt(inside ?
wxEVT_ENTER_WINDOW : wxEVT_LEAVE_WINDOW); wxEVT_ENTER_WINDOW : wxEVT_LEAVE_WINDOW);
evt.SetEventObject(win); evt.SetEventObject(win);
win->GetEventHandler()->ProcessEvent(evt); win->HandleWindowEvent(evt);
gs_windowUnderMouse = inside ? win : NULL; gs_windowUnderMouse = inside ? win : NULL;
} }
} }
@@ -276,7 +276,7 @@ static ibool MGLAPI wxWindowMouseHandler(window_t *wnd, event_t *e)
else else
{ {
event.SetEventType(type); 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 ) if ( e->what == EVT_KEYUP )
{ {
event.SetEventType(wxEVT_KEY_UP); event.SetEventType(wxEVT_KEY_UP);
return win->GetEventHandler()->ProcessEvent(event); return win->HandleWindowEvent(event);
} }
else else
{ {
@@ -481,7 +481,7 @@ static ibool MGLAPI wxWindowKeybHandler(window_t *wnd, event_t *e)
event.SetEventType(wxEVT_KEY_DOWN); event.SetEventType(wxEVT_KEY_DOWN);
event2 = event; event2 = event;
ret = win->GetEventHandler()->ProcessEvent(event); ret = win->HandleWindowEvent(event);
// wxMSW doesn't send char events with Alt pressed // wxMSW doesn't send char events with Alt pressed
// Only send wxEVT_CHAR event if not processed yet. Thus, ALT-x // 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 ) if ( !ret && event2.m_keyCode != 0 )
{ {
event2.SetEventType(wxEVT_CHAR); 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 // 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: // Ctrl-TAB changes the (parent) window, i.e. switch notebook page:
navEvent.SetWindowChange(event.m_controlDown); navEvent.SetWindowChange(event.m_controlDown);
navEvent.SetCurrentFocus(wxStaticCast(win, wxWindow)); navEvent.SetCurrentFocus(wxStaticCast(win, wxWindow));
ret = win->GetParent()->GetEventHandler()->ProcessEvent(navEvent); ret = win->HandleWindowEvent(navEvent);
} }
// Finally, process special meaning keys that are usually // Finally, process special meaning keys that are usually
@@ -695,24 +695,24 @@ void wxWindowMGL::SetFocus()
{ {
wxActivateEvent event(wxEVT_ACTIVATE, false, gs_activeFrame->GetId()); wxActivateEvent event(wxEVT_ACTIVATE, false, gs_activeFrame->GetId());
event.SetEventObject(gs_activeFrame); event.SetEventObject(gs_activeFrame);
gs_activeFrame->GetEventHandler()->ProcessEvent(event); gs_activeFrame->HandleWindowEvent(event);
} }
gs_activeFrame = active; gs_activeFrame = active;
wxActivateEvent event(wxEVT_ACTIVATE, true, gs_activeFrame->GetId()); wxActivateEvent event(wxEVT_ACTIVATE, true, gs_activeFrame->GetId());
event.SetEventObject(gs_activeFrame); event.SetEventObject(gs_activeFrame);
gs_activeFrame->GetEventHandler()->ProcessEvent(event); gs_activeFrame->HandleWindowEvent(event);
} }
// notify the parent keeping track of focus for the kbd navigation // notify the parent keeping track of focus for the kbd navigation
// purposes that we got it // purposes that we got it
wxChildFocusEvent eventFocus((wxWindow*)this); wxChildFocusEvent eventFocus((wxWindow*)this);
GetEventHandler()->ProcessEvent(eventFocus); HandleWindowEvent(eventFocus);
wxFocusEvent event(wxEVT_SET_FOCUS, GetId()); wxFocusEvent event(wxEVT_SET_FOCUS, GetId());
event.SetEventObject(this); event.SetEventObject(this);
event.SetWindow((wxWindow*)oldFocusedWindow); event.SetWindow((wxWindow*)oldFocusedWindow);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
#if wxUSE_CARET #if wxUSE_CARET
// caret needs to be informed about focus change // caret needs to be informed about focus change
@@ -741,7 +741,7 @@ void wxWindowMGL::KillFocus()
wxFocusEvent event(wxEVT_KILL_FOCUS, GetId()); wxFocusEvent event(wxEVT_KILL_FOCUS, GetId());
event.SetEventObject(this); event.SetEventObject(this);
event.SetWindow(gs_toBeFocusedWindow); 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); wxSize newSize(width, height);
wxSizeEvent event(newSize, GetId()); wxSizeEvent event(newSize, GetId());
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
} }
@@ -1175,17 +1175,17 @@ void wxWindowMGL::HandlePaint(MGLDevCtx *dc)
wxWindowDC dc((wxWindow*)this); wxWindowDC dc((wxWindow*)this);
wxEraseEvent eventEr(m_windowId, &dc); wxEraseEvent eventEr(m_windowId, &dc);
eventEr.SetEventObject(this); eventEr.SetEventObject(this);
GetEventHandler()->ProcessEvent(eventEr); HandleWindowEvent(eventEr);
} }
m_eraseBackground = -1; m_eraseBackground = -1;
wxNcPaintEvent eventNc(GetId()); wxNcPaintEvent eventNc(GetId());
eventNc.SetEventObject(this); eventNc.SetEventObject(this);
GetEventHandler()->ProcessEvent(eventNc); HandleWindowEvent(eventNc);
wxPaintEvent eventPt(GetId()); wxPaintEvent eventPt(GetId());
eventPt.SetEventObject(this); eventPt.SetEventObject(this);
GetEventHandler()->ProcessEvent(eventPt); HandleWindowEvent(eventPt);
#if wxUSE_CARET #if wxUSE_CARET
if ( caret ) if ( caret )

View File

@@ -141,7 +141,7 @@ void wxCheckListBox::DoToggleItem( int n, int x )
event.SetEventObject(this); event.SetEventObject(this);
event.SetString(GetString(n)); event.SetString(GetString(n));
GetEventHandler()->ProcessEvent(event); HandleWindowEvent(event);
} }
} }

View File

@@ -306,7 +306,7 @@ void wxComboBoxCallback (Widget WXUNUSED(w), XtPointer clientData,
event.SetClientData( item->GetClientData(idx) ); event.SetClientData( item->GetClientData(idx) );
event.SetExtraLong(true); event.SetExtraLong(true);
event.SetEventObject(item); event.SetEventObject(item);
item->GetEventHandler()->ProcessEvent(event); item->HandleWindowEvent(event);
break; break;
} }
case XmCR_VALUE_CHANGED: case XmCR_VALUE_CHANGED:
@@ -316,7 +316,7 @@ void wxComboBoxCallback (Widget WXUNUSED(w), XtPointer clientData,
event.SetString( item->GetValue() ); event.SetString( item->GetValue() );
event.SetExtraLong(true); event.SetExtraLong(true);
event.SetEventObject(item); event.SetEventObject(item);
item->GetEventHandler()->ProcessEvent(event); item->HandleWindowEvent(event);
break; break;
} }
default: default:

View File

@@ -102,7 +102,7 @@ wxString wxControl::GetLabel() const
bool wxControl::ProcessCommand(wxCommandEvent & event) bool wxControl::ProcessCommand(wxCommandEvent & event)
{ {
return GetEventHandler()->ProcessEvent(event); return HandleWindowEvent(event);
} }
wxSize wxControl::DoGetBestSize() const wxSize wxControl::DoGetBestSize() const

Some files were not shown because too many files have changed in this diff Show More