Add wxTimer::StartOnce().

This is a simple wrapper for wxTimer::Start(timeout, wxTIMER_ONE_SHOT) but is
often more readable and is definitely better than Start(timeout, true) which
many people still use in spite of wxTIMER_ONE_SHOT existence.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74330 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-07-03 00:24:10 +00:00
parent dbd5b2ce42
commit 7c60222510
3 changed files with 17 additions and 1 deletions

View File

@@ -81,6 +81,10 @@ public:
// timer if it is already running
virtual bool Start(int milliseconds = -1, bool oneShot = false);
// start the timer for one iteration only, this is just a simple wrapper
// for Start()
bool StartOnce(int milliseconds = -1) { return Start(milliseconds, true); }
// stop the timer, does nothing if the timer is not running
virtual void Stop();