Website Summary Files Commits Branches @commit @diff @stats
path: root / docs / html / classMenu.html
blob: 3aff43b573d497e4ecf89fc2339aa25ccc622530 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FMI Table: Menu Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">FMI Table
   </div>
   <div id="projectbrief">| Kamen Mladenov | FMI Computer Science Year 1 Group 6 | Project 2 | Project Topic 7 |</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classMenu-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">Menu Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Handles navigation between multiple commands.  
 <a href="classMenu.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="Menu_8h_source.html">Menu.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad466dd83355124a6ed958430450bfe94"><td class="memItemLeft" align="right" valign="top"><a id="ad466dd83355124a6ed958430450bfe94" name="ad466dd83355124a6ed958430450bfe94"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>Menu</b> ()</td></tr>
<tr class="memdesc:ad466dd83355124a6ed958430450bfe94"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets name as "Menu", leaves all flags to false and creates an empty <a class="el" href="classCommand.html" title="Stores a 256 character name and a function pointer to be executed when calling run()">Command</a> list. <br /></td></tr>
<tr class="separator:ad466dd83355124a6ed958430450bfe94"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a429338a549cf1cb86c4b6a55488ea8e0"><td class="memItemLeft" align="right" valign="top"><a id="a429338a549cf1cb86c4b6a55488ea8e0" name="a429338a549cf1cb86c4b6a55488ea8e0"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>Menu</b> (const <a class="el" href="classCommand.html">Command</a> *commands, unsigned commandCount)</td></tr>
<tr class="memdesc:a429338a549cf1cb86c4b6a55488ea8e0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copies commands. <br /></td></tr>
<tr class="separator:a429338a549cf1cb86c4b6a55488ea8e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1f022cc8b705369073f8fd7b90b30c8d"><td class="memItemLeft" align="right" valign="top"><a id="a1f022cc8b705369073f8fd7b90b30c8d" name="a1f022cc8b705369073f8fd7b90b30c8d"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>addCommand</b> (const <a class="el" href="classCommand.html">Command</a> &amp;command)</td></tr>
<tr class="memdesc:a1f022cc8b705369073f8fd7b90b30c8d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a command to the internal <a class="el" href="classCommand.html" title="Stores a 256 character name and a function pointer to be executed when calling run()">Command</a> list. <br /></td></tr>
<tr class="separator:a1f022cc8b705369073f8fd7b90b30c8d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0400751da7f8583029b7a12d3003c36d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMenu.html#a0400751da7f8583029b7a12d3003c36d">navigate</a> () const</td></tr>
<tr class="memdesc:a0400751da7f8583029b7a12d3003c36d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Lists commands and after user input executes an appropriate command run() function.  <a href="classMenu.html#a0400751da7f8583029b7a12d3003c36d">More...</a><br /></td></tr>
<tr class="separator:a0400751da7f8583029b7a12d3003c36d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >Handles navigation between multiple commands. </p>
<p >Shows the title, then below it an Error/Warning/Success message if set, lists all command options as an enumerated list, takes command index and calls the chosen command's run() function. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a0400751da7f8583029b7a12d3003c36d" name="a0400751da7f8583029b7a12d3003c36d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0400751da7f8583029b7a12d3003c36d">&#9670;&nbsp;</a></span>navigate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Menu::navigate </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Lists commands and after user input executes an appropriate command run() function. </p>
<p >Prints the title, then an Error/Warning/Sucess message (if set), prints all command names as an ordered list (starting from 1), waits for user input to select one of those commands (by list number) and finally executes the appropriate command's run() function.</p>
<p >After the run() function exists, everything is reprinted. The 0 list index is always "Go Back"/"Exit" and it always stops the reprinting loop.</p>
<p >If there are no commands, prints "Menu is empty!". If user input doesn't correspond to any command, registers an error message and reprints. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/Generic/ConsoleInterface/<a class="el" href="Menu_8h_source.html">Menu.h</a></li>
<li>src/Generic/ConsoleInterface/Menu.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3
</small></address>
</body>
</html>