12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052 |
- <!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.56.2.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"></div>
- <div class="sr-items">
- <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
- </div>
- <ul id="pagination"></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, multille 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_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_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_Terminal_Gui_TextAlignment_System_Boolean_">Format(ustring, Int32, TextAlignment, Boolean)</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 constrainted 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>
- <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_" data-uid="Terminal.Gui.TextFormatter.CalcRect(System.Int32,System.Int32,NStack.ustring)">CalcRect(Int32, Int32, ustring)</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)</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>
- </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_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_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 eanbled.
- Regardless of the value of this parameter, <code>hotKeySpecifier</code> takes precidence.</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_Terminal_Gui_TextAlignment_System_Boolean_" data-uid="Terminal.Gui.TextFormatter.Format(NStack.ustring,System.Int32,Terminal.Gui.TextAlignment,System.Boolean)">Format(ustring, Int32, TextAlignment, Boolean)</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)</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>
- </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__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_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 justifed 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 multple 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 specfiied 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_" data-uid="Terminal.Gui.TextFormatter.WordWrap(NStack.ustring,System.Int32)">WordWrap(ustring, 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)</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 contrain the text to</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__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">
- <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
- </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>
|