Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

ScriptedWizard Plugin Add function such as Wiz::AppendComboListboxWithChoice()

<< < (2/3) > >>

BlueHazzard:
I see no big problems with this. Should i implement it in my branch?

@gocad: can you make a git patch against one of this repos:
https://github.com/obfuscated/codeblocks_sf
or
https://github.com/bluehazzard/codeblocks_sf

greetings

oBFusCATed:
The question is will this change cause you problems in your branch?
Will it work out-of-the-box there or you'll have to make some changes?
And so on...

gocad:
I find that Wiz::GetWizardDir() is not what I want.

I just want to get that

--- Code: ---// get the folder of the running wizard.scrip
wxString Wiz::GetWizardScriptFolder(void)
{
    return m_WizardScriptFolder;
}

--- End code ---

wxString m_WizardScriptFolder;  // in wiz.h


--- Code: ---CompileTargetBase* Wiz::Launch(int index, wxString* pFilename)
{
    .
    .

    // locate the script
    wxString script = ConfigManager::GetFolder(sdDataUser) + _T("/templates/wizard/") + m_Wizards[index].script;
    if (!wxFileExists(script))
        script = ConfigManager::GetFolder(sdDataGlobal) + _T("/templates/wizard/") + m_Wizards[index].script;

    if (!Manager::Get()->GetScriptingManager()->LoadScript(script)) // build and run script
    {
        // any errors have been displayed by ScriptingManager
        Clear();
        InfoWindow::Display(_("Error"), _("Failed to load the wizard's script.\nPlease check the debug log for details..."));
        return 0;
    }
    m_WizardScriptFolder = script.BeforeLast( _T('/') );
    m_WizardScriptFolder = m_WizardScriptFolder.AfterLast( _T('/') );

    // call BeginWizard()
    try
    {
        SqPlus::SquirrelFunction<void> f("BeginWizard");
        f();
    }
    catch (SquirrelError& e)
    {
        Manager::Get()->GetScriptingManager()->DisplayErrors(&e);
        Clear();
        return 0;
    }
    catch (cbException& e)
    {
        e.ShowErrorMessage(false);
        Clear();
        return 0;
    }

    .
    .
    Clear();
    return base;
}

void Wiz::RegisterWizard()
{
    .
    .

            func(&Wiz::GetWizardScriptFolder, "GetWizardScriptFolder").

    .
    .
    SqPlus::BindVariable(this, "Wizard", SqPlus::VAR_ACCESS_READ_ONLY);
}

--- End code ---


The code use Wiz::GetWizardDir() in function GetFilesDir() ( wizard.script ) will go wrong.

--- Code: ---// return the files this project contains
function GetFilesDir()
{
    local result = _T("");
    local wizdir = Wizard.GetWizardDir();
    if (!IsEmpty) // Checks whether user wants Empty Project or not
    {
        if (PLATFORM == PLATFORM_MSW)
            result = wizdir + _T("rc;"); // go wrong, it doesn't copy any file
        if (GuiBuilder == 2)
        {
            if (GuiAppType == 0)
                result = result + wizdir + _T("wxfb/dialog;"); // go wrong, it doesn't copy any file
            else if (GuiAppType == 1)
                result = result + wizdir + _T("wxfb/frame;"); // go wrong, it doesn't copy any file
        }
    }
    return result;
}

--- End code ---
You will use Wiz::GetWizardScriptFolder().

--- Code: ---// return the files this project contains
function GetFilesDir()
{
    local result = _T("");
    local wizScriptFolder = Wizard.GetWizardScriptFolder();
    if (!IsEmpty) // Checks whether user wants Empty Project or not
    {
        if (PLATFORM == PLATFORM_MSW)
            result = wizScriptFolder + _T("/rc;");
        if (GuiBuilder == 2)
        {
            if (GuiAppType == 0)
                result = result + wizScriptFolder + _T("/wxfb/dialog;");
            else if (GuiAppType == 1)
                result = result + wizScriptFolder + _T("/wxfb/frame;");
        }
    }
    return result;
}

--- End code ---

gocad:
Put A Extended Scripted Wizard Plugin source code on https://github.com/ywx/cbScriptedWizardPlugin

oBFusCATed:
What is the purpose of this plugin?
It won't be reintegrated in the main repo.
Why don't you post patches against the main source tree as BlueHazzard have suggested?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version