X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a6982a3882f976f5764c0bac808cc3fd64c9a7f3..8a31648287be0ef976f133de2786b137f1e98340:/src/generic/aboutdlgg.cpp diff --git a/src/generic/aboutdlgg.cpp b/src/generic/aboutdlgg.cpp index 03edc08ab0..ee338f01ba 100644 --- a/src/generic/aboutdlgg.cpp +++ b/src/generic/aboutdlgg.cpp @@ -51,7 +51,7 @@ static wxString AllAsString(const wxArrayString& a) s.reserve(20*count); for ( size_t n = 0; n < count; n++ ) { - s << a[n] << (n == count - 1 ? _T("\n") : _T(", ")); + s << a[n] << (n == count - 1 ? wxT("\n") : wxT(", ")); } return s; @@ -65,19 +65,19 @@ wxString wxAboutDialogInfo::GetDescriptionAndCredits() const { wxString s = GetDescription(); if ( !s.empty() ) - s << _T('\n'); + s << wxT('\n'); if ( HasDevelopers() ) - s << _T('\n') << _("Developed by ") << AllAsString(GetDevelopers()); + s << wxT('\n') << _("Developed by ") << AllAsString(GetDevelopers()); if ( HasDocWriters() ) - s << _T('\n') << _("Documentation by ") << AllAsString(GetDocWriters()); + s << wxT('\n') << _("Documentation by ") << AllAsString(GetDocWriters()); if ( HasArtists() ) - s << _T('\n') << _("Graphics art by ") << AllAsString(GetArtists()); + s << wxT('\n') << _("Graphics art by ") << AllAsString(GetArtists()); if ( HasTranslators() ) - s << _T('\n') << _("Translations by ") << AllAsString(GetTranslators()); + s << wxT('\n') << _("Translations by ") << AllAsString(GetTranslators()); return s; } @@ -85,7 +85,7 @@ wxString wxAboutDialogInfo::GetDescriptionAndCredits() const wxIcon wxAboutDialogInfo::GetIcon() const { wxIcon icon = m_icon; - if ( !icon.Ok() && wxTheApp ) + if ( !icon.IsOk() && wxTheApp ) { const wxTopLevelWindow * const tlw = wxDynamicCast(wxTheApp->GetTopWindow(), wxTopLevelWindow); @@ -109,20 +109,43 @@ wxString wxAboutDialogInfo::GetCopyrightToDisplay() const return ret; } +void wxAboutDialogInfo::SetVersion(const wxString& version, + const wxString& longVersion) +{ + if ( version.empty() ) + { + m_version.clear(); + + wxASSERT_MSG( longVersion.empty(), + "long version should be empty if version is"); + + m_longVersion.clear(); + } + else // setting valid version + { + m_version = version; + + if ( longVersion.empty() ) + m_longVersion = _("Version ") + m_version; + else + m_longVersion = longVersion; + } +} + // ---------------------------------------------------------------------------- // wxGenericAboutDialog // ---------------------------------------------------------------------------- bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info, wxWindow* parent) { - if ( !wxDialog::Create(parent, wxID_ANY, _("About ") + info.GetName(), + if ( !wxDialog::Create(parent, wxID_ANY, wxString::Format(_("About %s"), info.GetName()), wxDefaultPosition, wxDefaultSize, wxRESIZE_BORDER|wxDEFAULT_DIALOG_STYLE) ) return false; m_sizerText = new wxBoxSizer(wxVERTICAL); wxString nameAndVersion = info.GetName(); if ( info.HasVersion() ) - nameAndVersion << _T(' ') << info.GetVersion(); + nameAndVersion << wxT(' ') << info.GetVersion(); wxStaticText *label = new wxStaticText(this, wxID_ANY, nameAndVersion); wxFont fontBig(*wxNORMAL_FONT); fontBig.SetPointSize(fontBig.GetPointSize() + 2); @@ -173,7 +196,7 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info, wxWindow* paren wxSizer *sizerIconAndText = new wxBoxSizer(wxHORIZONTAL); #if wxUSE_STATBMP wxIcon icon = info.GetIcon(); - if ( icon.Ok() ) + if ( icon.IsOk() ) { sizerIconAndText->Add(new wxStaticBitmap(this, wxID_ANY, icon), wxSizerFlags().Border(wxRIGHT)); @@ -202,8 +225,8 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info, wxWindow* paren void wxGenericAboutDialog::AddControl(wxWindow *win, const wxSizerFlags& flags) { - wxCHECK_RET( m_sizerText, _T("can only be called after Create()") ); - wxASSERT_MSG( win, _T("can't add NULL window to about dialog") ); + wxCHECK_RET( m_sizerText, wxT("can only be called after Create()") ); + wxASSERT_MSG( win, wxT("can't add NULL window to about dialog") ); m_sizerText->Add(win, flags); }