+// ----------------------------------------------------------------------------
+// wxTimerRunner: starts the timer in its ctor, stops in the dtor
+// ----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxTimerRunner
+{
+public:
+ wxTimerRunner(wxTimer& timer) : m_timer(timer) { }
+ wxTimerRunner(wxTimer& timer, int milli, bool oneShot = FALSE)
+ : m_timer(timer)
+ {
+ m_timer.Start(milli, oneShot);
+ }
+
+ void Start(int milli, bool oneShot = FALSE)
+ {
+ m_timer.Start(milli, oneShot);
+ }
+
+ ~wxTimerRunner()
+ {
+ if ( m_timer.IsRunning() )
+ {
+ m_timer.Stop();
+ }
+ }
+
+private:
+ wxTimer& m_timer;
+};
+