本文整理汇总了C++中CSlider::resetRange方法的典型用法代码示例。如果您正苦于以下问题:C++ CSlider::resetRange方法的具体用法?C++ CSlider::resetRange怎么用?C++ CSlider::resetRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSlider
的用法示例。
在下文中一共展示了CSlider::resetRange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createNewSlider
void SliderDialog::createNewSlider()
{
// allow the user to create more than one slider
std::vector<const CCopasiObject*> objects = CCopasiSelectionDialog::getObjectVector(this,
CQSimpleSelectionTree::InitialTime |
CQSimpleSelectionTree::Parameters);
std::vector<CSlider*>* pVector = getCSlidersForCurrentFolderId();
std::vector<const CCopasiObject*>::const_iterator it = objects.begin(), endit = objects.end();
bool yesToAll = false;
bool noToAll = false;
// create the sliders for all the selected objects
// first we need the task object because we need it later to associate the
// later with the correct task
CCopasiObject* object = (CCopasiObject*)getTaskForFolderId(mCurrentFolderId);
if (!object) return;
CCopasiObject* pTmpObject = NULL;
while (it != endit)
{
// create a new slider
assert((*it) != NULL);
pTmpObject = const_cast<CCopasiObject*>(determineCorrectObjectForSlider(*it));
CSlider* pCSlider = new CSlider("slider", (*CCopasiRootContainer::getDatamodelList())[0]);
if (pCSlider)
{
pCSlider->setSliderObject(pTmpObject);
pCSlider->setAssociatedEntityKey(object->getKey());
// check if a slider for that object already exists and if so, prompt
// the user what to do
CSlider* pEquivalentSlider = equivalentSliderExists(pCSlider);
if (pEquivalentSlider != NULL)
{
CopasiSlider* pCopasiSlider = NULL;
// if the user has specified yesToAll, we reset the ranges of all
// duplicate sliders
if (yesToAll)
{
pEquivalentSlider->resetRange();
// update the slider widget
pCopasiSlider = findCopasiSliderForCSlider(pEquivalentSlider);
assert(pCopasiSlider != NULL);
if (pCopasiSlider != NULL)
{
pCopasiSlider->updateSliderData();
}
}
// if the user has not specified noToAll, we need to prompt
else if (!noToAll)
{
QMessageBox::StandardButton result = CQMessageBox::information(NULL, "Slider Exists",
"A slider for this object already exists.\n\nDo you want to reset the range of the slider?",
QMessageBox::Yes | QMessageBox::No | QMessageBox::YesToAll | QMessageBox::NoToAll, QMessageBox::No);
// check the answer and maybe set some flags
switch (result)
{
case QMessageBox::YesToAll:
// set the flag
yesToAll = true;
case QMessageBox::Yes:
// reset the range
pEquivalentSlider->resetRange();
// update the slider widget
pCopasiSlider = findCopasiSliderForCSlider(pEquivalentSlider);
assert(pCopasiSlider != NULL);
if (pCopasiSlider != NULL)
{
pCopasiSlider->updateSliderData();
}
break;
case QMessageBox::NoToAll:
// set the flag
noToAll = true;
break;
case QMessageBox::No:
// do nothing else
break;
default:
// do nothing
break;
}
}
delete pCSlider;
}
else
//.........这里部分代码省略.........