示例#1
0
    void response(int Response)
    {
      if (Response == Gtk::RESPONSE_OK)
      {
        unsigned int NextId = 1;

        if (mp_TestUnitsColl)
        {
          openfluid::core::UnitsList_t* TestUnits = mp_TestUnitsColl->getList();

          if (!TestUnits->empty())
          {
            NextId = TestUnits->end().operator --()->getID() + 1;

            while (mp_TestUnitsColl->getUnit(NextId))
              NextId++;
          }
        }

        openfluid::core::Unit U("TestUnits", NextId, 1,
            openfluid::core::InstantiationInfo::DESCRIPTOR);

        mp_SimulationBlob->getCoreRepository().addUnit(U);

        signal_ChangedOccurs().emit();
      }
      else
      {
        mp_Dialog->hide();
        signal_Hidden().emit();
      }
    }
示例#2
0
    void show()
    {
      openfluid::core::UnitsCollection* TestUnitsColl = 0;

      if (!mp_SimulationBlob)
      {
        mp_Dialog->set_message("I am DummyModalWindow\n"
          "Nb of units in TestUnits class: no CoreRepository\n"
          "Nothing to do");
      }
      else
      {
        unsigned int Size = 0;

        TestUnitsColl = mp_SimulationBlob->getCoreRepository().getUnits(
            "TestUnits");

        if (TestUnitsColl)
          Size = TestUnitsColl->getList()->size();

        mp_Dialog->set_message(Glib::ustring::compose("I am DummyModalWindow\n"
          "Nb of units in TestUnits class: %1\n"
          "Clicking ok will add a Unit of class \"TestUnits\"", Size));
      }

      if (mp_Dialog->run() == Gtk::RESPONSE_OK && mp_SimulationBlob)
      {
        unsigned int NextId = 1;

        if (TestUnitsColl)
        {
          openfluid::core::UnitsList_t* TestUnits = TestUnitsColl->getList();
          if (!TestUnits->empty())
          {
            NextId = TestUnits->end().operator --()->getID() + 1;

            while (TestUnitsColl->getUnit(NextId))
              NextId++;
          }

        }

        openfluid::core::Unit U("TestUnits", NextId, 1,
            openfluid::core::InstantiationInfo::DESCRIPTOR);

        mp_SimulationBlob->getCoreRepository().addUnit(U);

        signal_ChangedOccurs().emit();
      }

      mp_Dialog->hide();
    }
示例#3
0
 void onProjectClosed()
 {
   mp_Dialog->hide();
   signal_Hidden().emit();
 }
 void show()
 {
     mp_Dialog->run();
     mp_Dialog->hide();
 }