// default: if you don't call SetOwner(), your only chance to get timer
// notifications is to override Notify() in the derived class
// default: if you don't call SetOwner(), your only chance to get timer
// notifications is to override Notify() in the derived class
// ctor which allows to avoid having to override Notify() in the derived
// class: the owner will get timer notifications which can be handled with
// ctor which allows to avoid having to override Notify() in the derived
// class: the owner will get timer notifications which can be handled with
- { 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; }
int GetInterval() const { return m_milli; }
// return true if the timer is one shot
bool IsOneShot() const { return m_oneShot; }
int GetInterval() const { return m_milli; }
// return true if the timer is one shot
bool IsOneShot() const { return m_oneShot; }
#include "wx/msw/timer.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/timer.h"
#include "wx/msw/timer.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/timer.h"
#include "wx/generic/timer.h"
#elif defined (__WXCOCOA__)
#include "wx/cocoa/timer.h"
#include "wx/generic/timer.h"
#elif defined (__WXCOCOA__)
#include "wx/cocoa/timer.h"