Terminal.Gui.Pos.html 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843
  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 Pos
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class Pos
  11. ">
  12. <meta name="generator" content="docfx 2.59.3.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. <meta property="docfx:navrel" content="../../toc.html">
  18. <meta property="docfx:tocrel" content="toc.html">
  19. <meta property="docfx:rel" content="../../">
  20. </head>
  21. <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">Search Results for <span></span></div>
  57. <div class="sr-items">
  58. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  59. </div>
  60. <ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></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.Pos">
  73. <h1 id="Terminal_Gui_Pos" data-uid="Terminal.Gui.Pos" class="text-break">Class Pos
  74. </h1>
  75. <div class="markdown level0 summary">
  76. Describes the position of a <a class="xref" href="Terminal.Gui.View.html">View</a> which can be an absolute value, a percentage, centered, or
  77. relative to the ending dimension. Integer values are implicitly convertible to
  78. an absolute <a class="xref" href="Terminal.Gui.Pos.html">Pos</a>. These objects are created using the static methods Percent,
  79. AnchorEnd, and Center. The <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> objects can be combined with the addition and
  80. subtraction operators.
  81. </div>
  82. <div class="markdown level0 conceptual"></div>
  83. <div class="inheritance">
  84. <h5>Inheritance</h5>
  85. <div class="level0"><span class="xref">System.Object</span></div>
  86. <div class="level1"><span class="xref">Pos</span></div>
  87. </div>
  88. <h6><strong>Namespace</strong>: <a class="xref" href="Terminal.Gui.html">Terminal.Gui</a></h6>
  89. <h6><strong>Assembly</strong>: Terminal.Gui.dll</h6>
  90. <h5 id="Terminal_Gui_Pos_syntax">Syntax</h5>
  91. <div class="codewrapper">
  92. <pre><code class="lang-csharp hljs">public class Pos : Object</code></pre>
  93. </div>
  94. <h5 id="Terminal_Gui_Pos_remarks"><strong>Remarks</strong></h5>
  95. <div class="markdown level0 remarks">
  96. <p>
  97. Use the <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> objects on the X or Y properties of a view to control the position.
  98. </p>
  99. <p>
  100. These can be used to set the absolute position, when merely assigning an
  101. integer value (via the implicit integer to <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> conversion), and they can be combined
  102. to produce more useful layouts, like: Pos.Center - 3, which would shift the position
  103. of the <a class="xref" href="Terminal.Gui.View.html">View</a> 3 characters to the left after centering for example.
  104. </p>
  105. <p>
  106. It is possible to reference coordinates of another view by using the methods
  107. Left(View), Right(View), Bottom(View), Top(View). The X(View) and Y(View) are
  108. aliases to Left(View) and Top(View) respectively.
  109. </p>
  110. </div>
  111. <h3 id="constructors">Constructors
  112. </h3>
  113. <a id="Terminal_Gui_Pos__ctor_" data-uid="Terminal.Gui.Pos.#ctor*"></a>
  114. <h4 id="Terminal_Gui_Pos__ctor" data-uid="Terminal.Gui.Pos.#ctor">Pos()</h4>
  115. <div class="markdown level1 summary"></div>
  116. <div class="markdown level1 conceptual"></div>
  117. <h5 class="decalaration">Declaration</h5>
  118. <div class="codewrapper">
  119. <pre><code class="lang-csharp hljs">public Pos()</code></pre>
  120. </div>
  121. <h3 id="methods">Methods
  122. </h3>
  123. <a id="Terminal_Gui_Pos_AnchorEnd_" data-uid="Terminal.Gui.Pos.AnchorEnd*"></a>
  124. <h4 id="Terminal_Gui_Pos_AnchorEnd_System_Int32_" data-uid="Terminal.Gui.Pos.AnchorEnd(System.Int32)">AnchorEnd(Int32)</h4>
  125. <div class="markdown level1 summary">
  126. Creates a <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> object that is anchored to the end (right side or bottom) of the dimension,
  127. useful to flush the layout from the right or bottom.
  128. </div>
  129. <div class="markdown level1 conceptual"></div>
  130. <h5 class="decalaration">Declaration</h5>
  131. <div class="codewrapper">
  132. <pre><code class="lang-csharp hljs">public static Pos AnchorEnd(int margin = 0)</code></pre>
  133. </div>
  134. <h5 class="parameters">Parameters</h5>
  135. <table class="table table-bordered table-striped table-condensed">
  136. <thead>
  137. <tr>
  138. <th>Type</th>
  139. <th>Name</th>
  140. <th>Description</th>
  141. </tr>
  142. </thead>
  143. <tbody>
  144. <tr>
  145. <td><span class="xref">System.Int32</span></td>
  146. <td><span class="parametername">margin</span></td>
  147. <td>Optional margin to place to the right or below.</td>
  148. </tr>
  149. </tbody>
  150. </table>
  151. <h5 class="returns">Returns</h5>
  152. <table class="table table-bordered table-striped table-condensed">
  153. <thead>
  154. <tr>
  155. <th>Type</th>
  156. <th>Description</th>
  157. </tr>
  158. </thead>
  159. <tbody>
  160. <tr>
  161. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  162. <td>The <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> object anchored to the end (the bottom or the right side).</td>
  163. </tr>
  164. </tbody>
  165. </table>
  166. <h5 id="Terminal_Gui_Pos_AnchorEnd_System_Int32__examples">Examples</h5>
  167. This sample shows how align a <a class="xref" href="Terminal.Gui.Button.html">Button</a> to the bottom-right of a <a class="xref" href="Terminal.Gui.View.html">View</a>.
  168. <pre><code>// See Issue #502
  169. anchorButton.X = Pos.AnchorEnd () - (Pos.Right (anchorButton) - Pos.Left (anchorButton));
  170. anchorButton.Y = Pos.AnchorEnd (1);</code></pre>
  171. <a id="Terminal_Gui_Pos_At_" data-uid="Terminal.Gui.Pos.At*"></a>
  172. <h4 id="Terminal_Gui_Pos_At_System_Int32_" data-uid="Terminal.Gui.Pos.At(System.Int32)">At(Int32)</h4>
  173. <div class="markdown level1 summary">
  174. Creates an Absolute <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> from the specified integer value.
  175. </div>
  176. <div class="markdown level1 conceptual"></div>
  177. <h5 class="decalaration">Declaration</h5>
  178. <div class="codewrapper">
  179. <pre><code class="lang-csharp hljs">public static Pos At(int n)</code></pre>
  180. </div>
  181. <h5 class="parameters">Parameters</h5>
  182. <table class="table table-bordered table-striped table-condensed">
  183. <thead>
  184. <tr>
  185. <th>Type</th>
  186. <th>Name</th>
  187. <th>Description</th>
  188. </tr>
  189. </thead>
  190. <tbody>
  191. <tr>
  192. <td><span class="xref">System.Int32</span></td>
  193. <td><span class="parametername">n</span></td>
  194. <td>The value to convert to the <a class="xref" href="Terminal.Gui.Pos.html">Pos</a>.</td>
  195. </tr>
  196. </tbody>
  197. </table>
  198. <h5 class="returns">Returns</h5>
  199. <table class="table table-bordered table-striped table-condensed">
  200. <thead>
  201. <tr>
  202. <th>Type</th>
  203. <th>Description</th>
  204. </tr>
  205. </thead>
  206. <tbody>
  207. <tr>
  208. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  209. <td>The Absolute <a class="xref" href="Terminal.Gui.Pos.html">Pos</a>.</td>
  210. </tr>
  211. </tbody>
  212. </table>
  213. <a id="Terminal_Gui_Pos_Bottom_" data-uid="Terminal.Gui.Pos.Bottom*"></a>
  214. <h4 id="Terminal_Gui_Pos_Bottom_Terminal_Gui_View_" data-uid="Terminal.Gui.Pos.Bottom(Terminal.Gui.View)">Bottom(View)</h4>
  215. <div class="markdown level1 summary">
  216. Returns a <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> object tracks the Bottom (Y+Height) coordinate of the specified <a class="xref" href="Terminal.Gui.View.html">View</a>
  217. </div>
  218. <div class="markdown level1 conceptual"></div>
  219. <h5 class="decalaration">Declaration</h5>
  220. <div class="codewrapper">
  221. <pre><code class="lang-csharp hljs">public static Pos Bottom(View view)</code></pre>
  222. </div>
  223. <h5 class="parameters">Parameters</h5>
  224. <table class="table table-bordered table-striped table-condensed">
  225. <thead>
  226. <tr>
  227. <th>Type</th>
  228. <th>Name</th>
  229. <th>Description</th>
  230. </tr>
  231. </thead>
  232. <tbody>
  233. <tr>
  234. <td><a class="xref" href="Terminal.Gui.View.html">View</a></td>
  235. <td><span class="parametername">view</span></td>
  236. <td>The <a class="xref" href="Terminal.Gui.View.html">View</a> that will be tracked.</td>
  237. </tr>
  238. </tbody>
  239. </table>
  240. <h5 class="returns">Returns</h5>
  241. <table class="table table-bordered table-striped table-condensed">
  242. <thead>
  243. <tr>
  244. <th>Type</th>
  245. <th>Description</th>
  246. </tr>
  247. </thead>
  248. <tbody>
  249. <tr>
  250. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  251. <td>The <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> that depends on the other view.</td>
  252. </tr>
  253. </tbody>
  254. </table>
  255. <a id="Terminal_Gui_Pos_Center_" data-uid="Terminal.Gui.Pos.Center*"></a>
  256. <h4 id="Terminal_Gui_Pos_Center" data-uid="Terminal.Gui.Pos.Center">Center()</h4>
  257. <div class="markdown level1 summary">
  258. Returns a <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> object that can be used to center the <a class="xref" href="Terminal.Gui.View.html">View</a>
  259. </div>
  260. <div class="markdown level1 conceptual"></div>
  261. <h5 class="decalaration">Declaration</h5>
  262. <div class="codewrapper">
  263. <pre><code class="lang-csharp hljs">public static Pos Center()</code></pre>
  264. </div>
  265. <h5 class="returns">Returns</h5>
  266. <table class="table table-bordered table-striped table-condensed">
  267. <thead>
  268. <tr>
  269. <th>Type</th>
  270. <th>Description</th>
  271. </tr>
  272. </thead>
  273. <tbody>
  274. <tr>
  275. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  276. <td>The center Pos.</td>
  277. </tr>
  278. </tbody>
  279. </table>
  280. <h5 id="Terminal_Gui_Pos_Center_examples">Examples</h5>
  281. This creates a <a class="xref" href="Terminal.Gui.TextField.html">TextField</a>that is centered horizontally, is 50% of the way down,
  282. is 30% the height, and is 80% the width of the <a class="xref" href="Terminal.Gui.View.html">View</a> it added to.
  283. <pre><code>var textView = new TextView () {
  284. X = Pos.Center (),
  285. Y = Pos.Percent (50),
  286. Width = Dim.Percent (80),
  287. Height = Dim.Percent (30),
  288. };</code></pre>
  289. <a id="Terminal_Gui_Pos_Equals_" data-uid="Terminal.Gui.Pos.Equals*"></a>
  290. <h4 id="Terminal_Gui_Pos_Equals_System_Object_" data-uid="Terminal.Gui.Pos.Equals(System.Object)">Equals(Object)</h4>
  291. <div class="markdown level1 summary">Determines whether the specified object is equal to the current object.</div>
  292. <div class="markdown level1 conceptual"></div>
  293. <h5 class="decalaration">Declaration</h5>
  294. <div class="codewrapper">
  295. <pre><code class="lang-csharp hljs">public override bool Equals(object other)</code></pre>
  296. </div>
  297. <h5 class="parameters">Parameters</h5>
  298. <table class="table table-bordered table-striped table-condensed">
  299. <thead>
  300. <tr>
  301. <th>Type</th>
  302. <th>Name</th>
  303. <th>Description</th>
  304. </tr>
  305. </thead>
  306. <tbody>
  307. <tr>
  308. <td><span class="xref">System.Object</span></td>
  309. <td><span class="parametername">other</span></td>
  310. <td>The object to compare with the current object. </td>
  311. </tr>
  312. </tbody>
  313. </table>
  314. <h5 class="returns">Returns</h5>
  315. <table class="table table-bordered table-striped table-condensed">
  316. <thead>
  317. <tr>
  318. <th>Type</th>
  319. <th>Description</th>
  320. </tr>
  321. </thead>
  322. <tbody>
  323. <tr>
  324. <td><span class="xref">System.Boolean</span></td>
  325. <td>
  326. <span class="xref">true</span> if the specified object is equal to the current object; otherwise, <span class="xref">false</span>.</td>
  327. </tr>
  328. </tbody>
  329. </table>
  330. <a id="Terminal_Gui_Pos_Function_" data-uid="Terminal.Gui.Pos.Function*"></a>
  331. <h4 id="Terminal_Gui_Pos_Function_System_Func_System_Int32__" data-uid="Terminal.Gui.Pos.Function(System.Func{System.Int32})">Function(Func&lt;Int32&gt;)</h4>
  332. <div class="markdown level1 summary">
  333. Creates a &quot;PosFunc&quot; from the specified function.
  334. </div>
  335. <div class="markdown level1 conceptual"></div>
  336. <h5 class="decalaration">Declaration</h5>
  337. <div class="codewrapper">
  338. <pre><code class="lang-csharp hljs">public static Pos Function(Func&lt;int&gt; function)</code></pre>
  339. </div>
  340. <h5 class="parameters">Parameters</h5>
  341. <table class="table table-bordered table-striped table-condensed">
  342. <thead>
  343. <tr>
  344. <th>Type</th>
  345. <th>Name</th>
  346. <th>Description</th>
  347. </tr>
  348. </thead>
  349. <tbody>
  350. <tr>
  351. <td><span class="xref">System.Func</span>&lt;<span class="xref">System.Int32</span>&gt;</td>
  352. <td><span class="parametername">function</span></td>
  353. <td>The function to be executed.</td>
  354. </tr>
  355. </tbody>
  356. </table>
  357. <h5 class="returns">Returns</h5>
  358. <table class="table table-bordered table-striped table-condensed">
  359. <thead>
  360. <tr>
  361. <th>Type</th>
  362. <th>Description</th>
  363. </tr>
  364. </thead>
  365. <tbody>
  366. <tr>
  367. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  368. <td>The <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> returned from the function.</td>
  369. </tr>
  370. </tbody>
  371. </table>
  372. <a id="Terminal_Gui_Pos_GetHashCode_" data-uid="Terminal.Gui.Pos.GetHashCode*"></a>
  373. <h4 id="Terminal_Gui_Pos_GetHashCode" data-uid="Terminal.Gui.Pos.GetHashCode">GetHashCode()</h4>
  374. <div class="markdown level1 summary">Serves as the default hash function. </div>
  375. <div class="markdown level1 conceptual"></div>
  376. <h5 class="decalaration">Declaration</h5>
  377. <div class="codewrapper">
  378. <pre><code class="lang-csharp hljs">public override int GetHashCode()</code></pre>
  379. </div>
  380. <h5 class="returns">Returns</h5>
  381. <table class="table table-bordered table-striped table-condensed">
  382. <thead>
  383. <tr>
  384. <th>Type</th>
  385. <th>Description</th>
  386. </tr>
  387. </thead>
  388. <tbody>
  389. <tr>
  390. <td><span class="xref">System.Int32</span></td>
  391. <td>A hash code for the current object.</td>
  392. </tr>
  393. </tbody>
  394. </table>
  395. <a id="Terminal_Gui_Pos_Left_" data-uid="Terminal.Gui.Pos.Left*"></a>
  396. <h4 id="Terminal_Gui_Pos_Left_Terminal_Gui_View_" data-uid="Terminal.Gui.Pos.Left(Terminal.Gui.View)">Left(View)</h4>
  397. <div class="markdown level1 summary">
  398. Returns a <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> object tracks the Left (X) position of the specified <a class="xref" href="Terminal.Gui.View.html">View</a>.
  399. </div>
  400. <div class="markdown level1 conceptual"></div>
  401. <h5 class="decalaration">Declaration</h5>
  402. <div class="codewrapper">
  403. <pre><code class="lang-csharp hljs">public static Pos Left(View view)</code></pre>
  404. </div>
  405. <h5 class="parameters">Parameters</h5>
  406. <table class="table table-bordered table-striped table-condensed">
  407. <thead>
  408. <tr>
  409. <th>Type</th>
  410. <th>Name</th>
  411. <th>Description</th>
  412. </tr>
  413. </thead>
  414. <tbody>
  415. <tr>
  416. <td><a class="xref" href="Terminal.Gui.View.html">View</a></td>
  417. <td><span class="parametername">view</span></td>
  418. <td>The <a class="xref" href="Terminal.Gui.View.html">View</a> that will be tracked.</td>
  419. </tr>
  420. </tbody>
  421. </table>
  422. <h5 class="returns">Returns</h5>
  423. <table class="table table-bordered table-striped table-condensed">
  424. <thead>
  425. <tr>
  426. <th>Type</th>
  427. <th>Description</th>
  428. </tr>
  429. </thead>
  430. <tbody>
  431. <tr>
  432. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  433. <td>The <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> that depends on the other view.</td>
  434. </tr>
  435. </tbody>
  436. </table>
  437. <a id="Terminal_Gui_Pos_Percent_" data-uid="Terminal.Gui.Pos.Percent*"></a>
  438. <h4 id="Terminal_Gui_Pos_Percent_System_Single_" data-uid="Terminal.Gui.Pos.Percent(System.Single)">Percent(Single)</h4>
  439. <div class="markdown level1 summary">
  440. Creates a percentage <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> object
  441. </div>
  442. <div class="markdown level1 conceptual"></div>
  443. <h5 class="decalaration">Declaration</h5>
  444. <div class="codewrapper">
  445. <pre><code class="lang-csharp hljs">public static Pos Percent(float n)</code></pre>
  446. </div>
  447. <h5 class="parameters">Parameters</h5>
  448. <table class="table table-bordered table-striped table-condensed">
  449. <thead>
  450. <tr>
  451. <th>Type</th>
  452. <th>Name</th>
  453. <th>Description</th>
  454. </tr>
  455. </thead>
  456. <tbody>
  457. <tr>
  458. <td><span class="xref">System.Single</span></td>
  459. <td><span class="parametername">n</span></td>
  460. <td>A value between 0 and 100 representing the percentage.</td>
  461. </tr>
  462. </tbody>
  463. </table>
  464. <h5 class="returns">Returns</h5>
  465. <table class="table table-bordered table-striped table-condensed">
  466. <thead>
  467. <tr>
  468. <th>Type</th>
  469. <th>Description</th>
  470. </tr>
  471. </thead>
  472. <tbody>
  473. <tr>
  474. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  475. <td>The percent <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> object.</td>
  476. </tr>
  477. </tbody>
  478. </table>
  479. <h5 id="Terminal_Gui_Pos_Percent_System_Single__examples">Examples</h5>
  480. This creates a <a class="xref" href="Terminal.Gui.TextField.html">TextField</a>that is centered horizontally, is 50% of the way down,
  481. is 30% the height, and is 80% the width of the <a class="xref" href="Terminal.Gui.View.html">View</a> it added to.
  482. <pre><code>var textView = new TextView () {
  483. X = Pos.Center (),
  484. Y = Pos.Percent (50),
  485. Width = Dim.Percent (80),
  486. Height = Dim.Percent (30),
  487. };</code></pre>
  488. <a id="Terminal_Gui_Pos_Right_" data-uid="Terminal.Gui.Pos.Right*"></a>
  489. <h4 id="Terminal_Gui_Pos_Right_Terminal_Gui_View_" data-uid="Terminal.Gui.Pos.Right(Terminal.Gui.View)">Right(View)</h4>
  490. <div class="markdown level1 summary">
  491. Returns a <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> object tracks the Right (X+Width) coordinate of the specified <a class="xref" href="Terminal.Gui.View.html">View</a>.
  492. </div>
  493. <div class="markdown level1 conceptual"></div>
  494. <h5 class="decalaration">Declaration</h5>
  495. <div class="codewrapper">
  496. <pre><code class="lang-csharp hljs">public static Pos Right(View view)</code></pre>
  497. </div>
  498. <h5 class="parameters">Parameters</h5>
  499. <table class="table table-bordered table-striped table-condensed">
  500. <thead>
  501. <tr>
  502. <th>Type</th>
  503. <th>Name</th>
  504. <th>Description</th>
  505. </tr>
  506. </thead>
  507. <tbody>
  508. <tr>
  509. <td><a class="xref" href="Terminal.Gui.View.html">View</a></td>
  510. <td><span class="parametername">view</span></td>
  511. <td>The <a class="xref" href="Terminal.Gui.View.html">View</a> that will be tracked.</td>
  512. </tr>
  513. </tbody>
  514. </table>
  515. <h5 class="returns">Returns</h5>
  516. <table class="table table-bordered table-striped table-condensed">
  517. <thead>
  518. <tr>
  519. <th>Type</th>
  520. <th>Description</th>
  521. </tr>
  522. </thead>
  523. <tbody>
  524. <tr>
  525. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  526. <td>The <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> that depends on the other view.</td>
  527. </tr>
  528. </tbody>
  529. </table>
  530. <a id="Terminal_Gui_Pos_Top_" data-uid="Terminal.Gui.Pos.Top*"></a>
  531. <h4 id="Terminal_Gui_Pos_Top_Terminal_Gui_View_" data-uid="Terminal.Gui.Pos.Top(Terminal.Gui.View)">Top(View)</h4>
  532. <div class="markdown level1 summary">
  533. Returns a <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> object tracks the Top (Y) position of the specified <a class="xref" href="Terminal.Gui.View.html">View</a>.
  534. </div>
  535. <div class="markdown level1 conceptual"></div>
  536. <h5 class="decalaration">Declaration</h5>
  537. <div class="codewrapper">
  538. <pre><code class="lang-csharp hljs">public static Pos Top(View view)</code></pre>
  539. </div>
  540. <h5 class="parameters">Parameters</h5>
  541. <table class="table table-bordered table-striped table-condensed">
  542. <thead>
  543. <tr>
  544. <th>Type</th>
  545. <th>Name</th>
  546. <th>Description</th>
  547. </tr>
  548. </thead>
  549. <tbody>
  550. <tr>
  551. <td><a class="xref" href="Terminal.Gui.View.html">View</a></td>
  552. <td><span class="parametername">view</span></td>
  553. <td>The <a class="xref" href="Terminal.Gui.View.html">View</a> that will be tracked.</td>
  554. </tr>
  555. </tbody>
  556. </table>
  557. <h5 class="returns">Returns</h5>
  558. <table class="table table-bordered table-striped table-condensed">
  559. <thead>
  560. <tr>
  561. <th>Type</th>
  562. <th>Description</th>
  563. </tr>
  564. </thead>
  565. <tbody>
  566. <tr>
  567. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  568. <td>The <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> that depends on the other view.</td>
  569. </tr>
  570. </tbody>
  571. </table>
  572. <a id="Terminal_Gui_Pos_X_" data-uid="Terminal.Gui.Pos.X*"></a>
  573. <h4 id="Terminal_Gui_Pos_X_Terminal_Gui_View_" data-uid="Terminal.Gui.Pos.X(Terminal.Gui.View)">X(View)</h4>
  574. <div class="markdown level1 summary">
  575. Returns a <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> object tracks the Left (X) position of the specified <a class="xref" href="Terminal.Gui.View.html">View</a>.
  576. </div>
  577. <div class="markdown level1 conceptual"></div>
  578. <h5 class="decalaration">Declaration</h5>
  579. <div class="codewrapper">
  580. <pre><code class="lang-csharp hljs">public static Pos X(View view)</code></pre>
  581. </div>
  582. <h5 class="parameters">Parameters</h5>
  583. <table class="table table-bordered table-striped table-condensed">
  584. <thead>
  585. <tr>
  586. <th>Type</th>
  587. <th>Name</th>
  588. <th>Description</th>
  589. </tr>
  590. </thead>
  591. <tbody>
  592. <tr>
  593. <td><a class="xref" href="Terminal.Gui.View.html">View</a></td>
  594. <td><span class="parametername">view</span></td>
  595. <td>The <a class="xref" href="Terminal.Gui.View.html">View</a> that will be tracked.</td>
  596. </tr>
  597. </tbody>
  598. </table>
  599. <h5 class="returns">Returns</h5>
  600. <table class="table table-bordered table-striped table-condensed">
  601. <thead>
  602. <tr>
  603. <th>Type</th>
  604. <th>Description</th>
  605. </tr>
  606. </thead>
  607. <tbody>
  608. <tr>
  609. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  610. <td>The <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> that depends on the other view.</td>
  611. </tr>
  612. </tbody>
  613. </table>
  614. <a id="Terminal_Gui_Pos_Y_" data-uid="Terminal.Gui.Pos.Y*"></a>
  615. <h4 id="Terminal_Gui_Pos_Y_Terminal_Gui_View_" data-uid="Terminal.Gui.Pos.Y(Terminal.Gui.View)">Y(View)</h4>
  616. <div class="markdown level1 summary">
  617. Returns a <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> object tracks the Top (Y) position of the specified <a class="xref" href="Terminal.Gui.View.html">View</a>.
  618. </div>
  619. <div class="markdown level1 conceptual"></div>
  620. <h5 class="decalaration">Declaration</h5>
  621. <div class="codewrapper">
  622. <pre><code class="lang-csharp hljs">public static Pos Y(View view)</code></pre>
  623. </div>
  624. <h5 class="parameters">Parameters</h5>
  625. <table class="table table-bordered table-striped table-condensed">
  626. <thead>
  627. <tr>
  628. <th>Type</th>
  629. <th>Name</th>
  630. <th>Description</th>
  631. </tr>
  632. </thead>
  633. <tbody>
  634. <tr>
  635. <td><a class="xref" href="Terminal.Gui.View.html">View</a></td>
  636. <td><span class="parametername">view</span></td>
  637. <td>The <a class="xref" href="Terminal.Gui.View.html">View</a> that will be tracked.</td>
  638. </tr>
  639. </tbody>
  640. </table>
  641. <h5 class="returns">Returns</h5>
  642. <table class="table table-bordered table-striped table-condensed">
  643. <thead>
  644. <tr>
  645. <th>Type</th>
  646. <th>Description</th>
  647. </tr>
  648. </thead>
  649. <tbody>
  650. <tr>
  651. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  652. <td>The <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> that depends on the other view.</td>
  653. </tr>
  654. </tbody>
  655. </table>
  656. <h3 id="operators">Operators
  657. </h3>
  658. <a id="Terminal_Gui_Pos_op_Addition_" data-uid="Terminal.Gui.Pos.op_Addition*"></a>
  659. <h4 id="Terminal_Gui_Pos_op_Addition_Terminal_Gui_Pos_Terminal_Gui_Pos_" data-uid="Terminal.Gui.Pos.op_Addition(Terminal.Gui.Pos,Terminal.Gui.Pos)">Addition(Pos, Pos)</h4>
  660. <div class="markdown level1 summary">
  661. Adds a <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> to a <a class="xref" href="Terminal.Gui.Pos.html">Pos</a>, yielding a new <a class="xref" href="Terminal.Gui.Pos.html">Pos</a>.
  662. </div>
  663. <div class="markdown level1 conceptual"></div>
  664. <h5 class="decalaration">Declaration</h5>
  665. <div class="codewrapper">
  666. <pre><code class="lang-csharp hljs">public static Pos operator +(Pos left, Pos right)</code></pre>
  667. </div>
  668. <h5 class="parameters">Parameters</h5>
  669. <table class="table table-bordered table-striped table-condensed">
  670. <thead>
  671. <tr>
  672. <th>Type</th>
  673. <th>Name</th>
  674. <th>Description</th>
  675. </tr>
  676. </thead>
  677. <tbody>
  678. <tr>
  679. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  680. <td><span class="parametername">left</span></td>
  681. <td>The first <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> to add.</td>
  682. </tr>
  683. <tr>
  684. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  685. <td><span class="parametername">right</span></td>
  686. <td>The second <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> to add.</td>
  687. </tr>
  688. </tbody>
  689. </table>
  690. <h5 class="returns">Returns</h5>
  691. <table class="table table-bordered table-striped table-condensed">
  692. <thead>
  693. <tr>
  694. <th>Type</th>
  695. <th>Description</th>
  696. </tr>
  697. </thead>
  698. <tbody>
  699. <tr>
  700. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  701. <td>The <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> that is the sum of the values of <code>left</code> and <code>right</code>.</td>
  702. </tr>
  703. </tbody>
  704. </table>
  705. <a id="Terminal_Gui_Pos_op_Implicit_" data-uid="Terminal.Gui.Pos.op_Implicit*"></a>
  706. <h4 id="Terminal_Gui_Pos_op_Implicit_System_Int32__Terminal_Gui_Pos" data-uid="Terminal.Gui.Pos.op_Implicit(System.Int32)~Terminal.Gui.Pos">Implicit(Int32 to Pos)</h4>
  707. <div class="markdown level1 summary">
  708. Creates an Absolute <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> from the specified integer value.
  709. </div>
  710. <div class="markdown level1 conceptual"></div>
  711. <h5 class="decalaration">Declaration</h5>
  712. <div class="codewrapper">
  713. <pre><code class="lang-csharp hljs">public static implicit operator Pos(int n)</code></pre>
  714. </div>
  715. <h5 class="parameters">Parameters</h5>
  716. <table class="table table-bordered table-striped table-condensed">
  717. <thead>
  718. <tr>
  719. <th>Type</th>
  720. <th>Name</th>
  721. <th>Description</th>
  722. </tr>
  723. </thead>
  724. <tbody>
  725. <tr>
  726. <td><span class="xref">System.Int32</span></td>
  727. <td><span class="parametername">n</span></td>
  728. <td>The value to convert to the <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> .</td>
  729. </tr>
  730. </tbody>
  731. </table>
  732. <h5 class="returns">Returns</h5>
  733. <table class="table table-bordered table-striped table-condensed">
  734. <thead>
  735. <tr>
  736. <th>Type</th>
  737. <th>Description</th>
  738. </tr>
  739. </thead>
  740. <tbody>
  741. <tr>
  742. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  743. <td>The Absolute <a class="xref" href="Terminal.Gui.Pos.html">Pos</a>.</td>
  744. </tr>
  745. </tbody>
  746. </table>
  747. <a id="Terminal_Gui_Pos_op_Subtraction_" data-uid="Terminal.Gui.Pos.op_Subtraction*"></a>
  748. <h4 id="Terminal_Gui_Pos_op_Subtraction_Terminal_Gui_Pos_Terminal_Gui_Pos_" data-uid="Terminal.Gui.Pos.op_Subtraction(Terminal.Gui.Pos,Terminal.Gui.Pos)">Subtraction(Pos, Pos)</h4>
  749. <div class="markdown level1 summary">
  750. Subtracts a <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> from a <a class="xref" href="Terminal.Gui.Pos.html">Pos</a>, yielding a new <a class="xref" href="Terminal.Gui.Pos.html">Pos</a>.
  751. </div>
  752. <div class="markdown level1 conceptual"></div>
  753. <h5 class="decalaration">Declaration</h5>
  754. <div class="codewrapper">
  755. <pre><code class="lang-csharp hljs">public static Pos operator -(Pos left, Pos right)</code></pre>
  756. </div>
  757. <h5 class="parameters">Parameters</h5>
  758. <table class="table table-bordered table-striped table-condensed">
  759. <thead>
  760. <tr>
  761. <th>Type</th>
  762. <th>Name</th>
  763. <th>Description</th>
  764. </tr>
  765. </thead>
  766. <tbody>
  767. <tr>
  768. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  769. <td><span class="parametername">left</span></td>
  770. <td>The <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> to subtract from (the minuend).</td>
  771. </tr>
  772. <tr>
  773. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  774. <td><span class="parametername">right</span></td>
  775. <td>The <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> to subtract (the subtrahend).</td>
  776. </tr>
  777. </tbody>
  778. </table>
  779. <h5 class="returns">Returns</h5>
  780. <table class="table table-bordered table-striped table-condensed">
  781. <thead>
  782. <tr>
  783. <th>Type</th>
  784. <th>Description</th>
  785. </tr>
  786. </thead>
  787. <tbody>
  788. <tr>
  789. <td><a class="xref" href="Terminal.Gui.Pos.html">Pos</a></td>
  790. <td>The <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> that is the <code>left</code> minus <code>right</code>.</td>
  791. </tr>
  792. </tbody>
  793. </table>
  794. </article>
  795. </div>
  796. <div class="hidden-sm col-md-2" role="complementary">
  797. <div class="sideaffix">
  798. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  799. <h5>In This Article</h5>
  800. <div></div>
  801. </nav>
  802. </div>
  803. </div>
  804. </div>
  805. </div>
  806. <footer>
  807. <div class="grad-bottom"></div>
  808. <div class="footer">
  809. <div class="container">
  810. <span class="pull-right">
  811. <a href="#top">Back to top</a>
  812. </span>
  813. <span>Generated by <strong>DocFX</strong></span>
  814. </div>
  815. </div>
  816. </footer>
  817. </div>
  818. <script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
  819. <script type="text/javascript" src="../../styles/docfx.js"></script>
  820. <script type="text/javascript" src="../../styles/main.js"></script>
  821. </body>
  822. </html>