]> git.saurik.com Git - wxWidgets.git/commitdiff
substitute (c) and (C) for copyright strings as documented
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Thu, 11 Dec 2008 12:14:14 +0000 (12:14 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Thu, 11 Dec 2008 12:14:14 +0000 (12:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/aboutdlg.h
src/generic/aboutdlgg.cpp
src/gtk/aboutdlg.cpp
src/osx/carbon/aboutdlg.cpp
src/osx/cocoa/aboutdlg.mm

index 9c8946d193c1d54d5b944394ab970ef2cf1d2961..44e86b06f6d120bd1b9fc457750f649556fc324b 100644 (file)
@@ -128,6 +128,10 @@ public:
     // artists and translators) as a one long multiline string
     wxString GetDescriptionAndCredits() const;
 
+    // returns the copyright with the (C) string substituted by the Unicode
+    // character U+00A9
+    wxString GetCopyrightToDisplay() const;
+
 private:
     wxString m_name,
              m_version,
index 09122a1c16f4743246797bac0d40e28ee0c4f35f..b7a9fcf9775109ada00a0f8dafc8a66b2706f718 100644 (file)
@@ -96,6 +96,16 @@ wxIcon wxAboutDialogInfo::GetIcon() const
     return icon;
 }
 
+wxString wxAboutDialogInfo::GetCopyrightToDisplay() const
+{
+    wxString ret = m_copyright;
+
+    ret.Replace("(c)", "\u00A9");
+    ret.Replace("(C)", "\u00A9");
+
+    return ret;
+}
+
 // ----------------------------------------------------------------------------
 // wxGenericAboutDialog
 // ----------------------------------------------------------------------------
@@ -120,7 +130,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() )
index 6e06f39b68b27e36328a80b4d6dddacfc4c4b851..7be26532d951b473a5097d8b79f06de9cbc90424 100644 (file)
@@ -44,7 +44,7 @@ public:
     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)
@@ -124,7 +124,7 @@ void wxAboutBox(const wxAboutDialogInfo& info)
         else
             gtk_about_dialog_set_version(dlg, NULL);
         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
             gtk_about_dialog_set_copyright(dlg, NULL);
         if ( info.HasDescription() )
index 061a42b2a5ce9425f5e4ef47b0f93edc826896b0..9188a221c71aab70d60e18aecc88922969683086 100644 (file)
@@ -75,7 +75,7 @@ void wxAboutBox(const wxAboutDialogInfo& info)
         }
 
         if ( info.HasCopyright() )
-            opts.Set(kHIAboutBoxCopyrightKey, info.GetCopyright());
+            opts.Set(kHIAboutBoxCopyrightKey, info.GetCopyrightToDisplay());
 
         opts.Set(kHIAboutBoxDescriptionKey, info.GetDescriptionAndCredits());
 
index 553094bf1807e083456cf31e32b5d8764410626b..9c702e9d551f8a8cef333637f052b23fb7d9e424 100644 (file)
@@ -62,7 +62,7 @@ public:
 
     void SetAttributedString( CFStringRef key, const wxString& value )
     {
-          wxCFRef<CFAttributedStringRef> attrString( 
+          wxCFRef<CFAttributedStringRef> attrString(
             CFAttributedStringCreate(kCFAllocatorDefault, wxCFStringRef(value), NULL) );
         CFDictionarySetValue(*this, key, attrString);
     }
@@ -92,7 +92,7 @@ void wxAboutBox(const wxAboutDialogInfo& info)
         }
 
         if ( info.HasCopyright() )
-            opts.Set(CFSTR("Copyright"), info.GetCopyright());
+            opts.Set(CFSTR("Copyright"), info.GetCopyrightToDisplay());
 
         opts.SetAttributedString(CFSTR("Credits"), info.GetDescriptionAndCredits());