]> git.saurik.com Git - wxWidgets.git/blob - src/osx/carbon/aboutdlg.cpp
Set missing Language: headers in PO files.
[wxWidgets.git] / src / osx / carbon / aboutdlg.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/carbon/aboutdlg.cpp
3 // Purpose: native wxAboutBox() implementation for wxMac
4 // Author: Vadim Zeitlin
5 // Created: 2006-10-08
6 // Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
9
10 // ============================================================================
11 // declarations
12 // ============================================================================
13
14 // ----------------------------------------------------------------------------
15 // headers
16 // ----------------------------------------------------------------------------
17
18 // for compilers that support precompilation, includes "wx.h".
19 #include "wx/wxprec.h"
20
21 #if wxUSE_ABOUTDLG
22
23 #ifndef WX_PRECOMP
24 #endif //WX_PRECOMP
25
26 #include "wx/aboutdlg.h"
27 #include "wx/generic/aboutdlgg.h"
28
29 #include "wx/osx/private.h"
30
31 // helper class for HIAboutBox options
32 class AboutBoxOptions : public wxCFRef<CFMutableDictionaryRef>
33 {
34 public:
35 AboutBoxOptions() : wxCFRef<CFMutableDictionaryRef>
36 (
37 CFDictionaryCreateMutable
38 (
39 kCFAllocatorDefault,
40 4, // there are at most 4 values
41 &kCFTypeDictionaryKeyCallBacks,
42 &kCFTypeDictionaryValueCallBacks
43 )
44 )
45 {
46 }
47
48 void Set(CFStringRef key, const wxString& value)
49 {
50 CFDictionarySetValue(*this, key, wxCFStringRef(value));
51 }
52 };
53
54 // ============================================================================
55 // implementation
56 // ============================================================================
57
58 void wxAboutBox(const wxAboutDialogInfo& info, wxWindow *parent)
59 {
60 // Mac native about box currently can show only name, version, copyright
61 // and description fields and we also shoehorn the credits text into the
62 // description but if we have anything else we must use the generic version
63
64 if ( info.IsSimple() )
65 {
66 AboutBoxOptions opts;
67
68 opts.Set(kHIAboutBoxNameKey, info.GetName());
69
70 if ( info.HasVersion() )
71 opts.Set(kHIAboutBoxVersionKey,info.GetLongVersion());
72
73 if ( info.HasCopyright() )
74 opts.Set(kHIAboutBoxCopyrightKey, info.GetCopyrightToDisplay());
75
76 opts.Set(kHIAboutBoxDescriptionKey, info.GetDescriptionAndCredits());
77
78 HIAboutBox(opts);
79 }
80 else // simple "native" version is not enough
81 {
82 // we need to use the full-blown generic version
83 wxGenericAboutBox(info, parent);
84 }
85 }
86
87 #endif // wxUSE_ABOUTDLG