]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/aboutdlg.cpp
9b6ee683c6086e4dd66723cb4f9f450bc5d3dbd2
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/aboutdlg.cpp
3 // Purpose: implementation of wxAboutBox() for wxMSW
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 // for compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
31 #include "wx/aboutdlg.h"
32 #include "wx/generic/aboutdlgg.h"
34 // ============================================================================
36 // ============================================================================
38 // helper function: returns all array elements in a single comma-separated and
39 // newline-terminated string
40 static wxString
AllAsString(const wxArrayString
& a
)
43 const size_t count
= a
.size();
44 for ( size_t n
= 0; n
< count
; n
++ )
46 s
<< a
[n
] << (n
== count
- 1 ? _T("\n") : _T(", "));
52 // our public entry point
53 void wxAboutBox(const wxAboutDialogInfo
& info
)
55 // we prefer to show a simple message box if we don't have any fields which
56 // can't be shown in it because as much as there is a standard about box
57 // under MSW at all, this is it
58 if ( info
.HasWebSite() || info
.HasIcon() || info
.HasLicence() )
60 // we need to use the full-blown generic version
61 wxGenericAboutBox(info
);
63 else // simple "native" version should do
65 // build the text to show in the box
66 const wxString name
= info
.GetName();
69 if ( info
.HasVersion() )
70 msg
<< _(" Version ") << info
.GetVersion();
73 if ( info
.HasCopyright() )
74 msg
<< info
.GetCopyright() << _T('\n');
76 msg
<< info
.GetDescription() << _T('\n');
78 if ( info
.HasDevelopers() )
79 msg
<< _("Developed by ") << AllAsString(info
.GetDevelopers());
81 if ( info
.HasDocWriters() )
82 msg
<< _("Documentation by ") << AllAsString(info
.GetDocWriters());
84 if ( info
.HasArtists() )
85 msg
<< _("Graphics art by ") << AllAsString(info
.GetArtists());
87 if ( info
.HasTranslators() )
88 msg
<< _("Translations by ") << AllAsString(info
.GetTranslators());
90 wxMessageBox(msg
, _T("About ") + name
);
94 #endif // wxUSE_ABOUTDLG