X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb8dcb05283b9ccfd130eeb0bdae24b6615d5ce8..8a31648287be0ef976f133de2786b137f1e98340:/src/osx/cocoa/aboutdlg.mm diff --git a/src/osx/cocoa/aboutdlg.mm b/src/osx/cocoa/aboutdlg.mm index 553094bf18..e7cb94b3f1 100644 --- a/src/osx/cocoa/aboutdlg.mm +++ b/src/osx/cocoa/aboutdlg.mm @@ -1,9 +1,9 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: osx/cocoa/aboutdlg.cpp +// Name: src/osx/cocoa/aboutdlg.mm // Purpose: native wxAboutBox() implementation for wxMac // Author: Vadim Zeitlin // Created: 2006-10-08 -// RCS-ID: $Id: aboutdlg.cpp 54820 2008-07-29 20:04:11Z SC $ +// RCS-ID: $Id$ // Copyright: (c) 2006 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -29,14 +29,8 @@ #include "wx/osx/private.h" -/* -@"Credits": An NSAttributedString displayed in the info area of the panel. If not specified, this method then looks for a file named “Credits.html”, “Credits.rtf”, and “Credits.rtfd”, in that order, in the bundle returned by the NSBundle class method mainBundle. The first file found is used. If none is found, the info area is left blank. -@"ApplicationName": An NSString object displayed as the application’s name. If not specified, this method then uses the value of CFBundleName (localizable). If neither is found, this method uses [[NSProcessInfo processInfo] processName]. -@"ApplicationIcon": An NSImage object displayed as the application’s icon. If not specified, this method then looks for an image named “NSApplicationIcon”, using [NSImage imageNamed:@"NSApplicationIcon"]. If neither is available, this method uses the generic application icon. -@"Version": An NSString object with the build version number of the application (“58.4”), displayed as “(v58.4)”. If not specified, obtain from the CFBundleVersion key in infoDictionary; if not specified, leave blank (the “(v)” is not displayed). -@"Copyright": An NSString object with a line of copyright information. If not specified, this method then looks for the value of NSHumanReadableCopyright in the localized version infoDictionary. If neither is available, this method leaves the space blank. -@"ApplicationVersion": An NSString object with the application version (“Mac OS X”, “3”, “WebObjects 4.5”, “AppleWorks 6”,...). If not specified, obtain from the CFBundleShortVersionString key in infoDictionary. If neither is available, the build version, if available, is printed alone, as “Version x.x”. -*/ +// see http://developer.apple.com/mac/library/technotes/tn2006/tn2179.html for +// information about the various keys used here // helper class for HIAboutBox options class AboutBoxOptions : public wxCFRef @@ -62,7 +56,7 @@ public: void SetAttributedString( CFStringRef key, const wxString& value ) { - wxCFRef attrString( + wxCFRef attrString( CFAttributedStringCreate(kCFAllocatorDefault, wxCFStringRef(value), NULL) ); CFDictionarySetValue(*this, key, attrString); } @@ -72,7 +66,7 @@ public: // implementation // ============================================================================ -void wxAboutBox(const wxAboutDialogInfo& info) +void wxAboutBox(const wxAboutDialogInfo& info, wxWindow *parent) { // Mac native about box currently can show only name, version, copyright // and description fields and we also shoehorn the credits text into the @@ -87,12 +81,11 @@ void wxAboutBox(const wxAboutDialogInfo& info) if ( info.HasVersion() ) { opts.Set(CFSTR("Version"),info.GetVersion()); - opts.Set(CFSTR("ApplicationVersion"), - wxString::Format(_("Version %s"), info.GetVersion())); + opts.Set(CFSTR("ApplicationVersion"),info.GetLongVersion()); } if ( info.HasCopyright() ) - opts.Set(CFSTR("Copyright"), info.GetCopyright()); + opts.Set(CFSTR("Copyright"), info.GetCopyrightToDisplay()); opts.SetAttributedString(CFSTR("Credits"), info.GetDescriptionAndCredits()); @@ -101,7 +94,7 @@ void wxAboutBox(const wxAboutDialogInfo& info) else // simple "native" version is not enough { // we need to use the full-blown generic version - wxGenericAboutBox(info); + wxGenericAboutBox(info, parent); } }