Example #1
0
void CodeEditor::setCodeFormats(QList<codeTokenFormat> formats, int defaultFormat)
{
    if(formats.count()==0)gcerror("DEVERROR: No formats set to the code editor!");
    codeTokenFormats = formats;
    defaultTokenFormat = defaultFormat;
    viewport()->repaint();
}
Example #2
0
void AddFunction::on_okbutton_clicked()
{
    pgsParser p;
    if(!argumentmode)p.setProject(project); //else we don't need a project
    pgsParser::tokenlist l = p.tokenize(ui->lineEdit->text());
    bool valid=false;
    //to do: validation!
    //for now, only the name to be valid
    if(l.count()==1)
        if(l.at(0).kind==pgsParser::nameId)valid=true;

    if(!valid)
    {
        gcerror(tr("The function name is invalid or conflicts with something"));
        return;
    }

    //it's ok now
    name = l.at(0).text;
    switch(ui->varType->currentIndex())
    {
        case 0: type="int";break;
        case 1: type="real";break;
        case 2: type="string";break;
        case 3: type="bool";break;
        case 4: type=theclass;break;
        case 5: type="void";break;
    }

    //store the arguments as well:
    if(!argumentmode)
    {
        vObject o;
        for(int i=0;i<ui->ArgumentList->topLevelItemCount();i++)
        {
            o[ui->ArgumentList->topLevelItem(i)->text(0)] = ui->ArgumentList->topLevelItem(i)->text(1);
        }
        args = o;
    }
    accept();
}
Example #3
0
bool dllForExport::debug(QString projectfile, QString target)
{
    if(pdebug!=0)return pdebug(projectfile, target);
    else gcerror(QString("The exporter %1's DEBUG function is not implemented").arg(exportername));
}
Example #4
0
bool dllForExport::clean(QString projectfile, QString target)
{
    if(pclean!=0)return pclean(projectfile, target);
    else gcerror(QString("The exporter %1's CLEAN function not exists").arg(exportername));
}
Example #5
0
bool dllForExport::run(QString projectfile, QString target)
{
    if(prun!=0)return prun(projectfile, target);
    else gcerror(QString("The exporter %1's RUN function is not implemented").arg(exportername));
}