added native Mac implementation of wxAboutBox(); also moved aboutdlg.* files from...
[wxWidgets.git] / src / msw / aboutdlg.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/aboutdlg.cpp
3 // Purpose: implementation of wxAboutBox() for wxMSW
4 // Author: Vadim Zeitlin
5 // Created: 2006-10-07
6 // RCS-ID: $Id$
7 // Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 // ============================================================================
12 // declarations
13 // ============================================================================
14
15 // ----------------------------------------------------------------------------
16 // headers
17 // ----------------------------------------------------------------------------
18
19 // for compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
21
22 #ifdef __BORLANDC__
23 #pragma hdrstop
24 #endif
25
26 #if wxUSE_ABOUTDLG
27
28 #ifndef WX_PRECOMP
29 #endif //WX_PRECOMP
30
31 #include "wx/aboutdlg.h"
32 #include "wx/generic/aboutdlgg.h"
33
34 // ============================================================================
35 // implementation
36 // ============================================================================
37
38 // our public entry point
39 void wxAboutBox(const wxAboutDialogInfo& info)
40 {
41 // we prefer to show a simple message box if we don't have any fields which
42 // can't be shown in it because as much as there is a standard about box
43 // under MSW at all, this is it
44 if ( info.IsSimple() )
45 {
46 // build the text to show in the box
47 const wxString name = info.GetName();
48 wxString msg;
49 msg << name;
50 if ( info.HasVersion() )
51 msg << _(" Version ") << info.GetVersion();
52 msg << _T('\n');
53
54 if ( info.HasCopyright() )
55 msg << info.GetCopyright() << _T('\n');
56
57 // add everything remaining
58 msg << info.GetDescriptionAndCredits();
59
60 wxMessageBox(msg, _T("About ") + name);
61 }
62 else // simple "native" version is not enough
63 {
64 // we need to use the full-blown generic version
65 wxGenericAboutBox(info);
66 }
67 }
68
69 #endif // wxUSE_ABOUTDLG