wxMotif STL-ification.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22822 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2003-08-13 21:28:56 +00:00
parent 7bd54b688e
commit 4410d619c5
3 changed files with 74 additions and 65 deletions

View File

@@ -15,7 +15,7 @@
#include "wx/timer.h"
#include "wx/app.h"
#include "wx/list.h"
#include "wx/hashmap.h"
#ifdef __VMS__
#pragma message disable nosimpint
@@ -27,14 +27,16 @@
#include "wx/motif/private.h"
IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject)
IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject);
static wxList wxTimerList(wxKEY_INTEGER);
WX_DECLARE_VOIDPTR_HASH_MAP(wxTimer*, wxTimerHashMap);
static wxTimerHashMap s_timers;
void wxTimerCallback (wxTimer * timer)
{
// Check to see if it's still on
if (!wxTimerList.Find((long)timer))
if (s_timers.find(timer) == s_timers.end())
return;
if (timer->m_id == 0)
@@ -59,8 +61,8 @@ void wxTimer::Init()
wxTimer::~wxTimer()
{
wxTimer::Stop();
wxTimerList.DeleteObject(this);
Stop();
s_timers.erase(this);
}
bool wxTimer::Start(int milliseconds, bool mode)
@@ -69,8 +71,8 @@ bool wxTimer::Start(int milliseconds, bool mode)
(void)wxTimerBase::Start(milliseconds, mode);
if (!wxTimerList.Find((long)this))
wxTimerList.Append((long)this, this);
if (s_timers.find(this) == s_timers.end())
s_timers[this] = this;
m_id = XtAppAddTimeOut((XtAppContext) wxTheApp->GetAppContext(),
m_milli,