X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b9e5acc5400f99a5da9dc46adb83d421a0408a92..26e422a9adf74e0744a83f2647de4714f13786d3:/src/generic/aboutdlgg.cpp diff --git a/src/generic/aboutdlgg.cpp b/src/generic/aboutdlgg.cpp index 21a6a05754..506662d6c7 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,18 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info) #endif // wxUSE_HYPERLINKCTRL/!wxUSE_HYPERLINKCTRL } - // TODO: add licence + // 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)); + } // TODO: add credits (developers, artists, doc writers, translators) @@ -152,25 +165,16 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info) wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); sizerTop->Add(sizerIconAndText, wxSizerFlags(1).Expand().Border()); - int defBorder = wxSizerFlags().Border().GetBorderInPixels(); - 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; }