implemented first full Theory Block handler

This commit is contained in:
nemu
2009-03-22 15:52:11 +00:00
parent eef0dac3a9
commit 201692410a
4 changed files with 92 additions and 28 deletions

View File

@@ -61,6 +61,53 @@ PGetTheoryBlockDialog::PGetTheoryBlockDialog(PAdmin *admin,
}
}
//----------------------------------------------------------------------------------------------------
/**
* <p>
*/
QString PGetTheoryBlockDialog::getTheoFuncString()
{
QString str = "????";
int idx = fTheoryFunction_comboBox->currentItem();
PTheory *theoItem = fAdmin->getTheoryItem(idx);
if (theoItem == 0)
return str;
// add theory function name
str = theoItem->name + " ";
if (theoItem->name == "userFcn") {
str += "libMyLibrary.so TMyFunction ";
}
// add pseudo parameters
for (int i=0; i<theoItem->params; i++) {
str += QString("%1").arg(i+1) + " ";
}
// add comment
str += theoItem->comment;
return str;
}
//----------------------------------------------------------------------------------------------------
/**
* <p>
*/
void PGetTheoryBlockDialog::addPlus()
{
QString str = getTheoFuncString() + "\n+\n";
fTheoryBlock_textEdit->append(str);
}
//----------------------------------------------------------------------------------------------------
/**
* <p>
*/
void PGetTheoryBlockDialog::addMultiply()
{
QString str = getTheoFuncString() + "\n";
fTheoryBlock_textEdit->append(str);
}
//----------------------------------------------------------------------------------------------------
/**
* <p>