X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4c286ef633586717113cf0149f98ad1bc1683bc6..855f31ebe72bef834a32df2c274b41fb282ad265:/include/wx/timer.h diff --git a/include/wx/timer.h b/include/wx/timer.h index 8955051268..c79633c6c0 100644 --- a/include/wx/timer.h +++ b/include/wx/timer.h @@ -21,6 +21,7 @@ #include "wx/longlong.h" #include "wx/event.h" #include "wx/stopwatch.h" // for backwards compatibility +#include "wx/window.h" // only for NewControlId() // more readable flags for Start(): @@ -51,8 +52,12 @@ public: // same as ctor above void SetOwner(wxEvtHandler *owner, int timerid = wxID_ANY) - { m_owner = owner; m_idTimer = timerid; } - wxEvtHandler * GetOwner() const { return m_owner; } + { + m_owner = owner; + m_idTimer = timerid == wxID_ANY ? wxWindow::NewControlId() : timerid; + } + + wxEvtHandler *GetOwner() const { return m_owner; } virtual ~wxTimerBase(); @@ -113,7 +118,7 @@ protected: #include "wx/gtk/timer.h" #elif defined(__WXGTK__) #include "wx/gtk1/timer.h" -#elif defined(__WXX11__) || defined(__WXMGL__) +#elif defined(__WXX11__) || defined(__WXMGL__) || defined(__WXDFB__) #include "wx/generic/timer.h" #elif defined (__WXCOCOA__) #include "wx/cocoa/timer.h"