X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2be7beda2d186af20ce9f0cd2bc28352d890db77..b97dc9c8bcfbc22e007474427289c7d5fbd9746e:/src/generic/aboutdlgg.cpp diff --git a/src/generic/aboutdlgg.cpp b/src/generic/aboutdlgg.cpp index 11a545c816..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) @@ -152,25 +167,16 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info) wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); sizerTop->Add(sizerIconAndText, wxSizerFlags(1).Expand().Border()); - const int defBorder = wxSizerFlags::GetDefaultBorder(); - wxSizer *buttonSizer = CreateButtonSizer( wxOK , false, defBorder ); - if(buttonSizer->GetChildren().GetCount() > 0 ) + wxSizer *sizerBtns = CreateButtonSizer(wxOK); + if ( sizerBtns ) { - sizerTop->Add( buttonSizer, 0, wxEXPAND | wxALL, defBorder ); - } - else - { - sizerTop->AddSpacer( defBorder ); - delete buttonSizer; + sizerTop->Add(sizerBtns, wxSizerFlags().Expand().Border()); } SetSizerAndFit(sizerTop); CentreOnScreen(); - wxWindow *ok = FindWindow(wxID_OK); - if (ok) ok->SetFocus(); - return true; }