2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: aboutdlg.h
|
2008-03-09 17:42:34 +00:00
|
|
|
// Purpose: interface of wxAboutDialogInfo
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxAboutDialogInfo
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
wxAboutDialogInfo contains information shown in the standard @e About
|
2008-03-10 15:19:31 +00:00
|
|
|
dialog displayed by the wxAboutBox() function.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00: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 14:43:31 +00:00
|
|
|
and the program web site, while the lists from the latter group are stored as
|
2008-03-09 17:42:34 +00: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 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00: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 15:19:31 +00: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.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxadv}
|
2009-02-20 11:34:52 +00:00
|
|
|
@category{cmndlg,data}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-10 15:19:31 +00:00
|
|
|
@see wxAboutDialogInfo::SetArtists
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-08 14:43:31 +00:00
|
|
|
class wxAboutDialogInfo
|
2008-03-08 13:52:38 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Default constructor leaves all fields are initially uninitialized, in general
|
2008-03-09 17:42:34 +00:00
|
|
|
you should call at least SetVersion(), SetCopyright() and SetDescription().
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
wxAboutDialogInfo();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Adds an artist name to be shown in the program credits.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see SetArtists()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void AddArtist(const wxString& artist);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Adds a developer name to be shown in the program credits.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see SetDevelopers()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void AddDeveloper(const wxString& developer);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Adds a documentation writer name to be shown in the program credits.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see SetDocWriters()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void AddDocWriter(const wxString& docwriter);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Adds a translator name to be shown in the program credits. Notice that if no
|
2008-03-10 15:19:31 +00:00
|
|
|
translator names are specified explicitely, wxAboutBox() will try to use the
|
2008-03-09 17:42:34 +00: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 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see SetTranslators()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void AddTranslator(const wxString& translator);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the the list of artists to be shown in the program credits.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see AddArtist()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetArtists(const wxArrayString& artists);
|
|
|
|
|
|
|
|
/**
|
2008-03-09 12:33:59 +00: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 13:52:38 +00: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 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see AddDeveloper()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetDevelopers(const wxArrayString& developers);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set the list of documentation writers.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see AddDocWriter()
|
2008-03-08 13:52:38 +00: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 17:42:34 +00:00
|
|
|
|
2008-03-08 13:52:38 +00: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 14:43:31 +00:00
|
|
|
you do not call this method but provide a separate menu item in the
|
2008-03-08 13:52:38 +00: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 17:42:34 +00:00
|
|
|
Set the list of translators. Please see AddTranslator() for additional
|
2008-03-08 13:52:38 +00:00
|
|
|
discussion.
|
|
|
|
*/
|
|
|
|
void SetTranslators(const wxArrayString& translators);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set the version of the program. The version is in free format, i.e. not
|
2008-03-09 17:42:34 +00:00
|
|
|
necessarily in the @c x.y.z form but it shouldn't contain the "version" word.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetVersion(const wxString& version);
|
|
|
|
|
|
|
|
/**
|
2008-03-09 17:42:34 +00:00
|
|
|
Set the web site for the program and its description (which defaults to @a url
|
2008-03-08 13:52:38 +00:00
|
|
|
itself if empty).
|
2008-03-09 17:42:34 +00:00
|
|
|
|
2008-03-08 13:52:38 +00: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 20:48:06 +00:00
|
|
|
/** @addtogroup group_funcmacro_dialog */
|
2008-03-14 15:35:10 +00:00
|
|
|
//@{
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
This function shows the standard about dialog containing the information
|
2008-03-09 17:42:34 +00: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 13:52:38 +00:00
|
|
|
Here is an example of how this function may be used:
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00: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."));
|
2008-03-18 19:30:01 +00:00
|
|
|
info.SetCopyright(_T("(C) 2007 Me <my@email.addre.ss>"));
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
wxAboutBox(info);
|
|
|
|
}
|
|
|
|
@endcode
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-24 18:17:11 +00: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 19:30:01 +00:00
|
|
|
|
|
|
|
@header{wx/aboutdlg.h}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2009-04-26 13:41:21 +00:00
|
|
|
void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-03-10 15:19:31 +00:00
|
|
|
This function does the same thing as wxAboutBox() except that it always uses
|
2008-03-09 17:42:34 +00: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 13:52:38 +00:00
|
|
|
supported).
|
2008-03-09 17:42:34 +00:00
|
|
|
|
2008-03-24 18:17:11 +00:00
|
|
|
See the @ref page_samples_dialogs for an example of about dialog
|
2008-03-09 12:33:59 +00:00
|
|
|
customization.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see wxAboutDialogInfo
|
2008-03-18 19:30:01 +00:00
|
|
|
|
|
|
|
@header{wx/aboutdlg.h}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2009-04-26 13:41:21 +00:00
|
|
|
void wxGenericAboutBox(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
2008-03-14 15:35:10 +00:00
|
|
|
//@}
|