Proposed wxTimer change

Robin Dunn robin at alldunn.com
Sat Aug 5 16:17:33 PDT 2006


Does anybody foresee any problems with this change?  It simply gives the 
timers a generated ID if wxID_ANY is passed, to make it behave more like 
window, menu, toolbar, etc. IDs.

Index: include/wx/timer.h
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/include/wx/timer.h,v
retrieving revision 1.56
diff -u -4 -r1.56 timer.h
--- include/wx/timer.h	2006/03/14 22:46:49	1.56
+++ include/wx/timer.h	2006/08/05 22:47:29
@@ -50,9 +50,9 @@
          { Init(); SetOwner(owner, timerid); }

      // same as ctor above
      void SetOwner(wxEvtHandler *owner, int timerid = wxID_ANY)
-        { m_owner = owner; m_idTimer = timerid; }
+        { m_owner = owner; m_idTimer = timerid == wxID_ANY ? wxNewId() 
: timerid; }
      wxEvtHandler * GetOwner() const { return m_owner; }

      virtual ~wxTimerBase();


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wx-dev mailing list