X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/99646f7ee4afb3d7d929e1d396e56de8c1aed622..fd008b87e310c3c1ab42f9b79573cebecedad21c:/include/wx/timer.h diff --git a/include/wx/timer.h b/include/wx/timer.h index 8c1724df97..f835029b3c 100644 --- a/include/wx/timer.h +++ b/include/wx/timer.h @@ -22,7 +22,7 @@ #include "wx/longlong.h" #include "wx/event.h" -#if wxUSE_GUI +#if wxUSE_GUI && wxUSE_TIMER // ---------------------------------------------------------------------------- // wxTimer @@ -49,6 +49,10 @@ public: void SetOwner(wxEvtHandler *owner, int id = -1) { m_owner = owner; m_idTimer = id; } +#ifdef __DARWIN__ + virtual ~wxTimerBase() { } +#endif + // working with the timer // ---------------------- @@ -105,8 +109,8 @@ protected: #include "wx/motif/timer.h" #elif defined(__WXGTK__) #include "wx/gtk/timer.h" -#elif defined(__WXQT__) - #include "wx/qt/timer.h" +#elif defined(__WXMGL__) + #include "wx/mgl/timer.h" #elif defined(__WXMAC__) #include "wx/mac/timer.h" #elif defined(__WXPM__) @@ -163,6 +167,9 @@ public: // accessors int GetInterval() const { return m_interval; } + // implement the base class pure virtual + virtual wxEvent *Clone() const { return new wxTimerEvent(*this); } + private: int m_interval; @@ -171,14 +178,17 @@ private: typedef void (wxEvtHandler::*wxTimerEventFunction)(wxTimerEvent&); -#define EVT_TIMER(id, func) { wxEVT_TIMER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTimerEventFunction) & func, NULL}, +#define EVT_TIMER(id, func) \ + DECLARE_EVENT_TABLE_ENTRY( wxEVT_TIMER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTimerEventFunction) & func, NULL), -#endif // wxUSE_GUI +#endif // wxUSE_GUI && wxUSE_TIMER // ---------------------------------------------------------------------------- // wxStopWatch: measure time intervals with up to 1ms resolution // ---------------------------------------------------------------------------- +#if wxUSE_STOPWATCH + class WXDLLEXPORT wxStopWatch { public: @@ -200,6 +210,9 @@ private: long m_pause; // the time of the last Pause() or 0 }; +#endif // wxUSE_STOPWATCH + +#if wxUSE_LONGLONG // Starts a global timer // -- DEPRECATED: use wxStopWatch instead @@ -209,6 +222,8 @@ void WXDLLEXPORT wxStartTimer(); // -- DEPRECATED: use wxStopWatch instead long WXDLLEXPORT wxGetElapsedTime(bool resetTimer = TRUE); +#endif // wxUSE_LONGLONG + // ---------------------------------------------------------------------------- // global time functions // ---------------------------------------------------------------------------- @@ -219,8 +234,10 @@ extern long WXDLLEXPORT wxGetLocalTime(); // Get number of seconds since GMT 00:00:00, Jan 1st 1970. extern long WXDLLEXPORT wxGetUTCTime(); +#if wxUSE_LONGLONG // Get number of milliseconds since local time 00:00:00 Jan 1st 1970 extern wxLongLong WXDLLEXPORT wxGetLocalTimeMillis(); +#endif // wxUSE_LONGLONG #define wxGetCurrentTime() wxGetLocalTime()