]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/aboutdlg.cpp
XRC spec: document wxRibbon* XRC handler.
[wxWidgets.git] / src / msw / aboutdlg.cpp
index 9b6ee683c6086e4dd66723cb4f9f450bc5d3dbd2..5b100b81ae8fc849c3abd8918b47b7680dee7b68 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     implementation of wxAboutBox() for wxMSW
 // Author:      Vadim Zeitlin
 // Created:     2006-10-07
-// RCS-ID:      $Id$
 // Copyright:   (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
@@ -26,6 +25,7 @@
 #if wxUSE_ABOUTDLG
 
 #ifndef WX_PRECOMP
+    #include "wx/msgdlg.h"
 #endif //WX_PRECOMP
 
 #include "wx/aboutdlg.h"
 // implementation
 // ============================================================================
 
-// helper function: returns all array elements in a single comma-separated and
-// newline-terminated string
-static wxString AllAsString(const wxArrayString& a)
-{
-    wxString s;
-    const size_t count = a.size();
-    for ( size_t n = 0; n < count; n++ )
-    {
-        s << a[n] << (n == count - 1 ? _T("\n") : _T(", "));
-    }
-
-    return s;
-}
-
 // our public entry point
-void wxAboutBox(const wxAboutDialogInfo& info)
+void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* parent)
 {
     // we prefer to show a simple message box if we don't have any fields which
     // can't be shown in it because as much as there is a standard about box
     // under MSW at all, this is it
-    if ( info.HasWebSite() || info.HasIcon() || info.HasLicence() )
-    {
-        // we need to use the full-blown generic version
-        wxGenericAboutBox(info);
-    }
-    else // simple "native" version should do
+    if ( info.IsSimple() )
     {
         // build the text to show in the box
         const wxString name = info.GetName();
         wxString msg;
         msg << name;
         if ( info.HasVersion() )
-            msg << _(" Version ") << info.GetVersion();
-        msg << _T('\n');
+        {
+            msg << wxT('\n');
+            msg << info.GetLongVersion();
+        }
 
-        if ( info.HasCopyright() )
-            msg << info.GetCopyright() << _T('\n');
-
-        msg << info.GetDescription() << _T('\n');
-
-        if ( info.HasDevelopers() )
-            msg << _("Developed by ") << AllAsString(info.GetDevelopers());
-
-        if ( info.HasDocWriters() )
-            msg << _("Documentation by ") << AllAsString(info.GetDocWriters());
+        msg << wxT("\n\n");
 
-        if ( info.HasArtists() )
-            msg << _("Graphics art by ") << AllAsString(info.GetArtists());
+        if ( info.HasCopyright() )
+            msg << info.GetCopyrightToDisplay() << wxT('\n');
 
-        if ( info.HasTranslators() )
-            msg << _("Translations by ") << AllAsString(info.GetTranslators());
+        // add everything remaining
+        msg << info.GetDescriptionAndCredits();
 
-        wxMessageBox(msg, _T("About ") + name);
+        wxMessageBox(msg, wxString::Format(_("About %s"), name), wxOK | wxCENTRE, parent);
+    }
+    else // simple "native" version is not enough
+    {
+        // we need to use the full-blown generic version
+        wxGenericAboutBox(info, parent);
     }
 }