- Timestamp:
- Mar 26, 2010, 3:13:31 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:
- 0a4f7f, 2efa90, 4415da, 9cf88c
- Parents:
- f6bbc6
- Location:
- src/Menu
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Menu/ActionMenuItem.cpp
rf6bbc6 rf9352d 20 20 21 21 ActionMenuItem::~ActionMenuItem() 22 { 23 // TODO Auto-generated destructor stub 24 } 22 {} 25 23 26 24 void ActionMenuItem::doTrigger() { 27 25 action->call(); 28 26 } 27 28 bool ActionMenuItem::isActive() { 29 return action->isActive(); 30 } -
src/Menu/ActionMenuItem.hpp
rf6bbc6 rf9352d 26 26 virtual void doTrigger(); 27 27 28 virtual bool isActive(); 29 28 30 private: 29 31 Action* action; //!< this action will be called when the trigger matches -
src/Menu/MenuItem.cpp
rf6bbc6 rf9352d 78 78 return added; 79 79 } 80 81 bool MenuItem::isActive(){ 82 return true; 83 } -
src/Menu/MenuItem.hpp
rf6bbc6 rf9352d 21 21 */ 22 22 class MenuItem { 23 private:24 char trigger;25 string *description;26 bool added;27 28 23 public: 29 24 MenuItem(char,const char*,Menu*); … … 41 36 bool wasAdded(); 42 37 38 virtual bool isActive(); 39 43 40 protected: 44 41 void setDescription(string); 42 43 private: 44 char trigger; 45 string *description; 46 bool added; 45 47 }; 46 48 -
src/Menu/TextMenu.cpp
rf6bbc6 rf9352d 52 52 53 53 void TextMenu::showEntry(MenuItem* entry){ 54 outputter << entry->formatEntry() << "\n"; 54 if(entry->isActive()==false){ 55 outputter << "("; 56 } 57 outputter << entry->formatEntry(); 58 if(entry->isActive()==false){ 59 outputter << ")"; 60 } 61 outputter << "\n"; 55 62 } 56 63 … … 75 82 list<MenuItem*>::iterator iter; 76 83 for(iter = items.begin(); iter!=items.end();iter++){ 77 somethingChosen |= (*iter)->checkTrigger(choice); 84 if((*iter)->isActive()){ 85 somethingChosen |= (*iter)->checkTrigger(choice); 86 } 78 87 } 79 88 // see if something was chosen and call default Item if not
Note:
See TracChangeset
for help on using the changeset viewer.