Terminal.Gui.MessageBox.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  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 MessageBox
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class MessageBox
  11. ">
  12. <meta name="generator" content="docfx 2.54.0.0">
  13. <link rel="shortcut icon" href="../../favicon.ico">
  14. <link rel="stylesheet" href="../../styles/docfx.vendor.css">
  15. <link rel="stylesheet" href="../../styles/docfx.css">
  16. <link rel="stylesheet" href="../../styles/main.css">
  17. <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
  18. <meta property="docfx:navrel" content="../../toc.html">
  19. <meta property="docfx:tocrel" content="toc.html">
  20. <meta property="docfx:rel" content="../../">
  21. </head> <body data-spy="scroll" data-target="#affix" data-offset="120">
  22. <div id="wrapper">
  23. <header>
  24. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  25. <div class="container">
  26. <div class="navbar-header">
  27. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  28. <span class="sr-only">Toggle navigation</span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. </button>
  33. <a class="navbar-brand" href="../../index.html">
  34. <img id="logo" class="svg" src="../../images/logo48.png" alt="">
  35. </a>
  36. </div>
  37. <div class="collapse navbar-collapse" id="navbar">
  38. <form class="navbar-form navbar-right" role="search" id="search">
  39. <div class="form-group">
  40. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  41. </div>
  42. </form>
  43. </div>
  44. </div>
  45. </nav>
  46. <div class="subnav navbar navbar-default">
  47. <div class="container hide-when-search" id="breadcrumb">
  48. <ul class="breadcrumb">
  49. <li></li>
  50. </ul>
  51. </div>
  52. </div>
  53. </header>
  54. <div class="container body-content">
  55. <div id="search-results">
  56. <div class="search-list"></div>
  57. <div class="sr-items">
  58. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  59. </div>
  60. <ul id="pagination"></ul>
  61. </div>
  62. </div>
  63. <div role="main" class="container body-content hide-when-search">
  64. <div class="sidenav hide-when-search">
  65. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  66. <div class="sidetoggle collapse" id="sidetoggle">
  67. <div id="sidetoc"></div>
  68. </div>
  69. </div>
  70. <div class="article row grid-right">
  71. <div class="col-md-10">
  72. <article class="content wrap" id="_content" data-uid="Terminal.Gui.MessageBox">
  73. <h1 id="Terminal_Gui_MessageBox" data-uid="Terminal.Gui.MessageBox" class="text-break">Class MessageBox
  74. </h1>
  75. <div class="markdown level0 summary">
  76. MessageBox displays a modal message to the user, with a title, a message and a series of options that the user can choose from.
  77. </div>
  78. <div class="markdown level0 conceptual"></div>
  79. <div class="inheritance">
  80. <h5>Inheritance</h5>
  81. <div class="level0"><span class="xref">System.Object</span></div>
  82. <div class="level1"><span class="xref">MessageBox</span></div>
  83. </div>
  84. <div class="inheritedMembers">
  85. <h5>Inherited Members</h5>
  86. <div>
  87. <span class="xref">System.Object.Equals(System.Object)</span>
  88. </div>
  89. <div>
  90. <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
  91. </div>
  92. <div>
  93. <span class="xref">System.Object.GetHashCode()</span>
  94. </div>
  95. <div>
  96. <span class="xref">System.Object.GetType()</span>
  97. </div>
  98. <div>
  99. <span class="xref">System.Object.MemberwiseClone()</span>
  100. </div>
  101. <div>
  102. <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
  103. </div>
  104. <div>
  105. <span class="xref">System.Object.ToString()</span>
  106. </div>
  107. </div>
  108. <h6><strong>Namespace</strong>: <a class="xref" href="Terminal.Gui.html">Terminal.Gui</a></h6>
  109. <h6><strong>Assembly</strong>: Terminal.Gui.dll</h6>
  110. <h5 id="Terminal_Gui_MessageBox_syntax">Syntax</h5>
  111. <div class="codewrapper">
  112. <pre><code class="lang-csharp hljs">public static class MessageBox</code></pre>
  113. </div>
  114. <h5 id="Terminal_Gui_MessageBox_examples"><strong>Examples</strong></h5>
  115. <pre><code>var n = MessageBox.Query (50, 7, &quot;Quit Demo&quot;, &quot;Are you sure you want to quit this demo?&quot;, &quot;Yes&quot;, &quot;No&quot;);
  116. if (n == 0)
  117. quit = true;
  118. else
  119. quit = false;</code></pre>
  120. <h3 id="methods">Methods
  121. </h3>
  122. <a id="Terminal_Gui_MessageBox_ErrorQuery_" data-uid="Terminal.Gui.MessageBox.ErrorQuery*"></a>
  123. <h4 id="Terminal_Gui_MessageBox_ErrorQuery_System_Int32_System_Int32_System_String_System_String_System_String___" data-uid="Terminal.Gui.MessageBox.ErrorQuery(System.Int32,System.Int32,System.String,System.String,System.String[])">ErrorQuery(Int32, Int32, String, String, String[])</h4>
  124. <div class="markdown level1 summary">
  125. Presents an error <a class="xref" href="Terminal.Gui.MessageBox.html">MessageBox</a> with the specified title and message and a list of buttons to show to the user.
  126. </div>
  127. <div class="markdown level1 conceptual"></div>
  128. <h5 class="decalaration">Declaration</h5>
  129. <div class="codewrapper">
  130. <pre><code class="lang-csharp hljs">public static int ErrorQuery(int width, int height, string title, string message, params string[] buttons)</code></pre>
  131. </div>
  132. <h5 class="parameters">Parameters</h5>
  133. <table class="table table-bordered table-striped table-condensed">
  134. <thead>
  135. <tr>
  136. <th>Type</th>
  137. <th>Name</th>
  138. <th>Description</th>
  139. </tr>
  140. </thead>
  141. <tbody>
  142. <tr>
  143. <td><span class="xref">System.Int32</span></td>
  144. <td><span class="parametername">width</span></td>
  145. <td>Width for the window.</td>
  146. </tr>
  147. <tr>
  148. <td><span class="xref">System.Int32</span></td>
  149. <td><span class="parametername">height</span></td>
  150. <td>Height for the window.</td>
  151. </tr>
  152. <tr>
  153. <td><span class="xref">System.String</span></td>
  154. <td><span class="parametername">title</span></td>
  155. <td>Title for the query.</td>
  156. </tr>
  157. <tr>
  158. <td><span class="xref">System.String</span></td>
  159. <td><span class="parametername">message</span></td>
  160. <td>Message to display, might contain multiple lines.</td>
  161. </tr>
  162. <tr>
  163. <td><span class="xref">System.String</span>[]</td>
  164. <td><span class="parametername">buttons</span></td>
  165. <td>Array of buttons to add.</td>
  166. </tr>
  167. </tbody>
  168. </table>
  169. <h5 class="returns">Returns</h5>
  170. <table class="table table-bordered table-striped table-condensed">
  171. <thead>
  172. <tr>
  173. <th>Type</th>
  174. <th>Description</th>
  175. </tr>
  176. </thead>
  177. <tbody>
  178. <tr>
  179. <td><span class="xref">System.Int32</span></td>
  180. <td>The index of the selected button, or -1 if the user pressed ESC to close the dialog.</td>
  181. </tr>
  182. </tbody>
  183. </table>
  184. <a id="Terminal_Gui_MessageBox_Query_" data-uid="Terminal.Gui.MessageBox.Query*"></a>
  185. <h4 id="Terminal_Gui_MessageBox_Query_System_Int32_System_Int32_System_String_System_String_System_String___" data-uid="Terminal.Gui.MessageBox.Query(System.Int32,System.Int32,System.String,System.String,System.String[])">Query(Int32, Int32, String, String, String[])</h4>
  186. <div class="markdown level1 summary">
  187. Presents a normal <a class="xref" href="Terminal.Gui.MessageBox.html">MessageBox</a> with the specified title and message and a list of buttons to show to the user.
  188. </div>
  189. <div class="markdown level1 conceptual"></div>
  190. <h5 class="decalaration">Declaration</h5>
  191. <div class="codewrapper">
  192. <pre><code class="lang-csharp hljs">public static int Query(int width, int height, string title, string message, params string[] buttons)</code></pre>
  193. </div>
  194. <h5 class="parameters">Parameters</h5>
  195. <table class="table table-bordered table-striped table-condensed">
  196. <thead>
  197. <tr>
  198. <th>Type</th>
  199. <th>Name</th>
  200. <th>Description</th>
  201. </tr>
  202. </thead>
  203. <tbody>
  204. <tr>
  205. <td><span class="xref">System.Int32</span></td>
  206. <td><span class="parametername">width</span></td>
  207. <td>Width for the window.</td>
  208. </tr>
  209. <tr>
  210. <td><span class="xref">System.Int32</span></td>
  211. <td><span class="parametername">height</span></td>
  212. <td>Height for the window.</td>
  213. </tr>
  214. <tr>
  215. <td><span class="xref">System.String</span></td>
  216. <td><span class="parametername">title</span></td>
  217. <td>Title for the query.</td>
  218. </tr>
  219. <tr>
  220. <td><span class="xref">System.String</span></td>
  221. <td><span class="parametername">message</span></td>
  222. <td>Message to display, might contain multiple lines..</td>
  223. </tr>
  224. <tr>
  225. <td><span class="xref">System.String</span>[]</td>
  226. <td><span class="parametername">buttons</span></td>
  227. <td>Array of buttons to add.</td>
  228. </tr>
  229. </tbody>
  230. </table>
  231. <h5 class="returns">Returns</h5>
  232. <table class="table table-bordered table-striped table-condensed">
  233. <thead>
  234. <tr>
  235. <th>Type</th>
  236. <th>Description</th>
  237. </tr>
  238. </thead>
  239. <tbody>
  240. <tr>
  241. <td><span class="xref">System.Int32</span></td>
  242. <td>The index of the selected button, or -1 if the user pressed ESC to close the dialog.</td>
  243. </tr>
  244. </tbody>
  245. </table>
  246. </article>
  247. </div>
  248. <div class="hidden-sm col-md-2" role="complementary">
  249. <div class="sideaffix">
  250. <div class="contribution">
  251. <ul class="nav">
  252. </ul>
  253. </div>
  254. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  255. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  256. </nav>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. <footer>
  262. <div class="grad-bottom"></div>
  263. <div class="footer">
  264. <div class="container">
  265. <span class="pull-right">
  266. <a href="#top">Back to top</a>
  267. </span>
  268. <span>Generated by <strong>DocFX</strong></span>
  269. </div>
  270. </div>
  271. </footer>
  272. </div>
  273. <script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
  274. <script type="text/javascript" src="../../styles/docfx.js"></script>
  275. <script type="text/javascript" src="../../styles/main.js"></script>
  276. </body>
  277. </html>