示例#1
0
文件: aboutdlg.cpp 项目: EdgarTx/wx
void wxAboutBox(const wxAboutDialogInfo& info)
{
    // Mac native about box currently can show only name, version, copyright
    // and description fields and we also shoehorn the credits text into the
    // description but if we have anything else we must use the generic version
    if ( info.IsSimple() )
    {
        AboutBoxOptions opts;

        opts.Set(kHIAboutBoxNameKey, info.GetName());

        if ( info.HasVersion() )
        {
            opts.Set(kHIAboutBoxVersionKey,
                     wxString::Format(_("Version %s"), info.GetVersion().c_str()));
        }

        if ( info.HasCopyright() )
            opts.Set(kHIAboutBoxCopyrightKey, info.GetCopyright());

        opts.Set(kHIAboutBoxDescriptionKey, info.GetDescriptionAndCredits());

        HIAboutBox(opts);
    }
    else // simple "native" version is not enough
    {
        // we need to use the full-blown generic version
        wxGenericAboutBox(info);
    }
}
示例#2
0
// our public entry point
void wxAboutBox(const wxAboutDialogInfo& info)
{
    // we prefer to show a simple message box if we don't have any fields which
    // can't be shown in it because as much as there is a standard about box
    // under MSW at all, this is it
    if ( info.IsSimple() )
    {
        // build the text to show in the box
        const wxString name = info.GetName();
        wxString msg;
        msg << name;
        if ( info.HasVersion() )
            msg << _(" Version ") << info.GetVersion();
        msg << _T('\n');

        if ( info.HasCopyright() )
            msg << info.GetCopyright() << _T('\n');

        // add everything remaining
        msg << info.GetDescriptionAndCredits();

        wxMessageBox(msg, _T("About ") + name);
    }
    else // simple "native" version is not enough
    {
        // we need to use the full-blown generic version
        wxGenericAboutBox(info);
    }
}