messages - it will be more visual
*/
-#ifdef __GNUG__
- #pragma implementation "thread.cpp"
- #pragma interface "thread.cpp"
-#endif
-
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
{
wxString text;
- text.Printf("Thread 0x%x started (priority = %d).\n",
+ text.Printf(wxT("Thread 0x%x started (priority = %d).\n"),
GetId(), GetPriority());
WriteText(text);
// wxLogMessage(text); -- test wxLog thread safeness
if ( TestDestroy() )
break;
- text.Printf("[%u] Thread 0x%x here.\n", m_count, GetId());
+ text.Printf(wxT("[%u] Thread 0x%x here.\n"), m_count, GetId());
WriteText(text);
// wxSleep() can't be called from non-GUI thread!
wxThread::Sleep(1000);
}
- text.Printf("Thread 0x%x finished.\n", GetId());
+ text.Printf(wxT("Thread 0x%x finished.\n"), GetId());
WriteText(text);
// wxLogMessage(text); -- test wxLog thread safeness
break;
wxString text;
- text.Printf("[%u] Thread 0x%x here!!", m_count, GetId());
+ text.Printf(wxT("[%u] Thread 0x%x here!!"), m_count, GetId());
// create any type of command event here
wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, WORKER_EVENT );
if ( thread->Create() != wxTHREAD_NO_ERROR )
{
- wxLogError("Can't create thread!");
+ wxLogError(wxT("Can't create thread!"));
}
wxCriticalSectionLocker enter(wxGetApp().m_critsect);
}
wxString msg;
- msg.Printf("%d new threads created.", count);
+ msg.Printf(wxT("%d new threads created."), count);
SetStatusText(msg, 1);
// ...and then start them
if ( thread->Run() != wxTHREAD_NO_ERROR )
{
- wxLogError("Can't start thread!");
+ wxLogError(wxT("Can't start thread!"));
}
SetStatusText("New thread started.", 1);
// stop the last thread
if ( wxGetApp().m_threads.IsEmpty() )
{
- wxLogError("No thread to stop!");
+ wxLogError(wxT("No thread to stop!"));
wxGetApp().m_critsect.Leave();
}
if ( n == count )
{
- wxLogError("No thread to resume!");
+ wxLogError(wxT("No thread to resume!"));
}
else
{
if ( n < 0 )
{
- wxLogError("No thread to pause!");
+ wxLogError(wxT("No thread to pause!"));
}
else
{
m_nRunning = nRunning;
m_nCount = nCount;
- wxLogStatus(this, "%u threads total, %u running.", nCount, nRunning);
+ wxLogStatus(this, wxT("%u threads total, %u running."), nCount, nRunning);
}
//else: avoid flicker - don't print anything
}
if ( thread->Create() != wxTHREAD_NO_ERROR )
{
- wxLogError("Can't create thread!");
+ wxLogError(wxT("Can't create thread!"));
}
m_dlgProgress = new wxProgressDialog