In linux process events from the main frame regularly to update statusbar text

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5018 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2010-02-06 01:08:36 +00:00
parent c65bfbdf7b
commit d979532c00
3 changed files with 26 additions and 10 deletions

View File

@ -285,7 +285,7 @@ EVT_SIZE(CFrame::OnResize)
EVT_MOVE(CFrame::OnMove)
EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, CFrame::OnGameListCtrl_ItemActivated)
EVT_HOST_COMMAND(wxID_ANY, CFrame::OnHostMessage)
#if wxUSE_TIMER && defined _WIN32
#if wxUSE_TIMER
EVT_TIMER(wxID_ANY, CFrame::OnTimer)
#endif
@ -324,8 +324,10 @@ CFrame::CFrame(wxFrame* parent,
, bRenderToMain(false), bFloatLogWindow(false), bFloatConsoleWindow(false)
, HaveLeds(false), HaveSpeakers(false)
, m_bControlsCreated(false), bNoWiimoteMsg(false), m_StopDlg(NULL)
#if wxUSE_TIMER && defined _WIN32
#if wxUSE_TIMER
#ifdef _WIN32
, m_fLastClickTime(0), m_iLastMotionTime(0), LastMouseX(0), LastMouseY(0)
#endif
, m_timer(this)
#endif
@ -348,7 +350,7 @@ CFrame::CFrame(wxFrame* parent,
}
// Create timer
#if wxUSE_TIMER && defined _WIN32
#if wxUSE_TIMER
int TimesPerSecond = 10; // We don't need more than this
m_timer.Start( floor((double)(1000 / TimesPerSecond)) );
#endif
@ -506,7 +508,7 @@ CFrame::~CFrame()
cdio_free_device_list(drives);
/* The statbar sample has this so I add this to, but I guess timer will be deleted after
this anyway */
#if wxUSE_TIMER && defined _WIN32
#if wxUSE_TIMER
if (m_timer.IsRunning()) m_timer.Stop();
#endif
@ -612,6 +614,18 @@ WXLRESULT CFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
}
#endif
void CFrame::OnTimer(wxTimerEvent& WXUNUSED(event))
{
#ifdef _WIN32
Update();
#else
// Process events in linux. Primarily to update the statusbar text.
// This should be unnecessary if we ever get WXGL and render to main working
if (wxGetApp().Pending())
wxGetApp().ProcessPendingEvents();
#endif
}
void CFrame::OnHostMessage(wxCommandEvent& event)
{
switch (event.GetId())

View File

@ -337,14 +337,17 @@ class CFrame : public wxFrame
void BootGame(const std::string& filename);
// Double click and mouse move options
#if wxUSE_TIMER && defined _WIN32
#if wxUSE_TIMER
#ifdef _WIN32
double m_fLastClickTime, m_iLastMotionTime;
int LastMouseX, LastMouseY;
void Update();
void OnTimer(wxTimerEvent& WXUNUSED(event)) { Update(); }
wxTimer m_timer;
#endif
void Update();
#endif
// Used in linux to process command events
void OnTimer(wxTimerEvent& WXUNUSED(event));
wxTimer m_timer;
#endif
// Event table
DECLARE_EVENT_TABLE();

View File

@ -567,7 +567,6 @@ void OpenGL_Update()
// Close plugin
void OpenGL_Shutdown()
{
printf("Deleting\n");
#if defined(USE_WX) && USE_WX
delete GLWin.glCanvas;
delete GLWin.frame;