1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525 |
- <!DOCTYPE html>
- <!--[if IE]><![endif]-->
- <html>
-
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <title>Class TextFormatter
- </title>
- <meta name="viewport" content="width=device-width">
- <meta name="title" content="Class TextFormatter
- ">
- <meta name="generator" content="docfx 2.58.5.0">
-
- <link rel="shortcut icon" href="../../favicon.ico">
- <link rel="stylesheet" href="../../styles/docfx.vendor.css">
- <link rel="stylesheet" href="../../styles/docfx.css">
- <link rel="stylesheet" href="../../styles/main.css">
- <meta property="docfx:navrel" content="../../toc.html">
- <meta property="docfx:tocrel" content="toc.html">
-
- <meta property="docfx:rel" content="../../">
-
- </head>
- <body data-spy="scroll" data-target="#affix" data-offset="120">
- <div id="wrapper">
- <header>
-
- <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
- <div class="container">
- <div class="navbar-header">
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
-
- <a class="navbar-brand" href="../../index.html">
- <img id="logo" class="svg" src="../../images/logo48.png" alt="">
- </a>
- </div>
- <div class="collapse navbar-collapse" id="navbar">
- <form class="navbar-form navbar-right" role="search" id="search">
- <div class="form-group">
- <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
- </div>
- </form>
- </div>
- </div>
- </nav>
-
- <div class="subnav navbar navbar-default">
- <div class="container hide-when-search" id="breadcrumb">
- <ul class="breadcrumb">
- <li></li>
- </ul>
- </div>
- </div>
- </header>
- <div class="container body-content">
-
- <div id="search-results">
- <div class="search-list">Search Results for <span></span></div>
- <div class="sr-items">
- <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
- </div>
- <ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
- </div>
- </div>
- <div role="main" class="container body-content hide-when-search">
-
- <div class="sidenav hide-when-search">
- <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
- <div class="sidetoggle collapse" id="sidetoggle">
- <div id="sidetoc"></div>
- </div>
- </div>
- <div class="article row grid-right">
- <div class="col-md-10">
- <article class="content wrap" id="_content" data-uid="Terminal.Gui.TextFormatter">
-
-
- <h1 id="Terminal_Gui_TextFormatter" data-uid="Terminal.Gui.TextFormatter" class="text-break">Class TextFormatter
- </h1>
- <div class="markdown level0 summary">
- Provides text formatting capabilities for console apps. Supports, hotkeys, horizontal alignment, multiple lines, and word-based line wrap.
- </div>
- <div class="markdown level0 conceptual"></div>
- <div class="inheritance">
- <h5>Inheritance</h5>
- <div class="level0"><span class="xref">System.Object</span></div>
- <div class="level1"><span class="xref">TextFormatter</span></div>
- </div>
- <div class="inheritedMembers">
- <h5>Inherited Members</h5>
- <div>
- <span class="xref">System.Object.Equals(System.Object)</span>
- </div>
- <div>
- <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
- </div>
- <div>
- <span class="xref">System.Object.GetHashCode()</span>
- </div>
- <div>
- <span class="xref">System.Object.GetType()</span>
- </div>
- <div>
- <span class="xref">System.Object.MemberwiseClone()</span>
- </div>
- <div>
- <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
- </div>
- <div>
- <span class="xref">System.Object.ToString()</span>
- </div>
- </div>
- <h6><strong>Namespace</strong>: <a class="xref" href="Terminal.Gui.html">Terminal.Gui</a></h6>
- <h6><strong>Assembly</strong>: Terminal.Gui.dll</h6>
- <h5 id="Terminal_Gui_TextFormatter_syntax">Syntax</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public class TextFormatter</code></pre>
- </div>
- <h3 id="properties">Properties
- </h3>
-
-
- <a id="Terminal_Gui_TextFormatter_Alignment_" data-uid="Terminal.Gui.TextFormatter.Alignment*"></a>
- <h4 id="Terminal_Gui_TextFormatter_Alignment" data-uid="Terminal.Gui.TextFormatter.Alignment">Alignment</h4>
- <div class="markdown level1 summary">
- Controls the horizontal text-alignment property.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public TextAlignment Alignment { get; set; }</code></pre>
- </div>
- <h5 class="propertyValue">Property Value</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><a class="xref" href="Terminal.Gui.TextAlignment.html">TextAlignment</a></td>
- <td>The text alignment.</td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_AutoSize_" data-uid="Terminal.Gui.TextFormatter.AutoSize*"></a>
- <h4 id="Terminal_Gui_TextFormatter_AutoSize" data-uid="Terminal.Gui.TextFormatter.AutoSize">AutoSize</h4>
- <div class="markdown level1 summary">
- Used by <a class="xref" href="Terminal.Gui.TextFormatter.html#Terminal_Gui_TextFormatter_Text">Text</a> to resize the view's <a class="xref" href="Terminal.Gui.View.html#Terminal_Gui_View_Bounds">Bounds</a> with the <a class="xref" href="Terminal.Gui.TextFormatter.html#Terminal_Gui_TextFormatter_Size">Size</a>.
- Setting <a class="xref" href="Terminal.Gui.TextFormatter.html#Terminal_Gui_TextFormatter_AutoSize">AutoSize</a> to true only work if the <a class="xref" href="Terminal.Gui.View.html#Terminal_Gui_View_Width">Width</a> and <a class="xref" href="Terminal.Gui.View.html#Terminal_Gui_View_Height">Height</a> are null or
- <a class="xref" href="Terminal.Gui.LayoutStyle.html#Terminal_Gui_LayoutStyle_Absolute">Absolute</a> values and doesn't work with <a class="xref" href="Terminal.Gui.LayoutStyle.html#Terminal_Gui_LayoutStyle_Computed">Computed</a> layout,
- to avoid breaking the <a class="xref" href="Terminal.Gui.Pos.html">Pos</a> and <a class="xref" href="Terminal.Gui.Dim.html">Dim</a> settings.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public bool AutoSize { get; set; }</code></pre>
- </div>
- <h5 class="propertyValue">Property Value</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.Boolean</span></td>
- <td></td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_CursorPosition_" data-uid="Terminal.Gui.TextFormatter.CursorPosition*"></a>
- <h4 id="Terminal_Gui_TextFormatter_CursorPosition" data-uid="Terminal.Gui.TextFormatter.CursorPosition">CursorPosition</h4>
- <div class="markdown level1 summary">
- Gets the cursor position from <a class="xref" href="Terminal.Gui.TextFormatter.html#Terminal_Gui_TextFormatter_HotKey">HotKey</a>. If the <a class="xref" href="Terminal.Gui.TextFormatter.html#Terminal_Gui_TextFormatter_HotKey">HotKey</a> is defined, the cursor will be positioned over it.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public int CursorPosition { get; set; }</code></pre>
- </div>
- <h5 class="propertyValue">Property Value</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td></td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_Direction_" data-uid="Terminal.Gui.TextFormatter.Direction*"></a>
- <h4 id="Terminal_Gui_TextFormatter_Direction" data-uid="Terminal.Gui.TextFormatter.Direction">Direction</h4>
- <div class="markdown level1 summary">
- Controls the text-direction property.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public TextDirection Direction { get; set; }</code></pre>
- </div>
- <h5 class="propertyValue">Property Value</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><a class="xref" href="Terminal.Gui.TextDirection.html">TextDirection</a></td>
- <td>The text vertical alignment.</td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_HotKey_" data-uid="Terminal.Gui.TextFormatter.HotKey*"></a>
- <h4 id="Terminal_Gui_TextFormatter_HotKey" data-uid="Terminal.Gui.TextFormatter.HotKey">HotKey</h4>
- <div class="markdown level1 summary">
- Gets the hotkey. Will be an upper case letter or digit.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public Key HotKey { get; }</code></pre>
- </div>
- <h5 class="propertyValue">Property Value</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
- <td></td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_HotKeyPos_" data-uid="Terminal.Gui.TextFormatter.HotKeyPos*"></a>
- <h4 id="Terminal_Gui_TextFormatter_HotKeyPos" data-uid="Terminal.Gui.TextFormatter.HotKeyPos">HotKeyPos</h4>
- <div class="markdown level1 summary">
- The position in the text of the hotkey. The hotkey will be rendered using the hot color.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public int HotKeyPos { get; set; }</code></pre>
- </div>
- <h5 class="propertyValue">Property Value</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td></td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_HotKeySpecifier_" data-uid="Terminal.Gui.TextFormatter.HotKeySpecifier*"></a>
- <h4 id="Terminal_Gui_TextFormatter_HotKeySpecifier" data-uid="Terminal.Gui.TextFormatter.HotKeySpecifier">HotKeySpecifier</h4>
- <div class="markdown level1 summary">
- The specifier character for the hotkey (e.g. '_'). Set to '\xffff' to disable hotkey support for this View instance. The default is '\xffff'.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public Rune HotKeySpecifier { get; set; }</code></pre>
- </div>
- <h5 class="propertyValue">Property Value</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.Rune</span></td>
- <td></td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_HotKeyTagMask_" data-uid="Terminal.Gui.TextFormatter.HotKeyTagMask*"></a>
- <h4 id="Terminal_Gui_TextFormatter_HotKeyTagMask" data-uid="Terminal.Gui.TextFormatter.HotKeyTagMask">HotKeyTagMask</h4>
- <div class="markdown level1 summary">
- Specifies the mask to apply to the hotkey to tag it as the hotkey. The default value of <code>0x100000</code> causes
- the underlying Rune to be identified as a "private use" Unicode character.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public uint HotKeyTagMask { get; set; }</code></pre>
- </div>
- <h5 class="propertyValue">Property Value</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.UInt32</span></td>
- <td></td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_Lines_" data-uid="Terminal.Gui.TextFormatter.Lines*"></a>
- <h4 id="Terminal_Gui_TextFormatter_Lines" data-uid="Terminal.Gui.TextFormatter.Lines">Lines</h4>
- <div class="markdown level1 summary">
- Gets the formatted lines.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public List<ustring> Lines { get; }</code></pre>
- </div>
- <h5 class="propertyValue">Property Value</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.Collections.Generic.List</span><<span class="xref">NStack.ustring</span>></td>
- <td></td>
- </tr>
- </tbody>
- </table>
- <h5 id="Terminal_Gui_TextFormatter_Lines_remarks">Remarks</h5>
- <div class="markdown level1 remarks">
- <p>
- Upon a 'get' of this property, if the text needs to be formatted (if <a class="xref" href="Terminal.Gui.TextFormatter.html#Terminal_Gui_TextFormatter_NeedsFormat">NeedsFormat</a> is <code>true</code>)
- <a class="xref" href="Terminal.Gui.TextFormatter.html#Terminal_Gui_TextFormatter_Format_NStack_ustring_System_Int32_System_Boolean_System_Boolean_System_Boolean_System_Int32_">Format(ustring, Int32, Boolean, Boolean, Boolean, Int32)</a> will be called internally.
- </p>
- </div>
-
-
- <a id="Terminal_Gui_TextFormatter_NeedsFormat_" data-uid="Terminal.Gui.TextFormatter.NeedsFormat*"></a>
- <h4 id="Terminal_Gui_TextFormatter_NeedsFormat" data-uid="Terminal.Gui.TextFormatter.NeedsFormat">NeedsFormat</h4>
- <div class="markdown level1 summary">
- Gets or sets whether the <a class="xref" href="Terminal.Gui.TextFormatter.html">TextFormatter</a> needs to format the text when <a class="xref" href="Terminal.Gui.TextFormatter.html#Terminal_Gui_TextFormatter_Draw_Terminal_Gui_Rect_Terminal_Gui_Attribute_Terminal_Gui_Attribute_">Draw(Rect, Attribute, Attribute)</a> is called.
- If it is <code>false</code> when Draw is called, the Draw call will be faster.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public bool NeedsFormat { get; set; }</code></pre>
- </div>
- <h5 class="propertyValue">Property Value</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.Boolean</span></td>
- <td></td>
- </tr>
- </tbody>
- </table>
- <h5 id="Terminal_Gui_TextFormatter_NeedsFormat_remarks">Remarks</h5>
- <div class="markdown level1 remarks">
- <p>
- This is set to true when the properties of <a class="xref" href="Terminal.Gui.TextFormatter.html">TextFormatter</a> are set.
- </p>
- </div>
-
-
- <a id="Terminal_Gui_TextFormatter_Size_" data-uid="Terminal.Gui.TextFormatter.Size*"></a>
- <h4 id="Terminal_Gui_TextFormatter_Size" data-uid="Terminal.Gui.TextFormatter.Size">Size</h4>
- <div class="markdown level1 summary">
- Gets or sets the size of the area the text will be constrained to when formatted.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public Size Size { get; set; }</code></pre>
- </div>
- <h5 class="propertyValue">Property Value</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><a class="xref" href="Terminal.Gui.Size.html">Size</a></td>
- <td></td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_Text_" data-uid="Terminal.Gui.TextFormatter.Text*"></a>
- <h4 id="Terminal_Gui_TextFormatter_Text" data-uid="Terminal.Gui.TextFormatter.Text">Text</h4>
- <div class="markdown level1 summary">
- The text to be displayed. This text is never modified.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public virtual ustring Text { get; set; }</code></pre>
- </div>
- <h5 class="propertyValue">Property Value</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td></td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_VerticalAlignment_" data-uid="Terminal.Gui.TextFormatter.VerticalAlignment*"></a>
- <h4 id="Terminal_Gui_TextFormatter_VerticalAlignment" data-uid="Terminal.Gui.TextFormatter.VerticalAlignment">VerticalAlignment</h4>
- <div class="markdown level1 summary">
- Controls the vertical text-alignment property.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public VerticalTextAlignment VerticalAlignment { get; set; }</code></pre>
- </div>
- <h5 class="propertyValue">Property Value</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><a class="xref" href="Terminal.Gui.VerticalTextAlignment.html">VerticalTextAlignment</a></td>
- <td>The text vertical alignment.</td>
- </tr>
- </tbody>
- </table>
- <h3 id="methods">Methods
- </h3>
-
-
- <a id="Terminal_Gui_TextFormatter_CalcRect_" data-uid="Terminal.Gui.TextFormatter.CalcRect*"></a>
- <h4 id="Terminal_Gui_TextFormatter_CalcRect_System_Int32_System_Int32_NStack_ustring_Terminal_Gui_TextDirection_" data-uid="Terminal.Gui.TextFormatter.CalcRect(System.Int32,System.Int32,NStack.ustring,Terminal.Gui.TextDirection)">CalcRect(Int32, Int32, ustring, TextDirection)</h4>
- <div class="markdown level1 summary">
- Calculates the rectangle required to hold text, assuming no word wrapping.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public static Rect CalcRect(int x, int y, ustring text, TextDirection direction = TextDirection.LeftRight_TopBottom)</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td><span class="parametername">x</span></td>
- <td>The x location of the rectangle</td>
- </tr>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td><span class="parametername">y</span></td>
- <td>The y location of the rectangle</td>
- </tr>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td><span class="parametername">text</span></td>
- <td>The text to measure</td>
- </tr>
- <tr>
- <td><a class="xref" href="Terminal.Gui.TextDirection.html">TextDirection</a></td>
- <td><span class="parametername">direction</span></td>
- <td>The text direction.</td>
- </tr>
- </tbody>
- </table>
- <h5 class="returns">Returns</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><a class="xref" href="Terminal.Gui.Rect.html">Rect</a></td>
- <td></td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_ClipAndJustify_" data-uid="Terminal.Gui.TextFormatter.ClipAndJustify*"></a>
- <h4 id="Terminal_Gui_TextFormatter_ClipAndJustify_NStack_ustring_System_Int32_System_Boolean_" data-uid="Terminal.Gui.TextFormatter.ClipAndJustify(NStack.ustring,System.Int32,System.Boolean)">ClipAndJustify(ustring, Int32, Boolean)</h4>
- <div class="markdown level1 summary">
- Justifies text within a specified width.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public static ustring ClipAndJustify(ustring text, int width, bool justify)</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td><span class="parametername">text</span></td>
- <td>The text to justify.</td>
- </tr>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td><span class="parametername">width</span></td>
- <td>If the text length is greater that <code>width</code> it will be clipped.</td>
- </tr>
- <tr>
- <td><span class="xref">System.Boolean</span></td>
- <td><span class="parametername">justify</span></td>
- <td>Justify.</td>
- </tr>
- </tbody>
- </table>
- <h5 class="returns">Returns</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td>Justified and clipped text.</td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_ClipAndJustify_" data-uid="Terminal.Gui.TextFormatter.ClipAndJustify*"></a>
- <h4 id="Terminal_Gui_TextFormatter_ClipAndJustify_NStack_ustring_System_Int32_Terminal_Gui_TextAlignment_" data-uid="Terminal.Gui.TextFormatter.ClipAndJustify(NStack.ustring,System.Int32,Terminal.Gui.TextAlignment)">ClipAndJustify(ustring, Int32, TextAlignment)</h4>
- <div class="markdown level1 summary">
- Justifies text within a specified width.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public static ustring ClipAndJustify(ustring text, int width, TextAlignment talign)</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td><span class="parametername">text</span></td>
- <td>The text to justify.</td>
- </tr>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td><span class="parametername">width</span></td>
- <td>If the text length is greater that <code>width</code> it will be clipped.</td>
- </tr>
- <tr>
- <td><a class="xref" href="Terminal.Gui.TextAlignment.html">TextAlignment</a></td>
- <td><span class="parametername">talign</span></td>
- <td>Alignment.</td>
- </tr>
- </tbody>
- </table>
- <h5 class="returns">Returns</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td>Justified and clipped text.</td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_ClipOrPad_" data-uid="Terminal.Gui.TextFormatter.ClipOrPad*"></a>
- <h4 id="Terminal_Gui_TextFormatter_ClipOrPad_System_String_System_Int32_" data-uid="Terminal.Gui.TextFormatter.ClipOrPad(System.String,System.Int32)">ClipOrPad(String, Int32)</h4>
- <div class="markdown level1 summary">
- Adds trailing whitespace or truncates <code data-dev-comment-type="paramref" class="paramref">text</code>
- so that it fits exactly <code data-dev-comment-type="paramref" class="paramref">width</code> console units.
- Note that some unicode characters take 2+ columns
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public static string ClipOrPad(string text, int width)</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.String</span></td>
- <td><span class="parametername">text</span></td>
- <td></td>
- </tr>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td><span class="parametername">width</span></td>
- <td></td>
- </tr>
- </tbody>
- </table>
- <h5 class="returns">Returns</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.String</span></td>
- <td></td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_Draw_" data-uid="Terminal.Gui.TextFormatter.Draw*"></a>
- <h4 id="Terminal_Gui_TextFormatter_Draw_Terminal_Gui_Rect_Terminal_Gui_Attribute_Terminal_Gui_Attribute_" data-uid="Terminal.Gui.TextFormatter.Draw(Terminal.Gui.Rect,Terminal.Gui.Attribute,Terminal.Gui.Attribute)">Draw(Rect, Attribute, Attribute)</h4>
- <div class="markdown level1 summary">
- Draws the text held by <a class="xref" href="Terminal.Gui.TextFormatter.html">TextFormatter</a> to <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Driver">Driver</a> using the colors specified.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public void Draw(Rect bounds, Attribute normalColor, Attribute hotColor)</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><a class="xref" href="Terminal.Gui.Rect.html">Rect</a></td>
- <td><span class="parametername">bounds</span></td>
- <td>Specifies the screen-relative location and maximum size for drawing the text.</td>
- </tr>
- <tr>
- <td><a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a></td>
- <td><span class="parametername">normalColor</span></td>
- <td>The color to use for all text except the hotkey</td>
- </tr>
- <tr>
- <td><a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a></td>
- <td><span class="parametername">hotColor</span></td>
- <td>The color to use to draw the hotkey</td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_FindHotKey_" data-uid="Terminal.Gui.TextFormatter.FindHotKey*"></a>
- <h4 id="Terminal_Gui_TextFormatter_FindHotKey_NStack_ustring_System_Rune_System_Boolean_System_Int32__Terminal_Gui_Key__" data-uid="Terminal.Gui.TextFormatter.FindHotKey(NStack.ustring,System.Rune,System.Boolean,System.Int32@,Terminal.Gui.Key@)">FindHotKey(ustring, Rune, Boolean, out Int32, out Key)</h4>
- <div class="markdown level1 summary">
- Finds the hotkey and its location in text.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public static bool FindHotKey(ustring text, Rune hotKeySpecifier, bool firstUpperCase, out int hotPos, out Key hotKey)</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td><span class="parametername">text</span></td>
- <td>The text to look in.</td>
- </tr>
- <tr>
- <td><span class="xref">System.Rune</span></td>
- <td><span class="parametername">hotKeySpecifier</span></td>
- <td>The hotkey specifier (e.g. '_') to look for.</td>
- </tr>
- <tr>
- <td><span class="xref">System.Boolean</span></td>
- <td><span class="parametername">firstUpperCase</span></td>
- <td>If <code>true</code> the legacy behavior of identifying the first upper case character as the hotkey will be enabled.
- Regardless of the value of this parameter, <code>hotKeySpecifier</code> takes precedence.</td>
- </tr>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td><span class="parametername">hotPos</span></td>
- <td>Outputs the Rune index into <code>text</code>.</td>
- </tr>
- <tr>
- <td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
- <td><span class="parametername">hotKey</span></td>
- <td>Outputs the hotKey.</td>
- </tr>
- </tbody>
- </table>
- <h5 class="returns">Returns</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.Boolean</span></td>
- <td><code>true</code> if a hotkey was found; <code>false</code> otherwise.</td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_Format_" data-uid="Terminal.Gui.TextFormatter.Format*"></a>
- <h4 id="Terminal_Gui_TextFormatter_Format_NStack_ustring_System_Int32_System_Boolean_System_Boolean_System_Boolean_System_Int32_" data-uid="Terminal.Gui.TextFormatter.Format(NStack.ustring,System.Int32,System.Boolean,System.Boolean,System.Boolean,System.Int32)">Format(ustring, Int32, Boolean, Boolean, Boolean, Int32)</h4>
- <div class="markdown level1 summary">
- Reformats text into lines, applying text alignment and optionally wrapping text to new lines on word boundaries.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public static List<ustring> Format(ustring text, int width, bool justify, bool wordWrap, bool preserveTrailingSpaces = false, int tabWidth = 0)</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td><span class="parametername">text</span></td>
- <td></td>
- </tr>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td><span class="parametername">width</span></td>
- <td>The width to bound the text to for word wrapping and clipping.</td>
- </tr>
- <tr>
- <td><span class="xref">System.Boolean</span></td>
- <td><span class="parametername">justify</span></td>
- <td>Specifies whether the text should be justified.</td>
- </tr>
- <tr>
- <td><span class="xref">System.Boolean</span></td>
- <td><span class="parametername">wordWrap</span></td>
- <td>If <code>true</code>, the text will be wrapped to new lines as need. If <code>false</code>, forces text to fit a single line. Line breaks are converted to spaces. The text will be clipped to <code>width</code></td>
- </tr>
- <tr>
- <td><span class="xref">System.Boolean</span></td>
- <td><span class="parametername">preserveTrailingSpaces</span></td>
- <td>If <code>true</code> and 'wordWrap' also true, the wrapped text will keep the trailing spaces. If <code>false</code>, the trailing spaces will be trimmed.</td>
- </tr>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td><span class="parametername">tabWidth</span></td>
- <td>The tab width.</td>
- </tr>
- </tbody>
- </table>
- <h5 class="returns">Returns</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.Collections.Generic.List</span><<span class="xref">NStack.ustring</span>></td>
- <td>A list of word wrapped lines.</td>
- </tr>
- </tbody>
- </table>
- <h5 id="Terminal_Gui_TextFormatter_Format_NStack_ustring_System_Int32_System_Boolean_System_Boolean_System_Boolean_System_Int32__remarks">Remarks</h5>
- <div class="markdown level1 remarks">
- <p>
- An empty <code>text</code> string will result in one empty line.
- </p>
- <p>
- If <code>width</code> is 0, a single, empty line will be returned.
- </p>
- <p>
- If <code>width</code> is int.MaxValue, the text will be formatted to the maximum width possible.
- </p>
- </div>
-
-
- <a id="Terminal_Gui_TextFormatter_Format_" data-uid="Terminal.Gui.TextFormatter.Format*"></a>
- <h4 id="Terminal_Gui_TextFormatter_Format_NStack_ustring_System_Int32_Terminal_Gui_TextAlignment_System_Boolean_System_Boolean_System_Int32_" data-uid="Terminal.Gui.TextFormatter.Format(NStack.ustring,System.Int32,Terminal.Gui.TextAlignment,System.Boolean,System.Boolean,System.Int32)">Format(ustring, Int32, TextAlignment, Boolean, Boolean, Int32)</h4>
- <div class="markdown level1 summary">
- Reformats text into lines, applying text alignment and optionally wrapping text to new lines on word boundaries.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public static List<ustring> Format(ustring text, int width, TextAlignment talign, bool wordWrap, bool preserveTrailingSpaces = false, int tabWidth = 0)</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td><span class="parametername">text</span></td>
- <td></td>
- </tr>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td><span class="parametername">width</span></td>
- <td>The width to bound the text to for word wrapping and clipping.</td>
- </tr>
- <tr>
- <td><a class="xref" href="Terminal.Gui.TextAlignment.html">TextAlignment</a></td>
- <td><span class="parametername">talign</span></td>
- <td>Specifies how the text will be aligned horizontally.</td>
- </tr>
- <tr>
- <td><span class="xref">System.Boolean</span></td>
- <td><span class="parametername">wordWrap</span></td>
- <td>If <code>true</code>, the text will be wrapped to new lines as need. If <code>false</code>, forces text to fit a single line. Line breaks are converted to spaces. The text will be clipped to <code>width</code></td>
- </tr>
- <tr>
- <td><span class="xref">System.Boolean</span></td>
- <td><span class="parametername">preserveTrailingSpaces</span></td>
- <td>If <code>true</code> and 'wordWrap' also true, the wrapped text will keep the trailing spaces. If <code>false</code>, the trailing spaces will be trimmed.</td>
- </tr>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td><span class="parametername">tabWidth</span></td>
- <td>The tab width.</td>
- </tr>
- </tbody>
- </table>
- <h5 class="returns">Returns</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.Collections.Generic.List</span><<span class="xref">NStack.ustring</span>></td>
- <td>A list of word wrapped lines.</td>
- </tr>
- </tbody>
- </table>
- <h5 id="Terminal_Gui_TextFormatter_Format_NStack_ustring_System_Int32_Terminal_Gui_TextAlignment_System_Boolean_System_Boolean_System_Int32__remarks">Remarks</h5>
- <div class="markdown level1 remarks">
- <p>
- An empty <code>text</code> string will result in one empty line.
- </p>
- <p>
- If <code>width</code> is 0, a single, empty line will be returned.
- </p>
- <p>
- If <code>width</code> is int.MaxValue, the text will be formatted to the maximum width possible.
- </p>
- </div>
-
-
- <a id="Terminal_Gui_TextFormatter_IsHorizontalDirection_" data-uid="Terminal.Gui.TextFormatter.IsHorizontalDirection*"></a>
- <h4 id="Terminal_Gui_TextFormatter_IsHorizontalDirection_Terminal_Gui_TextDirection_" data-uid="Terminal.Gui.TextFormatter.IsHorizontalDirection(Terminal.Gui.TextDirection)">IsHorizontalDirection(TextDirection)</h4>
- <div class="markdown level1 summary">
- Check if it is a horizontal direction
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public static bool IsHorizontalDirection(TextDirection textDirection)</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><a class="xref" href="Terminal.Gui.TextDirection.html">TextDirection</a></td>
- <td><span class="parametername">textDirection</span></td>
- <td></td>
- </tr>
- </tbody>
- </table>
- <h5 class="returns">Returns</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.Boolean</span></td>
- <td></td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_IsLeftToRight_" data-uid="Terminal.Gui.TextFormatter.IsLeftToRight*"></a>
- <h4 id="Terminal_Gui_TextFormatter_IsLeftToRight_Terminal_Gui_TextDirection_" data-uid="Terminal.Gui.TextFormatter.IsLeftToRight(Terminal.Gui.TextDirection)">IsLeftToRight(TextDirection)</h4>
- <div class="markdown level1 summary">
- Check if it is Left to Right direction
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public static bool IsLeftToRight(TextDirection textDirection)</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><a class="xref" href="Terminal.Gui.TextDirection.html">TextDirection</a></td>
- <td><span class="parametername">textDirection</span></td>
- <td></td>
- </tr>
- </tbody>
- </table>
- <h5 class="returns">Returns</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.Boolean</span></td>
- <td></td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_IsTopToBottom_" data-uid="Terminal.Gui.TextFormatter.IsTopToBottom*"></a>
- <h4 id="Terminal_Gui_TextFormatter_IsTopToBottom_Terminal_Gui_TextDirection_" data-uid="Terminal.Gui.TextFormatter.IsTopToBottom(Terminal.Gui.TextDirection)">IsTopToBottom(TextDirection)</h4>
- <div class="markdown level1 summary">
- Check if it is Top to Bottom direction
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public static bool IsTopToBottom(TextDirection textDirection)</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><a class="xref" href="Terminal.Gui.TextDirection.html">TextDirection</a></td>
- <td><span class="parametername">textDirection</span></td>
- <td></td>
- </tr>
- </tbody>
- </table>
- <h5 class="returns">Returns</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.Boolean</span></td>
- <td></td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_IsVerticalDirection_" data-uid="Terminal.Gui.TextFormatter.IsVerticalDirection*"></a>
- <h4 id="Terminal_Gui_TextFormatter_IsVerticalDirection_Terminal_Gui_TextDirection_" data-uid="Terminal.Gui.TextFormatter.IsVerticalDirection(Terminal.Gui.TextDirection)">IsVerticalDirection(TextDirection)</h4>
- <div class="markdown level1 summary">
- Check if it is a vertical direction
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public static bool IsVerticalDirection(TextDirection textDirection)</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><a class="xref" href="Terminal.Gui.TextDirection.html">TextDirection</a></td>
- <td><span class="parametername">textDirection</span></td>
- <td></td>
- </tr>
- </tbody>
- </table>
- <h5 class="returns">Returns</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.Boolean</span></td>
- <td></td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_Justify_" data-uid="Terminal.Gui.TextFormatter.Justify*"></a>
- <h4 id="Terminal_Gui_TextFormatter_Justify_NStack_ustring_System_Int32_System_Char_" data-uid="Terminal.Gui.TextFormatter.Justify(NStack.ustring,System.Int32,System.Char)">Justify(ustring, Int32, Char)</h4>
- <div class="markdown level1 summary">
- Justifies the text to fill the width provided. Space will be added between words (demarked by spaces and tabs) to
- make the text just fit <code>width</code>. Spaces will not be added to the ends.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public static ustring Justify(ustring text, int width, char spaceChar = ' ')</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td><span class="parametername">text</span></td>
- <td></td>
- </tr>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td><span class="parametername">width</span></td>
- <td></td>
- </tr>
- <tr>
- <td><span class="xref">System.Char</span></td>
- <td><span class="parametername">spaceChar</span></td>
- <td>Character to replace whitespace and pad with. For debugging purposes.</td>
- </tr>
- </tbody>
- </table>
- <h5 class="returns">Returns</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td>The justified text.</td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_MaxLines_" data-uid="Terminal.Gui.TextFormatter.MaxLines*"></a>
- <h4 id="Terminal_Gui_TextFormatter_MaxLines_NStack_ustring_System_Int32_" data-uid="Terminal.Gui.TextFormatter.MaxLines(NStack.ustring,System.Int32)">MaxLines(ustring, Int32)</h4>
- <div class="markdown level1 summary">
- Computes the number of lines needed to render the specified text given the width.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public static int MaxLines(ustring text, int width)</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td><span class="parametername">text</span></td>
- <td>Text, may contain newlines.</td>
- </tr>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td><span class="parametername">width</span></td>
- <td>The minimum width for the text.</td>
- </tr>
- </tbody>
- </table>
- <h5 class="returns">Returns</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td>Number of lines.</td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_MaxWidth_" data-uid="Terminal.Gui.TextFormatter.MaxWidth*"></a>
- <h4 id="Terminal_Gui_TextFormatter_MaxWidth_NStack_ustring_System_Int32_" data-uid="Terminal.Gui.TextFormatter.MaxWidth(NStack.ustring,System.Int32)">MaxWidth(ustring, Int32)</h4>
- <div class="markdown level1 summary">
- Computes the maximum width needed to render the text (single line or multiple lines) given a minimum width.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public static int MaxWidth(ustring text, int width)</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td><span class="parametername">text</span></td>
- <td>Text, may contain newlines.</td>
- </tr>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td><span class="parametername">width</span></td>
- <td>The minimum width for the text.</td>
- </tr>
- </tbody>
- </table>
- <h5 class="returns">Returns</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td>Max width of lines.</td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_RemoveHotKeySpecifier_" data-uid="Terminal.Gui.TextFormatter.RemoveHotKeySpecifier*"></a>
- <h4 id="Terminal_Gui_TextFormatter_RemoveHotKeySpecifier_NStack_ustring_System_Int32_System_Rune_" data-uid="Terminal.Gui.TextFormatter.RemoveHotKeySpecifier(NStack.ustring,System.Int32,System.Rune)">RemoveHotKeySpecifier(ustring, Int32, Rune)</h4>
- <div class="markdown level1 summary">
- Removes the hotkey specifier from text.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public static ustring RemoveHotKeySpecifier(ustring text, int hotPos, Rune hotKeySpecifier)</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td><span class="parametername">text</span></td>
- <td>The text to manipulate.</td>
- </tr>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td><span class="parametername">hotPos</span></td>
- <td>Returns the position of the hot-key in the text. -1 if not found.</td>
- </tr>
- <tr>
- <td><span class="xref">System.Rune</span></td>
- <td><span class="parametername">hotKeySpecifier</span></td>
- <td>The hot-key specifier (e.g. '_') to look for.</td>
- </tr>
- </tbody>
- </table>
- <h5 class="returns">Returns</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td>The input text with the hotkey specifier ('_') removed.</td>
- </tr>
- </tbody>
- </table>
-
-
- <a id="Terminal_Gui_TextFormatter_ReplaceHotKeyWithTag_" data-uid="Terminal.Gui.TextFormatter.ReplaceHotKeyWithTag*"></a>
- <h4 id="Terminal_Gui_TextFormatter_ReplaceHotKeyWithTag_NStack_ustring_System_Int32_" data-uid="Terminal.Gui.TextFormatter.ReplaceHotKeyWithTag(NStack.ustring,System.Int32)">ReplaceHotKeyWithTag(ustring, Int32)</h4>
- <div class="markdown level1 summary">
- Replaces the Rune at the index specified by the <code>hotPos</code> parameter with a tag identifying
- it as the hotkey.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public ustring ReplaceHotKeyWithTag(ustring text, int hotPos)</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td><span class="parametername">text</span></td>
- <td>The text to tag the hotkey in.</td>
- </tr>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td><span class="parametername">hotPos</span></td>
- <td>The Rune index of the hotkey in <code>text</code>.</td>
- </tr>
- </tbody>
- </table>
- <h5 class="returns">Returns</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td>The text with the hotkey tagged.</td>
- </tr>
- </tbody>
- </table>
- <h5 id="Terminal_Gui_TextFormatter_ReplaceHotKeyWithTag_NStack_ustring_System_Int32__remarks">Remarks</h5>
- <div class="markdown level1 remarks">
- The returned string will not render correctly without first un-doing the tag. To undo the tag, search for
- Runes with a bitmask of <code>otKeyTagMask</code> and remove that bitmask.
- </div>
-
-
- <a id="Terminal_Gui_TextFormatter_WordWrap_" data-uid="Terminal.Gui.TextFormatter.WordWrap*"></a>
- <h4 id="Terminal_Gui_TextFormatter_WordWrap_NStack_ustring_System_Int32_System_Boolean_System_Int32_" data-uid="Terminal.Gui.TextFormatter.WordWrap(NStack.ustring,System.Int32,System.Boolean,System.Int32)">WordWrap(ustring, Int32, Boolean, Int32)</h4>
- <div class="markdown level1 summary">
- Formats the provided text to fit within the width provided using word wrapping.
- </div>
- <div class="markdown level1 conceptual"></div>
- <h5 class="decalaration">Declaration</h5>
- <div class="codewrapper">
- <pre><code class="lang-csharp hljs">public static List<ustring> WordWrap(ustring text, int width, bool preserveTrailingSpaces = false, int tabWidth = 0)</code></pre>
- </div>
- <h5 class="parameters">Parameters</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Name</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">NStack.ustring</span></td>
- <td><span class="parametername">text</span></td>
- <td>The text to word wrap</td>
- </tr>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td><span class="parametername">width</span></td>
- <td>The width to contain the text to</td>
- </tr>
- <tr>
- <td><span class="xref">System.Boolean</span></td>
- <td><span class="parametername">preserveTrailingSpaces</span></td>
- <td>If <code>true</code>, the wrapped text will keep the trailing spaces.
- If <code>false</code>, the trailing spaces will be trimmed.</td>
- </tr>
- <tr>
- <td><span class="xref">System.Int32</span></td>
- <td><span class="parametername">tabWidth</span></td>
- <td>The tab width.</td>
- </tr>
- </tbody>
- </table>
- <h5 class="returns">Returns</h5>
- <table class="table table-bordered table-striped table-condensed">
- <thead>
- <tr>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><span class="xref">System.Collections.Generic.List</span><<span class="xref">NStack.ustring</span>></td>
- <td>Returns a list of word wrapped lines.</td>
- </tr>
- </tbody>
- </table>
- <h5 id="Terminal_Gui_TextFormatter_WordWrap_NStack_ustring_System_Int32_System_Boolean_System_Int32__remarks">Remarks</h5>
- <div class="markdown level1 remarks">
- <p>
- This method does not do any justification.
- </p>
- <p>
- This method strips Newline ('\n' and '\r\n') sequences before processing.
- </p>
- </div>
- </article>
- </div>
-
- <div class="hidden-sm col-md-2" role="complementary">
- <div class="sideaffix">
- <div class="contribution">
- <ul class="nav">
- </ul>
- </div>
- <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
- <h5>In This Article</h5>
- <div></div>
- </nav>
- </div>
- </div>
- </div>
- </div>
-
- <footer>
- <div class="grad-bottom"></div>
- <div class="footer">
- <div class="container">
- <span class="pull-right">
- <a href="#top">Back to top</a>
- </span>
-
- <span>Generated by <strong>DocFX</strong></span>
- </div>
- </div>
- </footer>
- </div>
-
- <script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
- <script type="text/javascript" src="../../styles/docfx.js"></script>
- <script type="text/javascript" src="../../styles/main.js"></script>
- </body>
- </html>
|