Ignore:
Timestamp:
Dec 4, 2010, 11:42:38 PM (15 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:
f0f9a6
Parents:
0af7ef
git-author:
Frederik Heber <heber@…> (11/08/10 10:31:40)
git-committer:
Frederik Heber <heber@…> (12/04/10 23:42:38)
Message:

Added documentation on the new menu structure.

File:
1 edited

Legend:

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

    r0af7ef r8f3f40  
    2525
    2626/** TextMenu is a specialization of MenuInterface to access TxMenu-like menus.
     27 *
     28 * Basically, this class is to be used in the MainWindow class of the TextUI.
     29 * There, we simply instantiate the class and call init() in order to add all
     30 * MenuItem's from MenuDescriptions and Action's ActionRegistry.
     31 *
    2732 * \sa QtMenu.
    2833 */
     
    3136{
    3237public:
     38  /** Constructor for class TextMenu.
     39   * Initializes outputter and token and takes note whether to delete the
     40   * MenuInstance or not.
     41   */
    3342  TextMenu(std::ostream &_outputter, const std::string &_token) :
    3443    MenuInterface(_token),
     
    4655  {}
    4756
     57  /** Destructor of MenuInstance.
     58   *
     59   */
    4860  virtual ~TextMenu()
    4961  {
     
    5264  }
    5365
     66  /** Display this MenuInstance.
     67   *
     68   */
    5469  void display()
    5570  {
     
    5772  }
    5873
     74  /** Returns a pointer to the contained/wrapped MenuInstance.
     75   * \return pointer to template class pointer
     76   */
    5977  T * const getMenuInstance()
    6078  {
     
    6280  }
    6381
     82  /** Reserves a specific trigger key such that it is not used during init().
     83   * \param trigger trigger key
     84   * \param &name token given for reference.
     85   */
    6486  void reserveShortcut(char trigger, const std::string &name)
    6587  {
     
    78100  MenuShortcutMap ShortcutMap;
    79101
     102  /** Adds an ActionItem by simply creating a new one.
     103   * \param &token token of Action (token in ActionRegistry)
     104   * \param &description descriptive text to be shown
     105   */
    80106  virtual void addActionItem(const std::string &token, const std::string &description)
    81107  {
     
    83109  }
    84110
     111  /** Adds a (dead) separator item.
     112   *
     113   */
    85114  virtual void addSeparatorItem()
    86115  {
     
    88117  }
    89118
     119  /** Adds a Menu to this current Menu.
     120   * We also create here a leave action for this submenu to be able to return
     121   * to the current one again
     122   * \param &token token of the menu
     123   * \param &description descriptive text
     124   */
    90125  virtual void addSubmenuItem(const std::string &token, const std::string &description)
    91126  {
     
    102137  }
    103138
     139  /** Return the next available trigger key suitable to this name.
     140   * This function is used internally to make sure that each key is unique to
     141   * each Action/Menu. The chosen trigger key is also stored in an internal ShortcutMap.
     142   * \param &name text shown in menu
     143   * \return trigger key
     144   */
    104145  char getSuitableShortForm(const std::string &name)
    105146  {
Note: See TracChangeset for help on using the changeset viewer.