mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-12-16 01:48:56 +08:00
337 lines
39 KiB
HTML
337 lines
39 KiB
HTML
<!-- HTML header for doxygen 1.8.14-->
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="cache-control" content="max-age=86400"/>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.12.0"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>FTXUI: include/ftxui/component/component.hpp Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="cookie.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">FTXUI
|
|
 <span id="projectnumber">0.11.0</span>
|
|
</div>
|
|
<div id="projectbrief">C++ functional terminal UI.</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.12.0 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() { codefold.init(0); });
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search',true);
|
|
$(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function(){initNavTree('component_8hpp_source.html',''); initResizable(true); });
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="headertitle"><div class="title">component.hpp</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="component_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#ifndef FTXUI_COMPONENT_HPP</span></div>
|
|
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#define FTXUI_COMPONENT_HPP</span></div>
|
|
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span> </div>
|
|
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="preprocessor">#include <functional></span> <span class="comment">// for function</span></div>
|
|
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include <memory></span> <span class="comment">// for make_shared, shared_ptr</span></div>
|
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include <string></span> <span class="comment">// for wstring</span></div>
|
|
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include <vector></span> <span class="comment">// for vector</span></div>
|
|
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
|
|
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include "<a class="code" href="component__base_8hpp.html">ftxui/component/component_base.hpp</a>"</span> <span class="comment">// for Component, Components</span></div>
|
|
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include "<a class="code" href="component__options_8hpp.html">ftxui/component/component_options.hpp</a>"</span> <span class="comment">// for ButtonOption, CheckboxOption, InputOption, MenuOption, RadioboxOption, ToggleOption</span></div>
|
|
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include "<a class="code" href="elements_8hpp.html">ftxui/dom/elements.hpp</a>"</span> <span class="comment">// for Element</span></div>
|
|
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include "<a class="code" href="ref_8hpp.html">ftxui/util/ref.hpp</a>"</span> <span class="comment">// for Ref, ConstStringRef, ConstStringListRef, StringRef</span></div>
|
|
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
|
|
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespaceftxui.html">ftxui</a> {</div>
|
|
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="keyword">struct </span>ButtonOption;</div>
|
|
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="keyword">struct </span>CheckboxOption;</div>
|
|
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="keyword">struct </span>Event;</div>
|
|
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="keyword">struct </span>InputOption;</div>
|
|
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="keyword">struct </span>MenuOption;</div>
|
|
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="keyword">struct </span>RadioboxOption;</div>
|
|
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="keyword">struct </span>ToggleOption;</div>
|
|
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="keyword">struct </span>MenuEntryOption;</div>
|
|
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
|
|
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="keyword">template</span> <<span class="keyword">class </span>T, <span class="keyword">class</span>... Args></div>
|
|
<div class="foldopen" id="foldopen00025" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="namespaceftxui.html#a2b8973dc71334f1d98e2e6f55de8b5ae"> 25</a></span>std::shared_ptr<T> <a class="code hl_function" href="namespaceftxui.html#a2b8973dc71334f1d98e2e6f55de8b5ae">Make</a>(Args&&... args) {</div>
|
|
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keywordflow">return</span> std::make_shared<T>(args...);</div>
|
|
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
|
|
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#a6910ffaa082c693603aafab4e7dddac3">Button</a>(ConstStringRef label,</div>
|
|
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> std::function<<span class="keywordtype">void</span>()> on_click,</div>
|
|
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> Ref<ButtonOption> = {});</div>
|
|
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#a04e40e348dee25bbbfce0a13bf234e19">Checkbox</a>(ConstStringRef label,</div>
|
|
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordtype">bool</span>* checked,</div>
|
|
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> Ref<CheckboxOption> option = {});</div>
|
|
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#a30be54a28004c1c48c2a5ed54e4abd64">Input</a>(StringRef content,</div>
|
|
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> ConstStringRef placeholder,</div>
|
|
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> Ref<InputOption> option = {});</div>
|
|
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#a777280bcec2414bef5c6725658c7714b">Menu</a>(ConstStringListRef entries,</div>
|
|
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordtype">int</span>* selected_,</div>
|
|
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> Ref<MenuOption> = {});</div>
|
|
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#ab984001f4208b35a22b9dcafae4debb6">MenuEntry</a>(ConstStringRef label, Ref<MenuEntryOption> = {});</div>
|
|
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#aa22bddff4aeed66e20f30d0715596999">Dropdown</a>(ConstStringListRef entries, <span class="keywordtype">int</span>* selected);</div>
|
|
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#a0d757f667caaff5287cb8702f52186ee">Radiobox</a>(ConstStringListRef entries,</div>
|
|
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordtype">int</span>* selected_,</div>
|
|
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> Ref<RadioboxOption> option = {});</div>
|
|
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#a1c4cbe6596ef55350f8a6a49a090510c">Toggle</a>(ConstStringListRef entries,</div>
|
|
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordtype">int</span>* selected,</div>
|
|
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> Ref<ToggleOption> option = {});</div>
|
|
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="keyword">template</span> <<span class="keyword">class</span> T> <span class="comment">// T = {int, float, long}</span></div>
|
|
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#acc572957ec06e5eb955856ee058f8d90">Slider</a>(ConstStringRef label, T* value, T min, T max, T increment);</div>
|
|
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#ae2205fc172615b43e1e3307bb614be4c">ResizableSplitLeft</a>(<a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> main, <a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> back, <span class="keywordtype">int</span>* main_size);</div>
|
|
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#a9030d0beb64f653603cab382b02750a8">ResizableSplitRight</a>(<a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> main, <a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> back, <span class="keywordtype">int</span>* main_size);</div>
|
|
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#a238b4b650aca14716b82b2198695e008">ResizableSplitTop</a>(<a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> main, <a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> back, <span class="keywordtype">int</span>* main_size);</div>
|
|
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#acb75e6e61a021829893f7b57aeb7e3a2">ResizableSplitBottom</a>(<a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> main, <a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> back, <span class="keywordtype">int</span>* main_size);</div>
|
|
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#a533e883e2aeea28de2b60564fcaf0361">Renderer</a>(<a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> child, std::function<<a class="code hl_typedef" href="namespaceftxui.html#a2bc31f2d685189e5c61d2293a1f51b4f">Element</a>()>);</div>
|
|
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#a533e883e2aeea28de2b60564fcaf0361">Renderer</a>(std::function<<a class="code hl_typedef" href="namespaceftxui.html#a2bc31f2d685189e5c61d2293a1f51b4f">Element</a>()>);</div>
|
|
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#a533e883e2aeea28de2b60564fcaf0361">Renderer</a>(std::function<<a class="code hl_typedef" href="namespaceftxui.html#a2bc31f2d685189e5c61d2293a1f51b4f">Element</a>(<span class="keywordtype">bool</span> <span class="comment">/* focused */</span>)>);</div>
|
|
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="namespaceftxui.html#afa5872ba3f9889c7487e57e745e56857"> 58</a></span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#afa5872ba3f9889c7487e57e745e56857">CatchEvent</a>(<a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> child, std::function<<span class="keywordtype">bool</span>(<a class="code hl_struct" href="structftxui_1_1Event.html">Event</a>)>);</div>
|
|
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui.html#abe1e4e93c6f28539357d0a6aec27ebdd">Maybe</a>(<a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a>, <span class="keywordtype">bool</span>* show);</div>
|
|
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> </div>
|
|
<div class="foldopen" id="foldopen00061" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="namespaceftxui_1_1Container.html"> 61</a></span><span class="keyword">namespace </span>Container {</div>
|
|
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui_1_1Container.html#a6471e39f5664d059144746c5801d37e6">Vertical</a>(<a class="code hl_typedef" href="namespaceftxui.html#a3d4ccad0c8a07d5b0cb4b2e690ffc90c">Components</a> children);</div>
|
|
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui_1_1Container.html#a6471e39f5664d059144746c5801d37e6">Vertical</a>(<a class="code hl_typedef" href="namespaceftxui.html#a3d4ccad0c8a07d5b0cb4b2e690ffc90c">Components</a> children, <span class="keywordtype">int</span>* selector);</div>
|
|
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui_1_1Container.html#a01563bae9454fe64c0b29b0eb3755e68">Horizontal</a>(<a class="code hl_typedef" href="namespaceftxui.html#a3d4ccad0c8a07d5b0cb4b2e690ffc90c">Components</a> children);</div>
|
|
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui_1_1Container.html#a01563bae9454fe64c0b29b0eb3755e68">Horizontal</a>(<a class="code hl_typedef" href="namespaceftxui.html#a3d4ccad0c8a07d5b0cb4b2e690ffc90c">Components</a> children, <span class="keywordtype">int</span>* selector);</div>
|
|
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span><a class="code hl_typedef" href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">Component</a> <a class="code hl_function" href="namespaceftxui_1_1Container.html#aea9fe244eeeb420276bcc5760b46953d">Tab</a>(<a class="code hl_typedef" href="namespaceftxui.html#a3d4ccad0c8a07d5b0cb4b2e690ffc90c">Components</a> children, <span class="keywordtype">int</span>* selector);</div>
|
|
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> </div>
|
|
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span>} <span class="comment">// namespace Container</span></div>
|
|
</div>
|
|
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
|
|
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span>} <span class="comment">// namespace ftxui</span></div>
|
|
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> </div>
|
|
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span><span class="comment">// Include component using the old deprecated wstring.</span></div>
|
|
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span><span class="preprocessor">#include "<a class="code" href="component_2deprecated_8hpp.html">ftxui/component/deprecated.hpp</a>"</span></div>
|
|
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> </div>
|
|
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span><span class="preprocessor">#endif </span><span class="comment">/* end of include guard: FTXUI_COMPONENT_HPP */</span><span class="preprocessor"></span></div>
|
|
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> </div>
|
|
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span><span class="comment">// Copyright 2021 Arthur Sonzogni. All rights reserved.</span></div>
|
|
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span><span class="comment">// Use of this source code is governed by the MIT license that can be found in</span></div>
|
|
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span><span class="comment">// the LICENSE file.</span></div>
|
|
<div class="ttc" id="acomponent_2deprecated_8hpp_html"><div class="ttname"><a href="component_2deprecated_8hpp.html">deprecated.hpp</a></div></div>
|
|
<div class="ttc" id="acomponent__base_8hpp_html"><div class="ttname"><a href="component__base_8hpp.html">component_base.hpp</a></div></div>
|
|
<div class="ttc" id="acomponent__options_8hpp_html"><div class="ttname"><a href="component__options_8hpp.html">component_options.hpp</a></div></div>
|
|
<div class="ttc" id="aelements_8hpp_html"><div class="ttname"><a href="elements_8hpp.html">elements.hpp</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_1_1Container_html_a01563bae9454fe64c0b29b0eb3755e68"><div class="ttname"><a href="namespaceftxui_1_1Container.html#a01563bae9454fe64c0b29b0eb3755e68">ftxui::Container::Horizontal</a></div><div class="ttdeci">Component Horizontal(Components children)</div><div class="ttdoc">A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...</div><div class="ttdef"><b>Definition</b> <a href="container_8cpp_source.html#l00243">container.cpp:243</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_1_1Container_html_a6471e39f5664d059144746c5801d37e6"><div class="ttname"><a href="namespaceftxui_1_1Container.html#a6471e39f5664d059144746c5801d37e6">ftxui::Container::Vertical</a></div><div class="ttdeci">Component Vertical(Components children)</div><div class="ttdoc">A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...</div><div class="ttdef"><b>Definition</b> <a href="container_8cpp_source.html#l00200">container.cpp:200</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_1_1Container_html_aea9fe244eeeb420276bcc5760b46953d"><div class="ttname"><a href="namespaceftxui_1_1Container.html#aea9fe244eeeb420276bcc5760b46953d">ftxui::Container::Tab</a></div><div class="ttdeci">Component Tab(Components children, int *selector)</div><div class="ttdoc">A list of components, where only one is drawn and interacted with at a time. The |selector| gives the...</div><div class="ttdef"><b>Definition</b> <a href="container_8cpp_source.html#l00288">container.cpp:288</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html"><div class="ttname"><a href="namespaceftxui.html">ftxui</a></div><div class="ttdef"><b>Definition</b> <a href="captured__mouse_8hpp_source.html#l00006">captured_mouse.hpp:6</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_a04e40e348dee25bbbfce0a13bf234e19"><div class="ttname"><a href="namespaceftxui.html#a04e40e348dee25bbbfce0a13bf234e19">ftxui::Checkbox</a></div><div class="ttdeci">Component Checkbox(ConstStringRef label, bool *checked, Ref< CheckboxOption > option={})</div><div class="ttdoc">Draw checkable element.</div><div class="ttdef"><b>Definition</b> <a href="checkbox_8cpp_source.html#l00117">checkbox.cpp:117</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_a0d757f667caaff5287cb8702f52186ee"><div class="ttname"><a href="namespaceftxui.html#a0d757f667caaff5287cb8702f52186ee">ftxui::Radiobox</a></div><div class="ttdeci">Component Radiobox(ConstStringListRef entries, int *selected_, Ref< RadioboxOption > option={})</div><div class="ttdoc">A list of element, where only one can be selected.</div><div class="ttdef"><b>Definition</b> <a href="radiobox_8cpp_source.html#l00190">radiobox.cpp:190</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_a1c4cbe6596ef55350f8a6a49a090510c"><div class="ttname"><a href="namespaceftxui.html#a1c4cbe6596ef55350f8a6a49a090510c">ftxui::Toggle</a></div><div class="ttdeci">Component Toggle(ConstStringListRef entries, int *selected, Ref< ToggleOption > option={})</div><div class="ttdoc">An horizontal list of elements. The user can navigate through them.</div><div class="ttdef"><b>Definition</b> <a href="toggle_8cpp_source.html#l00126">toggle.cpp:126</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_a238b4b650aca14716b82b2198695e008"><div class="ttname"><a href="namespaceftxui.html#a238b4b650aca14716b82b2198695e008">ftxui::ResizableSplitTop</a></div><div class="ttdeci">Component ResizableSplitTop(Component main, Component back, int *main_size)</div><div class="ttdoc">An vertical split in between two components, configurable using the mouse.</div><div class="ttdef"><b>Definition</b> <a href="resizable__split_8cpp_source.html#l00326">resizable_split.cpp:326</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_a2b8973dc71334f1d98e2e6f55de8b5ae"><div class="ttname"><a href="namespaceftxui.html#a2b8973dc71334f1d98e2e6f55de8b5ae">ftxui::Make</a></div><div class="ttdeci">std::shared_ptr< T > Make(Args &&... args)</div><div class="ttdef"><b>Definition</b> <a href="#l00025">component.hpp:25</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_a2bc31f2d685189e5c61d2293a1f51b4f"><div class="ttname"><a href="namespaceftxui.html#a2bc31f2d685189e5c61d2293a1f51b4f">ftxui::Element</a></div><div class="ttdeci">std::shared_ptr< Node > Element</div><div class="ttdef"><b>Definition</b> <a href="elements_8hpp_source.html#l00015">elements.hpp:15</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_a30be54a28004c1c48c2a5ed54e4abd64"><div class="ttname"><a href="namespaceftxui.html#a30be54a28004c1c48c2a5ed54e4abd64">ftxui::Input</a></div><div class="ttdeci">Component Input(StringRef content, ConstStringRef placeholder, Ref< InputOption > option={})</div><div class="ttdoc">An input box for editing text.</div><div class="ttdef"><b>Definition</b> <a href="input_8cpp_source.html#l00241">input.cpp:241</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_a3d4ccad0c8a07d5b0cb4b2e690ffc90c"><div class="ttname"><a href="namespaceftxui.html#a3d4ccad0c8a07d5b0cb4b2e690ffc90c">ftxui::Components</a></div><div class="ttdeci">std::vector< Component > Components</div><div class="ttdef"><b>Definition</b> <a href="component__base_8hpp_source.html#l00018">component_base.hpp:18</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_a533e883e2aeea28de2b60564fcaf0361"><div class="ttname"><a href="namespaceftxui.html#a533e883e2aeea28de2b60564fcaf0361">ftxui::Renderer</a></div><div class="ttdeci">Component Renderer(Component child, std::function< Element()>)</div><div class="ttdoc">Return a new Component, similar to |child|, but using |render| as the Component::Render() event.</div><div class="ttdef"><b>Definition</b> <a href="renderer_8cpp_source.html#l00059">renderer.cpp:59</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_a6910ffaa082c693603aafab4e7dddac3"><div class="ttname"><a href="namespaceftxui.html#a6910ffaa082c693603aafab4e7dddac3">ftxui::Button</a></div><div class="ttdeci">Component Button(ConstStringRef label, std::function< void()> on_click, Ref< ButtonOption >={})</div><div class="ttdoc">Draw a button. Execute a function when clicked.</div><div class="ttdef"><b>Definition</b> <a href="button_8cpp_source.html#l00090">button.cpp:90</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_a777280bcec2414bef5c6725658c7714b"><div class="ttname"><a href="namespaceftxui.html#a777280bcec2414bef5c6725658c7714b">ftxui::Menu</a></div><div class="ttdeci">Component Menu(ConstStringListRef entries, int *selected_, Ref< MenuOption >={})</div><div class="ttdoc">A list of text. The focused element is selected.</div><div class="ttdef"><b>Definition</b> <a href="menu_8cpp_source.html#l00173">menu.cpp:173</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_a9030d0beb64f653603cab382b02750a8"><div class="ttname"><a href="namespaceftxui.html#a9030d0beb64f653603cab382b02750a8">ftxui::ResizableSplitRight</a></div><div class="ttdeci">Component ResizableSplitRight(Component main, Component back, int *main_size)</div><div class="ttdoc">An horizontal split in between two components, configurable using the mouse.</div><div class="ttdef"><b>Definition</b> <a href="resizable__split_8cpp_source.html#l00296">resizable_split.cpp:296</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_aa22bddff4aeed66e20f30d0715596999"><div class="ttname"><a href="namespaceftxui.html#aa22bddff4aeed66e20f30d0715596999">ftxui::Dropdown</a></div><div class="ttdeci">Component Dropdown(ConstStringListRef entries, int *selected)</div><div class="ttdef"><b>Definition</b> <a href="dropdown_8cpp_source.html#l00013">dropdown.cpp:13</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_ab984001f4208b35a22b9dcafae4debb6"><div class="ttname"><a href="namespaceftxui.html#ab984001f4208b35a22b9dcafae4debb6">ftxui::MenuEntry</a></div><div class="ttdeci">Component MenuEntry(ConstStringRef label, Ref< MenuEntryOption >={})</div><div class="ttdef"><b>Definition</b> <a href="menu_8cpp_source.html#l00179">menu.cpp:179</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_abe1e4e93c6f28539357d0a6aec27ebdd"><div class="ttname"><a href="namespaceftxui.html#abe1e4e93c6f28539357d0a6aec27ebdd">ftxui::Maybe</a></div><div class="ttdeci">Component Maybe(Component, bool *show)</div><div class="ttdef"><b>Definition</b> <a href="maybe_8cpp_source.html#l00012">maybe.cpp:12</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_acb75e6e61a021829893f7b57aeb7e3a2"><div class="ttname"><a href="namespaceftxui.html#acb75e6e61a021829893f7b57aeb7e3a2">ftxui::ResizableSplitBottom</a></div><div class="ttdeci">Component ResizableSplitBottom(Component main, Component back, int *main_size)</div><div class="ttdoc">An vertical split in between two components, configurable using the mouse.</div><div class="ttdef"><b>Definition</b> <a href="resizable__split_8cpp_source.html#l00356">resizable_split.cpp:356</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_acc572957ec06e5eb955856ee058f8d90"><div class="ttname"><a href="namespaceftxui.html#acc572957ec06e5eb955856ee058f8d90">ftxui::Slider</a></div><div class="ttdeci">Component Slider(ConstStringRef label, T *value, T min, T max, T increment)</div><div class="ttdoc">An horizontal slider.</div><div class="ttdef"><b>Definition</b> <a href="slider_8cpp_source.html#l00123">slider.cpp:123</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_ae2205fc172615b43e1e3307bb614be4c"><div class="ttname"><a href="namespaceftxui.html#ae2205fc172615b43e1e3307bb614be4c">ftxui::ResizableSplitLeft</a></div><div class="ttdeci">Component ResizableSplitLeft(Component main, Component back, int *main_size)</div><div class="ttdoc">An horizontal split in between two components, configurable using the mouse.</div><div class="ttdef"><b>Definition</b> <a href="resizable__split_8cpp_source.html#l00266">resizable_split.cpp:266</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_af1479ede01dbf087342534ab4ada11d3"><div class="ttname"><a href="namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3">ftxui::Component</a></div><div class="ttdeci">std::shared_ptr< ComponentBase > Component</div><div class="ttdef"><b>Definition</b> <a href="component__base_8hpp_source.html#l00017">component_base.hpp:17</a></div></div>
|
|
<div class="ttc" id="anamespaceftxui_html_afa5872ba3f9889c7487e57e745e56857"><div class="ttname"><a href="namespaceftxui.html#afa5872ba3f9889c7487e57e745e56857">ftxui::CatchEvent</a></div><div class="ttdeci">Component CatchEvent(Component child, std::function< bool(Event)>)</div></div>
|
|
<div class="ttc" id="aref_8hpp_html"><div class="ttname"><a href="ref_8hpp.html">ref.hpp</a></div></div>
|
|
<div class="ttc" id="astructftxui_1_1Event_html"><div class="ttname"><a href="structftxui_1_1Event.html">ftxui::Event</a></div><div class="ttdoc">Represent an event. It can be key press event, a terminal resize, or more ...</div><div class="ttdef"><b>Definition</b> <a href="event_8hpp_source.html#l00025">event.hpp:25</a></div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- HTML footer for doxygen 1.8.14-->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
</div>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const projectNumber = document.getElementById('projectname');
|
|
|
|
if (!projectNumber) {
|
|
console.warn('Doxygen element with ID "projectnumber" not found. Cannot add version switcher.');
|
|
return;
|
|
}
|
|
|
|
const langs = ["en", "es", "fr", "ja", "zh-CH", "zh-TW"];
|
|
const lang_paths = {"en": "../../index.html", "es": "../../es/index.html", "fr": "../../fr/index.html", "ja": "../../ja/index.html", "zh-CH": "../../zh-CH/index.html", "zh-TW": "../../zh-TW/index.html"};
|
|
const lang_display = {"en": "English", "es": "Espa\u00f1ol", "fr": "Fran\u00e7ais", "ja": "\u65e5\u672c\u8a9e", "zh-CH": "\u4e2d\u6587 (\u7b80\u4f53)", "zh-TW": "\u4e2d\u6587 (\u7e41\u9ad4)"};
|
|
const versions = ["main", "v6.1.9", "v6.1.8", "v6.1.7", "v6.1.6", "v6.1.5", "v6.1.4", "v6.1.3", "v6.1.2", "v6.1.1", "v6.1.0", "v6.0.2", "v6.0.1", "v6.0.0", "v5.0.0", "v4.1.1", "v4.1.0", "v4.0.0", "v3.0.0", "v2.0.0", "v0.9", "v0.11", "v0.10"];
|
|
const version_paths = {"main": "../../index.html", "v6.1.9": "../v6.1.9/index.html", "v6.1.8": "../v6.1.8/index.html", "v6.1.7": "../v6.1.7/index.html", "v6.1.6": "../v6.1.6/index.html", "v6.1.5": "../v6.1.5/index.html", "v6.1.4": "../v6.1.4/index.html", "v6.1.3": "../v6.1.3/index.html", "v6.1.2": "../v6.1.2/index.html", "v6.1.1": "../v6.1.1/index.html", "v6.1.0": "../v6.1.0/index.html", "v6.0.2": "../v6.0.2/index.html", "v6.0.1": "../v6.0.1/index.html", "v6.0.0": "../v6.0.0/index.html", "v5.0.0": "../v5.0.0/index.html", "v4.1.1": "../v4.1.1/index.html", "v4.1.0": "../v4.1.0/index.html", "v4.0.0": "../v4.0.0/index.html", "v3.0.0": "../v3.0.0/index.html", "v2.0.0": "../v2.0.0/index.html", "v0.9": "../v0.9/index.html", "v0.11": "index.html", "v0.10": "../v0.10/index.html"};
|
|
const currentLang = "en";
|
|
const currentVersion = "v0.11";
|
|
|
|
// Helper function to create a styled select element
|
|
const createSelect = (options, current, paths, label, displayMap = null) => {
|
|
const select = document.createElement('select');
|
|
select.title = label;
|
|
select.onchange = function() {
|
|
const selectedValue = this.value;
|
|
if (selectedValue in paths) {
|
|
window.location.href = paths[selectedValue];
|
|
}
|
|
};
|
|
|
|
// Sort versions: 'main' first, then others numerically descending.
|
|
options.sort((a, b) => {
|
|
if (a === 'main') return -1;
|
|
if (b === 'main') return 1;
|
|
return b.localeCompare(a, undefined, { numeric: true, sensitivity: 'base' });
|
|
});
|
|
|
|
options.forEach(v => {
|
|
const option = document.createElement('option');
|
|
option.value = v;
|
|
// Use the displayMap if provided, otherwise default to the value (v)
|
|
option.textContent = displayMap ? displayMap[v] : v;
|
|
if (v === current) {
|
|
option.selected = true;
|
|
}
|
|
select.appendChild(option);
|
|
});
|
|
|
|
// Apply some styling to make it look good.
|
|
Object.assign(select.style, {
|
|
backgroundColor: 'rgba(0, 0, 0, 0.8)',
|
|
color: 'white',
|
|
border: '1px solid rgba(255, 255, 255, 0.2)',
|
|
padding: '5px',
|
|
borderRadius: '5px',
|
|
fontSize: '14px',
|
|
fontFamily: 'inherit',
|
|
margin: '0 5px 0 0',
|
|
cursor: 'pointer'
|
|
});
|
|
return select;
|
|
};
|
|
|
|
// 1. Create Language Switcher, passing the language display names map
|
|
const langSelect = createSelect(langs, currentLang, lang_paths, 'Select Language', lang_display);
|
|
|
|
// 2. Create Version Switcher
|
|
const versionSelect = createSelect(versions, currentVersion, version_paths, 'Select Version');
|
|
|
|
// 3. Create FTXUI title.
|
|
const ftxuiTitle = document.createElement('span');
|
|
ftxuiTitle.textContent = 'FTXUI: ';
|
|
Object.assign(ftxuiTitle.style, {
|
|
color: 'white',
|
|
fontSize: '20px',
|
|
fontWeight: 'bold',
|
|
marginRight: '10px'
|
|
});
|
|
|
|
// 3. Create a container to hold both selectors
|
|
const container = document.createElement('div');
|
|
container.id = 'version-lang-switchers';
|
|
Object.assign(container.style, {
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
justifyContent: 'flex-end',
|
|
width: 'auto'
|
|
});
|
|
container.appendChild(ftxuiTitle);
|
|
container.appendChild(langSelect);
|
|
container.appendChild(versionSelect);
|
|
|
|
Object.assign(container.style, {
|
|
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
padding: '5px 10px',
|
|
borderRadius: '8px'
|
|
});
|
|
|
|
|
|
// Replace the Doxygen project number element with our container.
|
|
projectNumber.replaceWith(container);
|
|
|
|
// Clean up the original Doxygen project number text if it still exists nearby
|
|
const parent = container.parentElement;
|
|
if (parent) {
|
|
const textNode = Array.from(parent.childNodes).find(n => n.nodeType === 3 && n.textContent.trim() !== '');
|
|
if (textNode) {
|
|
textNode.remove();
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|