wxWidgets: wxGenericAboutDialog Class Reference

| Version: 3.1.5

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
wxGenericAboutDialog Class Reference
Class List by Category » Common Dialogs

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.1/wxWidgets3.1-3.1.5-3.x86_64/src/wxWidgets-3.1.5/interface/wx/generic/aboutdlgg.h>`

## Detailed Description

This class defines a customizable About dialog.

Note that if you don't need customization, you should use the global wxAboutBox() function that is both easier to use and shows the native dialog if available.

To use this class, you need to derive your own class from it and override the virtual method DoAddCustomControls().

To instantiate an object from your wxGenericAboutDialog-based class, you can use either the default constructor followed by a call to Create(), or directly using the alternate constructor. In either case, you have to prepare a wxAboutDialogInfo containing standard information to display in an about-box.

Example of usage, MyAboutDlg being a class derived from wxGenericAboutDialog:

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-2021");
aboutInfo.SetWebSite("http://myapp.org");
aboutInfo.AddDeveloper("My Self");
MyAboutDlg dlgAbout(aboutInfo, this);
dlgAbout.ShowModal();
}
wxAboutDialogInfo
wxAboutDialogInfo contains information shown in the standard About dialog displayed by the wxAboutBox...
Definition aboutdlg.h:54
wxAboutDialogInfo::SetCopyright
void SetCopyright(const wxString &copyright)
Set the short string containing the program copyright information.
wxAboutDialogInfo::AddDeveloper
void AddDeveloper(const wxString &developer)
Adds a developer name to be shown in the program credits.
wxAboutDialogInfo::SetDescription
void SetDescription(const wxString &desc)
Set brief, but possibly multiline, description of the program.
wxAboutDialogInfo::SetName
void SetName(const wxString &name)
Set the name of the program.
wxAboutDialogInfo::SetVersion
void SetVersion(const wxString &version, const wxString &longVersion=wxString())
Set the version of the program.
wxAboutDialogInfo::SetWebSite
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).
wxCommandEvent
This event class contains information about command events, which originate from a variety of simple ...
Definition event.h:2007
_
const wxString & _(const wxString &string)
Macro to be used around all literal strings that should be translated.

##

Library: wxCore

<>< =''>:</>&;&;< =''>\ </></>

See also
  wxAboutDialogInfo

## Public Member Functions
| wxGenericAboutDialog ()
| Default constructor, Create() must be called later.
| wxGenericAboutDialog (const wxAboutDialogInfo &info, wxWindow *parent=NULL)
| Creates the dialog and initializes it with the given information.
bool | Create (const wxAboutDialogInfo &info, wxWindow *parent=NULL)
| Initializes the dialog created using the default constructor.

## Protected Member Functions
virtual void | DoAddCustomControls ()
| This virtual method may be overridden to add more controls to the dialog.
void | AddControl (wxWindow *win, const wxSizerFlags &flags)
| Add arbitrary control to the sizer content with the specified flags.
void | AddControl (wxWindow *win)
| Add arbitrary control to the sizer content and centre it.
void | AddText (const wxString &text)
| Add the given (not empty) text to the sizer content.
void | AddCollapsiblePane (const wxString &title, const wxString &text)
| Add a wxCollapsiblePane containing the given text.

## Constructor & Destructor Documentation

## ◆ wxGenericAboutDialog() [1/2]

wxGenericAboutDialog::wxGenericAboutDialog | ( |  | ) |

Default constructor, Create() must be called later.

## ◆ wxGenericAboutDialog() [2/2]

wxGenericAboutDialog::wxGenericAboutDialog | ( | const wxAboutDialogInfo & | info,
|  | wxWindow * | parent = NULL )

Creates the dialog and initializes it with the given information.

## Member Function Documentation

## ◆ AddCollapsiblePane()

void wxGenericAboutDialog::AddCollapsiblePane | ( | const wxString & | title,
|  | const wxString & | text )
| protected

Add a wxCollapsiblePane containing the given text.

## ◆ AddControl() [1/2]

void wxGenericAboutDialog::AddControl | ( | wxWindow * | win | ) |
| protected

Add arbitrary control to the sizer content and centre it.

## ◆ AddControl() [2/2]

void wxGenericAboutDialog::AddControl | ( | wxWindow * | win,
|  | const wxSizerFlags & | flags )
| protected

Add arbitrary control to the sizer content with the specified flags.

For example, here is how to add an expandable line with a border of 3 pixels, then a line of text:

AddControl(new wxStaticLine(this), wxSizerFlags().Expand().Border(wxALL, 3));
AddText(_("This line is just an example of custom text."));
wxGenericAboutDialog::AddText
void AddText(const wxString &text)
Add the given (not empty) text to the sizer content.
wxGenericAboutDialog::AddControl
void AddControl(wxWindow *win, const wxSizerFlags &flags)
Add arbitrary control to the sizer content with the specified flags.
wxSizerFlags
Container for sizer items flags providing readable names for them.
Definition sizer.h:1382
wxStaticLine
A static line is just a line which may be used in a dialog to separate the groups of controls.
Definition statline.h:32
wxALL
@ wxALL
Definition defs.h:57

## ◆ AddText()

void wxGenericAboutDialog::AddText | ( | const wxString & | text | ) |
| protected

Add the given (not empty) text to the sizer content.

## ◆ Create()

bool wxGenericAboutDialog::Create | ( | const wxAboutDialogInfo & | info,
|  | wxWindow * | parent = NULL )

Initializes the dialog created using the default constructor.

## ◆ DoAddCustomControls()

virtual void wxGenericAboutDialog::DoAddCustomControls | ( |  | ) |
| inlineprotectedvirtual

This virtual method may be overridden to add more controls to the dialog.

Use the protected AddControl(), AddText() and AddCollapsiblePane() methods to add custom controls.

This method is called during the dialog creation and you don't need to call it, only to override it.