- Timestamp:
- May 8, 2010, 9:59:27 PM (15 years ago)
- 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:
- 808fd3
- Parents:
- 8e1f7af
- Location:
- src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/CommandLineUIFactory.cpp
r8e1f7af rd893f79 28 28 } 29 29 30 MainWindow* CommandLineUIFactory::makeMainWindow( menuPopulaters populaters) {31 return new CommandLineWindow( populaters);30 MainWindow* CommandLineUIFactory::makeMainWindow() { 31 return new CommandLineWindow(); 32 32 } -
src/UIElements/CommandLineUIFactory.hpp
r8e1f7af rd893f79 19 19 20 20 virtual Dialog* makeDialog(); 21 virtual MainWindow* makeMainWindow( menuPopulaters);21 virtual MainWindow* makeMainWindow(); 22 22 23 23 protected: -
src/UIElements/CommandLineWindow.cpp
r8e1f7af rd893f79 11 11 #include "UIElements/CommandLineStatusIndicator.hpp" 12 12 13 #include "Actions/CmdAction/HelpAction.hpp" 14 #include "Actions/ParserAction/LoadXyzAction.hpp" 15 #include "Actions/ParserAction/SaveXyzAction.hpp" 16 13 17 #include <iostream> 14 18 … … 16 20 17 21 // TODO: see what code can be moved to a base class for Graphic and CommandLine Windows 18 CommandLineWindow::CommandLineWindow( menuPopulaters populaters)22 CommandLineWindow::CommandLineWindow() 19 23 { 24 // create and register all command line callable actions 25 populateParserActions(); 20 26 21 27 // Add status indicators etc... 22 23 28 statusIndicator = new CommandLineStatusIndicator(); 24 29 } … … 31 36 void CommandLineWindow::display() { 32 37 } 38 39 void CommandLineWindow::populateParserActions() 40 { 41 new ParserLoadXyzAction(); 42 new ParserSaveXyzAction(); 43 } 44 -
src/UIElements/CommandLineWindow.hpp
r8e1f7af rd893f79 16 16 { 17 17 public: 18 CommandLineWindow( menuPopulaters);18 CommandLineWindow(); 19 19 virtual ~CommandLineWindow(); 20 20 … … 22 22 23 23 private: 24 // populaters 25 void populateParserActions(); 24 26 25 27 CommandLineStatusIndicator *statusIndicator; -
src/UIElements/MainWindow.hpp
r8e1f7af rd893f79 25 25 }; 26 26 27 /**28 * The type of menuPopulators29 */30 typedef void (*MenuMaker)(Menu*);31 32 /**33 * This contains all Functions that are used to create the menus.34 * Needs a specific funtion for each menu. All populators will be called35 * by the UIFactory upon creation of the main menu. Thus the actuall construction36 * of the Menus can be kept independent of the concrete type of UI that is being37 * built.38 */39 struct menuPopulaters{40 MenuMaker MakeEditMoleculesMenu;41 };42 27 43 28 #endif /* MAINWINDOW_HPP_ */ -
src/UIElements/TextUIFactory.cpp
r8e1f7af rd893f79 27 27 } 28 28 29 MainWindow* TextUIFactory::makeMainWindow( menuPopulaters populaters) {30 return new TextWindow( populaters);29 MainWindow* TextUIFactory::makeMainWindow() { 30 return new TextWindow(); 31 31 } 32 32 -
src/UIElements/TextUIFactory.hpp
r8e1f7af rd893f79 19 19 20 20 virtual Dialog* makeDialog(); 21 virtual MainWindow* makeMainWindow( menuPopulaters);21 virtual MainWindow* makeMainWindow(); 22 22 23 23 protected: -
src/UIElements/TextWindow.cpp
r8e1f7af rd893f79 39 39 #include "UIElements/TextStatusIndicator.hpp" 40 40 #include "Actions/MethodAction.hpp" 41 #include "Actions/MoleculeAction/ChangeNameAction.hpp" 41 42 #include "Actions/ErrorAction.hpp" 42 43 #include "Actions/ActionRegistry.hpp" … … 49 50 50 51 // TODO: see what code can be moved to a base class for Graphic and Text Windows 51 TextWindow::TextWindow( menuPopulaters populaters)52 TextWindow::TextWindow() 52 53 { 53 54 MoleculeListClass *molecules = World::getInstance().getMolecules(); … … 106 107 // call all functions used to build the submenus 107 108 108 populate rs.MakeEditMoleculesMenu(editMoleculesMenu);109 populateEditMoleculesMenu(editMoleculesMenu); 109 110 110 111 Action *returnFromEditMoleculeAction = new TextMenu::LeaveAction(editMoleculesMenu); … … 130 131 main_menu->display(); 131 132 } 133 134 void TextWindow::populateEditMoleculesMenu(Menu* editMoleculesMenu) 135 { 136 MoleculeListClass *molecules = World::getInstance().getMolecules(); 137 periodentafel *periode = World::getInstance().getPeriode(); 138 139 // build the EditMoleculesMenu 140 Action *createMoleculeAction = new MethodAction("createMoleculeAction",boost::bind(&MoleculeListClass::createNewMolecule,molecules,periode)); 141 new ActionMenuItem('c',"create new molecule",editMoleculesMenu,createMoleculeAction); 142 143 Action *loadMoleculeAction = new MethodAction("loadMoleculeAction",boost::bind(&MoleculeListClass::loadFromXYZ,molecules,periode)); 144 new ActionMenuItem('l',"load molecule from xyz file",editMoleculesMenu,loadMoleculeAction); 145 146 Action *changeFilenameAction = new MoleculeChangeNameAction(molecules); 147 new ActionMenuItem('n',"change molecule's name",editMoleculesMenu,changeFilenameAction); 148 149 Action *giveFilenameAction = new MethodAction("giveFilenameAction",boost::bind(&MoleculeListClass::setMoleculeFilename,molecules)); 150 new ActionMenuItem('N',"give molecules filename",editMoleculesMenu,giveFilenameAction); 151 152 Action *parseAtomsAction = new MethodAction("parseAtomsAction",boost::bind(&MoleculeListClass::parseXYZIntoMolecule,molecules)); 153 new ActionMenuItem('p',"parse atoms in xyz file into molecule",editMoleculesMenu,parseAtomsAction); 154 155 Action *eraseMoleculeAction = new MethodAction("eraseMoleculeAction",boost::bind(&MoleculeListClass::eraseMolecule,molecules)); 156 new ActionMenuItem('r',"remove a molecule",editMoleculesMenu,eraseMoleculeAction); 157 158 } -
src/UIElements/TextWindow.hpp
r8e1f7af rd893f79 17 17 class TextStatusIndicator; 18 18 19 19 20 class TextWindow : public MainWindow 20 21 { 21 22 public: 22 TextWindow( menuPopulaters);23 TextWindow(); 23 24 virtual ~TextWindow(); 24 25 25 26 virtual void display(); 26 27 private: 28 // populaters 29 void populateEditMoleculesMenu(Menu* editMoleculesMenu); 30 27 31 TextMenu *main_menu; 28 32 -
src/UIElements/UIFactory.hpp
r8e1f7af rd893f79 12 12 class Dialog; 13 13 class DialogDescription; 14 15 struct menuPopulaters;16 14 17 15 #include "Patterns/Singleton.hpp" … … 34 32 * Produce some kind of main window, of whichever type was chosen when the factory was created 35 33 */ 36 virtual MainWindow* makeMainWindow( menuPopulaters)=0;34 virtual MainWindow* makeMainWindow()=0; 37 35 38 36 /** -
src/builder.cpp
r8e1f7af rd893f79 2512 2512 }; 2513 2513 2514 /***************************************** Functions used to build all menus **********************/2515 2516 void populateEditMoleculesMenu(Menu* editMoleculesMenu){2517 MoleculeListClass *molecules = World::getInstance().getMolecules();2518 periodentafel *periode = World::getInstance().getPeriode();2519 2520 // build the EditMoleculesMenu2521 Action *createMoleculeAction = new MethodAction("createMoleculeAction",boost::bind(&MoleculeListClass::createNewMolecule,molecules,periode));2522 new ActionMenuItem('c',"create new molecule",editMoleculesMenu,createMoleculeAction);2523 2524 Action *loadMoleculeAction = new MethodAction("loadMoleculeAction",boost::bind(&MoleculeListClass::loadFromXYZ,molecules,periode));2525 new ActionMenuItem('l',"load molecule from xyz file",editMoleculesMenu,loadMoleculeAction);2526 2527 Action *changeFilenameAction = new MoleculeChangeNameAction(molecules);2528 new ActionMenuItem('n',"change molecule's name",editMoleculesMenu,changeFilenameAction);2529 2530 Action *giveFilenameAction = new MethodAction("giveFilenameAction",boost::bind(&MoleculeListClass::setMoleculeFilename,molecules));2531 new ActionMenuItem('N',"give molecules filename",editMoleculesMenu,giveFilenameAction);2532 2533 Action *parseAtomsAction = new MethodAction("parseAtomsAction",boost::bind(&MoleculeListClass::parseXYZIntoMolecule,molecules));2534 new ActionMenuItem('p',"parse atoms in xyz file into molecule",editMoleculesMenu,parseAtomsAction);2535 2536 Action *eraseMoleculeAction = new MethodAction("eraseMoleculeAction",boost::bind(&MoleculeListClass::eraseMolecule,molecules));2537 new ActionMenuItem('r',"remove a molecule",editMoleculesMenu,eraseMoleculeAction);2538 2539 }2540 2541 2542 2514 /********************************************** Main routine **************************************/ 2543 2515 … … 2586 2558 2587 2559 { 2588 menuPopulaters populaters; 2589 populaters.MakeEditMoleculesMenu = populateEditMoleculesMenu; 2590 2591 MainWindow *mainWindow = UIFactory::getInstance().makeMainWindow(populaters); 2560 MainWindow *mainWindow = UIFactory::getInstance().makeMainWindow(); 2592 2561 mainWindow->display(); 2593 2562 delete mainWindow;
Note:
See TracChangeset
for help on using the changeset viewer.