Terminal.Gui.Pos.html 32 KB

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