X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c78e7c70271608b076b1dbed201b1204e6898d4..399b60a0ad232265cd74ce8bf6a53a1f2cc57ff2:/src/qt/timer.cpp diff --git a/src/qt/timer.cpp b/src/qt/timer.cpp index e8b08d3ca4..c07c4a5f82 100644 --- a/src/qt/timer.cpp +++ b/src/qt/timer.cpp @@ -1,66 +1,54 @@ ///////////////////////////////////////////////////////////////////////////// // Name: timer.cpp -// Purpose: -// Author: Robert Roebling -// Created: 01/02/97 -// Id: -// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem +// Purpose: wxTimer implementation +// Author: AUTHOR +// Modified by: +// Created: ??/??/98 +// RCS-ID: $Id$ +// Copyright: (c) AUTHOR // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - #ifdef __GNUG__ #pragma implementation "timer.h" #endif #include "wx/timer.h" -//----------------------------------------------------------------------------- -// wxTimer -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxTimer,wxObject) +IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject) -gint timeout_callback( gpointer data ) +wxTimer::wxTimer() { - wxTimer *timer = (wxTimer*)data; - timer->Notify(); - if (timer->OneShot()) timer->Stop(); - return TRUE; -}; + m_milli = 0 ; + m_lastMilli = -1 ; + m_id = 0; + m_oneShot = FALSE; +} -wxTimer::wxTimer(void) +wxTimer::~wxTimer() { - m_time = 1000; - m_oneShot = FALSE; -}; + Stop(); +} -wxTimer::~wxTimer(void) +bool wxTimer::Start(int milliseconds,bool mode) { - Stop(); -}; + m_oneShot = mode ; + if (m_milliseconds < 0) + m_milliseconds = lastMilli; -int wxTimer::Interval(void) -{ - return m_time; -}; + if (m_milliseconds <= 0) + return FALSE; -bool wxTimer::OneShot(void) -{ - return m_oneShot; -}; + m_lastMilli = m_milli = m_milliseconds; -void wxTimer::Notify(void) -{ -}; + // TODO: set the timer going. + return FALSE; +} -void wxTimer::Start( int millisecs, bool oneShot ) +void wxTimer::Stop() { - if (millisecs != -1) m_time = millisecs; - m_oneShot = oneShot; -}; + m_id = 0 ; + m_milli = 0 ; +} -void wxTimer::Stop(void) -{ -};