]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/aboutdlgg.cpp
Typemaps for wxRect2D
[wxWidgets.git] / src / generic / aboutdlgg.cpp
index 4543ada040583e50825e789f90144218913c0609..506662d6c73f76146e213dd927364ca787b7062e 100644 (file)
 
 #ifndef WX_PRECOMP
     #include "wx/sizer.h"
-
     #include "wx/statbmp.h"
     #include "wx/stattext.h"
+    #include "wx/button.h"
 #endif //WX_PRECOMP
 
 #include "wx/aboutdlg.h"
 #include "wx/generic/aboutdlgg.h"
 
 #include "wx/hyperlink.h"
+#include "wx/collpane.h"
 
 // ============================================================================
 // implementation
@@ -69,13 +70,13 @@ wxString wxAboutDialogInfo::GetDescriptionAndCredits() const
         s << _T('\n') << _("Developed by ") << AllAsString(GetDevelopers());
 
     if ( HasDocWriters() )
-        s << _T('\n') << ("Documentation by ") << AllAsString(GetDocWriters());
+        s << _T('\n') << _("Documentation by ") << AllAsString(GetDocWriters());
 
     if ( HasArtists() )
-        s << _T('\n') << ("Graphics art by ") << AllAsString(GetArtists());
+        s << _T('\n') << _("Graphics art by ") << AllAsString(GetArtists());
 
     if ( HasTranslators() )
-        s << _T('\n') << ("Translations by ") << AllAsString(GetTranslators());
+        s << _T('\n') << _("Translations by ") << AllAsString(GetTranslators());
 
     return s;
 }
@@ -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)
 
@@ -151,10 +164,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();
+
     return true;
 }