Changeset 1630ce


Ignore:
Timestamp:
Jan 13, 2010, 11:05:17 AM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
931903
Parents:
3896fc
Message:

Used new Query Infrastructure for SimpleAdd menupoint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/menu.cpp

    r3896fc r1630ce  
    2424#include "periodentafel.hpp"
    2525
     26#include "UIElements/UIFactory.hpp"
     27#include "UIElements/Dialog.hpp"
    2628#include "Menu/Menu.hpp"
    2729#include "Menu/TextMenu.hpp"
     
    912914
    913915void oldmenu::SimpleAddMolecules(MoleculeListClass *molecules) {
    914   int src, dest;
     916  //int src, dest;
    915917  molecule *srcmol = NULL, *destmol = NULL;
    916   {
     918  /*{
    917919    do {
    918920      Log() << Verbose(0) << "Enter index of destination molecule: ";
     
    927929    if ((src != -1) && (dest != -1))
    928930      molecules->SimpleAdd(srcmol, destmol);
     931  }*/
     932  Dialog *dialog = UIFactory::get()->makeDialog();
     933  dialog->queryMolecule("Enter index of destination molecule: ",&destmol, molecules);
     934  dialog->queryMolecule("Enter index of source molecule to add from: ",&srcmol, molecules);
     935  if(dialog->display()) {
     936    molecules->SimpleAdd(srcmol, destmol);
     937  }
     938  else {
     939    Log() << Verbose(0) << "Adding of Molecules canceled" << endl;
    929940  }
    930941}
Note: See TracChangeset for help on using the changeset viewer.