Patch #1250 2006-07-28 10:59

jomabrueloe

Enhanced wxWidgets wizard
Download
1250-Enhanced_wxWid.patch (9.9 KB)
Category
Application::Refinement
Status
Out of date
Close date
2006-11-22 22:27
Assigned to
mortenmacfly
////////////////////////////////////////////////////////////////////////////////
//
// wxWidgets project wizard
//
////////////////////////////////////////////////////////////////////////////////

// globals
WxPath <- _T("");
WantPCH <- false;
IsDLL <- false;
IsMonolithic <- false;
IsUnicode <- false;
IsDebug <- false;
Configuration <- _T("");
LibPath <- _T("");
LibName <- _T("");

function BeginWizard()
{
    local intro_msg = _T("Welcome to the new wxWidgets 2.6.x project wizard!\n\n" +
                        "This wizard will guide you to create a new project\n" +
                        "using the wxWidgets cross-platform GUI library.\n\n" +
                        "When you 're ready to proceed, please click \"Next\"...");

    local wxpath_msg = _T("Please select the location of wxWidgets on your computer.\n" +
                            "This is the top-level folder where wxWidgets was unpacked.\n" +
                            "To help you, this folder must contain the subfolders\n" +
                            "\"include\" and \"lib\".");

    Wizard.AddInfoPage(_T("WxIntro"), intro_msg);
    Wizard.AddProjectPathPage();
    if (PLATFORM == PLATFORM_MSW)
        Wizard.AddGenericSelectPathPage(_T("WxPath"), wxpath_msg, _T("wxWidgets' location:"), _T("$(#wx)"));
    // we need the compiler selection before wx settings, because we 'll have
    // to validate the settings. To do this we must know the compiler beforehand...
    Wizard.AddCompilerPage(_T(""), _T("*"), true, true);
    if (PLATFORM == PLATFORM_MSW)
        Wizard.AddPage(_T("WxConf")); // only for windows
    else
        Wizard.AddPage(_T("WxConfUnix")); // just PCH option
}

////////////////////////////////////////////////////////////////////////////////
// wxWidgets' path page
////////////////////////////////////////////////////////////////////////////////

function OnLeave_WxPath(fwd)
{
    if (fwd)
    {
        local dir         = Wizard.GetTextControlValue(_T("txtFolder"));
        local dir_nomacro = ReplaceMacros(dir, true);
        if (!IO.FileExists(dir_nomacro + _T("/include/wx/wx.h")))
        {
            ShowError(_T("The path you entered seems valid, but this wizard " +
                    "can't locate wxWidgets' files in it..."));
            return false;
        }

        // see if it matches the global var. if it does, use the var instead...
        if (GetUserVariableManager().Exists(_T("#wx")))
        {
            local gvar = ReplaceMacros(_T("$(#wx)"), true);
            if (gvar.Matches(dir_nomacro))
                dir = gvar;
        }
        WxPath = dir;
    }
    return true;
}

////////////////////////////////////////////////////////////////////////////////
// wxWidgets' settings
////////////////////////////////////////////////////////////////////////////////

function OnEnter_WxConf(fwd)
{
    if (fwd)
    {
        Wizard.CheckCheckbox(_T("chkWxConfDLL"), ConfigManager.Read(_T("/wx_project_wizard/dll"), true));
        Wizard.CheckCheckbox(_T("chkWxConfMono"), ConfigManager.Read(_T("/wx_project_wizard/monolithic"), true));
        Wizard.CheckCheckbox(_T("chkWxConfUni"), ConfigManager.Read(_T("/wx_project_wizard/unicode"), true));
        Wizard.CheckCheckbox(_T("chkWxConfDebug"), ConfigManager.Read(_T("/wx_project_wizard/debug"), false));
        Wizard.CheckCheckbox(_T("chkWxConfPCH"), ConfigManager.Read(_T("/wx_project_wizard/pch"), true));
        Wizard.SetTextControlValue(_T("txtWxConfConfig"), ConfigManager.Read(_T("/wx_project_wizard/configuration"), _T("")));
    }
    return true;
}

function OnLeave_WxConf(fwd)
{
    if (fwd)
    {
        IsDLL = Wizard.IsCheckboxChecked(_T("chkWxConfDLL"));
        IsMonolithic = Wizard.IsCheckboxChecked(_T("chkWxConfMono"));
        IsUnicode = Wizard.IsCheckboxChecked(_T("chkWxConfUni"));
        IsDebug = Wizard.IsCheckboxChecked(_T("chkWxConfDebug"));
        WantPCH = Wizard.IsCheckboxChecked(_T("chkWxConfPCH"));
        Configuration = Wizard.GetTextControlValue(_T("txtWxConfConfig"));

        // validate settings
        local lib_prefix;
        local lib_suffix;
        local lib = WxPath + _T("/lib/");
        if (GetCompilerFactory().CompilerInheritsFrom(Wizard.GetCompilerID(), _T("gcc*")))
        {
            lib = lib + _T("gcc_");
            lib_prefix = _T("lib");
            lib_suffix = _T(".a");
        }
        else if (GetCompilerFactory().CompilerInheritsFrom(Wizard.GetCompilerID(), _T("msvc*")))
        {
            lib = lib + _T("vc_");
            lib_prefix = _T("");
            lib_suffix = _T(".lib");
        }

        if (IsDLL)
            lib = lib + _T("dll");

        lib = lib + Configuration;

        // at this point we have the full path to the link libraries
        LibPath = lib;

        lib = lib + _T("/");

        local lib_name = lib_prefix;

        if (IsMonolithic)
            lib_name = lib_name + _T("wxmsw26");
        else
            lib_name = lib_name + _T("wxcore26"); // TODO: how are non-m
download for full patch...
artoj 2006-10-07 10:30

Looking at the diff it seems that most of the changes this patch had, have already made it to the script in trunk so applying this patch will result in loss of functionality.

Requesting to be closed.