git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8819
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#include "wx/log.h"
#include "wx/thread.h"
#include "wx/log.h"
#include "wx/thread.h"
// other standard headers
#include <errno.h>
#include <stdlib.h>
// other standard headers
#include <errno.h>
#include <stdlib.h>
#include "wx/textfile.h"
#include "wx/statline.h"
#include "wx/textfile.h"
#include "wx/statline.h"
#ifdef __WXMSW__
// for OutputDebugString()
#include "wx/msw/private.h"
#ifdef __WXMSW__
// for OutputDebugString()
#include "wx/msw/private.h"
#define wxUSE_LOG_DIALOG 1
#if wxUSE_LOG_DIALOG
#define wxUSE_LOG_DIALOG 1
#if wxUSE_LOG_DIALOG
- #include "wx/datetime.h"
#include "wx/listctrl.h"
#include "wx/imaglist.h"
#include "wx/image.h"
#include "wx/listctrl.h"
#include "wx/imaglist.h"
#include "wx/image.h"
+// this function is a wrapper around strftime(3)
+// allows to exclude the usage of wxDateTime
+static wxString TimeStamp(const wxChar *format, time_t t)
+{
+ wxChar buf[4096];
+ if ( !wxStrftime(buf, WXSIZEOF(buf), format, localtime(&t)) )
+ {
+ // buffer is too small?
+ wxFAIL_MSG(_T("strftime() failed"));
+ }
+ return wxString(buf);
+}
+
+
class wxLogDialog : public wxDialog
{
public:
class wxLogDialog : public wxDialog
{
public:
m_listctrl->InsertItem(n, m_messages[n]);
m_listctrl->SetItem(n, 1,
m_listctrl->InsertItem(n, m_messages[n]);
m_listctrl->SetItem(n, 1,
- wxDateTime((time_t)m_times[n]).Format(fmt));
+ TimeStamp(fmt, (time_t)m_times[n]));
}
// let the columns size themselves
}
// let the columns size themselves
for ( size_t n = 0; ok && (n < count); n++ )
{
wxString line;
for ( size_t n = 0; ok && (n < count); n++ )
{
wxString line;
- line << wxDateTime((time_t)m_times[n]).Format(fmt)
+ line << TimeStamp(fmt, (time_t)m_times[n])
<< _T(": ")
<< m_messages[n]
<< wxTextFile::GetEOL();
<< _T(": ")
<< m_messages[n]
<< wxTextFile::GetEOL();
#include "wx/event.h"
#include "wx/app.h"
#include "wx/dcclient.h"
#include "wx/event.h"
#include "wx/app.h"
#include "wx/dcclient.h"
#endif
#include "wx/control.h"
#endif
#include "wx/control.h"
#include "wx/utils.h"
#include "wx/app.h"
#include "wx/font.h"
#include "wx/utils.h"
#include "wx/app.h"
#include "wx/font.h"
#endif // WX_PRECOMP
#include "wx/msw/private.h"
#endif // WX_PRECOMP
#include "wx/msw/private.h"
#ifndef WX_PRECOMP
#include "wx/string.h"
#ifndef WX_PRECOMP
#include "wx/string.h"
#endif // WX_PRECOMP
#include "wx/msw/private.h"
#endif // WX_PRECOMP
#include "wx/msw/private.h"
#include "wx/app.h"
#include "wx/icon.h"
#include "wx/bitmap.h"
#include "wx/app.h"
#include "wx/icon.h"
#include "wx/bitmap.h"
#endif
#include "wx/msw/private.h"
#endif
#include "wx/msw/private.h"