void SliderDialog::removeSlider() { if (mpCurrSlider) { assert(CCopasiRootContainer::getDatamodelList()->size() > 0); CCopasiVector<CSlider>* pSliderList = (*CCopasiRootContainer::getDatamodelList())[0]->getGUI()->getSliderList(); size_t i, maxCount = pSliderList->size(); for (i = 0; i < maxCount; ++i) { CSlider* pTmpSlider = (*pSliderList)[i]; if (pTmpSlider == mpCurrSlider->getCSlider()) { pSliderList->remove(i); break; } } deleteSlider(mpCurrSlider); mpCurrSlider = NULL; } }
void SliderDialog::removeSlider() { if (mpCurrSlider) { CCopasiDataModel * pDataModel = mpCurrSlider->getCSlider()->getObjectDataModel(); assert(pDataModel != NULL); CCopasiVector<CSlider>* pSliderList = pDataModel->getGUI()->getSliderList(); size_t i, maxCount = pSliderList->size(); for (i = 0; i < maxCount; ++i) { CSlider* pTmpSlider = &pSliderList->operator[](i); if (pTmpSlider == mpCurrSlider->getCSlider()) { pSliderList->remove(i); break; } } deleteSlider(mpCurrSlider); mpCurrSlider = NULL; } }