Changeset 096214


Ignore:
Timestamp:
Jan 2, 2010, 3:28:29 PM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
477bb2
Parents:
7c6f73
Message:

Made EditMoleculesMenu a Submenu inside the MainMenu

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/menu.cpp

    r7c6f73 r096214  
    2929#include "Menu/SeperatorItem.hpp"
    3030#include "Menu/DisplayMenuItem.hpp"
     31#include "Menu/SubMenuItem.hpp"
    3132#include "Actions/MethodAction.hpp"
    3233#include "Views/StreamStringView.hpp"
     
    986987};
    987988
    988 
    989 /** Submenu for creating new molecules.
    990  * \param *periode periodentafel
    991  * \param *molecules list of molecules to add to
    992  */
    993 void oldmenu::EditMolecules(periodentafel *periode, MoleculeListClass *molecules)
    994 {
    995   TextMenu *edit_molecules_menu = new TextMenu(Log() << Verbose(0), "Edit Molecules");
    996 
    997   Action *createMoleculeAction = new MethodAction(boost::bind(&oldmenu::createNewMolecule,this,periode,molecules));
    998   new ActionMenuItem('c',"create new molecule",edit_molecules_menu,createMoleculeAction);
    999 
    1000   Action *loadMoleculeAction = new MethodAction(boost::bind(&oldmenu::loadFromXYZ,this,periode,molecules));
    1001   new ActionMenuItem('l',"load molecule from xyz file",edit_molecules_menu,loadMoleculeAction);
    1002 
    1003   Action *changeFilenameAction = new MethodAction(boost::bind(&oldmenu::changeName,this,molecules));
    1004   new ActionMenuItem('n',"change molecule's name",edit_molecules_menu,changeFilenameAction);
    1005 
    1006   Action *giveFilenameAction = new MethodAction(boost::bind(&oldmenu::setMoleculeFilename,this,molecules));
    1007   new ActionMenuItem('N',"give molecules filename",edit_molecules_menu,giveFilenameAction);
    1008 
    1009   Action *parseAtomsAction = new MethodAction(boost::bind(&oldmenu::parseXYZIntoMolecule,this,molecules));
    1010   new ActionMenuItem('p',"parse atoms in xyz file into molecule",edit_molecules_menu,parseAtomsAction);
    1011 
    1012   Action *eraseMoleculeAction = new MethodAction(boost::bind(&oldmenu::eraseMolecule,this,molecules));
    1013   new ActionMenuItem('r',"remove a molecule",edit_molecules_menu,eraseMoleculeAction);
    1014 
    1015   Action *returnAction = new MethodAction(boost::bind(&TextMenu::doQuit,edit_molecules_menu));
    1016   MenuItem *returnItem = new ActionMenuItem('q',"return to Main menu",edit_molecules_menu,returnAction);
    1017 
    1018   edit_molecules_menu->addDefault(returnItem);
    1019 
    1020 
    1021   edit_molecules_menu->display();
    1022 
    1023   delete edit_molecules_menu;
    1024   delete createMoleculeAction;
    1025   delete loadMoleculeAction;
    1026   delete changeFilenameAction;
    1027   delete giveFilenameAction;
    1028   delete parseAtomsAction;
    1029   delete eraseMoleculeAction;
    1030   delete returnAction;
    1031 
    1032 #if 0
    1033   char choice;  // menu choice char
    1034 
    1035   Log() << Verbose(0) << "==========EDIT MOLECULES=====================" << endl;
    1036   Log() << Verbose(0) << "c - create new molecule" << endl;
    1037   Log() << Verbose(0) << "l - load molecule from xyz file" << endl;
    1038   Log() << Verbose(0) << "n - change molecule's name" << endl;
    1039   Log() << Verbose(0) << "N - give molecules filename" << endl;
    1040   Log() << Verbose(0) << "p - parse atoms in xyz file into molecule" << endl;
    1041   Log() << Verbose(0) << "r - remove a molecule" << endl;
    1042   Log() << Verbose(0) << "all else - go back" << endl;
    1043   Log() << Verbose(0) << "===============================================" << endl;
    1044   Log() << Verbose(0) << "INPUT: ";
    1045   cin >> choice;
    1046 
    1047   switch (choice) {
    1048     default:
    1049       Log() << Verbose(0) << "Not a valid choice." << endl;
    1050       break;
    1051     case 'c':
    1052         createNewMolecule(periode,molecules);
    1053       break;
    1054 
    1055     case 'l': // load from XYZ file
    1056       loadFromXYZ(periode,molecules);
    1057       break;
    1058 
    1059     case 'n':
    1060       changeName(molecules);
    1061       break;
    1062 
    1063     case 'N':
    1064       setMoleculeFilename(molecules);
    1065       break;
    1066 
    1067     case 'p': // parse XYZ file
    1068       parseXYZIntoMolecule(molecules);
    1069       break;
    1070 
    1071     case 'r':
    1072       eraseMolecule(molecules);
    1073       break;
    1074   }
    1075 #endif
    1076 };
    1077 
    1078 
    1079989/** Submenu for merging molecules.
    1080990 * \param *periode periodentafel
     
    13011211  new ActionMenuItem('a',"set molecule (in)active",main_menu,setMoleculeAction);
    13021212
    1303   Action *editMoleculeAction = new MethodAction(boost::bind(&oldmenu::EditMolecules,this,periode, molecules));
    1304   new ActionMenuItem('e',"edit molecules (load, parse, save)",main_menu,editMoleculeAction);
     1213  TextMenu *edit_molecules_menu = new TextMenu(Log() << Verbose(0), "Edit Molecules");
     1214  new SubMenuItem('e',"edit molecules (load, parse, save)",main_menu,edit_molecules_menu);
    13051215
    13061216  Action *manipulateMoleculeAction = new MethodAction(boost::bind(&oldmenu::ManipulateMolecules,this,periode, molecules, configuration));
     
    13291239  new ActionMenuItem('q',"quit",main_menu,quitAction);
    13301240
     1241  // build the EditMoleculesMenu
     1242  Action *createMoleculeAction = new MethodAction(boost::bind(&oldmenu::createNewMolecule,this,periode,molecules));
     1243  new ActionMenuItem('c',"create new molecule",edit_molecules_menu,createMoleculeAction);
     1244
     1245  Action *loadMoleculeAction = new MethodAction(boost::bind(&oldmenu::loadFromXYZ,this,periode,molecules));
     1246  new ActionMenuItem('l',"load molecule from xyz file",edit_molecules_menu,loadMoleculeAction);
     1247
     1248  Action *changeFilenameAction = new MethodAction(boost::bind(&oldmenu::changeName,this,molecules));
     1249  new ActionMenuItem('n',"change molecule's name",edit_molecules_menu,changeFilenameAction);
     1250
     1251  Action *giveFilenameAction = new MethodAction(boost::bind(&oldmenu::setMoleculeFilename,this,molecules));
     1252  new ActionMenuItem('N',"give molecules filename",edit_molecules_menu,giveFilenameAction);
     1253
     1254  Action *parseAtomsAction = new MethodAction(boost::bind(&oldmenu::parseXYZIntoMolecule,this,molecules));
     1255  new ActionMenuItem('p',"parse atoms in xyz file into molecule",edit_molecules_menu,parseAtomsAction);
     1256
     1257  Action *eraseMoleculeAction = new MethodAction(boost::bind(&oldmenu::eraseMolecule,this,molecules));
     1258  new ActionMenuItem('r',"remove a molecule",edit_molecules_menu,eraseMoleculeAction);
     1259
     1260  Action *returnAction = new MethodAction(boost::bind(&TextMenu::doQuit,edit_molecules_menu));
     1261  MenuItem *returnItem = new ActionMenuItem('q',"return to Main menu",edit_molecules_menu,returnAction);
     1262
     1263  edit_molecules_menu->addDefault(returnItem);
    13311264
    13321265  main_menu->display();
    13331266
    13341267
     1268  delete main_menu;
     1269
     1270  // delete all actions and views contained in Menu
     1271  // TODO: find a better way to handle this
     1272
    13351273  delete moleculeView;
    13361274
    13371275  delete setMoleculeAction;
    1338   delete editMoleculeAction;
    13391276  delete manipulateMoleculeAction;
    13401277  delete mergeMoleculeAction;
     
    13451282  delete quitAction;
    13461283
    1347   delete main_menu;
     1284  delete createMoleculeAction;
     1285  delete loadMoleculeAction;
     1286  delete changeFilenameAction;
     1287  delete giveFilenameAction;
     1288  delete parseAtomsAction;
     1289  delete eraseMoleculeAction;
     1290  delete returnAction;
    13481291};
    13491292
  • src/menu.hpp

    r7c6f73 r096214  
    3838  void AlignAtoms(periodentafel *, molecule *);
    3939  void CenterAtoms(molecule *);
    40   void EditMolecules(periodentafel *, MoleculeListClass *);
    4140  void FragmentAtoms(molecule *, config *);
    4241  void ManipulateAtoms(periodentafel *, MoleculeListClass *, config *);
Note: See TracChangeset for help on using the changeset viewer.