2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: aboutdlg.h
|
2008-03-09 13:42:34 -04:00
|
|
|
// Purpose: interface of wxAboutDialogInfo
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxAboutDialogInfo
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
wxAboutDialogInfo contains information shown in the standard @e About
|
2008-03-10 11:19:31 -04:00
|
|
|
dialog displayed by the wxAboutBox() function.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
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
|
2008-03-08 09:43:31 -05:00
|
|
|
and the program web site, while the lists from the latter group are stored as
|
2008-03-09 13:42:34 -04:00
|
|
|
wxArrayString and can be either set entirely at once using
|
|
|
|
wxAboutDialogInfo::SetDevelopers and similar functions or built one by one using
|
|
|
|
wxAboutDialogInfo::AddDeveloper etc.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
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
|
2008-03-10 11:19:31 -04:00
|
|
|
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.
|
2010-05-30 19:28:51 -04:00
|
|
|
|
|
|
|
Example of usage:
|
|
|
|
@code
|
|
|
|
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-2010");
|
|
|
|
aboutInfo.SetWebSite("http://myapp.org");
|
|
|
|
aboutInfo.AddDeveloper("My Self");
|
|
|
|
|
|
|
|
wxAboutBox(aboutInfo);
|
|
|
|
}
|
|
|
|
@endcode
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxadv}
|
2009-02-20 06:34:52 -05:00
|
|
|
@category{cmndlg,data}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:19:31 -04:00
|
|
|
@see wxAboutDialogInfo::SetArtists
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
class wxAboutDialogInfo
|
2008-03-08 08:52:38 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Default constructor leaves all fields are initially uninitialized, in general
|
2008-03-09 13:42:34 -04:00
|
|
|
you should call at least SetVersion(), SetCopyright() and SetDescription().
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxAboutDialogInfo();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Adds an artist name to be shown in the program credits.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetArtists()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void AddArtist(const wxString& artist);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Adds a developer name to be shown in the program credits.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetDevelopers()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void AddDeveloper(const wxString& developer);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Adds a documentation writer name to be shown in the program credits.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetDocWriters()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void AddDocWriter(const wxString& docwriter);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Adds a translator name to be shown in the program credits. Notice that if no
|
2011-03-22 10:08:30 -04:00
|
|
|
translator names are specified explicitly, wxAboutBox() will try to use the
|
2008-03-09 13:42:34 -04:00
|
|
|
translation of the string @c 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.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetTranslators()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void AddTranslator(const wxString& translator);
|
|
|
|
|
2010-11-24 19:53:30 -05:00
|
|
|
/**
|
|
|
|
Get the name of the program.
|
|
|
|
|
|
|
|
@return Name of the program
|
|
|
|
@see SetName()
|
|
|
|
*/
|
|
|
|
const wxString& GetName() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if a description string has been specified.
|
|
|
|
|
|
|
|
@see GetDescription()
|
|
|
|
*/
|
|
|
|
bool HasDescription() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Get the description string.
|
|
|
|
|
|
|
|
@return The description string, free-form.
|
|
|
|
*/
|
|
|
|
const wxString& GetDescription();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if a copyright string has been specified.
|
|
|
|
|
|
|
|
@see GetCopyright()
|
|
|
|
*/
|
|
|
|
bool HasCopyright() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Get the copyright string.
|
|
|
|
|
|
|
|
@return The copyright string
|
|
|
|
*/
|
|
|
|
const wxString& GetCopyright() const;
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2011-03-22 10:08:30 -04:00
|
|
|
Sets the list of artists to be shown in the program credits.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see AddArtist()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetArtists(const wxArrayString& artists);
|
|
|
|
|
|
|
|
/**
|
2008-03-09 08:33:59 -04:00
|
|
|
Set the short string containing the program copyright information. Notice that
|
|
|
|
any occurrences of @c "(C)" in @a copyright will be replaced by the
|
2008-03-08 08:52:38 -05:00
|
|
|
copyright symbol (circled C) automatically, which means that you can avoid
|
|
|
|
using this symbol in the program source code which can be problematic,
|
|
|
|
*/
|
|
|
|
void SetCopyright(const wxString& copyright);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set brief, but possibly multiline, description of the program.
|
|
|
|
*/
|
|
|
|
void SetDescription(const wxString& desc);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set the list of developers of the program.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see AddDeveloper()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetDevelopers(const wxArrayString& developers);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set the list of documentation writers.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see AddDocWriter()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetDocWriters(const wxArrayString& docwriters);
|
|
|
|
|
|
|
|
/**
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
void SetIcon(const wxIcon& icon);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set the long, multiline string containing the text of the program licence.
|
2008-03-09 13:42:34 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
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
|
2008-03-08 09:43:31 -05:00
|
|
|
you do not call this method but provide a separate menu item in the
|
2008-03-08 08:52:38 -05:00
|
|
|
@c "Help" menu for displaying the text of your program licence.
|
|
|
|
*/
|
|
|
|
void SetLicence(const wxString& licence);
|
|
|
|
|
|
|
|
/**
|
|
|
|
This is the same as SetLicence().
|
|
|
|
*/
|
|
|
|
void SetLicense(const wxString& licence);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set the name of the program. If this method is not called, the string returned
|
|
|
|
by wxApp::GetAppName will be shown in the dialog.
|
|
|
|
*/
|
|
|
|
void SetName(const wxString& name);
|
|
|
|
|
|
|
|
/**
|
2008-03-09 13:42:34 -04:00
|
|
|
Set the list of translators. Please see AddTranslator() for additional
|
2008-03-08 08:52:38 -05:00
|
|
|
discussion.
|
|
|
|
*/
|
|
|
|
void SetTranslators(const wxArrayString& translators);
|
|
|
|
|
|
|
|
/**
|
2009-07-25 18:53:23 -04:00
|
|
|
Set the version of the program. The word "version" shouldn't be included
|
|
|
|
in @a version. Example @a version values: "1.2" and "RC2". In about dialogs
|
|
|
|
with more space set aside for version information, @a longVersion is used.
|
|
|
|
Example @a longVersion values: "Version 1.2" and "Release Candidate 2".
|
|
|
|
If @a version is non-empty but @a longVersion is empty, a long version
|
|
|
|
is constructed automatically, using @a version (by simply prepending
|
|
|
|
"Version " to @a version).
|
|
|
|
|
|
|
|
The generic about dialog and native GTK+ dialog use @a version only,
|
|
|
|
as a suffix to the program name. The native MSW and OS X about dialogs
|
|
|
|
use the long version.
|
|
|
|
*/
|
|
|
|
void SetVersion(const wxString& version, const wxString& longVersion = wxString());
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-09 13:42:34 -04:00
|
|
|
Set the web site for the program and its description (which defaults to @a url
|
2008-03-08 08:52:38 -05:00
|
|
|
itself if empty).
|
2008-03-09 13:42:34 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
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.
|
|
|
|
*/
|
|
|
|
void SetWebSite(const wxString& url,
|
|
|
|
const wxString& desc = wxEmptyString);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Global functions/macros
|
|
|
|
// ============================================================================
|
|
|
|
|
2009-01-05 15:48:06 -05:00
|
|
|
/** @addtogroup group_funcmacro_dialog */
|
2008-03-14 11:35:10 -04:00
|
|
|
//@{
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
This function shows the standard about dialog containing the information
|
2008-03-09 13:42:34 -04:00
|
|
|
specified in @a info. If the current platform has a native about dialog
|
|
|
|
which is capable of showing all the fields in @a info, the native dialog is
|
|
|
|
used, otherwise the function falls back to the generic wxWidgets version of
|
|
|
|
the dialog, i.e. does the same thing as wxGenericAboutBox.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
Here is an example of how this function may be used:
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@code
|
|
|
|
void MyFrame::ShowSimpleAboutDialog(wxCommandEvent& WXUNUSED(event))
|
|
|
|
{
|
|
|
|
wxAboutDialogInfo info;
|
|
|
|
info.SetName(_("My Program"));
|
|
|
|
info.SetVersion(_("1.2.3 Beta"));
|
|
|
|
info.SetDescription(_("This program does something great."));
|
2009-07-23 16:30:22 -04:00
|
|
|
info.SetCopyright(wxT("(C) 2007 Me <my@email.addre.ss>"));
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
wxAboutBox(info);
|
|
|
|
}
|
|
|
|
@endcode
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-24 14:17:11 -04:00
|
|
|
Please see the @ref page_samples_dialogs for more examples of using this
|
|
|
|
function and wxAboutDialogInfo for the description of the information which
|
|
|
|
can be shown in the about dialog.
|
2008-03-18 15:30:01 -04:00
|
|
|
|
|
|
|
@header{wx/aboutdlg.h}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2009-04-26 09:41:21 -04:00
|
|
|
void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-10 11:19:31 -04:00
|
|
|
This function does the same thing as wxAboutBox() except that it always uses
|
2008-03-09 13:42:34 -04:00
|
|
|
the generic wxWidgets version of the dialog instead of the native one.
|
|
|
|
|
|
|
|
This is mainly useful if you need to customize the dialog by e.g. adding
|
|
|
|
custom controls to it (customizing the native dialog is not currently
|
2008-03-08 08:52:38 -05:00
|
|
|
supported).
|
2008-03-09 13:42:34 -04:00
|
|
|
|
2008-03-24 14:17:11 -04:00
|
|
|
See the @ref page_samples_dialogs for an example of about dialog
|
2008-03-09 08:33:59 -04:00
|
|
|
customization.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see wxAboutDialogInfo
|
2008-03-18 15:30:01 -04:00
|
|
|
|
|
|
|
@header{wx/aboutdlg.h}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2009-04-26 09:41:21 -04:00
|
|
|
void wxGenericAboutBox(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-03-14 11:35:10 -04:00
|
|
|
//@}
|