#include "wx/defs.h"
#include "wx/object.h"
#include "wx/gdicmn.h"
+#if wxUSE_THREADS
+#include "wx/thread.h"
+#endif
/*
* Event types
// Set/Get listbox/choice selection string
void SetString(const wxString& s) { m_commandString = s; }
- const wxString& GetString() const { return m_commandString; }
+ wxString GetString() const { return m_commandString; }
// Get checkbox value
bool Checked() const { return (m_commandInt != 0); }
{
// GetVeto() will return FALSE anyhow...
wxCHECK_RET( m_canVeto,
- "call to Veto() ignored (can't veto this event)" );
+ _T("call to Veto() ignored (can't veto this event)") );
m_veto = veto;
}
virtual bool OnClose();
#endif
+#if wxUSE_THREADS
+ bool ProcessThreadEvent(wxEvent& event);
+ void ProcessPendingEvents();
+#endif
virtual bool ProcessEvent(wxEvent& event);
virtual bool SearchEventTable(wxEventTable& table, wxEvent& event);
virtual const wxEventTable *GetEventTable() const;
protected:
- wxEvtHandler* m_nextHandler;
- wxEvtHandler* m_previousHandler;
- bool m_enabled; // Is event handler enabled?
- wxList* m_dynamicEvents;
+ wxEvtHandler* m_nextHandler;
+ wxEvtHandler* m_previousHandler;
+ bool m_enabled; // Is event handler enabled?
+ wxList* m_dynamicEvents;
+ wxList* m_pendingEvents;
+#if wxUSE_THREADS
+ wxCriticalSection* m_eventsLocker;
+#endif
// optimization: instead of using costly IsKindOf() to decide whether we're
// a window (which is true in 99% of cases), use this flag
#define EVT_UPDATE_UI(id, func) \
{ wxEVT_UPDATE_UI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxUpdateUIEventFunction) & func, (wxObject *) NULL },\
+/*
+ * Helper functions
+ */
+
+// Find a window with the focus, that is also a descendant of the given window.
+// This is used to determine the window to initially send commands to.
+wxWindow* wxFindFocusDescendant(wxWindow* ancestor);
+
#endif
// _WX_EVENTH__