changed exceptions handling to work under wxGTK
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -433,6 +433,12 @@ public:
|
||||
// Perform standard OnIdle behaviour: call from port's OnIdle
|
||||
void OnIdle(wxIdleEvent& event);
|
||||
|
||||
#if wxUSE_EXCEPTIONS
|
||||
virtual void HandleEvent(wxEvtHandler *handler,
|
||||
wxEventFunction func,
|
||||
wxEvent& event) const;
|
||||
#endif // wxUSE_EXCEPTIONS
|
||||
|
||||
|
||||
// top level window functions
|
||||
// --------------------------
|
||||
|
@@ -2295,6 +2295,8 @@ protected:
|
||||
// wxEvtHandler: the base class for all objects handling wxWidgets events
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&);
|
||||
|
||||
class WXDLLIMPEXP_BASE wxEvtHandler : public wxObject
|
||||
{
|
||||
public:
|
||||
@@ -2322,6 +2324,15 @@ public:
|
||||
bool ProcessThreadEvent(wxEvent& event);
|
||||
#endif
|
||||
|
||||
#if wxUSE_EXCEPTIONS
|
||||
// call the specified handler with the given event
|
||||
//
|
||||
// this method only exists to allow catching the exceptions thrown by any
|
||||
// event handler, it would lead to an extra (useless) virtual function call
|
||||
// if the exceptions were not used, so it doesn't even exist in that case
|
||||
virtual void DoHandleEvent(wxEventFunction func, wxEvent& event);
|
||||
#endif // wxUSE_EXCEPTIONS
|
||||
|
||||
// Dynamic association of a member function handler with the event handler,
|
||||
// winid and event type
|
||||
void Connect(int winid,
|
||||
@@ -2482,8 +2493,6 @@ inline void wxPostEvent(wxEvtHandler *dest, wxEvent& event)
|
||||
dest->AddPendingEvent(event);
|
||||
}
|
||||
|
||||
typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&);
|
||||
|
||||
#define wxEventHandler(func) \
|
||||
(wxObjectEventFunction)wxStaticCastEvent(wxEventFunction, &func)
|
||||
|
||||
|
@@ -26,6 +26,10 @@
|
||||
|
||||
class WXDLLIMPEXP_BASE wxObject;
|
||||
|
||||
// FIXME: remove in wx-2.7:
|
||||
class WXDLLIMPEXP_BASE wxEvent;
|
||||
class WXDLLIMPEXP_BASE wxEvtHandler;
|
||||
|
||||
#ifndef wxUSE_EXTENDED_RTTI
|
||||
#define wxUSE_EXTENDED_RTTI 0
|
||||
#endif
|
||||
@@ -478,7 +482,9 @@ public:
|
||||
virtual void ReservedObjectFunc6() {}
|
||||
virtual void ReservedObjectFunc7() {}
|
||||
virtual void ReservedObjectFunc8() {}
|
||||
virtual void ReservedObjectFunc9() {}
|
||||
// FIXME: turn back into ReservedObjectFunc9() in wx-2.7 (see also FIXME
|
||||
// near the top of this file)
|
||||
virtual void DoHandleEvent(void (wxEvtHandler::*)(wxEvent&), wxEvent&) {}
|
||||
|
||||
protected:
|
||||
// ensure that our data is not shared with anybody else: if we have no
|
||||
|
Reference in New Issue
Block a user