+// A helper used by ProcessEventLocally() to restrict the event processing
+// to this handler only.
+class WXDLLIMPEXP_BASE wxEventProcessHereOnly
+{
+public:
+ wxEventProcessHereOnly(wxEvent& event) : m_event(event)
+ {
+ // This would be unexpected and would also restore the wrong value in
+ // this class dtor so if even does happen legitimately we'd need to
+ // store the value in ctor and restore it in dtor.
+ wxASSERT_MSG( !m_event.m_processHereOnly,
+ "shouldn't be used twice for the same event" );
+
+ m_event.m_processHereOnly = true;
+ }
+
+ ~wxEventProcessHereOnly()
+ {
+ m_event.m_processHereOnly = false;
+ }
+
+private:
+ wxEvent& m_event;
+
+ wxDECLARE_NO_COPY_CLASS(wxEventProcessHereOnly);
+};