当前位置: 首页>>代码示例>>C++>>正文


C++ CCopasiDataModel::getGUI方法代码示例

本文整理汇总了C++中CCopasiDataModel::getGUI方法的典型用法代码示例。如果您正苦于以下问题:C++ CCopasiDataModel::getGUI方法的具体用法?C++ CCopasiDataModel::getGUI怎么用?C++ CCopasiDataModel::getGUI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCopasiDataModel的用法示例。


在下文中一共展示了CCopasiDataModel::getGUI方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addSlider

void SliderDialog::addSlider(CSlider* pSlider)
{
  if (mpParentWindow == NULL)
    return;

  // check if there already is a slider for this  object
  CCopasiDataModel * pDataModel = pSlider->getObjectDataModel();
  assert(pDataModel != NULL);
  SCopasiXMLGUI* pGUI = pDataModel->getGUI();
  assert(pGUI);

  if (!equivalentSliderExists(pSlider))
    {
      CObjectInterface::ContainerList listOfContainers;
      assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
      listOfContainers.push_back(pDataModel->getModel());
      pSlider->compile(listOfContainers);
      pGUI->getSliderList()->add(pSlider, true);
    }

  CopasiSlider* tmp = findCopasiSliderForCSlider(pSlider);

  if (!tmp)
    {
      setCurrentSlider(new CopasiSlider(pSlider, mpParentWindow->getDataModel(), mpSliderBox));
      mpCurrSlider->installEventFilter(this);
      mpCurrSlider->setHidden(true);
      mpCurrSlider->updateSliderData();
      // make sure the slider points to the correct object
      // for the currently set framework
      this->setCorrectSliderObject(this->mpCurrSlider);
      mSliderMap[mCurrentFolderId].push_back(mpCurrSlider);
      QBoxLayout* layout = static_cast<QBoxLayout*>(mpSliderBox->layout());
      int childCount = layout->count() - 1;
      layout->insertWidget(childCount, mpCurrSlider);
      connect(mpCurrSlider, SIGNAL(valueChanged(double)), this , SLOT(sliderValueChanged()));
      connect(mpCurrSlider, SIGNAL(sliderReleased()), this, SLOT(sliderReleased()));
      connect(mpCurrSlider, SIGNAL(sliderPressed()), this, SLOT(sliderPressed()));
      connect(mpCurrSlider, SIGNAL(closeClicked(CopasiSlider*)), this, SLOT(removeSlider(CopasiSlider*)));
      connect(mpCurrSlider, SIGNAL(editClicked(CopasiSlider*)), this, SLOT(editSlider(CopasiSlider*)));
      mpCurrSlider->setHidden(false);
      mChanged = true;
    }
开发者ID:,项目名称:,代码行数:43,代码来源:

示例2: removeSlider

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;
    }
}
开发者ID:,项目名称:,代码行数:24,代码来源:


注:本文中的CCopasiDataModel::getGUI方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。