- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Menu/TextMenu/TextMenu.hpp
r670cd1 rb59da6 12 12 #include <string> 13 13 14 #include "Helpers/MemDebug.hpp"15 16 14 #include "Helpers/Log.hpp" 17 15 #include "Helpers/Verbose.hpp" … … 21 19 #include "Actions/ActionRegistry.hpp" 22 20 #include "Actions/ActionTraits.hpp" 23 #include "Menu/TextMenu/TxMenu LeaveAction.hpp"21 #include "Menu/TextMenu/TxMenu.hpp" 24 22 #include "Menu/TextMenu/ActionMenuItem.hpp" 25 #include "Menu/TextMenu/Sep aratorMenuItem.hpp"23 #include "Menu/TextMenu/SeperatorItem.hpp" 26 24 #include "Menu/TextMenu/SubMenuItem.hpp" 27 25 28 26 /** 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 all32 * MenuItem's from MenuDescriptions and Action's ActionRegistry.33 *34 27 * \sa QtMenu. 35 28 */ … … 38 31 { 39 32 public: 40 /** Constructor for class TextMenu.41 * Initializes outputter and token and takes note whether to delete the42 * MenuInstance or not.43 */44 33 TextMenu(std::ostream &_outputter, const std::string &_token) : 45 34 MenuInterface(_token), … … 57 46 {} 58 47 59 /** Destructor of MenuInstance.60 *61 */62 48 virtual ~TextMenu() 63 49 { … … 66 52 } 67 53 68 /** Display this MenuInstance.69 *70 */71 54 void display() 72 55 { … … 74 57 } 75 58 76 /** Returns a pointer to the contained/wrapped MenuInstance.77 * \return pointer to template class pointer78 */79 59 T * const getMenuInstance() 80 60 { … … 82 62 } 83 63 84 /** Reserves a specific trigger key such that it is not used during init().85 * \param trigger trigger key86 * \param &name token given for reference.87 */88 64 void reserveShortcut(char trigger, const std::string &name) 89 65 { … … 102 78 MenuShortcutMap ShortcutMap; 103 79 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 shown107 */108 80 virtual void addActionItem(const std::string &token, const std::string &description) 109 81 { … … 111 83 } 112 84 113 /** Adds a (dead) separator item.114 *115 */116 85 virtual void addSeparatorItem() 117 86 { 118 new Sep aratorMenuItem(MenuInstance);87 new SeperatorItem(MenuInstance); 119 88 } 120 89 121 /** Adds a Menu to this current Menu.122 * We also create here a leave action for this submenu to be able to return123 * to the current one again124 * \param &token token of the menu125 * \param &description descriptive text126 */127 90 virtual void addSubmenuItem(const std::string &token, const std::string &description) 128 91 { … … 139 102 } 140 103 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 to143 * each Action/Menu. The chosen trigger key is also stored in an internal ShortcutMap.144 * \param &name text shown in menu145 * \return trigger key146 */147 104 char getSuitableShortForm(const std::string &name) 148 105 {
Note:
See TracChangeset
for help on using the changeset viewer.