2006-10-07 21:02:04 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/aboutdlg.h
|
|
|
|
// Purpose: declaration of wxAboutDialog class
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Created: 2006-10-07
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_ABOUTDLG_H_
|
|
|
|
#define _WX_ABOUTDLG_H_
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
|
|
|
|
#if wxUSE_ABOUTDLG
|
|
|
|
|
|
|
|
#include "wx/app.h"
|
|
|
|
#include "wx/icon.h"
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxAboutDialogInfo: information shown by the standard "About" dialog
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2006-10-09 12:56:18 -04:00
|
|
|
class WXDLLIMPEXP_ADV wxAboutDialogInfo
|
2006-10-07 21:02:04 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// all fields are initially uninitialized
|
|
|
|
wxAboutDialogInfo() { }
|
|
|
|
|
|
|
|
// accessors for various simply fields
|
|
|
|
// -----------------------------------
|
|
|
|
|
2007-09-09 19:26:18 -04:00
|
|
|
// name of the program, if not used defaults to wxApp::GetAppDisplayName()
|
2006-10-07 21:02:04 -04:00
|
|
|
void SetName(const wxString& name) { m_name = name; }
|
|
|
|
wxString GetName() const
|
2007-09-09 19:26:18 -04:00
|
|
|
{ return m_name.empty() ? wxTheApp->GetAppDisplayName() : m_name; }
|
2006-10-07 21:02:04 -04:00
|
|
|
|
2009-07-25 18:53:23 -04:00
|
|
|
// 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());
|
|
|
|
|
2006-10-07 21:02:04 -04:00
|
|
|
bool HasVersion() const { return !m_version.empty(); }
|
2007-05-30 08:40:05 -04:00
|
|
|
const wxString& GetVersion() const { return m_version; }
|
2009-07-25 18:53:23 -04:00
|
|
|
const wxString& GetLongVersion() const { return m_longVersion; }
|
2006-10-07 21:02:04 -04:00
|
|
|
|
|
|
|
// brief, but possibly multiline, description of the program
|
|
|
|
void SetDescription(const wxString& desc) { m_description = desc; }
|
|
|
|
bool HasDescription() const { return !m_description.empty(); }
|
2007-05-30 08:40:05 -04:00
|
|
|
const wxString& GetDescription() const { return m_description; }
|
2006-10-07 21:02:04 -04:00
|
|
|
|
|
|
|
// short string containing the program copyright information
|
|
|
|
void SetCopyright(const wxString& copyright) { m_copyright = copyright; }
|
|
|
|
bool HasCopyright() const { return !m_copyright.empty(); }
|
2007-05-30 08:40:05 -04:00
|
|
|
const wxString& GetCopyright() const { return m_copyright; }
|
2006-10-07 21:02:04 -04:00
|
|
|
|
|
|
|
// 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(); }
|
2007-05-30 08:40:05 -04:00
|
|
|
const wxString& GetLicence() const { return m_licence; }
|
2006-10-07 21:02:04 -04:00
|
|
|
|
|
|
|
// 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(); }
|
2006-10-08 09:08:51 -04:00
|
|
|
wxIcon GetIcon() const;
|
2006-10-07 21:02:04 -04:00
|
|
|
|
|
|
|
// web site for the program and its description (defaults to URL itself if
|
|
|
|
// empty)
|
|
|
|
void SetWebSite(const wxString& url, const wxString& desc = wxEmptyString)
|
|
|
|
{
|
|
|
|
m_url = url;
|
|
|
|
m_urlDesc = desc.empty() ? url : desc;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool HasWebSite() const { return !m_url.empty(); }
|
|
|
|
|
2007-05-30 08:40:05 -04:00
|
|
|
const wxString& GetWebSiteURL() const { return m_url; }
|
|
|
|
const wxString& GetWebSiteDescription() const { return m_urlDesc; }
|
2006-10-07 21:02:04 -04:00
|
|
|
|
|
|
|
// accessors for the arrays
|
|
|
|
// ------------------------
|
|
|
|
|
|
|
|
// the list of developers of the program
|
|
|
|
void SetDevelopers(const wxArrayString& developers)
|
|
|
|
{ m_developers = developers; }
|
|
|
|
void AddDeveloper(const wxString& developer)
|
|
|
|
{ m_developers.push_back(developer); }
|
|
|
|
|
|
|
|
bool HasDevelopers() const { return !m_developers.empty(); }
|
|
|
|
const wxArrayString& GetDevelopers() const { return m_developers; }
|
|
|
|
|
|
|
|
// the list of documentation writers
|
|
|
|
void SetDocWriters(const wxArrayString& docwriters)
|
|
|
|
{ m_docwriters = docwriters; }
|
|
|
|
void AddDocWriter(const wxString& docwriter)
|
|
|
|
{ m_docwriters.push_back(docwriter); }
|
|
|
|
|
|
|
|
bool HasDocWriters() const { return !m_docwriters.empty(); }
|
|
|
|
const wxArrayString& GetDocWriters() const { return m_docwriters; }
|
|
|
|
|
|
|
|
// the list of artists for the program art
|
|
|
|
void SetArtists(const wxArrayString& artists)
|
|
|
|
{ m_artists = artists; }
|
|
|
|
void AddArtist(const wxString& artist)
|
|
|
|
{ m_artists.push_back(artist); }
|
|
|
|
|
|
|
|
bool HasArtists() const { return !m_artists.empty(); }
|
|
|
|
const wxArrayString& GetArtists() const { return m_artists; }
|
|
|
|
|
|
|
|
// the list of translators
|
|
|
|
void SetTranslators(const wxArrayString& translators)
|
|
|
|
{ m_translators = translators; }
|
|
|
|
void AddTranslator(const wxString& translator)
|
|
|
|
{ m_translators.push_back(translator); }
|
|
|
|
|
|
|
|
bool HasTranslators() const { return !m_translators.empty(); }
|
|
|
|
const wxArrayString& GetTranslators() const { return m_translators; }
|
|
|
|
|
2006-10-08 08:07:03 -04:00
|
|
|
|
|
|
|
// 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;
|
|
|
|
|
2008-12-11 07:14:14 -05:00
|
|
|
// returns the copyright with the (C) string substituted by the Unicode
|
|
|
|
// character U+00A9
|
|
|
|
wxString GetCopyrightToDisplay() const;
|
|
|
|
|
2006-10-07 21:02:04 -04:00
|
|
|
private:
|
|
|
|
wxString m_name,
|
|
|
|
m_version,
|
2009-07-25 18:53:23 -04:00
|
|
|
m_longVersion,
|
2006-10-07 21:02:04 -04:00
|
|
|
m_description,
|
|
|
|
m_copyright,
|
|
|
|
m_licence;
|
|
|
|
|
|
|
|
wxIcon m_icon;
|
|
|
|
|
|
|
|
wxString m_url,
|
|
|
|
m_urlDesc;
|
|
|
|
|
|
|
|
wxArrayString m_developers,
|
|
|
|
m_docwriters,
|
|
|
|
m_artists,
|
|
|
|
m_translators;
|
|
|
|
};
|
|
|
|
|
|
|
|
// functions to show the about dialog box
|
2009-04-26 09:41:21 -04:00
|
|
|
WXDLLIMPEXP_ADV void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
|
2006-10-07 21:02:04 -04:00
|
|
|
|
|
|
|
#endif // wxUSE_ABOUTDLG
|
|
|
|
|
|
|
|
#endif // _WX_ABOUTDLG_H_
|
|
|
|
|