Example #1
0
void FitDialog::showFunctionsList(int category)
{
	boxUseBuiltIn->setChecked(false);
	boxUseBuiltIn->setEnabled(false);
	boxUseBuiltIn->hide();
	buttonPlugins->hide();
    buttonClearUsrList->hide();
    buttonClearUsrList->setEnabled(false);
	btnDelFunc->setEnabled(false);
    funcBox->blockSignals(true);
	funcBox->clear();
    explainBox->clear();
	polynomOrderLabel->hide();
	polynomOrderBox->hide();

	switch (category)
	{
		case 0:
			if (d_user_function_names.count() > 0)
			{
				showUserFunctions();
                buttonClearUsrList->show();
				boxUseBuiltIn->setEnabled(true);
                buttonClearUsrList->setEnabled(true);
			}

			boxUseBuiltIn->setText(tr("Fit with selected &user function"));
			boxUseBuiltIn->show();
            buttonClearUsrList->show();
			btnDelFunc->setEnabled(true);
			break;

		case 1:
			boxUseBuiltIn->setText(tr("Fit using &built-in function"));
			boxUseBuiltIn->show();
			boxUseBuiltIn->setEnabled(true);
			funcBox->addItems(d_built_in_function_names);
			break;

		case 2:
			showParseFunctions();
			break;

		case 3:
			buttonPlugins->show();
			boxUseBuiltIn->setText(tr("Fit using &plugin function"));
			boxUseBuiltIn->show();
			if (d_plugin_function_names.size() > 0)
			{
				funcBox->addItems(d_plugin_function_names);
				boxUseBuiltIn->setEnabled(true);
			}
			break;
	}
    funcBox->blockSignals(false);
	funcBox->setCurrentRow (0);
}
void fitDialog::showFunctionsList(int category)
{
    boxUseBuiltIn->setChecked(false);
    boxUseBuiltIn->setEnabled(false);
    boxUseBuiltIn->hide();
    buttonPlugins->hide();
    btnDelFunc->setEnabled(false);
    funcBox->clear();

    switch (category)
    {
    case 0:
        if ((int)userFunctionNames.size() > 0)
        {
            showUserFunctions();
            boxUseBuiltIn->setEnabled(true);
        }

        boxUseBuiltIn->setText(tr("Fit with selected &user function"));
        boxUseBuiltIn->show();
        btnDelFunc->setEnabled(true);
        break;

    case 1:
        boxUseBuiltIn->setText(tr("Fit using &built-in function"));
        boxUseBuiltIn->show();
        boxUseBuiltIn->setEnabled(true);
        funcBox->insertStringList(builtInFunctionNames, -1);
        break;

    case 2:
        showParseFunctions();
        break;

    case 3:
        buttonPlugins->show();
        boxUseBuiltIn->setText(tr("Fit using &plugin function"));
        boxUseBuiltIn->show();
        if ((int)pluginFunctionNames.size() > 0)
        {
            funcBox->insertStringList(pluginFunctionNames, -1);
            boxUseBuiltIn->setEnabled(true);
        }
        break;
    }

    funcBox->setCurrentItem(0);
    showExpression(0);
}