]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/aboutdlgg.cpp
don't call wxSocketImpl::ReenableEvents() if the socket was closed while reading...
[wxWidgets.git] / src / generic / aboutdlgg.cpp
index 33cd027719517c027d47860398bc70e120e0440d..70f158262270c1a6591efdac29d8d1c8fa2d0dba 100644 (file)
@@ -96,14 +96,26 @@ wxIcon wxAboutDialogInfo::GetIcon() const
     return icon;
 }
 
+wxString wxAboutDialogInfo::GetCopyrightToDisplay() const
+{
+    wxString ret = m_copyright;
+
+#if wxUSE_UNICODE
+    const wxString copyrightSign = wxString::FromUTF8("\xc2\xa9");
+    ret.Replace("(c)", copyrightSign);
+    ret.Replace("(C)", copyrightSign);
+#endif // wxUSE_UNICODE
+
+    return ret;
+}
+
 // ----------------------------------------------------------------------------
 // wxGenericAboutDialog
 // ----------------------------------------------------------------------------
 
-bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info)
+bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info, wxWindow* parent)
 {
-    // TODO: should we use main frame as parent by default here?
-    if ( !wxDialog::Create(NULL, wxID_ANY, _("About ") + info.GetName(),
+    if ( !wxDialog::Create(parent, wxID_ANY, _("About ") + info.GetName(),
                            wxDefaultPosition, wxDefaultSize, wxRESIZE_BORDER|wxDEFAULT_DIALOG_STYLE) )
         return false;
 
@@ -120,7 +132,7 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info)
     m_sizerText->Add(label, wxSizerFlags().Centre().Border());
     m_sizerText->AddSpacer(5);
 
-    AddText(info.GetCopyright());
+    AddText(info.GetCopyrightToDisplay());
     AddText(info.GetDescription());
 
     if ( info.HasWebSite() )
@@ -136,22 +148,22 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info)
 
 #if wxUSE_COLLPANE
     if ( info.HasLicence() )
-        AddCollapsiblePane(wxT("License"), info.GetLicence());
+        AddCollapsiblePane(_("License"), info.GetLicence());
 
     if ( info.HasDevelopers() )
-        AddCollapsiblePane(wxT("Developers"),
+        AddCollapsiblePane(_("Developers"),
                            AllAsString(info.GetDevelopers()));
 
     if ( info.HasDocWriters() )
-        AddCollapsiblePane(wxT("Documentation writers"),
+        AddCollapsiblePane(_("Documentation writers"),
                            AllAsString(info.GetDocWriters()));
 
     if ( info.HasArtists() )
-        AddCollapsiblePane(wxT("Artists"),
+        AddCollapsiblePane(_("Artists"),
                            AllAsString(info.GetArtists()));
 
     if ( info.HasTranslators() )
-        AddCollapsiblePane(wxT("Translators"),
+        AddCollapsiblePane(_("Translators"),
                            AllAsString(info.GetTranslators()));
 #endif // wxUSE_COLLPANE
 
@@ -172,15 +184,18 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info)
     wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
     sizerTop->Add(sizerIconAndText, wxSizerFlags(1).Expand().Border());
 
+// Mac typically doesn't use OK buttons just for dismissing dialogs.
+#if !defined(__WXMAC__)
     wxSizer *sizerBtns = CreateButtonSizer(wxOK);
     if ( sizerBtns )
     {
         sizerTop->Add(sizerBtns, wxSizerFlags().Expand().Border());
     }
+#endif
 
     SetSizerAndFit(sizerTop);
 
-    CentreOnScreen();
+    CentreOnParent();
 
     return true;
 }
@@ -224,19 +239,24 @@ void wxGenericAboutDialog::AddCollapsiblePane(const wxString& title,
 // public functions
 // ----------------------------------------------------------------------------
 
-void wxGenericAboutBox(const wxAboutDialogInfo& info)
+void wxGenericAboutBox(const wxAboutDialogInfo& info, wxWindow* parent)
 {
-    wxGenericAboutDialog dlg(info);
+#if !defined(__WXGTK__) && !defined(__WXMAC__)
+    wxGenericAboutDialog dlg(info, parent);
     dlg.ShowModal();
+#else
+    wxGenericAboutDialog* dlg = new wxGenericAboutDialog(info, parent);
+    dlg->Show();
+#endif
 }
 
 // currently wxAboutBox is implemented natively only under these platforms, for
 // 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