X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ca7adbf8bc5df4932deebb653060dc220ff4c06e..7344108e8a129a3f9b4df5ab0f98a1713db03b89:/include/wx/aboutdlg.h diff --git a/include/wx/aboutdlg.h b/include/wx/aboutdlg.h index 2f7419e42b..edcf6fd105 100644 --- a/include/wx/aboutdlg.h +++ b/include/wx/aboutdlg.h @@ -22,7 +22,7 @@ // wxAboutDialogInfo: information shown by the standard "About" dialog // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_CORE wxAboutDialogInfo +class WXDLLIMPEXP_ADV wxAboutDialogInfo { public: // all fields are initially uninitialized @@ -31,36 +31,46 @@ public: // accessors for various simply fields // ----------------------------------- - // name of the program, if not used defaults wxApp::GetAppName() + // name of the program, if not used defaults to wxApp::GetAppDisplayName() void SetName(const wxString& name) { m_name = name; } wxString GetName() const - { return m_name.empty() ? wxTheApp->GetAppName() : m_name; } + { return m_name.empty() ? wxTheApp->GetAppDisplayName() : m_name; } + + // version should contain program version without "version" word (e.g., + // "1.2" or "RC2") while longVersion may contain the full version including + // "version" word (e.g., "Version 1.2" or "Release Candidate 2") + // + // if longVersion is empty, it is automatically constructed from version + // + // generic and gtk native: use short version only, as a suffix to the + // program name msw and osx native: use long version + void SetVersion(const wxString& version, + const wxString& longVersion = wxString()); - // version of the program, in free format (but without "version" word) - void SetVersion(const wxString& version) { m_version = version; } bool HasVersion() const { return !m_version.empty(); } - wxString GetVersion() const { return m_version; } + const wxString& GetVersion() const { return m_version; } + const wxString& GetLongVersion() const { return m_longVersion; } // brief, but possibly multiline, description of the program void SetDescription(const wxString& desc) { m_description = desc; } bool HasDescription() const { return !m_description.empty(); } - wxString GetDescription() const { return m_description; } + const wxString& GetDescription() const { return m_description; } // short string containing the program copyright information void SetCopyright(const wxString& copyright) { m_copyright = copyright; } bool HasCopyright() const { return !m_copyright.empty(); } - wxString GetCopyright() const { return m_copyright; } + const wxString& GetCopyright() const { return m_copyright; } // long, multiline string containing the text of the program licence void SetLicence(const wxString& licence) { m_licence = licence; } void SetLicense(const wxString& licence) { m_licence = licence; } bool HasLicence() const { return !m_licence.empty(); } - wxString GetLicence() const { return m_licence; } + const wxString& GetLicence() const { return m_licence; } // icon to be shown in the dialog, defaults to the main frame icon void SetIcon(const wxIcon& icon) { m_icon = icon; } - bool HasIcon() const { return m_icon.Ok(); } - wxIcon GetIcon() const { return m_icon; } + bool HasIcon() const { return m_icon.IsOk(); } + wxIcon GetIcon() const; // web site for the program and its description (defaults to URL itself if // empty) @@ -72,8 +82,8 @@ public: bool HasWebSite() const { return !m_url.empty(); } - wxString GetWebSiteURL() const { return m_url; } - wxString GetWebSiteDescription() const { return m_urlDesc; } + const wxString& GetWebSiteURL() const { return m_url; } + const wxString& GetWebSiteDescription() const { return m_urlDesc; } // accessors for the arrays // ------------------------ @@ -114,9 +124,28 @@ public: bool HasTranslators() const { return !m_translators.empty(); } const wxArrayString& GetTranslators() const { return m_translators; } + + // implementation only + // ------------------- + + // "simple" about dialog shows only textual information (with possibly + // default icon but without hyperlink nor any long texts such as the + // licence text) + bool IsSimple() const + { return !HasWebSite() && !HasIcon() && !HasLicence(); } + + // get the description and credits (i.e. all of developers, doc writers, + // 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, + m_longVersion, m_description, m_copyright, m_licence; @@ -133,7 +162,7 @@ private: }; // functions to show the about dialog box -WXDLLIMPEXP_CORE void wxAboutBox(const wxAboutDialogInfo& info); +WXDLLIMPEXP_ADV void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* parent = NULL); #endif // wxUSE_ABOUTDLG