Version: 3.3.0

#include <wx/aboutdlg.h>

Detailed Description

wxAboutDialogInfo contains information shown in the standard About dialog displayed by the wxAboutBox() function.

This class contains the general information about the program, such as its name, version, copyright and so on, as well as lists of the program developers, documentation writers, artists and translators. The simple properties from the former group are represented as a string with the exception of the program icon and the program web site, while the lists from the latter group are stored as wxArrayString and can be either set entirely at once using wxAboutDialogInfo::SetDevelopers and similar functions or built one by one using wxAboutDialogInfo::AddDeveloper etc.

Please also notice that while all the main platforms have the native implementation of the about dialog, they are often more limited than the generic version provided by wxWidgets and so the generic version is used if wxAboutDialogInfo has any fields not supported by the native version. Currently GTK+ version supports all the possible fields natively but MSW and Mac versions don't support URLs, licence text nor custom icons in the about dialog and if either of those is used, wxAboutBox() will automatically use the generic version so you should avoid specifying these fields to achieve more native look and feel.

Example of usage:

void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxAboutDialogInfo aboutInfo;
aboutInfo.SetName("MyApp");
aboutInfo.SetVersion(MY_APP_VERSION_STRING);
aboutInfo.SetDescription(_("My wxWidgets-based application!"));
aboutInfo.SetCopyright("(C) 1992-2024");
aboutInfo.SetWebSite("http://myapp.org");
aboutInfo.AddDeveloper("My Self");
wxAboutBox(aboutInfo);
}
wxAboutDialogInfo contains information shown in the standard About dialog displayed by the wxAboutBox...
Definition: aboutdlg.h:61
void SetCopyright(const wxString &copyright)
Set the short string containing the program copyright information.
void AddDeveloper(const wxString &developer)
Adds a developer name to be shown in the program credits.
void SetDescription(const wxString &desc)
Set brief, but possibly multiline, description of the program.
void SetName(const wxString &name)
Set the name of the program.
void SetVersion(const wxString &version, const wxString &longVersion=wxString())
Set the version of the program.
void SetWebSite(const wxString &url, const wxString &desc=wxEmptyString)
Set the web site for the program and its description (which defaults to url itself if empty).
This event class contains information about command events, which originate from a variety of simple ...
Definition: event.h:2031
void wxAboutBox(const wxAboutDialogInfo &info, wxWindow *parent=nullptr)
This function shows the standard about dialog containing the information specified in info.
const wxString & _(const wxString &string)
Macro to be used around all literal strings that should be translated.

Example of appearance of a simple about dialog:

Appearance:

wxMSW Appearance

wxGTK Appearance

wxOSX Appearance

And that of a dialog using a web site link, which results in using the generic version under MSW and Mac:

Appearance:

wxMSW Appearance

wxGTK Appearance

wxOSX Appearance

Library:  wxCore
Category:  Common Dialogs, Data Structures
See also
wxAboutDialogInfo::SetArtists

Public Member Functions

 wxAboutDialogInfo ()
 Default constructor leaves all fields are initially uninitialized, in general you should call at least SetVersion(), SetCopyright() and SetDescription(). More...
 
void AddArtist (const wxString &artist)
 Adds an artist name to be shown in the program credits. More...
 
void AddDeveloper (const wxString &developer)
 Adds a developer name to be shown in the program credits. More...
 
void AddDocWriter (const wxString &docwriter)
 Adds a documentation writer name to be shown in the program credits. More...
 
void AddTranslator (const wxString &translator)
 Adds a translator name to be shown in the program credits. More...
 
wxString GetName () const
 Get the name of the program. More...
 
bool HasDescription () const
 Returns true if a description string has been specified. More...
 
const wxStringGetDescription ()
 Get the description string. More...
 
bool HasCopyright () const
 Returns true if a copyright string has been specified. More...
 
const wxStringGetCopyright () const
 Get the copyright string. More...
 
void SetArtists (const wxArrayString &artists)
 Sets the list of artists to be shown in the program credits. More...
 
void SetCopyright (const wxString &copyright)
 Set the short string containing the program copyright information. More...
 
void SetDescription (const wxString &desc)
 Set brief, but possibly multiline, description of the program. More...
 
void SetDevelopers (const wxArrayString &developers)
 Set the list of developers of the program. More...
 
void SetDocWriters (const wxArrayString &docwriters)
 Set the list of documentation writers. More...
 
bool HasIcon () const
 Returns true if an icon has been set for the about dialog. More...
 
wxIcon GetIcon () const
 Returns the icon set by SetIcon(). More...
 
void SetIcon (const wxIcon &icon)
 Set the icon to be shown in the dialog. More...
 
bool HasLicence () const
 Returns true if the licence string has been set. More...
 
const wxStringGetLicence () const
 Returns the licence string. More...
 
void SetLicence (const wxString &licence)
 Set the long, multiline string containing the text of the program licence. More...
 
void SetLicense (const wxString &licence)
 This is the same as SetLicence(). More...
 
void SetName (const wxString &name)
 Set the name of the program. More...
 
void SetTranslators (const wxArrayString &translators)
 Set the list of translators. More...
 
void SetVersion (const wxString &version, const wxString &longVersion=wxString())
 Set the version of the program. More...
 
const wxStringGetVersion () const
 Return the short version string. More...
 
const wxStringGetLongVersion () const
 Return the long version string if set. More...
 
bool HasWebSite () const
 Returns true if the website info has been set. More...
 
const wxStringGetWebSiteURL () const
 Returns the website URL set for the dialog. More...
 
const wxStringGetWebSiteDescription () const
 Returns the description of the website URL set for the dialog. More...
 
void SetWebSite (const wxString &url, const wxString &desc=wxEmptyString)
 Set the web site for the program and its description (which defaults to url itself if empty). More...
 
bool HasDevelopers () const
 Returns true if developers have been set in the dialog info. More...
 
const wxArrayStringGetDevelopers () const
 Returns an array of the developer strings set in the dialog info. More...
 
bool HasDocWriters () const
 Returns true if writers have been set in the dialog info. More...
 
const wxArrayStringGetDocWriters () const
 Returns an array of the writer strings set in the dialog info. More...
 
bool HasArtists () const
 Returns true if artists have been set in the dialog info. More...
 
const wxArrayStringGetArtists () const
 Returns an array of the artist strings set in the dialog info. More...
 
bool HasTranslators () const
 Returns true if translators have been set in the dialog info. More...
 
const wxArrayStringGetTranslators () const
 Returns an array of the translator strings set in the dialog info. More...
 

Constructor & Destructor Documentation

◆ wxAboutDialogInfo()

wxAboutDialogInfo::wxAboutDialogInfo ( )

Default constructor leaves all fields are initially uninitialized, in general you should call at least SetVersion(), SetCopyright() and SetDescription().

Member Function Documentation

◆ AddArtist()

void wxAboutDialogInfo::AddArtist ( const wxString artist)

Adds an artist name to be shown in the program credits.

See also
SetArtists()

◆ AddDeveloper()

void wxAboutDialogInfo::AddDeveloper ( const wxString developer)

Adds a developer name to be shown in the program credits.

See also
SetDevelopers()

◆ AddDocWriter()

void wxAboutDialogInfo::AddDocWriter ( const wxString docwriter)

Adds a documentation writer name to be shown in the program credits.

See also
SetDocWriters()

◆ AddTranslator()

void wxAboutDialogInfo::AddTranslator ( const wxString translator)

Adds a translator name to be shown in the program credits.

Notice that if no translator names are specified explicitly, wxAboutBox() will try to use the translation of the string translator-credits from the currently used message catalog – this can be used to show just the name of the translator of the program in the current language.

See also
SetTranslators()

◆ GetArtists()

const wxArrayString& wxAboutDialogInfo::GetArtists ( ) const

Returns an array of the artist strings set in the dialog info.

◆ GetCopyright()

const wxString& wxAboutDialogInfo::GetCopyright ( ) const

Get the copyright string.

Returns
The copyright string

◆ GetDescription()

const wxString& wxAboutDialogInfo::GetDescription ( )

Get the description string.

Returns
The description string, free-form.

◆ GetDevelopers()

const wxArrayString& wxAboutDialogInfo::GetDevelopers ( ) const

Returns an array of the developer strings set in the dialog info.

◆ GetDocWriters()

const wxArrayString& wxAboutDialogInfo::GetDocWriters ( ) const

Returns an array of the writer strings set in the dialog info.

◆ GetIcon()

wxIcon wxAboutDialogInfo::GetIcon ( ) const

Returns the icon set by SetIcon().

◆ GetLicence()

const wxString& wxAboutDialogInfo::GetLicence ( ) const

Returns the licence string.

See also
SetLicence()

◆ GetLongVersion()

const wxString& wxAboutDialogInfo::GetLongVersion ( ) const

Return the long version string if set.

See also
SetVersion()

◆ GetName()

wxString wxAboutDialogInfo::GetName ( ) const

Get the name of the program.

Returns
Name of the program
See also
SetName()

◆ GetTranslators()

const wxArrayString& wxAboutDialogInfo::GetTranslators ( ) const

Returns an array of the translator strings set in the dialog info.

◆ GetVersion()

const wxString& wxAboutDialogInfo::GetVersion ( ) const

Return the short version string.

See also
SetVersion()

◆ GetWebSiteDescription()

const wxString& wxAboutDialogInfo::GetWebSiteDescription ( ) const

Returns the description of the website URL set for the dialog.

◆ GetWebSiteURL()

const wxString& wxAboutDialogInfo::GetWebSiteURL ( ) const

Returns the website URL set for the dialog.

◆ HasArtists()

bool wxAboutDialogInfo::HasArtists ( ) const

Returns true if artists have been set in the dialog info.

◆ HasCopyright()

bool wxAboutDialogInfo::HasCopyright ( ) const

Returns true if a copyright string has been specified.

See also
GetCopyright()

◆ HasDescription()

bool wxAboutDialogInfo::HasDescription ( ) const

Returns true if a description string has been specified.

See also
GetDescription()

◆ HasDevelopers()

bool wxAboutDialogInfo::HasDevelopers ( ) const

Returns true if developers have been set in the dialog info.

◆ HasDocWriters()

bool wxAboutDialogInfo::HasDocWriters ( ) const

Returns true if writers have been set in the dialog info.

◆ HasIcon()

bool wxAboutDialogInfo::HasIcon ( ) const

Returns true if an icon has been set for the about dialog.

◆ HasLicence()

bool wxAboutDialogInfo::HasLicence ( ) const

Returns true if the licence string has been set.

◆ HasTranslators()

bool wxAboutDialogInfo::HasTranslators ( ) const

Returns true if translators have been set in the dialog info.

◆ HasWebSite()

bool wxAboutDialogInfo::HasWebSite ( ) const

Returns true if the website info has been set.

◆ SetArtists()

void wxAboutDialogInfo::SetArtists ( const wxArrayString artists)

Sets the list of artists to be shown in the program credits.

See also
AddArtist()

◆ SetCopyright()

void wxAboutDialogInfo::SetCopyright ( const wxString copyright)

Set the short string containing the program copyright information.

Notice that any occurrences of "(C)" in 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.

◆ SetDescription()

void wxAboutDialogInfo::SetDescription ( const wxString desc)

Set brief, but possibly multiline, description of the program.

◆ SetDevelopers()

void wxAboutDialogInfo::SetDevelopers ( const wxArrayString developers)

Set the list of developers of the program.

See also
AddDeveloper()

◆ SetDocWriters()

void wxAboutDialogInfo::SetDocWriters ( const wxArrayString docwriters)

Set the list of documentation writers.

See also
AddDocWriter()

◆ SetIcon()

void wxAboutDialogInfo::SetIcon ( const wxIcon icon)

Set the icon to be shown in the dialog.

By default the icon of the main frame will be shown if the native about dialog supports custom icons. If it doesn't but a valid icon is specified using this method, the generic about dialog is used instead so you should avoid calling this function for maximally native look and feel.

◆ SetLicence()

void wxAboutDialogInfo::SetLicence ( const wxString licence)

Set the long, multiline string containing the text of the program licence.

Only GTK+ version supports showing the licence text in the native about dialog currently so the generic version will be used under all the other platforms if this method is called. To preserve the native look and feel it is advised that you do not call this method but provide a separate menu item in the "Help" menu for displaying the text of your program licence.

◆ SetLicense()

void wxAboutDialogInfo::SetLicense ( const wxString licence)

This is the same as SetLicence().

◆ SetName()

void wxAboutDialogInfo::SetName ( const wxString name)

Set the name of the program.

If this method is not called, the string returned by wxApp::GetAppName will be shown in the dialog.

◆ SetTranslators()

void wxAboutDialogInfo::SetTranslators ( const wxArrayString translators)

Set the list of translators.

Please see AddTranslator() for additional discussion.

◆ SetVersion()

void wxAboutDialogInfo::SetVersion ( const wxString version,
const wxString longVersion = wxString() 
)

Set the version of the program.

The word "version" shouldn't be included in version. Example version values: "1.2" and "RC2". In about dialogs with more space set aside for version information, longVersion is used. Example longVersion values: "Version 1.2" and "Release Candidate 2". If version is non-empty but longVersion is empty, a long version is constructed automatically, using version (by simply prepending "Version " to version).

The generic about dialog and native GTK+ dialog use version only, as a suffix to the program name. The native MSW and macOS about dialogs use the long version.

◆ SetWebSite()

void wxAboutDialogInfo::SetWebSite ( const wxString url,
const wxString desc = wxEmptyString 
)

Set the web site for the program and its description (which defaults to url itself if empty).

Please notice that only GTK+ version currently supports showing the link in the native about dialog so if this method is called, the generic version will be used under all the other platforms.