Changeset 5d4b73 for src/UIElements/Menu/TextMenu/TextMenu.hpp
- Timestamp:
- Dec 5, 2010, 12:17:34 AM (14 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:
- 589112
- Parents:
- 41e15b (diff), d754bb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Menu/TextMenu/TextMenu.hpp
r41e15b r5d4b73 12 12 #include <string> 13 13 14 #include "Helpers/MemDebug.hpp" 15 14 16 #include "Helpers/Log.hpp" 15 17 #include "Helpers/Verbose.hpp" … … 19 21 #include "Actions/ActionRegistry.hpp" 20 22 #include "Actions/ActionTraits.hpp" 21 #include "Menu/TextMenu/TxMenu .hpp"23 #include "Menu/TextMenu/TxMenuLeaveAction.hpp" 22 24 #include "Menu/TextMenu/ActionMenuItem.hpp" 23 #include "Menu/TextMenu/Sep eratorItem.hpp"25 #include "Menu/TextMenu/SeparatorMenuItem.hpp" 24 26 #include "Menu/TextMenu/SubMenuItem.hpp" 25 27 26 28 /** TextMenu is a specialization of MenuInterface to access TxMenu-like menus. 29 * 30 * Basically, this class is to be used in the MainWindow class of the TextUI. 31 * There, we simply instantiate the class and call init() in order to add all 32 * MenuItem's from MenuDescriptions and Action's ActionRegistry. 33 * 27 34 * \sa QtMenu. 28 35 */ … … 31 38 { 32 39 public: 40 /** Constructor for class TextMenu. 41 * Initializes outputter and token and takes note whether to delete the 42 * MenuInstance or not. 43 */ 33 44 TextMenu(std::ostream &_outputter, const std::string &_token) : 34 45 MenuInterface(_token), … … 46 57 {} 47 58 59 /** Destructor of MenuInstance. 60 * 61 */ 48 62 virtual ~TextMenu() 49 63 { … … 52 66 } 53 67 68 /** Display this MenuInstance. 69 * 70 */ 54 71 void display() 55 72 { … … 57 74 } 58 75 76 /** Returns a pointer to the contained/wrapped MenuInstance. 77 * \return pointer to template class pointer 78 */ 59 79 T * const getMenuInstance() 60 80 { … … 62 82 } 63 83 84 /** Reserves a specific trigger key such that it is not used during init(). 85 * \param trigger trigger key 86 * \param &name token given for reference. 87 */ 64 88 void reserveShortcut(char trigger, const std::string &name) 65 89 { … … 78 102 MenuShortcutMap ShortcutMap; 79 103 104 /** Adds an ActionItem by simply creating a new one. 105 * \param &token token of Action (token in ActionRegistry) 106 * \param &description descriptive text to be shown 107 */ 80 108 virtual void addActionItem(const std::string &token, const std::string &description) 81 109 { … … 83 111 } 84 112 113 /** Adds a (dead) separator item. 114 * 115 */ 85 116 virtual void addSeparatorItem() 86 117 { 87 new Sep eratorItem(MenuInstance);118 new SeparatorMenuItem(MenuInstance); 88 119 } 89 120 121 /** Adds a Menu to this current Menu. 122 * We also create here a leave action for this submenu to be able to return 123 * to the current one again 124 * \param &token token of the menu 125 * \param &description descriptive text 126 */ 90 127 virtual void addSubmenuItem(const std::string &token, const std::string &description) 91 128 { … … 102 139 } 103 140 141 /** Return the next available trigger key suitable to this name. 142 * This function is used internally to make sure that each key is unique to 143 * each Action/Menu. The chosen trigger key is also stored in an internal ShortcutMap. 144 * \param &name text shown in menu 145 * \return trigger key 146 */ 104 147 char getSuitableShortForm(const std::string &name) 105 148 {
Note:
See TracChangeset
for help on using the changeset viewer.