X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fc7a2a602b4bd9308be21bc07e40a680f483438e..aa4d3151d6218dd21cc9cd6e77ddc0181aa3414c:/include/wx/timer.h?ds=sidebyside diff --git a/include/wx/timer.h b/include/wx/timer.h index cc33886ea1..9e9ed4e523 100644 --- a/include/wx/timer.h +++ b/include/wx/timer.h @@ -13,7 +13,7 @@ #ifndef _WX_TIMER_H_BASE_ #define _WX_TIMER_H_BASE_ -#if defined(__GNUG__) && !defined(__APPLE__) +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "timerbase.h" #endif @@ -52,12 +52,12 @@ public: // ctor which allows to avoid having to override Notify() in the derived // class: the owner will get timer notifications which can be handled with // EVT_TIMER - wxTimerBase(wxEvtHandler *owner, int id = -1) - { Init(); SetOwner(owner, id); } + wxTimerBase(wxEvtHandler *owner, int timerid = -1) + { Init(); SetOwner(owner, timerid); } // same as ctor above - void SetOwner(wxEvtHandler *owner, int id = -1) - { m_owner = owner; m_idTimer = id; } + void SetOwner(wxEvtHandler *owner, int timerid = -1) + { m_owner = owner; m_idTimer = timerid; } virtual ~wxTimerBase(); @@ -90,11 +90,9 @@ public: // return TRUE if the timer is one shot bool IsOneShot() const { return m_oneShot; } -#if WXWIN_COMPATIBILITY_2 - // deprecated functions - int Interval() const { return GetInterval(); }; - bool OneShot() const { return IsOneShot(); } -#endif // WXWIN_COMPATIBILITY_2 + // return the timer ID + int GetId() const { return m_idTimer; } + protected: // common part of all ctors @@ -167,7 +165,7 @@ private: class WXDLLEXPORT wxTimerEvent : public wxEvent { public: - wxTimerEvent(int id = 0, int interval = 0) : wxEvent(id) + wxTimerEvent(int timerid = 0, int interval = 0) : wxEvent(timerid) { m_eventType = wxEVT_TIMER; @@ -188,8 +186,8 @@ private: typedef void (wxEvtHandler::*wxTimerEventFunction)(wxTimerEvent&); -#define EVT_TIMER(id, func) \ - DECLARE_EVENT_TABLE_ENTRY( wxEVT_TIMER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTimerEventFunction) & func, NULL), +#define EVT_TIMER(timerid, func) \ + DECLARE_EVENT_TABLE_ENTRY( wxEVT_TIMER, timerid, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTimerEventFunction, & func ), NULL), #endif // wxUSE_GUI && wxUSE_TIMER