translate (c) and (C) to \u00a9 in wxAboutDialog [backport of r57245, r57514 and r57840 from trunk] (closes #4216)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@58748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-02-08 09:46:03 +00:00
parent 36523e69b4
commit a8e888b0c0
5 changed files with 32 additions and 3 deletions

View File

@@ -131,6 +131,7 @@ All (GUI):
- Added wxAUI_MGR_LIVE_RESIZE flag to wxAuiManager and made it the default on
wxMac with CoreGraphics where sash drawing isn't implemented.
- Use bitmap mask in wxSplashScreen.
- Translate "(c)" and "(C)" to the real copyright sign in wxAboutBox.
All (Unix):

View File

@@ -128,6 +128,12 @@ public:
// artists and translators) as a one long multiline string
wxString GetDescriptionAndCredits() const;
#if wxABI_VERSION >= 20810
// returns the copyright with the (C) string substituted by the Unicode
// character U+00A9
wxString GetCopyrightToDisplay() const;
#endif // wx 2.8.10+
private:
wxString m_name,
m_version,

View File

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

View File

@@ -50,6 +50,13 @@ public:
class GtkArray
{
public:
// Create empty GtkArray
GtkArray() : m_strings(0), m_count(0)
{
}
// Create GtkArray from wxArrayString. Note that the created object is
// only valid as long as 'a' is!
GtkArray(const wxArrayString& a)
{
m_count = a.size();
@@ -105,7 +112,9 @@ void wxAboutBox(const wxAboutDialogInfo& info)
if ( info.HasVersion() )
gtk_about_dialog_set_version(dlg, GtkStr(info.GetVersion()));
if ( info.HasCopyright() )
gtk_about_dialog_set_copyright(dlg, GtkStr(info.GetCopyright()));
gtk_about_dialog_set_copyright(dlg, GtkStr(info.GetCopyrightToDisplay()));
else
gtk_about_dialog_set_copyright(dlg, NULL);
if ( info.HasDescription() )
gtk_about_dialog_set_comments(dlg, GtkStr(info.GetDescription()));
if ( info.HasLicence() )

View File

@@ -53,7 +53,7 @@ void wxAboutBox(const wxAboutDialogInfo& info)
msg << _T('\n');
if ( info.HasCopyright() )
msg << info.GetCopyright() << _T('\n');
msg << info.GetCopyrightToDisplay() << _T('\n');
// add everything remaining
msg << info.GetDescriptionAndCredits();