git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60389
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
};
// functions to show the about dialog box
};
// functions to show the about dialog box
-WXDLLIMPEXP_ADV void wxAboutBox(const wxAboutDialogInfo& info);
+WXDLLIMPEXP_ADV void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
wxGenericAboutDialog() { Init(); }
// ctor which fully initializes the object
wxGenericAboutDialog() { Init(); }
// ctor which fully initializes the object
- wxGenericAboutDialog(const wxAboutDialogInfo& info)
+ wxGenericAboutDialog(const wxAboutDialogInfo& info, wxWindow* parent = NULL)
+ (void)Create(info, parent);
}
// this method must be called if and only if the default ctor was used
}
// this method must be called if and only if the default ctor was used
- bool Create(const wxAboutDialogInfo& info);
+ bool Create(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
protected:
// this virtual method may be overridden to add some more controls to the
protected:
// this virtual method may be overridden to add some more controls to the
// unlike wxAboutBox which can show either the native or generic about dialog,
// this function always shows the generic one
// unlike wxAboutBox which can show either the native or generic about dialog,
// this function always shows the generic one
-WXDLLIMPEXP_ADV void wxGenericAboutBox(const wxAboutDialogInfo& info);
+WXDLLIMPEXP_ADV void wxGenericAboutBox(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
@header{wx/aboutdlg.h}
*/
@header{wx/aboutdlg.h}
*/
-void wxAboutBox(const wxAboutDialogInfo& info);
+void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
/**
This function does the same thing as wxAboutBox() except that it always uses
/**
This function does the same thing as wxAboutBox() except that it always uses
@header{wx/aboutdlg.h}
*/
@header{wx/aboutdlg.h}
*/
-void wxGenericAboutBox(const wxAboutDialogInfo& info);
+void wxGenericAboutBox(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
wxAboutDialogInfo info;
InitAboutInfoMinimal(info);
wxAboutDialogInfo info;
InitAboutInfoMinimal(info);
+ wxAboutBox(info, this);
}
void MyFrame::ShowFancyAboutDialog(wxCommandEvent& WXUNUSED(event))
}
void MyFrame::ShowFancyAboutDialog(wxCommandEvent& WXUNUSED(event))
wxAboutDialogInfo info;
InitAboutInfoWebsite(info);
wxAboutDialogInfo info;
InitAboutInfoWebsite(info);
+ wxAboutBox(info, this);
}
void MyFrame::ShowFullAboutDialog(wxCommandEvent& WXUNUSED(event))
}
void MyFrame::ShowFullAboutDialog(wxCommandEvent& WXUNUSED(event))
wxAboutDialogInfo info;
InitAboutInfoAll(info);
wxAboutDialogInfo info;
InitAboutInfoAll(info);
+ wxAboutBox(info, this);
}
// a trivial example of a custom dialog class
class MyAboutDialog : public wxGenericAboutDialog
{
public:
}
// a trivial example of a custom dialog class
class MyAboutDialog : public wxGenericAboutDialog
{
public:
- MyAboutDialog(const wxAboutDialogInfo& info)
+ MyAboutDialog(const wxAboutDialogInfo& info, wxWindow* parent)
}
// add some custom controls
}
// add some custom controls
wxAboutDialogInfo info;
InitAboutInfoAll(info);
wxAboutDialogInfo info;
InitAboutInfoAll(info);
- MyAboutDialog dlg(info);
+ MyAboutDialog dlg(info, this);
// wxGenericAboutDialog
// ----------------------------------------------------------------------------
// wxGenericAboutDialog
// ----------------------------------------------------------------------------
-bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info)
+bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info, wxWindow* parent)
- // this is a modal dialog thus we'll use GetParentForModalDialog:
- if ( !wxDialog::Create(GetParentForModalDialog(), wxID_ANY, _("About ") + info.GetName(),
+ if ( !wxDialog::Create(parent, wxID_ANY, _("About ") + info.GetName(),
wxDefaultPosition, wxDefaultSize, wxRESIZE_BORDER|wxDEFAULT_DIALOG_STYLE) )
return false;
wxDefaultPosition, wxDefaultSize, wxRESIZE_BORDER|wxDEFAULT_DIALOG_STYLE) )
return false;
SetSizerAndFit(sizerTop);
SetSizerAndFit(sizerTop);
// public functions
// ----------------------------------------------------------------------------
// public functions
// ----------------------------------------------------------------------------
-void wxGenericAboutBox(const wxAboutDialogInfo& info)
+void wxGenericAboutBox(const wxAboutDialogInfo& info, wxWindow* parent)
{
#if !defined(__WXGTK__) && !defined(__WXMAC__)
{
#if !defined(__WXGTK__) && !defined(__WXMAC__)
- wxGenericAboutDialog dlg(info);
+ wxGenericAboutDialog dlg(info, parent);
dlg.ShowModal();
#else
wxGenericAboutDialog* dlg = new wxGenericAboutDialog(info);
dlg.ShowModal();
#else
wxGenericAboutDialog* dlg = new wxGenericAboutDialog(info);
// the others we provide a generic fallback here
#if !defined(__WXMSW__) && !defined(__WXMAC__) && !defined(__WXGTK26__)
// the others we provide a generic fallback here
#if !defined(__WXMSW__) && !defined(__WXMAC__) && !defined(__WXGTK26__)
-void wxAboutBox(const wxAboutDialogInfo& info)
+void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* parent)
- wxGenericAboutBox(info);
+ wxGenericAboutBox(info, parent);
}
#endif // platforms without native about dialog
}
#endif // platforms without native about dialog
wxLaunchDefaultBrowser(wxGTK_CONV_BACK_SYS(link));
}
wxLaunchDefaultBrowser(wxGTK_CONV_BACK_SYS(link));
}
-void wxAboutBox(const wxAboutDialogInfo& info)
+void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* WXUNUSED(parent))
{
if ( !gtk_check_version(2,6,0) )
{
{
if ( !gtk_check_version(2,6,0) )
{
// ============================================================================
// our public entry point
// ============================================================================
// our public entry point
-void wxAboutBox(const wxAboutDialogInfo& info)
+void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* parent)
{
// we prefer to show a simple message box if we don't have any fields which
// can't be shown in it because as much as there is a standard about box
{
// we prefer to show a simple message box if we don't have any fields which
// can't be shown in it because as much as there is a standard about box
// add everything remaining
msg << info.GetDescriptionAndCredits();
// add everything remaining
msg << info.GetDescriptionAndCredits();
- wxMessageBox(msg, wxString::Format(_("About %s"), name));
+ wxMessageBox(msg, wxString::Format(_("About %s"), name, wxOK | wxCENTRE, parent));
}
else // simple "native" version is not enough
{
// we need to use the full-blown generic version
}
else // simple "native" version is not enough
{
// we need to use the full-blown generic version
- wxGenericAboutBox(info);
+ wxGenericAboutBox(info, parent);
// implementation
// ============================================================================
// implementation
// ============================================================================
-void wxAboutBox(const wxAboutDialogInfo& info)
+void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* WXUNUSED(parent))
{
// Mac native about box currently can show only name, version, copyright
// and description fields and we also shoehorn the credits text into the
{
// Mac native about box currently can show only name, version, copyright
// and description fields and we also shoehorn the credits text into the