substitute (c) and (C) for copyright strings as documented

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2008-12-11 12:14:14 +00:00
parent da678e6c39
commit 953aebc2d5
5 changed files with 20 additions and 6 deletions

View File

@@ -128,6 +128,10 @@ public:
// artists and translators) as a one long multiline string // artists and translators) as a one long multiline string
wxString GetDescriptionAndCredits() const; wxString GetDescriptionAndCredits() const;
// returns the copyright with the (C) string substituted by the Unicode
// character U+00A9
wxString GetCopyrightToDisplay() const;
private: private:
wxString m_name, wxString m_name,
m_version, m_version,

View File

@@ -96,6 +96,16 @@ wxIcon wxAboutDialogInfo::GetIcon() const
return icon; return icon;
} }
wxString wxAboutDialogInfo::GetCopyrightToDisplay() const
{
wxString ret = m_copyright;
ret.Replace("(c)", "\u00A9");
ret.Replace("(C)", "\u00A9");
return ret;
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxGenericAboutDialog // wxGenericAboutDialog
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -120,7 +130,7 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info)
m_sizerText->Add(label, wxSizerFlags().Centre().Border()); m_sizerText->Add(label, wxSizerFlags().Centre().Border());
m_sizerText->AddSpacer(5); m_sizerText->AddSpacer(5);
AddText(info.GetCopyright()); AddText(info.GetCopyrightToDisplay());
AddText(info.GetDescription()); AddText(info.GetDescription());
if ( info.HasWebSite() ) if ( info.HasWebSite() )

View File

@@ -44,7 +44,7 @@ public:
GtkArray() : m_strings(0), m_count(0) GtkArray() : m_strings(0), m_count(0)
{ {
} }
// Create GtkArray from wxArrayString. Note that the created object is // Create GtkArray from wxArrayString. Note that the created object is
// only valid as long as 'a' is! // only valid as long as 'a' is!
GtkArray(const wxArrayString& a) GtkArray(const wxArrayString& a)
@@ -124,7 +124,7 @@ void wxAboutBox(const wxAboutDialogInfo& info)
else else
gtk_about_dialog_set_version(dlg, NULL); gtk_about_dialog_set_version(dlg, NULL);
if ( info.HasCopyright() ) if ( info.HasCopyright() )
gtk_about_dialog_set_copyright(dlg, wxGTK_CONV_SYS(info.GetCopyright())); gtk_about_dialog_set_copyright(dlg, wxGTK_CONV_SYS(info.GetCopyrightToDisplay()));
else else
gtk_about_dialog_set_copyright(dlg, NULL); gtk_about_dialog_set_copyright(dlg, NULL);
if ( info.HasDescription() ) if ( info.HasDescription() )

View File

@@ -75,7 +75,7 @@ void wxAboutBox(const wxAboutDialogInfo& info)
} }
if ( info.HasCopyright() ) if ( info.HasCopyright() )
opts.Set(kHIAboutBoxCopyrightKey, info.GetCopyright()); opts.Set(kHIAboutBoxCopyrightKey, info.GetCopyrightToDisplay());
opts.Set(kHIAboutBoxDescriptionKey, info.GetDescriptionAndCredits()); opts.Set(kHIAboutBoxDescriptionKey, info.GetDescriptionAndCredits());

View File

@@ -62,7 +62,7 @@ public:
void SetAttributedString( CFStringRef key, const wxString& value ) void SetAttributedString( CFStringRef key, const wxString& value )
{ {
wxCFRef<CFAttributedStringRef> attrString( wxCFRef<CFAttributedStringRef> attrString(
CFAttributedStringCreate(kCFAllocatorDefault, wxCFStringRef(value), NULL) ); CFAttributedStringCreate(kCFAllocatorDefault, wxCFStringRef(value), NULL) );
CFDictionarySetValue(*this, key, attrString); CFDictionarySetValue(*this, key, attrString);
} }
@@ -92,7 +92,7 @@ void wxAboutBox(const wxAboutDialogInfo& info)
} }
if ( info.HasCopyright() ) if ( info.HasCopyright() )
opts.Set(CFSTR("Copyright"), info.GetCopyright()); opts.Set(CFSTR("Copyright"), info.GetCopyrightToDisplay());
opts.SetAttributedString(CFSTR("Credits"), info.GetDescriptionAndCredits()); opts.SetAttributedString(CFSTR("Credits"), info.GetDescriptionAndCredits());