]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/logg.cpp
ignore WinCE projects and build directories
[wxWidgets.git] / src / generic / logg.cpp
index ab86120d6370467f6ea4e134fcae4bc1043c91c6..ecac929db9e95567fcf88cc25c1249c1c0e743e1 100644 (file)
@@ -275,15 +275,9 @@ void wxLogGui::Flush()
     // do it right now to block any new calls to Flush() while we're here
     m_bHasMessages = false;
 
     // do it right now to block any new calls to Flush() while we're here
     m_bHasMessages = false;
 
-    unsigned repeatCount = 0;
-    if ( wxLog::GetRepetitionCounting() )
-    {
-        repeatCount = wxLog::DoLogNumberOfRepeats();
-    }
+    const unsigned repeatCount = LogLastRepeatIfNeeded();
 
 
-    wxString appName = wxTheApp->GetAppName();
-    if ( !appName.empty() )
-        appName[0u] = (wxChar)wxToupper(appName[0u]);
+    wxString appName = wxTheApp->GetAppDisplayName();
 
     long style;
     wxString titleFormat;
 
     long style;
     wxString titleFormat;
@@ -319,7 +313,11 @@ void wxLogGui::Flush()
 #if wxUSE_LOG_DIALOG
 
         if ( repeatCount > 0 )
 #if wxUSE_LOG_DIALOG
 
         if ( repeatCount > 0 )
-            m_aMessages[nMsgCount-1] += wxString::Format(wxT(" (%s)"), m_aMessages[nMsgCount-2].c_str());
+        {
+            m_aMessages[nMsgCount - 1]
+                << " (" << m_aMessages[nMsgCount - 2] << ")";
+        }
+
         wxLogDialog dlg(NULL,
                         m_aMessages, m_aSeverity, m_aTimes,
                         title, style);
         wxLogDialog dlg(NULL,
                         m_aMessages, m_aSeverity, m_aTimes,
                         title, style);
@@ -407,7 +405,7 @@ void wxLogGui::DoLog(wxLogLevel level, const wxString& szString, time_t t)
                     // don't prepend debug/trace here: it goes to the
                     // debug window anyhow
                     str += wxT("\r\n");
                     // don't prepend debug/trace here: it goes to the
                     // debug window anyhow
                     str += wxT("\r\n");
-                    OutputDebugString(str);
+                    OutputDebugString(str.wx_str());
                 #else
                     // send them to stderr
                     wxFprintf(stderr, wxT("[%s] %s\n"),
                 #else
                     // send them to stderr
                     wxFprintf(stderr, wxT("[%s] %s\n"),
@@ -469,7 +467,7 @@ class wxLogFrame : public wxFrame
 {
 public:
     // ctor & dtor
 {
 public:
     // ctor & dtor
-    wxLogFrame(wxWindow *pParent, wxLogWindow *log, const wxChar *szTitle);
+    wxLogFrame(wxWindow *pParent, wxLogWindow *log, const wxString& szTitle);
     virtual ~wxLogFrame();
 
     // menu callbacks
     virtual ~wxLogFrame();
 
     // menu callbacks
@@ -513,7 +511,7 @@ BEGIN_EVENT_TABLE(wxLogFrame, wxFrame)
     EVT_CLOSE(wxLogFrame::OnCloseWindow)
 END_EVENT_TABLE()
 
     EVT_CLOSE(wxLogFrame::OnCloseWindow)
 END_EVENT_TABLE()
 
-wxLogFrame::wxLogFrame(wxWindow *pParent, wxLogWindow *log, const wxChar *szTitle)
+wxLogFrame::wxLogFrame(wxWindow *pParent, wxLogWindow *log, const wxString& szTitle)
           : wxFrame(pParent, wxID_ANY, szTitle)
 {
     m_log = log;
           : wxFrame(pParent, wxID_ANY, szTitle)
 {
     m_log = log;
@@ -621,7 +619,7 @@ wxLogFrame::~wxLogFrame()
 // -----------
 
 wxLogWindow::wxLogWindow(wxWindow *pParent,
 // -----------
 
 wxLogWindow::wxLogWindow(wxWindow *pParent,
-                         const wxChar *szTitle,
+                         const wxString& szTitle,
                          bool bShow,
                          bool bDoPass)
 {
                          bool bShow,
                          bool bDoPass)
 {
@@ -795,38 +793,17 @@ wxLogDialog::wxLogDialog(wxWindow *parent,
     wxBoxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
     wxBoxSizer *sizerAll = new wxBoxSizer(isPda ? wxVERTICAL : wxHORIZONTAL);
 
     wxBoxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
     wxBoxSizer *sizerAll = new wxBoxSizer(isPda ? wxVERTICAL : wxHORIZONTAL);
 
-    wxBitmap bitmap;
-    switch ( style & wxICON_MASK )
+    if (!isPda)
     {
     {
-        case wxICON_ERROR:
-            bitmap = wxArtProvider::GetBitmap(wxART_ERROR, wxART_MESSAGE_BOX);
-#ifdef __WXPM__
-            bitmap.SetId(wxICON_SMALL_ERROR);
-#endif
-            break;
-
-        case wxICON_INFORMATION:
-            bitmap = wxArtProvider::GetBitmap(wxART_INFORMATION, wxART_MESSAGE_BOX);
-#ifdef __WXPM__
-            bitmap.SetId(wxICON_SMALL_INFO);
-#endif
-            break;
-
-        case wxICON_WARNING:
-            bitmap = wxArtProvider::GetBitmap(wxART_WARNING, wxART_MESSAGE_BOX);
-#ifdef __WXPM__
-            bitmap.SetId(wxICON_SMALL_WARNING);
-#endif
-            break;
-
-        default:
-            wxFAIL_MSG(_T("incorrect log style"));
+        wxStaticBitmap *icon = new wxStaticBitmap
+                                   (
+                                    this,
+                                    wxID_ANY,
+                                    wxArtProvider::GetMessageBoxIcon(style)
+                                   );
+        sizerAll->Add(icon, 0, wxALIGN_CENTRE_VERTICAL);
     }
 
     }
 
-    if (!isPda)
-        sizerAll->Add(new wxStaticBitmap(this, wxID_ANY, bitmap), 0,
-                  wxALIGN_CENTRE_VERTICAL);
-
     // create the text sizer with a minimal size so that we are sure it won't be too small
     wxString message = EllipsizeString(messages.Last());
     wxSizer *szText = CreateTextSizer(message);
     // create the text sizer with a minimal size so that we are sure it won't be too small
     wxString message = EllipsizeString(messages.Last());
     wxSizer *szText = CreateTextSizer(message);