Ignore:
Timestamp:
Dec 5, 2010, 12:17:34 AM (14 years ago)
Author:
Frederik Heber <heber@…>
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.
Message:

Merge branch 'MenuStructureChange' into stable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Menu/TextMenu/TextMenu.hpp

    r41e15b r5d4b73  
    1212#include <string>
    1313
     14#include "Helpers/MemDebug.hpp"
     15
    1416#include "Helpers/Log.hpp"
    1517#include "Helpers/Verbose.hpp"
     
    1921#include "Actions/ActionRegistry.hpp"
    2022#include "Actions/ActionTraits.hpp"
    21 #include "Menu/TextMenu/TxMenu.hpp"
     23#include "Menu/TextMenu/TxMenuLeaveAction.hpp"
    2224#include "Menu/TextMenu/ActionMenuItem.hpp"
    23 #include "Menu/TextMenu/SeperatorItem.hpp"
     25#include "Menu/TextMenu/SeparatorMenuItem.hpp"
    2426#include "Menu/TextMenu/SubMenuItem.hpp"
    2527
    2628/** 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 *
    2734 * \sa QtMenu.
    2835 */
     
    3138{
    3239public:
     40  /** Constructor for class TextMenu.
     41   * Initializes outputter and token and takes note whether to delete the
     42   * MenuInstance or not.
     43   */
    3344  TextMenu(std::ostream &_outputter, const std::string &_token) :
    3445    MenuInterface(_token),
     
    4657  {}
    4758
     59  /** Destructor of MenuInstance.
     60   *
     61   */
    4862  virtual ~TextMenu()
    4963  {
     
    5266  }
    5367
     68  /** Display this MenuInstance.
     69   *
     70   */
    5471  void display()
    5572  {
     
    5774  }
    5875
     76  /** Returns a pointer to the contained/wrapped MenuInstance.
     77   * \return pointer to template class pointer
     78   */
    5979  T * const getMenuInstance()
    6080  {
     
    6282  }
    6383
     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   */
    6488  void reserveShortcut(char trigger, const std::string &name)
    6589  {
     
    78102  MenuShortcutMap ShortcutMap;
    79103
     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   */
    80108  virtual void addActionItem(const std::string &token, const std::string &description)
    81109  {
     
    83111  }
    84112
     113  /** Adds a (dead) separator item.
     114   *
     115   */
    85116  virtual void addSeparatorItem()
    86117  {
    87     new SeperatorItem(MenuInstance);
     118    new SeparatorMenuItem(MenuInstance);
    88119  }
    89120
     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   */
    90127  virtual void addSubmenuItem(const std::string &token, const std::string &description)
    91128  {
     
    102139  }
    103140
     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   */
    104147  char getSuitableShortForm(const std::string &name)
    105148  {
Note: See TracChangeset for help on using the changeset viewer.