Terminal.Gui.ContextMenu.html 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  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 ContextMenu
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class ContextMenu
  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.ContextMenu">
  72. <h1 id="Terminal_Gui_ContextMenu" data-uid="Terminal.Gui.ContextMenu" class="text-break">Class ContextMenu
  73. </h1>
  74. <div class="markdown level0 summary">ContextMenu provides a pop-up menu that can be positioned anywhere within a <a class="xref" href="Terminal.Gui.View.html">View</a>.
  75. ContextMenu is analogous to <a class="xref" href="Terminal.Gui.ContextMenu.html#Terminal_Gui_ContextMenu_MenuBar">MenuBar</a> and, once activated, works like a sub-menu
  76. of a <a class="xref" href="Terminal.Gui.MenuBarItem.html">MenuBarItem</a> (but can be positioned anywhere).
  77. <p>
  78. By default, a ContextMenu with sub-menus is displayed in a cascading manner, where each sub-menu pops out of the ContextMenu frame
  79. (either to the right or left, depending on where the ContextMenu is relative to the edge of the screen). By setting
  80. <a class="xref" href="Terminal.Gui.ContextMenu.html#Terminal_Gui_ContextMenu_UseSubMenusSingleFrame">UseSubMenusSingleFrame</a> to <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a>, this behavior can be changed such that all sub-menus are
  81. drawn within the ContextMenu frame.
  82. </p>
  83. <p>
  84. ContextMenus can be activated using the Shift-F10 key (by default; use the <a class="xref" href="Terminal.Gui.ContextMenu.html#Terminal_Gui_ContextMenu_Key">Key</a> to change to another key).
  85. </p>
  86. <p>
  87. Callers can cause the ContextMenu to be activated on a right-mouse click (or other interaction) by calling <a class="xref" href="Terminal.Gui.ContextMenu.html#Terminal_Gui_ContextMenu_Show">Show()</a>.
  88. </p>
  89. <p>
  90. ContextMenus are located using screen using screen coordinates and appear above all other Views.
  91. </p></div>
  92. <div class="markdown level0 conceptual"></div>
  93. <div class="inheritance">
  94. <h5>Inheritance</h5>
  95. <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
  96. <div class="level1"><span class="xref">ContextMenu</span></div>
  97. </div>
  98. <div class="implements">
  99. <h5>Implements</h5>
  100. <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
  101. </div>
  102. <div class="inheritedMembers">
  103. <h5>Inherited Members</h5>
  104. <div>
  105. <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
  106. </div>
  107. <div>
  108. <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>
  109. </div>
  110. <div>
  111. <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
  112. </div>
  113. <div>
  114. <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
  115. </div>
  116. <div>
  117. <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
  118. </div>
  119. <div>
  120. <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>
  121. </div>
  122. </div>
  123. <h6><strong>Namespace</strong>: <a class="xref" href="Terminal.html">Terminal</a>.<a class="xref" href="Terminal.Gui.html">Gui</a></h6>
  124. <h6><strong>Assembly</strong>: Terminal.Gui.dll</h6>
  125. <h5 id="Terminal_Gui_ContextMenu_syntax">Syntax</h5>
  126. <div class="codewrapper">
  127. <pre><code class="lang-csharp hljs">public sealed class ContextMenu : IDisposable</code></pre>
  128. </div>
  129. <h3 id="constructors">Constructors
  130. </h3>
  131. <span class="small pull-right mobile-hide">
  132. <span class="divider">|</span>
  133. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu__ctor.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu.%23ctor%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>
  134. </span>
  135. <span class="small pull-right mobile-hide">
  136. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L33">View Source</a>
  137. </span>
  138. <a id="Terminal_Gui_ContextMenu__ctor_" data-uid="Terminal.Gui.ContextMenu.#ctor*"></a>
  139. <h4 id="Terminal_Gui_ContextMenu__ctor" data-uid="Terminal.Gui.ContextMenu.#ctor">ContextMenu()</h4>
  140. <div class="markdown level1 summary">Initializes a context menu with no menu items.</div>
  141. <div class="markdown level1 conceptual"></div>
  142. <h5 class="declaration">Declaration</h5>
  143. <div class="codewrapper">
  144. <pre><code class="lang-csharp hljs">public ContextMenu()</code></pre>
  145. </div>
  146. <span class="small pull-right mobile-hide">
  147. <span class="divider">|</span>
  148. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu__ctor_System_Int32_System_Int32_Terminal_Gui_MenuBarItem_.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu.%23ctor(System.Int32%2CSystem.Int32%2CTerminal.Gui.MenuBarItem)%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>
  149. </span>
  150. <span class="small pull-right mobile-hide">
  151. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L52">View Source</a>
  152. </span>
  153. <a id="Terminal_Gui_ContextMenu__ctor_" data-uid="Terminal.Gui.ContextMenu.#ctor*"></a>
  154. <h4 id="Terminal_Gui_ContextMenu__ctor_System_Int32_System_Int32_Terminal_Gui_MenuBarItem_" data-uid="Terminal.Gui.ContextMenu.#ctor(System.Int32,System.Int32,Terminal.Gui.MenuBarItem)">ContextMenu(int, int, MenuBarItem)</h4>
  155. <div class="markdown level1 summary">Initializes a context menu with menu items at a specific screen location.</div>
  156. <div class="markdown level1 conceptual"></div>
  157. <h5 class="declaration">Declaration</h5>
  158. <div class="codewrapper">
  159. <pre><code class="lang-csharp hljs">public ContextMenu(int x, int y, MenuBarItem menuItems)</code></pre>
  160. </div>
  161. <h5 class="parameters">Parameters</h5>
  162. <table class="table table-bordered table-condensed">
  163. <thead>
  164. <tr>
  165. <th>Type</th>
  166. <th>Name</th>
  167. <th>Description</th>
  168. </tr>
  169. </thead>
  170. <tbody>
  171. <tr>
  172. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
  173. <td><span class="parametername">x</span></td>
  174. <td>The left position (screen relative).</td>
  175. </tr>
  176. <tr>
  177. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
  178. <td><span class="parametername">y</span></td>
  179. <td>The top position (screen relative).</td>
  180. </tr>
  181. <tr>
  182. <td><a class="xref" href="Terminal.Gui.MenuBarItem.html">MenuBarItem</a></td>
  183. <td><span class="parametername">menuItems</span></td>
  184. <td>The menu items.</td>
  185. </tr>
  186. </tbody>
  187. </table>
  188. <span class="small pull-right mobile-hide">
  189. <span class="divider">|</span>
  190. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu__ctor_Terminal_Gui_View_Terminal_Gui_MenuBarItem_.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu.%23ctor(Terminal.Gui.View%2CTerminal.Gui.MenuBarItem)%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>
  191. </span>
  192. <span class="small pull-right mobile-hide">
  193. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L40">View Source</a>
  194. </span>
  195. <a id="Terminal_Gui_ContextMenu__ctor_" data-uid="Terminal.Gui.ContextMenu.#ctor*"></a>
  196. <h4 id="Terminal_Gui_ContextMenu__ctor_Terminal_Gui_View_Terminal_Gui_MenuBarItem_" data-uid="Terminal.Gui.ContextMenu.#ctor(Terminal.Gui.View,Terminal.Gui.MenuBarItem)">ContextMenu(View, MenuBarItem)</h4>
  197. <div class="markdown level1 summary">Initializes a context menu, with a <a class="xref" href="Terminal.Gui.View.html">View</a> specifiying the parent/hose of the menu.</div>
  198. <div class="markdown level1 conceptual"></div>
  199. <h5 class="declaration">Declaration</h5>
  200. <div class="codewrapper">
  201. <pre><code class="lang-csharp hljs">public ContextMenu(View host, MenuBarItem menuItems)</code></pre>
  202. </div>
  203. <h5 class="parameters">Parameters</h5>
  204. <table class="table table-bordered table-condensed">
  205. <thead>
  206. <tr>
  207. <th>Type</th>
  208. <th>Name</th>
  209. <th>Description</th>
  210. </tr>
  211. </thead>
  212. <tbody>
  213. <tr>
  214. <td><a class="xref" href="Terminal.Gui.View.html">View</a></td>
  215. <td><span class="parametername">host</span></td>
  216. <td>The host view.</td>
  217. </tr>
  218. <tr>
  219. <td><a class="xref" href="Terminal.Gui.MenuBarItem.html">MenuBarItem</a></td>
  220. <td><span class="parametername">menuItems</span></td>
  221. <td>The menu items for the context menu.</td>
  222. </tr>
  223. </tbody>
  224. </table>
  225. <h3 id="properties">Properties
  226. </h3>
  227. <span class="small pull-right mobile-hide">
  228. <span class="divider">|</span>
  229. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu_ForceMinimumPosToZero.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu.ForceMinimumPosToZero%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>
  230. </span>
  231. <span class="small pull-right mobile-hide">
  232. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L229">View Source</a>
  233. </span>
  234. <a id="Terminal_Gui_ContextMenu_ForceMinimumPosToZero_" data-uid="Terminal.Gui.ContextMenu.ForceMinimumPosToZero*"></a>
  235. <h4 id="Terminal_Gui_ContextMenu_ForceMinimumPosToZero" data-uid="Terminal.Gui.ContextMenu.ForceMinimumPosToZero">ForceMinimumPosToZero</h4>
  236. <div class="markdown level1 summary">Sets or gets whether the context menu be forced to the right, ensuring it is not clipped, if the x position
  237. is less than zero. The default is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> which means the context menu will be forced to the right.
  238. If set to <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a>, the context menu will be clipped on the left if x is less than zero.</div>
  239. <div class="markdown level1 conceptual"></div>
  240. <h5 class="declaration">Declaration</h5>
  241. <div class="codewrapper">
  242. <pre><code class="lang-csharp hljs">public bool ForceMinimumPosToZero { get; set; }</code></pre>
  243. </div>
  244. <h5 class="propertyValue">Property Value</h5>
  245. <table class="table table-bordered table-condensed">
  246. <thead>
  247. <tr>
  248. <th>Type</th>
  249. <th>Description</th>
  250. </tr>
  251. </thead>
  252. <tbody>
  253. <tr>
  254. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
  255. <td></td>
  256. </tr>
  257. </tbody>
  258. </table>
  259. <span class="small pull-right mobile-hide">
  260. <span class="divider">|</span>
  261. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu_Host.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu.Host%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>
  262. </span>
  263. <span class="small pull-right mobile-hide">
  264. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L222">View Source</a>
  265. </span>
  266. <a id="Terminal_Gui_ContextMenu_Host_" data-uid="Terminal.Gui.ContextMenu.Host*"></a>
  267. <h4 id="Terminal_Gui_ContextMenu_Host" data-uid="Terminal.Gui.ContextMenu.Host">Host</h4>
  268. <div class="markdown level1 summary">The host <a class="xref" href="Terminal.Gui.View.html">View</a> which position will be used,
  269. otherwise if it's null the container will be used.</div>
  270. <div class="markdown level1 conceptual"></div>
  271. <h5 class="declaration">Declaration</h5>
  272. <div class="codewrapper">
  273. <pre><code class="lang-csharp hljs">public View Host { get; set; }</code></pre>
  274. </div>
  275. <h5 class="propertyValue">Property Value</h5>
  276. <table class="table table-bordered table-condensed">
  277. <thead>
  278. <tr>
  279. <th>Type</th>
  280. <th>Description</th>
  281. </tr>
  282. </thead>
  283. <tbody>
  284. <tr>
  285. <td><a class="xref" href="Terminal.Gui.View.html">View</a></td>
  286. <td></td>
  287. </tr>
  288. </tbody>
  289. </table>
  290. <span class="small pull-right mobile-hide">
  291. <span class="divider">|</span>
  292. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu_IsShow.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu.IsShow%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>
  293. </span>
  294. <span class="small pull-right mobile-hide">
  295. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L216">View Source</a>
  296. </span>
  297. <a id="Terminal_Gui_ContextMenu_IsShow_" data-uid="Terminal.Gui.ContextMenu.IsShow*"></a>
  298. <h4 id="Terminal_Gui_ContextMenu_IsShow" data-uid="Terminal.Gui.ContextMenu.IsShow">IsShow</h4>
  299. <div class="markdown level1 summary">Gets whether the ContextMenu is showing or not.</div>
  300. <div class="markdown level1 conceptual"></div>
  301. <h5 class="declaration">Declaration</h5>
  302. <div class="codewrapper">
  303. <pre><code class="lang-csharp hljs">public static bool IsShow { get; }</code></pre>
  304. </div>
  305. <h5 class="propertyValue">Property Value</h5>
  306. <table class="table table-bordered table-condensed">
  307. <thead>
  308. <tr>
  309. <th>Type</th>
  310. <th>Description</th>
  311. </tr>
  312. </thead>
  313. <tbody>
  314. <tr>
  315. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
  316. <td></td>
  317. </tr>
  318. </tbody>
  319. </table>
  320. <span class="small pull-right mobile-hide">
  321. <span class="divider">|</span>
  322. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu_Key.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu.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>
  323. </span>
  324. <span class="small pull-right mobile-hide">
  325. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L192">View Source</a>
  326. </span>
  327. <a id="Terminal_Gui_ContextMenu_Key_" data-uid="Terminal.Gui.ContextMenu.Key*"></a>
  328. <h4 id="Terminal_Gui_ContextMenu_Key" data-uid="Terminal.Gui.ContextMenu.Key">Key</h4>
  329. <div class="markdown level1 summary"><a class="xref" href="Terminal.Gui.Key.html">Key</a> specifies they keyboard key that will activate the context menu with the keyboard.</div>
  330. <div class="markdown level1 conceptual"></div>
  331. <h5 class="declaration">Declaration</h5>
  332. <div class="codewrapper">
  333. <pre><code class="lang-csharp hljs">public Key Key { get; set; }</code></pre>
  334. </div>
  335. <h5 class="propertyValue">Property Value</h5>
  336. <table class="table table-bordered table-condensed">
  337. <thead>
  338. <tr>
  339. <th>Type</th>
  340. <th>Description</th>
  341. </tr>
  342. </thead>
  343. <tbody>
  344. <tr>
  345. <td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
  346. <td></td>
  347. </tr>
  348. </tbody>
  349. </table>
  350. <span class="small pull-right mobile-hide">
  351. <span class="divider">|</span>
  352. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu_MenuBar.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu.MenuBar%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>
  353. </span>
  354. <span class="small pull-right mobile-hide">
  355. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L234">View Source</a>
  356. </span>
  357. <a id="Terminal_Gui_ContextMenu_MenuBar_" data-uid="Terminal.Gui.ContextMenu.MenuBar*"></a>
  358. <h4 id="Terminal_Gui_ContextMenu_MenuBar" data-uid="Terminal.Gui.ContextMenu.MenuBar">MenuBar</h4>
  359. <div class="markdown level1 summary">Gets the <a class="xref" href="Terminal.Gui.MenuBar.html">MenuBar</a> that is hosting this context menu.</div>
  360. <div class="markdown level1 conceptual"></div>
  361. <h5 class="declaration">Declaration</h5>
  362. <div class="codewrapper">
  363. <pre><code class="lang-csharp hljs">public MenuBar MenuBar { get; }</code></pre>
  364. </div>
  365. <h5 class="propertyValue">Property Value</h5>
  366. <table class="table table-bordered table-condensed">
  367. <thead>
  368. <tr>
  369. <th>Type</th>
  370. <th>Description</th>
  371. </tr>
  372. </thead>
  373. <tbody>
  374. <tr>
  375. <td><a class="xref" href="Terminal.Gui.MenuBar.html">MenuBar</a></td>
  376. <td></td>
  377. </tr>
  378. </tbody>
  379. </table>
  380. <span class="small pull-right mobile-hide">
  381. <span class="divider">|</span>
  382. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu_MenuItems.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu.MenuItems%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>
  383. </span>
  384. <span class="small pull-right mobile-hide">
  385. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L187">View Source</a>
  386. </span>
  387. <a id="Terminal_Gui_ContextMenu_MenuItems_" data-uid="Terminal.Gui.ContextMenu.MenuItems*"></a>
  388. <h4 id="Terminal_Gui_ContextMenu_MenuItems" data-uid="Terminal.Gui.ContextMenu.MenuItems">MenuItems</h4>
  389. <div class="markdown level1 summary">Gets or sets the menu items for this context menu.</div>
  390. <div class="markdown level1 conceptual"></div>
  391. <h5 class="declaration">Declaration</h5>
  392. <div class="codewrapper">
  393. <pre><code class="lang-csharp hljs">public MenuBarItem MenuItems { get; set; }</code></pre>
  394. </div>
  395. <h5 class="propertyValue">Property Value</h5>
  396. <table class="table table-bordered table-condensed">
  397. <thead>
  398. <tr>
  399. <th>Type</th>
  400. <th>Description</th>
  401. </tr>
  402. </thead>
  403. <tbody>
  404. <tr>
  405. <td><a class="xref" href="Terminal.Gui.MenuBarItem.html">MenuBarItem</a></td>
  406. <td></td>
  407. </tr>
  408. </tbody>
  409. </table>
  410. <span class="small pull-right mobile-hide">
  411. <span class="divider">|</span>
  412. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu_MouseFlags.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu.MouseFlags%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>
  413. </span>
  414. <span class="small pull-right mobile-hide">
  415. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L204">View Source</a>
  416. </span>
  417. <a id="Terminal_Gui_ContextMenu_MouseFlags_" data-uid="Terminal.Gui.ContextMenu.MouseFlags*"></a>
  418. <h4 id="Terminal_Gui_ContextMenu_MouseFlags" data-uid="Terminal.Gui.ContextMenu.MouseFlags">MouseFlags</h4>
  419. <div class="markdown level1 summary"><a class="xref" href="Terminal.Gui.MouseFlags.html">MouseFlags</a> specifies the mouse action used to activate the context menu by mouse.</div>
  420. <div class="markdown level1 conceptual"></div>
  421. <h5 class="declaration">Declaration</h5>
  422. <div class="codewrapper">
  423. <pre><code class="lang-csharp hljs">public MouseFlags MouseFlags { get; set; }</code></pre>
  424. </div>
  425. <h5 class="propertyValue">Property Value</h5>
  426. <table class="table table-bordered table-condensed">
  427. <thead>
  428. <tr>
  429. <th>Type</th>
  430. <th>Description</th>
  431. </tr>
  432. </thead>
  433. <tbody>
  434. <tr>
  435. <td><a class="xref" href="Terminal.Gui.MouseFlags.html">MouseFlags</a></td>
  436. <td></td>
  437. </tr>
  438. </tbody>
  439. </table>
  440. <span class="small pull-right mobile-hide">
  441. <span class="divider">|</span>
  442. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu_Position.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu.Position%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>
  443. </span>
  444. <span class="small pull-right mobile-hide">
  445. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L182">View Source</a>
  446. </span>
  447. <a id="Terminal_Gui_ContextMenu_Position_" data-uid="Terminal.Gui.ContextMenu.Position*"></a>
  448. <h4 id="Terminal_Gui_ContextMenu_Position" data-uid="Terminal.Gui.ContextMenu.Position">Position</h4>
  449. <div class="markdown level1 summary">Gets or sets the menu position.</div>
  450. <div class="markdown level1 conceptual"></div>
  451. <h5 class="declaration">Declaration</h5>
  452. <div class="codewrapper">
  453. <pre><code class="lang-csharp hljs">public Point Position { get; set; }</code></pre>
  454. </div>
  455. <h5 class="propertyValue">Property Value</h5>
  456. <table class="table table-bordered table-condensed">
  457. <thead>
  458. <tr>
  459. <th>Type</th>
  460. <th>Description</th>
  461. </tr>
  462. </thead>
  463. <tbody>
  464. <tr>
  465. <td><a class="xref" href="Terminal.Gui.Point.html">Point</a></td>
  466. <td></td>
  467. </tr>
  468. </tbody>
  469. </table>
  470. <span class="small pull-right mobile-hide">
  471. <span class="divider">|</span>
  472. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu_UseSubMenusSingleFrame.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu.UseSubMenusSingleFrame%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>
  473. </span>
  474. <span class="small pull-right mobile-hide">
  475. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L241">View Source</a>
  476. </span>
  477. <a id="Terminal_Gui_ContextMenu_UseSubMenusSingleFrame_" data-uid="Terminal.Gui.ContextMenu.UseSubMenusSingleFrame*"></a>
  478. <h4 id="Terminal_Gui_ContextMenu_UseSubMenusSingleFrame" data-uid="Terminal.Gui.ContextMenu.UseSubMenusSingleFrame">UseSubMenusSingleFrame</h4>
  479. <div class="markdown level1 summary">Gets or sets if sub-menus will be displayed using a "single frame" menu style. If <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a>, the ContextMenu
  480. and any sub-menus that would normally cascade will be displayed within a single frame. If <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a> (the default),
  481. sub-menus will cascade using separate frames for each level of the menu hierarchy.</div>
  482. <div class="markdown level1 conceptual"></div>
  483. <h5 class="declaration">Declaration</h5>
  484. <div class="codewrapper">
  485. <pre><code class="lang-csharp hljs">public bool UseSubMenusSingleFrame { get; set; }</code></pre>
  486. </div>
  487. <h5 class="propertyValue">Property Value</h5>
  488. <table class="table table-bordered table-condensed">
  489. <thead>
  490. <tr>
  491. <th>Type</th>
  492. <th>Description</th>
  493. </tr>
  494. </thead>
  495. <tbody>
  496. <tr>
  497. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
  498. <td></td>
  499. </tr>
  500. </tbody>
  501. </table>
  502. <h3 id="methods">Methods
  503. </h3>
  504. <span class="small pull-right mobile-hide">
  505. <span class="divider">|</span>
  506. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu_Dispose.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu.Dispose%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>
  507. </span>
  508. <span class="small pull-right mobile-hide">
  509. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L72">View Source</a>
  510. </span>
  511. <a id="Terminal_Gui_ContextMenu_Dispose_" data-uid="Terminal.Gui.ContextMenu.Dispose*"></a>
  512. <h4 id="Terminal_Gui_ContextMenu_Dispose" data-uid="Terminal.Gui.ContextMenu.Dispose">Dispose()</h4>
  513. <div class="markdown level1 summary">Disposes the context menu object.</div>
  514. <div class="markdown level1 conceptual"></div>
  515. <h5 class="declaration">Declaration</h5>
  516. <div class="codewrapper">
  517. <pre><code class="lang-csharp hljs">public void Dispose()</code></pre>
  518. </div>
  519. <span class="small pull-right mobile-hide">
  520. <span class="divider">|</span>
  521. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu_Hide.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu.Hide%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>
  522. </span>
  523. <span class="small pull-right mobile-hide">
  524. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L163">View Source</a>
  525. </span>
  526. <a id="Terminal_Gui_ContextMenu_Hide_" data-uid="Terminal.Gui.ContextMenu.Hide*"></a>
  527. <h4 id="Terminal_Gui_ContextMenu_Hide" data-uid="Terminal.Gui.ContextMenu.Hide">Hide()</h4>
  528. <div class="markdown level1 summary">Hides (closes) the ContextMenu.</div>
  529. <div class="markdown level1 conceptual"></div>
  530. <h5 class="declaration">Declaration</h5>
  531. <div class="codewrapper">
  532. <pre><code class="lang-csharp hljs">public void Hide()</code></pre>
  533. </div>
  534. <span class="small pull-right mobile-hide">
  535. <span class="divider">|</span>
  536. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu_Show.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu.Show%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>
  537. </span>
  538. <span class="small pull-right mobile-hide">
  539. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L89">View Source</a>
  540. </span>
  541. <a id="Terminal_Gui_ContextMenu_Show_" data-uid="Terminal.Gui.ContextMenu.Show*"></a>
  542. <h4 id="Terminal_Gui_ContextMenu_Show" data-uid="Terminal.Gui.ContextMenu.Show">Show()</h4>
  543. <div class="markdown level1 summary">Shows (opens) the ContextMenu, displaying the <a class="xref" href="Terminal.Gui.MenuItem.html">MenuItem</a>s it contains.</div>
  544. <div class="markdown level1 conceptual"></div>
  545. <h5 class="declaration">Declaration</h5>
  546. <div class="codewrapper">
  547. <pre><code class="lang-csharp hljs">public void Show()</code></pre>
  548. </div>
  549. <h3 id="events">Events
  550. </h3>
  551. <span class="small pull-right mobile-hide">
  552. <span class="divider">|</span>
  553. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu_KeyChanged.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu.KeyChanged%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>
  554. </span>
  555. <span class="small pull-right mobile-hide">
  556. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L172">View Source</a>
  557. </span>
  558. <h4 id="Terminal_Gui_ContextMenu_KeyChanged" data-uid="Terminal.Gui.ContextMenu.KeyChanged">KeyChanged</h4>
  559. <div class="markdown level1 summary">Event invoked when the <a class="xref" href="Terminal.Gui.ContextMenu.html#Terminal_Gui_ContextMenu_Key">Key</a> is changed.</div>
  560. <div class="markdown level1 conceptual"></div>
  561. <h5 class="declaration">Declaration</h5>
  562. <div class="codewrapper">
  563. <pre><code class="lang-csharp hljs">public event Action&lt;Key&gt; KeyChanged</code></pre>
  564. </div>
  565. <h5 class="eventType">Event Type</h5>
  566. <table class="table table-bordered table-condensed">
  567. <thead>
  568. <tr>
  569. <th>Type</th>
  570. <th>Description</th>
  571. </tr>
  572. </thead>
  573. <tbody>
  574. <tr>
  575. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action-1">Action</a>&lt;<a class="xref" href="Terminal.Gui.Key.html">Key</a>&gt;</td>
  576. <td></td>
  577. </tr>
  578. </tbody>
  579. </table>
  580. <span class="small pull-right mobile-hide">
  581. <span class="divider">|</span>
  582. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu_MouseFlagsChanged.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu.MouseFlagsChanged%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>
  583. </span>
  584. <span class="small pull-right mobile-hide">
  585. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L177">View Source</a>
  586. </span>
  587. <h4 id="Terminal_Gui_ContextMenu_MouseFlagsChanged" data-uid="Terminal.Gui.ContextMenu.MouseFlagsChanged">MouseFlagsChanged</h4>
  588. <div class="markdown level1 summary">Event invoked when the <a class="xref" href="Terminal.Gui.ContextMenu.html#Terminal_Gui_ContextMenu_MouseFlags">MouseFlags</a> is changed.</div>
  589. <div class="markdown level1 conceptual"></div>
  590. <h5 class="declaration">Declaration</h5>
  591. <div class="codewrapper">
  592. <pre><code class="lang-csharp hljs">public event Action&lt;MouseFlags&gt; MouseFlagsChanged</code></pre>
  593. </div>
  594. <h5 class="eventType">Event Type</h5>
  595. <table class="table table-bordered table-condensed">
  596. <thead>
  597. <tr>
  598. <th>Type</th>
  599. <th>Description</th>
  600. </tr>
  601. </thead>
  602. <tbody>
  603. <tr>
  604. <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action-1">Action</a>&lt;<a class="xref" href="Terminal.Gui.MouseFlags.html">MouseFlags</a>&gt;</td>
  605. <td></td>
  606. </tr>
  607. </tbody>
  608. </table>
  609. <h3 id="implements">Implements</h3>
  610. <div>
  611. <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a>
  612. </div>
  613. </article>
  614. </div>
  615. <div class="hidden-sm col-md-2" role="complementary">
  616. <div class="sideaffix">
  617. <div class="contribution">
  618. <ul class="nav">
  619. <li>
  620. <a href="https://github.com/gui-cs/Terminal.Gui/new/develop/docfx/overrides/new?filename=Terminal_Gui_ContextMenu.md&amp;value=---%0Auid%3A%20Terminal.Gui.ContextMenu%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>
  621. </li>
  622. <li>
  623. <a href="tig:tig/Terminal.Gui/blob/v2_develop/Terminal.Gui/Views/ContextMenu.cs/#L24" class="contribution-link">View Source</a>
  624. </li>
  625. </ul>
  626. </div>
  627. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  628. <h5>In this article</h5>
  629. <div></div>
  630. </nav>
  631. </div>
  632. </div>
  633. </div>
  634. </div>
  635. <footer>
  636. <div class="grad-bottom"></div>
  637. <div class="footer">
  638. <div class="container">
  639. <span class="pull-right">
  640. <a href="#top">Back to top</a>
  641. </span>
  642. <span>Generated by <strong>DocFX</strong></span>
  643. </div>
  644. </div>
  645. </footer>
  646. </div>
  647. <script type="text/javascript" src="../../styles/docfx.vendor.min.js"></script>
  648. <script type="text/javascript" src="../../styles/docfx.js"></script>
  649. <script type="text/javascript" src="../../styles/main.js"></script>
  650. </body>
  651. </html>