X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5ecfa93af6c160057997c09db7220280e37518af..e10b8ce820a08b5364c5ab93a462458881fed318:/src/generic/aboutdlgg.cpp diff --git a/src/generic/aboutdlgg.cpp b/src/generic/aboutdlgg.cpp index 8f72fe0e6d..542020e699 100644 --- a/src/generic/aboutdlgg.cpp +++ b/src/generic/aboutdlgg.cpp @@ -36,6 +36,7 @@ #include "wx/generic/aboutdlgg.h" #include "wx/hyperlink.h" +#include "wx/collpane.h" // ============================================================================ // implementation @@ -101,7 +102,8 @@ wxIcon wxAboutDialogInfo::GetIcon() const bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info) { // TODO: should we use main frame as parent by default here? - if ( !wxDialog::Create(NULL, wxID_ANY, _("About ") + info.GetName()) ) + if ( !wxDialog::Create(NULL, wxID_ANY, _("About ") + info.GetName(), + wxDefaultPosition, wxDefaultSize, wxRESIZE_BORDER|wxDEFAULT_DIALOG_STYLE) ) return false; m_sizerText = new wxBoxSizer(wxVERTICAL); @@ -131,7 +133,20 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info) #endif // wxUSE_HYPERLINKCTRL/!wxUSE_HYPERLINKCTRL } - // TODO: add licence +#if wxUSE_COLLPANE + // add licence + if ( info.HasLicence() ) + { + wxCollapsiblePane * + licensepnl = new wxCollapsiblePane(this, wxID_ANY, wxT("License")); + + new wxStaticText(licensepnl->GetPane(), wxID_ANY, info.GetLicence(), + wxDefaultPosition, wxDefaultSize, + wxALIGN_CENTRE); + + m_sizerText->Add(licensepnl, wxSizerFlags(1).Expand().Border(wxBOTTOM)); + } +#endif // wxUSE_COLLPANE // TODO: add credits (developers, artists, doc writers, translators) @@ -151,13 +166,17 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info) wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); sizerTop->Add(sizerIconAndText, wxSizerFlags(1).Expand().Border()); - sizerTop->Add(new wxButton(this, wxID_OK), wxSizerFlags().Right().Border()); + + wxSizer *sizerBtns = CreateButtonSizer(wxOK); + if ( sizerBtns ) + { + sizerTop->Add(sizerBtns, wxSizerFlags().Expand().Border()); + } + SetSizerAndFit(sizerTop); CentreOnScreen(); - FindWindow(wxID_OK)->SetFocus(); - return true; }