1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/carbon/aboutdlg.cpp
3 // Purpose: native wxAboutBox() implementation for wxMac
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"
27 #include "wx/aboutdlg.h"
28 #include "wx/generic/aboutdlgg.h"
30 #include "wx/osx/private.h"
32 // helper class for HIAboutBox options
33 class AboutBoxOptions
: public wxCFRef
<CFMutableDictionaryRef
>
36 AboutBoxOptions() : wxCFRef
<CFMutableDictionaryRef
>
38 CFDictionaryCreateMutable
41 4, // there are at most 4 values
42 &kCFTypeDictionaryKeyCallBacks
,
43 &kCFTypeDictionaryValueCallBacks
49 void Set(CFStringRef key
, const wxString
& value
)
51 CFDictionarySetValue(*this, key
, wxCFStringRef(value
));
55 // ============================================================================
57 // ============================================================================
59 void wxAboutBox(const wxAboutDialogInfo
& info
, wxWindow
*parent
)
61 // Mac native about box currently can show only name, version, copyright
62 // and description fields and we also shoehorn the credits text into the
63 // description but if we have anything else we must use the generic version
65 if ( info
.IsSimple() )
69 opts
.Set(kHIAboutBoxNameKey
, info
.GetName());
71 if ( info
.HasVersion() )
72 opts
.Set(kHIAboutBoxVersionKey
,info
.GetLongVersion());
74 if ( info
.HasCopyright() )
75 opts
.Set(kHIAboutBoxCopyrightKey
, info
.GetCopyrightToDisplay());
77 opts
.Set(kHIAboutBoxDescriptionKey
, info
.GetDescriptionAndCredits());
81 else // simple "native" version is not enough
83 // we need to use the full-blown generic version
84 wxGenericAboutBox(info
, parent
);
88 #endif // wxUSE_ABOUTDLG