]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/logg.cpp
use IMPLEMENT_APP_CONSOLE and not IMPLEMENT_APP for console apps
[wxWidgets.git] / src / generic / logg.cpp
index 4582c3b07e994750419cb394babc390a98071ec4..5d4bcc8771306241672d2f08461a83bbe38ab66c 100644 (file)
@@ -275,11 +275,7 @@ 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->GetAppDisplayName();
 
 
     wxString appName = wxTheApp->GetAppDisplayName();
 
@@ -317,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);
@@ -793,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);
@@ -1101,7 +1080,7 @@ static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent)
 
     // open file
     // ---------
 
     // open file
     // ---------
-    bool bOk wxDUMMY_INITIALIZE(false);
+    bool bOk = false;
     if ( wxFile::Exists(filename) ) {
         bool bAppend = false;
         wxString strMsg;
     if ( wxFile::Exists(filename) ) {
         bool bAppend = false;
         wxString strMsg;