From 020aff8a7fda88a1f3bfa268b6b9dba2a6dda9dc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 23 Feb 2023 19:37:33 +0000 Subject: [PATCH] Don't use "Copyright" word in wxAboutDialog under MSW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MSW platform convention is to show just "© whatever" instead of "Copyright © whatever" in the "About" dialogs, so make it simpler to conform to it but still keeping using the word under the other platforms, where it usually is included, by removing the "Copyright" word under MSW only in wx code. --- interface/wx/aboutdlg.h | 4 ++++ samples/dialogs/dialogs.cpp | 2 +- src/generic/aboutdlgg.cpp | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/interface/wx/aboutdlg.h b/interface/wx/aboutdlg.h index 2751c1935c..04dec96403 100644 --- a/interface/wx/aboutdlg.h +++ b/interface/wx/aboutdlg.h @@ -146,6 +146,10 @@ public: any occurrences of @c "(C)" in @a copyright will be replaced by the copyright symbol (circled C) automatically, which means that you can avoid using this symbol in the program source code which can be problematic, + + Also note that under MSW platform the word "Copyright" itself will be + removed from the string if it is followed by the copyright symbol, to + follow the platform convention. */ void SetCopyright(const wxString& copyright); diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index d296f354c1..ca4a090e09 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -3407,7 +3407,7 @@ static void InitAboutInfoMinimal(wxAboutDialogInfo& info) wxVERSION_NUM_DOT_STRING )); info.SetDescription("This sample shows different wxWidgets dialogs."); - info.SetCopyright("(C) 1998-2023 wxWidgets dev team."); + info.SetCopyright("Copyright (C) 1998-2023 wxWidgets dev team."); } static void InitAboutInfoWebsite(wxAboutDialogInfo& info) diff --git a/src/generic/aboutdlgg.cpp b/src/generic/aboutdlgg.cpp index f97445e5ff..c25a708afa 100644 --- a/src/generic/aboutdlgg.cpp +++ b/src/generic/aboutdlgg.cpp @@ -102,6 +102,14 @@ wxString wxAboutDialogInfo::GetCopyrightToDisplay() const ret.Replace("(c)", copyrightSign); ret.Replace("(C)", copyrightSign); +#ifdef __WXMSW__ + // Under MSW the dialogs typically show only "(C)" and "Copyright (C)", but + // under other platforms dialogs do use the word "Copyright" too, so to + // make it simpler to do the right thing under all platforms, remove the + // extra word here. + ret.Replace("Copyright " + copyrightSign, copyrightSign); +#endif // __WXMSW__ + return ret; }