Terminal.Gui.MenuItem.html 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703
  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Class MenuItem
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class MenuItem
  11. ">
  12. <link rel="shortcut icon" href="../../favicon.ico">
  13. <link rel="stylesheet" href="../../styles/docfx.vendor.min.css">
  14. <link rel="stylesheet" href="../../styles/docfx.css">
  15. <link rel="stylesheet" href="../../styles/main.css">
  16. <meta property="docfx:navrel" content="../../toc.html">
  17. <meta property="docfx:tocrel" content="toc.html">
  18. <meta property="docfx:rel" content="../../">
  19. </head>
  20. <body data-spy="scroll" data-target="#affix" data-offset="120">
  21. <div id="wrapper">
  22. <header>
  23. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  24. <div class="container">
  25. <div class="navbar-header">
  26. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  27. <span class="sr-only">Toggle navigation</span>
  28. <span class="icon-bar"></span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. </button>
  32. <a class="navbar-brand" href="../../index.html">
  33. <img id="logo" class="svg" src="../../images/logo48.png" alt="">
  34. </a>
  35. </div>
  36. <div class="collapse navbar-collapse" id="navbar">
  37. <form class="navbar-form navbar-right" role="search" id="search">
  38. <div class="form-group">
  39. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  40. </div>
  41. </form>
  42. </div>
  43. </div>
  44. </nav>
  45. <div class="subnav navbar navbar-default">
  46. <div class="container hide-when-search" id="breadcrumb">
  47. <ul class="breadcrumb">
  48. <li></li>
  49. </ul>
  50. </div>
  51. </div>
  52. </header>
  53. <div class="container body-content">
  54. <div id="search-results">
  55. <div class="search-list">Search Results for <span></span></div>
  56. <div class="sr-items">
  57. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  58. </div>
  59. <ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
  60. </div>
  61. </div>
  62. <div role="main" class="container body-content hide-when-search">
  63. <div class="sidenav hide-when-search">
  64. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  65. <div class="sidetoggle collapse" id="sidetoggle">
  66. <div id="sidetoc"></div>
  67. </div>
  68. </div>
  69. <div class="article row grid-right">
  70. <div class="col-md-10">
  71. <article class="content wrap" id="_content" data-uid="Terminal.Gui.MenuItem">
  72. <h1 id="Terminal_Gui_MenuItem" data-uid="Terminal.Gui.MenuItem" class="text-break">Class MenuItem
  73. </h1>
  74. <div class="markdown level0 summary">A <a class="xref" href="Terminal.Gui.MenuItem.html">MenuItem</a> has title, an associated help text, and an action to execute on activation.
  75. MenuItems can also have a checked indicator (see <a class="xref" href="Terminal.Gui.MenuItem.html#Terminal_Gui_MenuItem_Checked">Checked</a>).</div>
  76. <div class="markdown level0 conceptual"></div>
  77. <div class="inheritance">
  78. <h5>Inheritance</h5>
  79. <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
  80. <div class="level1"><span class="xref">MenuItem</span></div>
  81. <div class="level2"><a class="xref" href="Terminal.Gui.MenuBarItem.html">MenuBarItem</a></div>
  82. </div>
  83. <div class="inheritedMembers">
  84. <h5>Inherited Members</h5>
  85. <div>
  86. <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
  87. </div>
  88. <div>
  89. <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
  90. </div>
  91. <div>
  92. <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
  93. </div>
  94. <div>
  95. <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
  96. </div>
  97. <div>
  98. <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>
  99. </div>
  100. <div>
  101. <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
  102. </div>
  103. <div>
  104. <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>
  105. </div>
  106. </div>
  107. <h6><strong>Namespace</strong>: <a class="xref" href="Terminal.html">Terminal</a>.<a class="xref" href="Terminal.Gui.html">Gui</a></h6>
  108. <h6><strong>Assembly</strong>: Terminal.Gui.dll</h6>
  109. <h5 id="Terminal_Gui_MenuItem_syntax">Syntax</h5>
  110. <div class="codewrapper">
  111. <pre><code class="lang-csharp hljs">public class MenuItem</code></pre>
  112. </div>
  113. <h3 id="constructors">Constructors
  114. </h3>
  115. <span class="small pull-right mobile-hide">
  116. <span class="divider">|</span>
  117. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_MenuItem__ctor_NStack_ustring_NStack_ustring_System_Action_System_Func_System_Boolean__Terminal_Gui_MenuItem_Terminal_Gui_Key_.md&amp;value=---%0Auid%3A%20Terminal.Gui.MenuItem.%23ctor(NStack.ustring%2CNStack.ustring%2CSystem.Action%2CSystem.Func%7BSystem.Boolean%7D%2CTerminal.Gui.MenuItem%2CTerminal.Gui.Key)%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  118. </span>
  119. <span class="small pull-right mobile-hide">
  120. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/Menu.cs/#L58">View Source</a>
  121. </span>
  122. <a id="Terminal_Gui_MenuItem__ctor_" data-uid="Terminal.Gui.MenuItem.#ctor*"></a>
  123. <h4 id="Terminal_Gui_MenuItem__ctor_NStack_ustring_NStack_ustring_System_Action_System_Func_System_Boolean__Terminal_Gui_MenuItem_Terminal_Gui_Key_" data-uid="Terminal.Gui.MenuItem.#ctor(NStack.ustring,NStack.ustring,System.Action,System.Func{System.Boolean},Terminal.Gui.MenuItem,Terminal.Gui.Key)">MenuItem(ustring, ustring, Action, Func&lt;bool&gt;, MenuItem, Key)</h4>
  124. <div class="markdown level1 summary">Initializes a new instance of <a class="xref" href="Terminal.Gui.MenuItem.html">MenuItem</a>.</div>
  125. <div class="markdown level1 conceptual"></div>
  126. <h5 class="declaration">Declaration</h5>
  127. <div class="codewrapper">
  128. <pre><code class="lang-csharp hljs">public MenuItem(ustring title, ustring help, Action action, Func&lt;bool&gt; canExecute = null, MenuItem parent = null, Key shortcut = Key.Null)</code></pre>
  129. </div>
  130. <h5 class="parameters">Parameters</h5>
  131. <table class="table table-bordered table-condensed">
  132. <thead>
  133. <tr>
  134. <th>Type</th>
  135. <th>Name</th>
  136. <th>Description</th>
  137. </tr>
  138. </thead>
  139. <tbody>
  140. <tr>
  141. <td><span class="xref">ustring</span></td>
  142. <td><span class="parametername">title</span></td>
  143. <td>Title for the menu item.</td>
  144. </tr>
  145. <tr>
  146. <td><span class="xref">ustring</span></td>
  147. <td><span class="parametername">help</span></td>
  148. <td>Help text to display.</td>
  149. </tr>
  150. <tr>
  151. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a></td>
  152. <td><span class="parametername">action</span></td>
  153. <td>Action to invoke when the menu item is activated.</td>
  154. </tr>
  155. <tr>
  156. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-1">Func</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>&gt;</td>
  157. <td><span class="parametername">canExecute</span></td>
  158. <td>Function to determine if the action can currently be executed.</td>
  159. </tr>
  160. <tr>
  161. <td><a class="xref" href="Terminal.Gui.MenuItem.html">MenuItem</a></td>
  162. <td><span class="parametername">parent</span></td>
  163. <td>The <a class="xref" href="Terminal.Gui.MenuItem.html#Terminal_Gui_MenuItem_Parent">Parent</a> of this menu item.</td>
  164. </tr>
  165. <tr>
  166. <td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
  167. <td><span class="parametername">shortcut</span></td>
  168. <td>The <a class="xref" href="Terminal.Gui.MenuItem.html#Terminal_Gui_MenuItem_Shortcut">Shortcut</a> keystroke combination.</td>
  169. </tr>
  170. </tbody>
  171. </table>
  172. <span class="small pull-right mobile-hide">
  173. <span class="divider">|</span>
  174. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_MenuItem__ctor_Terminal_Gui_Key_.md&amp;value=---%0Auid%3A%20Terminal.Gui.MenuItem.%23ctor(Terminal.Gui.Key)%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  175. </span>
  176. <span class="small pull-right mobile-hide">
  177. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/Menu.cs/#L47">View Source</a>
  178. </span>
  179. <a id="Terminal_Gui_MenuItem__ctor_" data-uid="Terminal.Gui.MenuItem.#ctor*"></a>
  180. <h4 id="Terminal_Gui_MenuItem__ctor_Terminal_Gui_Key_" data-uid="Terminal.Gui.MenuItem.#ctor(Terminal.Gui.Key)">MenuItem(Key)</h4>
  181. <div class="markdown level1 summary">Initializes a new instance of <a class="xref" href="Terminal.Gui.MenuItem.html">MenuItem</a></div>
  182. <div class="markdown level1 conceptual"></div>
  183. <h5 class="declaration">Declaration</h5>
  184. <div class="codewrapper">
  185. <pre><code class="lang-csharp hljs">public MenuItem(Key shortcut = Key.Null)</code></pre>
  186. </div>
  187. <h5 class="parameters">Parameters</h5>
  188. <table class="table table-bordered table-condensed">
  189. <thead>
  190. <tr>
  191. <th>Type</th>
  192. <th>Name</th>
  193. <th>Description</th>
  194. </tr>
  195. </thead>
  196. <tbody>
  197. <tr>
  198. <td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
  199. <td><span class="parametername">shortcut</span></td>
  200. <td></td>
  201. </tr>
  202. </tbody>
  203. </table>
  204. <h3 id="fields">Fields
  205. </h3>
  206. <span class="small pull-right mobile-hide">
  207. <span class="divider">|</span>
  208. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_MenuItem_HotKey.md&amp;value=---%0Auid%3A%20Terminal.Gui.MenuItem.HotKey%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  209. </span>
  210. <span class="small pull-right mobile-hide">
  211. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/Menu.cs/#L86">View Source</a>
  212. </span>
  213. <h4 id="Terminal_Gui_MenuItem_HotKey" data-uid="Terminal.Gui.MenuItem.HotKey">HotKey</h4>
  214. <div class="markdown level1 summary">The HotKey is used to activate a <a class="xref" href="Terminal.Gui.MenuItem.html">MenuItem</a> with the keyboard. HotKeys are defined by prefixing the <a class="xref" href="Terminal.Gui.MenuItem.html#Terminal_Gui_MenuItem_Title">Title</a>
  215. of a MenuItem with an underscore ('_').
  216. <p>
  217. Pressing Alt-Hotkey for a <a class="xref" href="Terminal.Gui.MenuBarItem.html">MenuBarItem</a> (menu items on the menu bar) works even if the menu is not active).
  218. Once a menu has focus and is active, pressing just the HotKey will activate the MenuItem.
  219. </p>
  220. <p>
  221. For example for a MenuBar with a "_File" MenuBarItem that contains a "_New" MenuItem, Alt-F will open the File menu.
  222. Pressing the N key will then activate the New MenuItem.
  223. </p>
  224. <p>
  225. See also <a class="xref" href="Terminal.Gui.MenuItem.html#Terminal_Gui_MenuItem_Shortcut">Shortcut</a> which enable global key-bindings to menu items.
  226. </p></div>
  227. <div class="markdown level1 conceptual"></div>
  228. <h5 class="declaration">Declaration</h5>
  229. <div class="codewrapper">
  230. <pre><code class="lang-csharp hljs">public Rune HotKey</code></pre>
  231. </div>
  232. <h5 class="fieldValue">Field Value</h5>
  233. <table class="table table-bordered table-condensed">
  234. <thead>
  235. <tr>
  236. <th>Type</th>
  237. <th>Description</th>
  238. </tr>
  239. </thead>
  240. <tbody>
  241. <tr>
  242. <td><span class="xref">Rune</span></td>
  243. <td></td>
  244. </tr>
  245. </tbody>
  246. </table>
  247. <h3 id="properties">Properties
  248. </h3>
  249. <span class="small pull-right mobile-hide">
  250. <span class="divider">|</span>
  251. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_MenuItem_Action.md&amp;value=---%0Auid%3A%20Terminal.Gui.MenuItem.Action%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  252. </span>
  253. <span class="small pull-right mobile-hide">
  254. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/Menu.cs/#L133">View Source</a>
  255. </span>
  256. <a id="Terminal_Gui_MenuItem_Action_" data-uid="Terminal.Gui.MenuItem.Action*"></a>
  257. <h4 id="Terminal_Gui_MenuItem_Action" data-uid="Terminal.Gui.MenuItem.Action">Action</h4>
  258. <div class="markdown level1 summary">Gets or sets the action to be invoked when the menu item is triggered.</div>
  259. <div class="markdown level1 conceptual"></div>
  260. <h5 class="declaration">Declaration</h5>
  261. <div class="codewrapper">
  262. <pre><code class="lang-csharp hljs">public Action Action { get; set; }</code></pre>
  263. </div>
  264. <h5 class="propertyValue">Property Value</h5>
  265. <table class="table table-bordered table-condensed">
  266. <thead>
  267. <tr>
  268. <th>Type</th>
  269. <th>Description</th>
  270. </tr>
  271. </thead>
  272. <tbody>
  273. <tr>
  274. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a></td>
  275. <td>Method to invoke.</td>
  276. </tr>
  277. </tbody>
  278. </table>
  279. <span class="small pull-right mobile-hide">
  280. <span class="divider">|</span>
  281. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_MenuItem_CanExecute.md&amp;value=---%0Auid%3A%20Terminal.Gui.MenuItem.CanExecute%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  282. </span>
  283. <span class="small pull-right mobile-hide">
  284. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/Menu.cs/#L140">View Source</a>
  285. </span>
  286. <a id="Terminal_Gui_MenuItem_CanExecute_" data-uid="Terminal.Gui.MenuItem.CanExecute*"></a>
  287. <h4 id="Terminal_Gui_MenuItem_CanExecute" data-uid="Terminal.Gui.MenuItem.CanExecute">CanExecute</h4>
  288. <div class="markdown level1 summary">Gets or sets the action to be invoked to determine if the menu can be triggered. If <a class="xref" href="Terminal.Gui.MenuItem.html#Terminal_Gui_MenuItem_CanExecute">CanExecute</a> returns <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a>
  289. the menu item will be enabled. Otherwise, it will be disabled.</div>
  290. <div class="markdown level1 conceptual"></div>
  291. <h5 class="declaration">Declaration</h5>
  292. <div class="codewrapper">
  293. <pre><code class="lang-csharp hljs">public Func&lt;bool&gt; CanExecute { get; set; }</code></pre>
  294. </div>
  295. <h5 class="propertyValue">Property Value</h5>
  296. <table class="table table-bordered table-condensed">
  297. <thead>
  298. <tr>
  299. <th>Type</th>
  300. <th>Description</th>
  301. </tr>
  302. </thead>
  303. <tbody>
  304. <tr>
  305. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-1">Func</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>&gt;</td>
  306. <td>Function to determine if the action is can be executed or not.</td>
  307. </tr>
  308. </tbody>
  309. </table>
  310. <span class="small pull-right mobile-hide">
  311. <span class="divider">|</span>
  312. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_MenuItem_CheckType.md&amp;value=---%0Auid%3A%20Terminal.Gui.MenuItem.CheckType%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  313. </span>
  314. <span class="small pull-right mobile-hide">
  315. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/Menu.cs/#L173">View Source</a>
  316. </span>
  317. <a id="Terminal_Gui_MenuItem_CheckType_" data-uid="Terminal.Gui.MenuItem.CheckType*"></a>
  318. <h4 id="Terminal_Gui_MenuItem_CheckType" data-uid="Terminal.Gui.MenuItem.CheckType">CheckType</h4>
  319. <div class="markdown level1 summary">Sets or gets the <a class="xref" href="Terminal.Gui.MenuItemCheckStyle.html">MenuItemCheckStyle</a> of a menu item where <a class="xref" href="Terminal.Gui.MenuItem.html#Terminal_Gui_MenuItem_Checked">Checked</a> is set to <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a>.</div>
  320. <div class="markdown level1 conceptual"></div>
  321. <h5 class="declaration">Declaration</h5>
  322. <div class="codewrapper">
  323. <pre><code class="lang-csharp hljs">public MenuItemCheckStyle CheckType { get; set; }</code></pre>
  324. </div>
  325. <h5 class="propertyValue">Property Value</h5>
  326. <table class="table table-bordered table-condensed">
  327. <thead>
  328. <tr>
  329. <th>Type</th>
  330. <th>Description</th>
  331. </tr>
  332. </thead>
  333. <tbody>
  334. <tr>
  335. <td><a class="xref" href="Terminal.Gui.MenuItemCheckStyle.html">MenuItemCheckStyle</a></td>
  336. <td></td>
  337. </tr>
  338. </tbody>
  339. </table>
  340. <span class="small pull-right mobile-hide">
  341. <span class="divider">|</span>
  342. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_MenuItem_Checked.md&amp;value=---%0Auid%3A%20Terminal.Gui.MenuItem.Checked%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  343. </span>
  344. <span class="small pull-right mobile-hide">
  345. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/Menu.cs/#L168">View Source</a>
  346. </span>
  347. <a id="Terminal_Gui_MenuItem_Checked_" data-uid="Terminal.Gui.MenuItem.Checked*"></a>
  348. <h4 id="Terminal_Gui_MenuItem_Checked" data-uid="Terminal.Gui.MenuItem.Checked">Checked</h4>
  349. <div class="markdown level1 summary">Sets or gets whether the <a class="xref" href="Terminal.Gui.MenuItem.html">MenuItem</a> shows a check indicator or not. See <a class="xref" href="Terminal.Gui.MenuItemCheckStyle.html">MenuItemCheckStyle</a>.</div>
  350. <div class="markdown level1 conceptual"></div>
  351. <h5 class="declaration">Declaration</h5>
  352. <div class="codewrapper">
  353. <pre><code class="lang-csharp hljs">public bool Checked { get; set; }</code></pre>
  354. </div>
  355. <h5 class="propertyValue">Property Value</h5>
  356. <table class="table table-bordered table-condensed">
  357. <thead>
  358. <tr>
  359. <th>Type</th>
  360. <th>Description</th>
  361. </tr>
  362. </thead>
  363. <tbody>
  364. <tr>
  365. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
  366. <td></td>
  367. </tr>
  368. </tbody>
  369. </table>
  370. <span class="small pull-right mobile-hide">
  371. <span class="divider">|</span>
  372. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_MenuItem_Data.md&amp;value=---%0Auid%3A%20Terminal.Gui.MenuItem.Data%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  373. </span>
  374. <span class="small pull-right mobile-hide">
  375. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/Menu.cs/#L42">View Source</a>
  376. </span>
  377. <a id="Terminal_Gui_MenuItem_Data_" data-uid="Terminal.Gui.MenuItem.Data*"></a>
  378. <h4 id="Terminal_Gui_MenuItem_Data" data-uid="Terminal.Gui.MenuItem.Data">Data</h4>
  379. <div class="markdown level1 summary">Gets or sets arbitrary data for the menu item.</div>
  380. <div class="markdown level1 conceptual"></div>
  381. <h5 class="declaration">Declaration</h5>
  382. <div class="codewrapper">
  383. <pre><code class="lang-csharp hljs">public object Data { get; set; }</code></pre>
  384. </div>
  385. <h5 class="propertyValue">Property Value</h5>
  386. <table class="table table-bordered table-condensed">
  387. <thead>
  388. <tr>
  389. <th>Type</th>
  390. <th>Description</th>
  391. </tr>
  392. </thead>
  393. <tbody>
  394. <tr>
  395. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
  396. <td></td>
  397. </tr>
  398. </tbody>
  399. </table>
  400. <h5 id="Terminal_Gui_MenuItem_Data_remarks">Remarks</h5>
  401. <div class="markdown level1 remarks">This property is not used internally.</div>
  402. <span class="small pull-right mobile-hide">
  403. <span class="divider">|</span>
  404. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_MenuItem_Help.md&amp;value=---%0Auid%3A%20Terminal.Gui.MenuItem.Help%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  405. </span>
  406. <span class="small pull-right mobile-hide">
  407. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/Menu.cs/#L127">View Source</a>
  408. </span>
  409. <a id="Terminal_Gui_MenuItem_Help_" data-uid="Terminal.Gui.MenuItem.Help*"></a>
  410. <h4 id="Terminal_Gui_MenuItem_Help" data-uid="Terminal.Gui.MenuItem.Help">Help</h4>
  411. <div class="markdown level1 summary">Gets or sets the help text for the menu item. The help text is drawn to the right of the <a class="xref" href="Terminal.Gui.MenuItem.html#Terminal_Gui_MenuItem_Title">Title</a>.</div>
  412. <div class="markdown level1 conceptual"></div>
  413. <h5 class="declaration">Declaration</h5>
  414. <div class="codewrapper">
  415. <pre><code class="lang-csharp hljs">public ustring Help { get; set; }</code></pre>
  416. </div>
  417. <h5 class="propertyValue">Property Value</h5>
  418. <table class="table table-bordered table-condensed">
  419. <thead>
  420. <tr>
  421. <th>Type</th>
  422. <th>Description</th>
  423. </tr>
  424. </thead>
  425. <tbody>
  426. <tr>
  427. <td><span class="xref">ustring</span></td>
  428. <td>The help text.</td>
  429. </tr>
  430. </tbody>
  431. </table>
  432. <span class="small pull-right mobile-hide">
  433. <span class="divider">|</span>
  434. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_MenuItem_Parent.md&amp;value=---%0Auid%3A%20Terminal.Gui.MenuItem.Parent%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  435. </span>
  436. <span class="small pull-right mobile-hide">
  437. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/Menu.cs/#L179">View Source</a>
  438. </span>
  439. <a id="Terminal_Gui_MenuItem_Parent_" data-uid="Terminal.Gui.MenuItem.Parent*"></a>
  440. <h4 id="Terminal_Gui_MenuItem_Parent" data-uid="Terminal.Gui.MenuItem.Parent">Parent</h4>
  441. <div class="markdown level1 summary">Gets the parent for this <a class="xref" href="Terminal.Gui.MenuItem.html">MenuItem</a>.</div>
  442. <div class="markdown level1 conceptual"></div>
  443. <h5 class="declaration">Declaration</h5>
  444. <div class="codewrapper">
  445. <pre><code class="lang-csharp hljs">public MenuItem Parent { get; }</code></pre>
  446. </div>
  447. <h5 class="propertyValue">Property Value</h5>
  448. <table class="table table-bordered table-condensed">
  449. <thead>
  450. <tr>
  451. <th>Type</th>
  452. <th>Description</th>
  453. </tr>
  454. </thead>
  455. <tbody>
  456. <tr>
  457. <td><a class="xref" href="Terminal.Gui.MenuItem.html">MenuItem</a></td>
  458. <td>The parent.</td>
  459. </tr>
  460. </tbody>
  461. </table>
  462. <span class="small pull-right mobile-hide">
  463. <span class="divider">|</span>
  464. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_MenuItem_Shortcut.md&amp;value=---%0Auid%3A%20Terminal.Gui.MenuItem.Shortcut%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  465. </span>
  466. <span class="small pull-right mobile-hide">
  467. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/Menu.cs/#L95">View Source</a>
  468. </span>
  469. <a id="Terminal_Gui_MenuItem_Shortcut_" data-uid="Terminal.Gui.MenuItem.Shortcut*"></a>
  470. <h4 id="Terminal_Gui_MenuItem_Shortcut" data-uid="Terminal.Gui.MenuItem.Shortcut">Shortcut</h4>
  471. <div class="markdown level1 summary">Shortcut defines a key binding to the MenuItem that will invoke the MenuItem's action globally for the <a class="xref" href="Terminal.Gui.View.html">View</a> that is
  472. the parent of the <a class="xref" href="Terminal.Gui.MenuBar.html">MenuBar</a> or <a class="xref" href="Terminal.Gui.ContextMenu.html">ContextMenu</a> this <a class="xref" href="Terminal.Gui.MenuItem.html">MenuItem</a>.
  473. <p>
  474. The <a class="xref" href="Terminal.Gui.Key.html">Key</a> will be drawn on the MenuItem to the right of the <a class="xref" href="Terminal.Gui.MenuItem.html#Terminal_Gui_MenuItem_Title">Title</a> and <a class="xref" href="Terminal.Gui.MenuItem.html#Terminal_Gui_MenuItem_Help">Help</a> text. See <a class="xref" href="Terminal.Gui.MenuItem.html#Terminal_Gui_MenuItem_ShortcutTag">ShortcutTag</a>.
  475. </p></div>
  476. <div class="markdown level1 conceptual"></div>
  477. <h5 class="declaration">Declaration</h5>
  478. <div class="codewrapper">
  479. <pre><code class="lang-csharp hljs">public Key Shortcut { get; set; }</code></pre>
  480. </div>
  481. <h5 class="propertyValue">Property Value</h5>
  482. <table class="table table-bordered table-condensed">
  483. <thead>
  484. <tr>
  485. <th>Type</th>
  486. <th>Description</th>
  487. </tr>
  488. </thead>
  489. <tbody>
  490. <tr>
  491. <td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
  492. <td></td>
  493. </tr>
  494. </tbody>
  495. </table>
  496. <span class="small pull-right mobile-hide">
  497. <span class="divider">|</span>
  498. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_MenuItem_ShortcutTag.md&amp;value=---%0Auid%3A%20Terminal.Gui.MenuItem.ShortcutTag%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  499. </span>
  500. <span class="small pull-right mobile-hide">
  501. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/Menu.cs/#L107">View Source</a>
  502. </span>
  503. <a id="Terminal_Gui_MenuItem_ShortcutTag_" data-uid="Terminal.Gui.MenuItem.ShortcutTag*"></a>
  504. <h4 id="Terminal_Gui_MenuItem_ShortcutTag" data-uid="Terminal.Gui.MenuItem.ShortcutTag">ShortcutTag</h4>
  505. <div class="markdown level1 summary">Gets the text describing the keystroke combination defined by <a class="xref" href="Terminal.Gui.MenuItem.html#Terminal_Gui_MenuItem_Shortcut">Shortcut</a>.</div>
  506. <div class="markdown level1 conceptual"></div>
  507. <h5 class="declaration">Declaration</h5>
  508. <div class="codewrapper">
  509. <pre><code class="lang-csharp hljs">public ustring ShortcutTag { get; }</code></pre>
  510. </div>
  511. <h5 class="propertyValue">Property Value</h5>
  512. <table class="table table-bordered table-condensed">
  513. <thead>
  514. <tr>
  515. <th>Type</th>
  516. <th>Description</th>
  517. </tr>
  518. </thead>
  519. <tbody>
  520. <tr>
  521. <td><span class="xref">ustring</span></td>
  522. <td></td>
  523. </tr>
  524. </tbody>
  525. </table>
  526. <span class="small pull-right mobile-hide">
  527. <span class="divider">|</span>
  528. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_MenuItem_Title.md&amp;value=---%0Auid%3A%20Terminal.Gui.MenuItem.Title%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  529. </span>
  530. <span class="small pull-right mobile-hide">
  531. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/Menu.cs/#L113">View Source</a>
  532. </span>
  533. <a id="Terminal_Gui_MenuItem_Title_" data-uid="Terminal.Gui.MenuItem.Title*"></a>
  534. <h4 id="Terminal_Gui_MenuItem_Title" data-uid="Terminal.Gui.MenuItem.Title">Title</h4>
  535. <div class="markdown level1 summary">Gets or sets the title of the menu item .</div>
  536. <div class="markdown level1 conceptual"></div>
  537. <h5 class="declaration">Declaration</h5>
  538. <div class="codewrapper">
  539. <pre><code class="lang-csharp hljs">public ustring Title { get; set; }</code></pre>
  540. </div>
  541. <h5 class="propertyValue">Property Value</h5>
  542. <table class="table table-bordered table-condensed">
  543. <thead>
  544. <tr>
  545. <th>Type</th>
  546. <th>Description</th>
  547. </tr>
  548. </thead>
  549. <tbody>
  550. <tr>
  551. <td><span class="xref">ustring</span></td>
  552. <td>The title.</td>
  553. </tr>
  554. </tbody>
  555. </table>
  556. <h3 id="methods">Methods
  557. </h3>
  558. <span class="small pull-right mobile-hide">
  559. <span class="divider">|</span>
  560. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_MenuItem_GetMenuBarItem.md&amp;value=---%0Auid%3A%20Terminal.Gui.MenuItem.GetMenuBarItem%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  561. </span>
  562. <span class="small pull-right mobile-hide">
  563. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/Menu.cs/#L197">View Source</a>
  564. </span>
  565. <a id="Terminal_Gui_MenuItem_GetMenuBarItem_" data-uid="Terminal.Gui.MenuItem.GetMenuBarItem*"></a>
  566. <h4 id="Terminal_Gui_MenuItem_GetMenuBarItem" data-uid="Terminal.Gui.MenuItem.GetMenuBarItem">GetMenuBarItem()</h4>
  567. <div class="markdown level1 summary">Merely a debugging aid to see the interaction with main.</div>
  568. <div class="markdown level1 conceptual"></div>
  569. <h5 class="declaration">Declaration</h5>
  570. <div class="codewrapper">
  571. <pre><code class="lang-csharp hljs">public bool GetMenuBarItem()</code></pre>
  572. </div>
  573. <h5 class="returns">Returns</h5>
  574. <table class="table table-bordered table-condensed">
  575. <thead>
  576. <tr>
  577. <th>Type</th>
  578. <th>Description</th>
  579. </tr>
  580. </thead>
  581. <tbody>
  582. <tr>
  583. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
  584. <td></td>
  585. </tr>
  586. </tbody>
  587. </table>
  588. <span class="small pull-right mobile-hide">
  589. <span class="divider">|</span>
  590. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_MenuItem_GetMenuItem.md&amp;value=---%0Auid%3A%20Terminal.Gui.MenuItem.GetMenuItem%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  591. </span>
  592. <span class="small pull-right mobile-hide">
  593. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/Menu.cs/#L189">View Source</a>
  594. </span>
  595. <a id="Terminal_Gui_MenuItem_GetMenuItem_" data-uid="Terminal.Gui.MenuItem.GetMenuItem*"></a>
  596. <h4 id="Terminal_Gui_MenuItem_GetMenuItem" data-uid="Terminal.Gui.MenuItem.GetMenuItem">GetMenuItem()</h4>
  597. <div class="markdown level1 summary">Merely a debugging aid to see the interaction with main.</div>
  598. <div class="markdown level1 conceptual"></div>
  599. <h5 class="declaration">Declaration</h5>
  600. <div class="codewrapper">
  601. <pre><code class="lang-csharp hljs">public MenuItem GetMenuItem()</code></pre>
  602. </div>
  603. <h5 class="returns">Returns</h5>
  604. <table class="table table-bordered table-condensed">
  605. <thead>
  606. <tr>
  607. <th>Type</th>
  608. <th>Description</th>
  609. </tr>
  610. </thead>
  611. <tbody>
  612. <tr>
  613. <td><a class="xref" href="Terminal.Gui.MenuItem.html">MenuItem</a></td>
  614. <td></td>
  615. </tr>
  616. </tbody>
  617. </table>
  618. <span class="small pull-right mobile-hide">
  619. <span class="divider">|</span>
  620. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_MenuItem_IsEnabled.md&amp;value=---%0Auid%3A%20Terminal.Gui.MenuItem.IsEnabled%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Edit this page</a>
  621. </span>
  622. <span class="small pull-right mobile-hide">
  623. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/Menu.cs/#L145">View Source</a>
  624. </span>
  625. <a id="Terminal_Gui_MenuItem_IsEnabled_" data-uid="Terminal.Gui.MenuItem.IsEnabled*"></a>
  626. <h4 id="Terminal_Gui_MenuItem_IsEnabled" data-uid="Terminal.Gui.MenuItem.IsEnabled">IsEnabled()</h4>
  627. <div class="markdown level1 summary">Returns <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> if the menu item is enabled. This method is a wrapper around <a class="xref" href="Terminal.Gui.MenuItem.html#Terminal_Gui_MenuItem_CanExecute">CanExecute</a>.</div>
  628. <div class="markdown level1 conceptual"></div>
  629. <h5 class="declaration">Declaration</h5>
  630. <div class="codewrapper">
  631. <pre><code class="lang-csharp hljs">public bool IsEnabled()</code></pre>
  632. </div>
  633. <h5 class="returns">Returns</h5>
  634. <table class="table table-bordered table-condensed">
  635. <thead>
  636. <tr>
  637. <th>Type</th>
  638. <th>Description</th>
  639. </tr>
  640. </thead>
  641. <tbody>
  642. <tr>
  643. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
  644. <td></td>
  645. </tr>
  646. </tbody>
  647. </table>
  648. </article>
  649. </div>
  650. <div class="hidden-sm col-md-2" role="complementary">
  651. <div class="sideaffix">
  652. <div class="contribution">
  653. <ul class="nav">
  654. <li>
  655. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_MenuItem.md&amp;value=---%0Auid%3A%20Terminal.Gui.MenuItem%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Edit this page</a>
  656. </li>
  657. <li>
  658. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/Menu.cs/#L33" class="contribution-link">View Source</a>
  659. </li>
  660. </ul>
  661. </div>
  662. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  663. <h5>In this article</h5>
  664. <div></div>
  665. </nav>
  666. </div>
  667. </div>
  668. </div>
  669. </div>
  670. <footer>
  671. <div class="grad-bottom"></div>
  672. <div class="footer">
  673. <div class="container">
  674. <span class="pull-right">
  675. <a href="#top">Back to top</a>
  676. </span>
  677. <span>Generated by <strong>DocFX</strong></span>
  678. </div>
  679. </div>
  680. </footer>
  681. </div>
  682. <script type="text/javascript" src="../../styles/docfx.vendor.min.js"></script>
  683. <script type="text/javascript" src="../../styles/docfx.js"></script>
  684. <script type="text/javascript" src="../../styles/main.js"></script>
  685. </body>
  686. </html>