FTXUI 7.0.3
C++ functional terminal UI.
Loading...
Searching...
No Matches
ftxui/dom

Detailed Description

請查看 ftxui/dom 模組的 教學。

Enumerations

enum class  Direction : uint8_t {
  Up = 0 ,
  Down = 1 ,
  Left = 2 ,
  Right = 3
}
 Direction 是一個列舉,表示四個主要方向。 More...
 
enum  BorderStyle : uint8_t {
  LIGHT ,
  DASHED ,
  HEAVY ,
  DOUBLE ,
  ROUNDED ,
  EMPTY
}
 BorderStyle 是一個列舉,表示可以應用於終端機 UI 元素的不同邊框樣式。 More...
 

Functions

struct FTXUI_EXPORT (DOM) Canvas
 畫布是與繪圖操作相關聯的可繪製緩衝區。
 
Element automerge (Element child)
 啟用字符自動與附近其他字符合併。
 
Element blink (Element child)
 繪製的文字在可見和隱藏之間交替。
 
Element bold (Element child)
 使用粗體字型,用於需要更多強調的元素。
 
Element border (Element child)
 在元素周圍繪製邊框。
 
Decorator borderWith (const Cell &pixel)
 與 border 相同,但周圍使用固定的 Cell。
 
Decorator borderStyled (BorderStyle style)
 與 border 相同,但具有不同的樣式。
 
Decorator borderStyled (Color foreground_color)
 與 border 相同,但具有前景色。
 
Decorator borderStyled (BorderStyle style, Color foreground_color)
 與 border 相同,但具有前景色和不同的樣式。
 
Element borderDashed (Element child)
 在元素周圍繪製虛線邊框。
 
Element borderLight (Element child)
 在元素周圍繪製細邊框。
 
Element borderHeavy (Element child)
 在元素周圍繪製粗邊框。
 
Element borderDouble (Element child)
 在元素周圍繪製雙線邊框。
 
Element borderRounded (Element child)
 在元素周圍繪製圓角邊框。
 
Element borderEmpty (Element child)
 在元素周圍繪製空邊框。
 
Element window (Element title, Element content, BorderStyle border)
 繪製帶有標題和邊框的視窗。
 
Element clear_under (Element element)
 在繪製 |child| 之前,先清除底下的儲存格。這在 搭配 dbox 使用時很有用。
 
Element color (Color color, Element child)
 設定元素的前景顏色。
 
Element bgcolor (Color color, Element child)
 設定元素的背景顏色。
 
Decorator color (Color c)
 使用前景顏色進行裝飾。
 
Decorator bgcolor (Color color)
 使用背景顏色進行裝飾。
 
Element hcenter (Element child)
 水平置中一個元素。
 
Element vcenter (Element child)
 垂直置中一個元素。
 
Element center (Element child)
 水平與垂直置中一個元素。
 
Element align_right (Element child)
 將元素靠右對齊。
 
Element dbox (Elements children_)
 將多個元素堆疊在一起。
 
Element dim (Element child)
 使用淺色字體,適用於不那麼強調的元素。
 
Element filler ()
 一個會依照容器中剩餘空間 按比例擴展的元素。
 
Element flex (Element child)
 讓子元素依比例擴展以填滿容器中剩餘的空間。
 
Element xflex (Element child)
 在 X 軸上盡可能擴展/在需要時最小化。
 
Element yflex (Element child)
 在 Y 軸上盡可能擴展/在需要時最小化。
 
Element flex_grow (Element child)
 盡可能擴展。
 
Element xflex_grow (Element child)
 在 X 軸上盡可能擴展。
 
Element yflex_grow (Element child)
 在 Y 軸上盡可能擴展。
 
Element flex_shrink (Element child)
 在需要時最小化。
 
Element xflex_shrink (Element child)
 在 X 軸上在需要時最小化。
 
Element yflex_shrink (Element child)
 在 Y 軸上在需要時最小化。
 
Element notflex (Element child)
 使元素不可伸縮。
 
Decorator focusPositionRelative (float x, float y)
 在 frame 內部使用,這會強制視圖滾動到給定位置。該位置以請求大小的比例表示。
 
Decorator focusPosition (int x, int y)
 在 frame 內部使用,這會強制視圖滾動到給定位置。該位置以單元格數表示。
 
Element focus (Element child)
 將 child 設置為其同級元素中被聚焦的元素。
 
Element focusCursorBlock (Element child)
 與 focus 相同,但將游標形狀設置為靜止條狀。
 
Element focusCursorBlockBlinking (Element child)
 與 focus 相同,但將游標形狀設置為閃爍方塊。
 
Element focusCursorBar (Element child)
 與 focus 相同,但將游標形狀設置為靜止條狀。
 
Element focusCursorBarBlinking (Element child)
 與 focus 相同,但將游標形狀設置為閃爍條狀。
 
Element focusCursorUnderline (Element child)
 與 focus 相同,但將游標形狀設置為靜止底線。
 
Element focusCursorUnderlineBlinking (Element child)
 與 focus 相同,但將游標形狀設置為閃爍底線。
 
Element gaugeDirection (float progress, Direction direction)
 繪製一個指定方向的高解析度進度條。
 
Element gaugeRight (float progress)
 繪製一個從左到右進展的高解析度進度條。
 
Element gaugeLeft (float progress)
 繪製一個從右到左進展的高解析度進度條。
 
Element gaugeUp (float progress)
 繪製一個從下到上進展的高解析度進度條。
 
Element gaugeDown (float progress)
 繪製一個從上到下進展的高解析度進度條。
 
Element gauge (float progress)
 繪製一個高解析度進度條。
 
Element gaugeCharset (float progress, std::vector< std::string > charset, Direction direction)
 使用自訂字元集繪製高解析度進度條。
 
Element hyperlink (std::string_view link, Element child)
 使渲染區域可點擊並使用網路瀏覽器開啟。 當用戶點擊時,連結將被開啟。 此功能僅在有限的終端模擬器中受支援。 List: https://github.com/Alhadis/OSC8-Adoption/
 
Decorator hyperlink (std::string_view link)
 使用超連結裝飾。 當用戶點擊時,連結將被開啟。 此功能僅在有限的終端模擬器中受支援。 List: https://github.com/Alhadis/OSC8-Adoption/
 
Element inverted (Element child)
 添加一個濾鏡,它將反轉前景和背景 顏色。
 
Element italic (Element child)
 對文字應用雙底線。
 
Element color (const LinearGradient &gradient, Element child)
 使用線性漸變效果設定元素的前景色。
 
Element bgcolor (const LinearGradient &gradient, Element child)
 使用線性漸變效果設定元素的背景顏色。
 
Decorator color (const LinearGradient &gradient)
 使用線性漸變效果裝飾前景色。
 
Decorator bgcolor (const LinearGradient &gradient)
 使用線性漸變效果裝飾背景顏色。
 
void Render (Screen &screen, const Element &element)
 在 ftxui::Screen 上顯示元素。
 
void Render (Screen &screen, Node *node)
 在 ftxui::Screen 上顯示元素。
 
Element paragraph (std::string_view the_text)
 回傳一個在多行上繪製段落的元素。
 
Element paragraphAlignLeft (std::string_view the_text)
 回傳一個在多行上繪製段落並靠左對齊的元素。
 
Element paragraphAlignRight (std::string_view the_text)
 回傳一個在多行上繪製段落並靠右對齊的元素。
 
Element paragraphAlignCenter (std::string_view the_text)
 回傳一個在多行上繪製段落並置中對齊的元素。
 
Element paragraphAlignJustify (std::string_view the_text)
 回傳一個在多行上繪製段落並使用左右對齊的元素。
 
Element vscroll_indicator (Element child)
 在右側顯示一個垂直捲軸。 顏色與內容一致。
 
Element hscroll_indicator (Element child)
 在底部顯示一個水平捲軸。 顏色與內容一致。
 
Element separator ()
 在兩個元素之間繪製垂直或水平分隔線。
 
Element separatorStyled (BorderStyle style)
 在兩個元素之間繪製垂直或水平分隔線。
 
Element separatorLight ()
 使用 LIGHT 樣式在兩個元素之間繪製垂直或水平分隔線。
 
Element separatorDashed ()
 使用 DASHED 樣式在兩個元素之間繪製垂直或水平分隔線。
 
Element separatorHeavy ()
 使用 HEAVY 樣式在兩個元素之間繪製垂直或水平分隔線。
 
Element separatorDouble ()
 使用 DOUBLE 樣式在兩個元素之間繪製垂直或水平分隔線。
 
Element separatorEmpty ()
 使用 EMPTY 樣式在兩個元素之間繪製垂直或水平分隔線。
 
Element separatorCharacter (std::string_view value)
 在兩個元素之間繪製垂直或水平分隔線。
 
Element separator (Cell pixel)
 用指定的 pixel 填滿並在兩個元素之間繪製一條分隔線。
 
Decorator size (WidthOrHeight direction, Constraint constraint, int value)
 對元素的大小套用限制。
 
Element spinner (int charset_index, size_t image_index)
 用於表示時間和/或事件的效果。這將顯示 一個 ASCII 藝術「影片」。
 
Element strikethrough (Element child)
 對文字應用刪除線。
 
Element text (std::string_view text)
 顯示一段 UTF8 編碼的 Unicode 文字。
 
Element text (std::wstring_view text)
 顯示一段 Unicode 文字。
 
Element vtext (std::string_view text)
 垂直顯示一段 Unicode 文字。
 
Element vtext (std::wstring_view text)
 垂直顯示一段 Unicode 文字。
 
Element underlined (Element child)
 為給定元素加上底線。
 
Element underlinedDouble (Element child)
 對文字應用雙底線。
 
Element nothing (Element element)
 一個什麼都不做的裝飾器。
 
Decorator operator| (Decorator a, Decorator b)
 將兩個裝飾器組合為一個。
 
Elements operator| (Elements elements, Decorator decorator)
 從一組元素中,對每個元素應用一個裝飾器。
 
Element operator| (Element element, Decorator decorator)
 從一個元素中,應用一個裝飾器。
 
Element & operator|= (Element &e, Decorator d)
 對元素應用一個裝飾器。
 
Element emptyElement ()
 
Element vbox (Elements children)
 一個垂直一個接一個顯示元素的容器。
 
void SetColorSupport (Color color)
 在自動偵測失敗時覆寫終端機顏色支援
 

Enumeration Type Documentation

◆ Direction

enum class Direction : uint8_t
strong

Direction 是一個列舉,表示四個主要方向。

Enumerator
Up 
Down 
Left 
Right 

Definition at line 14 of file direction.hpp.

◆ BorderStyle

enum BorderStyle : uint8_t

BorderStyle 是一個列舉,表示可以應用於終端機 UI 元素的不同邊框樣式。

BorderStyle 是一個列舉,表示可以應用於終端機 UI 元素的不同邊框樣式。 它用於定義元素周圍邊框的視覺外觀,例如視窗、框架或分隔符。

Enumerator
LIGHT 
DASHED 
HEAVY 
DOUBLE 
ROUNDED 
EMPTY 

Definition at line 35 of file elements.hpp.

Function Documentation

◆ FTXUI_EXPORT()

class FTXUI_EXPORT ( DOM )

畫布是與繪圖操作相關聯的可繪製緩衝區。

Table 是一個用於繪製表格的工具。

表示終端機使用者介面中的選取範圍。

Requirement 是一個結構,定義了終端使用者介面中節點的佈局要求。

節點是DOM樹中所有元素的基底類別。

表示線性漸變顏色效果設定的類別。

FlexboxConfig 是一個配置結構,用於定義彈性盒容器的佈局屬性。

畫布是一個可繪製區域,可用於創建複雜的圖形。它支援使用 盲文、塊狀或普通字符繪製點、線條、圓形、橢圓、文本和圖像。

注意:終端包含單元格。一個單元格的單位是:

  • 2x4 盲文字符 (1x1 像素)
  • 2x2 塊狀字符 (2x2 像素)
  • 2x4 普通字符 (2x4 像素)

您需要將 x 座標乘以 2,將 y 座標乘以 4,才能在終端中獲得正確的位置。

它允許您指定彈性項目的方向、是否應該換行、它們在主軸上的對齊方式,以及 它們在交叉軸上的對齊方式。 它還包括彈性項目在主軸和交叉軸之間間距的屬性。 此結構用於配置終端使用者介面中彈性盒容器的佈局行為。

範例:

LinearGradient()
.Angle(45)
.Stop(Color::Red, 0.0)
.Stop(Color::Green, 0.5)
.Stop(Color::Blue, 1.0);

也有簡寫的建構函式:

LinearGradient(Color::Red, Color::Blue);
LinearGradient(45, Color::Red, Color::Blue);

它代表文件物件模型 (DOM) 中的單一節點,並提供佈局和渲染的基本結構。 它包含用於計算佈局需求、設定框尺寸、選取內容、渲染到螢幕以及檢查佈局狀態的方法。 它通常包含子元素,這些子元素也是節點的實例。

鼓勵使用者從這個類別派生以建立自訂元素。

內建元素的清單可以在 elements.hpp 檔案中找到。

它指定了完全繪製元素所需的最小尺寸。

Selection 是一個類別,表示終端機使用者介面中選取範圍的兩個端點。

範例

auto table = Table({
{"X", "Y"},
{"-1", "1"},
{"+0", "0"},
{"+1", "1"},
});
table.SelectAll().Border(LIGHT);
table.SelectRow(1).Border(DOUBLE);
table.SelectRow(1).SeparatorInternal(LIGHT);
std::move(table).Render();
@ DOUBLE
Definition elements.hpp:39
@ LIGHT
Definition elements.hpp:36

這決定了主軸,也就是彈性項目在彈性容器中 排列的方向。除了換行外,Flexbox 是單方向的 布局概念。可以將彈性項目想成主要以 水平列或垂直欄的方式排列。

< 彈性項目以列的方式排列。

< 彈性項目以列的方式排列,但順序相反。

< 彈性項目以欄的方式排列。

< 彈性項目以欄的方式排列,但順序 相反。

預設情況下,彈性項目都會嘗試放入同一行。你可以透過此屬性 改變此行為,讓項目視需要換行。

< 彈性項目都會嘗試放入同一行。

< 彈性項目會換行到多行。

< 彈性項目會換行到多行,但順序 相反。

這定義了沿主軸的對齊方式。它有助於分配 當一行中所有彈性項目都是不可彈性的,或雖可彈性但已達最大 大小時,剩餘的額外可用空間。它也在項目 超出該行時對對齊方式有一定的控制。

項目對齊到 flexbox 方向的起始處。

項目對齊到 flexbox 方向的結束處。

項目沿著該行置中對齊。

項目被拉伸以填滿該行。

項目在該行中平均分佈;第一個項目在起始

項目在該行中平均分佈,項目周圍留有相等的空間。 注意在視覺上這些空間並不相等,因為所有項目 在兩側都留有相等的空間。第一個項目相對於容器邊緣 只有一個單位的空間,但與下一個項目之間卻有兩個單位的 空間,因為下一個項目也套用了自己的間距。

項目分佈的方式,使任意兩個項目之間(以及與邊緣之間) 的間距都相等。

這定義了彈性項目在當前行上沿交叉軸佈局的預設行為。 將其視為交叉軸(垂直於主軸)的 justify-content 版本。

< 項目放置在交叉軸的起始處。

< 項目放置在交叉軸的結束處。

< 項目沿著交叉軸置中對齊。

< 項目被拉伸以填滿交叉軸。

< 項目放置在交叉軸的起始處。

< 項目放置在交叉軸的結束處。

< 項目沿著交叉軸置中對齊。

< 項目被拉伸以填滿交叉軸。

< 項目在交叉軸上平均分佈。

< 項目平均分佈,每一行周圍留有 相等的空間。

< 項目在交叉軸上平均分佈,項目周圍 留有相等的空間。

一個 stop 是漸層中特定位置上的顏色。 該位置是介於 0.0 與 1.0 之間的值, 0.0 代表漸層的起點, 1.0 代表漸層的終點。

這決定了主軸,也就是彈性項目在彈性容器中 排列的方向。除了換行外,Flexbox 是單方向的 布局概念。可以將彈性項目想成主要以 水平列或垂直欄的方式排列。

< 彈性項目以列的方式排列。

< 彈性項目以列的方式排列,但順序相反。

< 彈性項目以欄的方式排列。

< 彈性項目以欄的方式排列,但順序 相反。

預設情況下,彈性項目都會嘗試放入同一行。你可以透過此屬性 改變此行為,讓項目視需要換行。

< 彈性項目都會嘗試放入同一行。

< 彈性項目會換行到多行。

< 彈性項目會換行到多行,但順序 相反。

這定義了沿主軸的對齊方式。它有助於分配 當一行中所有彈性項目都是不可彈性的,或雖可彈性但已達最大 大小時,剩餘的額外可用空間。它也在項目 超出該行時對對齊方式有一定的控制。

項目對齊到 flexbox 方向的起始處。

項目對齊到 flexbox 方向的結束處。

項目沿著該行置中對齊。

項目被拉伸以填滿該行。

項目在該行中平均分佈;第一個項目在起始

項目在該行中平均分佈,項目周圍留有相等的空間。 注意在視覺上這些空間並不相等,因為所有項目 在兩側都留有相等的空間。第一個項目相對於容器邊緣 只有一個單位的空間,但與下一個項目之間卻有兩個單位的 空間,因為下一個項目也套用了自己的間距。

項目分佈的方式,使任意兩個項目之間(以及與邊緣之間) 的間距都相等。

這定義了彈性項目在當前行上沿交叉軸佈局的預設行為。 將其視為交叉軸(垂直於主軸)的 justify-content 版本。

< 項目放置在交叉軸的起始處。

< 項目放置在交叉軸的結束處。

< 項目沿著交叉軸置中對齊。

< 項目被拉伸以填滿交叉軸。

< 項目放置在交叉軸的起始處。

< 項目放置在交叉軸的結束處。

< 項目沿著交叉軸置中對齊。

< 項目被拉伸以填滿交叉軸。

< 項目在交叉軸上平均分佈。

< 項目平均分佈,每一行周圍留有 相等的空間。

< 項目在交叉軸上平均分佈,項目周圍 留有相等的空間。

一個 stop 是漸層中特定位置上的顏色。 該位置是介於 0.0 與 1.0 之間的值, 0.0 代表漸層的起點, 1.0 代表漸層的終點。

Definition at line 1 of file canvas.hpp.

◆ automerge()

Element automerge ( Element child)

啟用字符自動與附近其他字符合併。

Definition at line 17 of file automerge.cpp.

◆ blink()

Element blink ( Element child)

繪製的文字在可見和隱藏之間交替。

Definition at line 33 of file blink.cpp.

◆ bold()

Element bold ( Element child)

使用粗體字型,用於需要更多強調的元素。

Definition at line 33 of file bold.cpp.

◆ border()

Element border ( Element child)

在元素周圍繪製邊框。

See also
border
borderLight
borderDashed
borderDouble
borderHeavy
borderEmpty
borderRounded
borderStyled
borderWith

在元素周圍新增邊框

範例

// 將 'border' 作為函數使用...
Element document = border(text("The element"));
// ...或作為 'pipe' 使用。
Element document = text("The element") | border;
Element text(std::string_view text)
顯示一段 UTF8 編碼的 Unicode 文字。
Element border(Element child)
在元素周圍繪製邊框。
std::shared_ptr< Node > Element
Definition elements.hpp:25

輸出

┌───────────┐
│The element│
└───────────┘

Definition at line 227 of file src/ftxui/dom/border.cpp.

◆ borderWith()

Decorator borderWith ( const Cell & pixel)

與 border 相同,但周圍使用固定的 Cell。

See also
border

Definition at line 234 of file src/ftxui/dom/border.cpp.

◆ borderStyled() [1/3]

Decorator borderStyled ( BorderStyle style)

與 border 相同,但具有不同的樣式。

See also
border

Definition at line 243 of file src/ftxui/dom/border.cpp.

◆ borderStyled() [2/3]

Decorator borderStyled ( Color foreground_color)

與 border 相同,但具有前景色。

See also
border

Definition at line 252 of file src/ftxui/dom/border.cpp.

◆ borderStyled() [3/3]

Decorator borderStyled ( BorderStyle style,
Color foreground_color )

與 border 相同,但具有前景色和不同的樣式。

See also
border

Definition at line 262 of file src/ftxui/dom/border.cpp.

◆ borderDashed()

Element borderDashed ( Element child)

在元素周圍繪製虛線邊框。

See also
border
borderLight
borderDashed
borderDouble
borderHeavy
borderRounded
borderEmpty
borderStyled
borderWith

在元素周圍新增邊框

範例

// 將 'borderDash' 作為函數使用...
Element document = borderDash(text("The element"));
// ...或作為 'pipe' 使用。
Element document = text("The element") | borderDAsh;

輸出

┏╍╍╍╍╍╍╍╍╍╍╍╍╍╍┓
╏The element ╏
┗╍╍╍╍╍╍╍╍╍╍╍╍╍╍┛

Definition at line 300 of file src/ftxui/dom/border.cpp.

◆ borderLight()

Element borderLight ( Element child)

在元素周圍繪製細邊框。

See also
border
borderLight
borderDashed
borderDouble
borderHeavy
borderRounded
borderEmpty
borderStyled
borderWith

在元素周圍新增邊框

範例

// 將 'borderLight' 作為函數使用...
Element document = borderLight(text("The element"));
// ...或作為 'pipe' 使用。
Element document = text("The element") | borderLight;
Element borderLight(Element child)
在元素周圍繪製細邊框。

輸出

┌──────────────┐
│The element │
└──────────────┘

Definition at line 335 of file src/ftxui/dom/border.cpp.

◆ borderHeavy()

Element borderHeavy ( Element child)

在元素周圍繪製粗邊框。

See also
border
borderLight
borderDashed
borderDouble
borderHeavy
borderRounded
borderEmpty
borderStyled
borderWith

在元素周圍新增邊框

範例

// 將 'borderHeavy' 作為函數使用...
Element document = borderHeavy(text("The element"));
// ...或作為 'pipe' 使用。
Element document = text("The element") | borderHeavy;
Element borderHeavy(Element child)
在元素周圍繪製粗邊框。

輸出

┏━━━━━━━━━━━━━━┓
┃The element ┃
┗━━━━━━━━━━━━━━┛

Definition at line 370 of file src/ftxui/dom/border.cpp.

◆ borderDouble()

Element borderDouble ( Element child)

在元素周圍繪製雙線邊框。

See also
border
borderLight
borderDashed
borderDouble
borderHeavy
borderRounded
borderEmpty
borderStyled
borderWith

在元素周圍新增邊框

範例

// 將 'borderDouble' 作為函數使用...
Element document = borderDouble(text("The element"));
// ...或作為 'pipe' 使用。
Element document = text("The element") | borderDouble;
Element borderDouble(Element child)
在元素周圍繪製雙線邊框。

輸出

╔══════════════╗
║The element ║
╚══════════════╝

Definition at line 405 of file src/ftxui/dom/border.cpp.

◆ borderRounded()

Element borderRounded ( Element child)

在元素周圍繪製圓角邊框。

See also
border
borderLight
borderDashed
borderDouble
borderHeavy
borderRounded
borderEmpty
borderStyled
borderWith

在元素周圍新增邊框

範例

// 將 'borderRounded' 作為函數使用...
Element document = borderRounded(text("The element"));
// ...或作為 'pipe' 使用。
Element document = text("The element") | borderRounded;
Element borderRounded(Element child)
在元素周圍繪製圓角邊框。

輸出

╭──────────────╮
│The element │
╰──────────────╯

Definition at line 440 of file src/ftxui/dom/border.cpp.

◆ borderEmpty()

Element borderEmpty ( Element child)

在元素周圍繪製空邊框。

See also
border
borderLight
borderDashed
borderDouble
borderHeavy
borderRounded
borderEmpty
borderStyled
borderWith

在元素周圍新增邊框

範例

// 將 'borderRounded' 作為函數使用...
Element document = borderRounded(text("The element"));
// ...或作為 'pipe' 使用。
Element document = text("The element") | borderRounded;

輸出

The element

Definition at line 475 of file src/ftxui/dom/border.cpp.

◆ window()

Element window ( Element title,
Element content,
BorderStyle border )

繪製帶有標題和邊框的視窗。

Parameters
title視窗的標題。
content要包裝的元素。
border邊框的樣式。預設為 ROUNDED。
See also
border

範例

Element document = window(text("Title"),
text("content")
);
// 指定邊框樣式
Element document = window(text("Title"),
text("content"),
);
Element window(Element title, Element content, BorderStyle border=ROUNDED)
繪製帶有標題和邊框的視窗。
@ ROUNDED
Definition elements.hpp:40

輸出

┌Title──┐
│content│
└───────┘

Definition at line 507 of file src/ftxui/dom/border.cpp.

◆ clear_under()

Element clear_under ( Element element)

在繪製 |child| 之前,先清除底下的儲存格。這在 搭配 dbox 使用時很有用。

See also
ftxui::dbox

Definition at line 38 of file clear_under.cpp.

◆ color() [1/4]

Element color ( Color color,
Element child )

設定元素的前景顏色。

Parameters
color輸出元素的顏色。
child輸入元素。
Returns
著色的輸出元素。

範例

Element document = color(Color::Green, text("Success")),
Element color(Color color, Element child)
設定元素的前景顏色。
Definition dom/color.cpp:81

Definition at line 81 of file dom/color.cpp.

◆ bgcolor() [1/4]

Element bgcolor ( Color color,
Element child )

設定元素的背景顏色。

Parameters
color輸出元素的顏色。
child輸入元素。
Returns
著色的輸出元素。

範例

Element document = bgcolor(Color::Green, text("Success")),
Element bgcolor(Color color, Element child)
設定元素的背景顏色。
Definition dom/color.cpp:96

Definition at line 96 of file dom/color.cpp.

◆ color() [2/4]

Decorator color ( Color c)

使用前景顏色進行裝飾。

Parameters
c要應用的前景顏色。
Returns
應用顏色的裝飾器。

範例

Element document = text("red") | color(Color::Red);

Definition at line 110 of file dom/color.cpp.

◆ bgcolor() [2/4]

Decorator bgcolor ( Color color)

使用背景顏色進行裝飾。

Parameters
color要應用的背景顏色。
Returns
應用顏色的裝飾器。

範例

Element document = text("red") | bgcolor(Color::Red);

Definition at line 124 of file dom/color.cpp.

◆ hcenter()

Element hcenter ( Element child)

水平置中一個元素。

Parameters
child被裝飾的元素。
Returns
水平置中的元素。

Definition at line 15 of file composite_decorator.cpp.

◆ vcenter()

Element vcenter ( Element child)

垂直置中一個元素。

Parameters
child被裝飾的元素。
Returns
垂直置中的元素。

Definition at line 23 of file composite_decorator.cpp.

◆ center()

Element center ( Element child)

水平與垂直置中一個元素。

Parameters
child被裝飾的元素。
Returns
置中的元素。

Definition at line 31 of file composite_decorator.cpp.

◆ align_right()

Element align_right ( Element child)

將元素靠右對齊。

Parameters
child被裝飾的元素。
Returns
靠右對齊的元素。

Definition at line 39 of file composite_decorator.cpp.

◆ dbox()

Element dbox ( Elements children_)

將多個元素堆疊在一起。

Parameters
children_輸入的元素。
Returns
右對齊的元素。

Definition at line 59 of file src/ftxui/dom/dbox.cpp.

◆ dim()

Element dim ( Element child)

使用淺色字體,適用於不那麼強調的元素。

Definition at line 33 of file dim.cpp.

◆ filler()

Element filler ( )

一個會依照容器中剩餘空間 按比例擴展的元素。

Definition at line 70 of file flex.cpp.

◆ flex()

Element flex ( Element child)

讓子元素依比例擴展以填滿容器中剩餘的空間。

範例:

text("left") | border ,
text("middle") | border | flex,
text("right") | border,
});
Element flex(Element child)
讓子元素依比例擴展以填滿容器中剩餘的空間。
Definition flex.cpp:94
Element hbox(Elements children)
一個逐一水平顯示元素的容器。
Definition hbox.cpp:94

輸出:

┌────┐┌─────────────────────────────────────────────────────────┐┌─────┐
│left││middle ││right│
└────┘└─────────────────────────────────────────────────────────┘└─────┘

Definition at line 94 of file flex.cpp.

◆ xflex()

Element xflex ( Element child)

在 X 軸上盡可能擴展/在需要時最小化。

Definition at line 100 of file flex.cpp.

◆ yflex()

Element yflex ( Element child)

在 Y 軸上盡可能擴展/在需要時最小化。

Definition at line 106 of file flex.cpp.

◆ flex_grow()

Element flex_grow ( Element child)

盡可能擴展。

Definition at line 112 of file flex.cpp.

◆ xflex_grow()

Element xflex_grow ( Element child)

在 X 軸上盡可能擴展。

Definition at line 118 of file flex.cpp.

◆ yflex_grow()

Element yflex_grow ( Element child)

在 Y 軸上盡可能擴展。

Definition at line 124 of file flex.cpp.

◆ flex_shrink()

Element flex_shrink ( Element child)

在需要時最小化。

Definition at line 130 of file flex.cpp.

◆ xflex_shrink()

Element xflex_shrink ( Element child)

在 X 軸上在需要時最小化。

Definition at line 136 of file flex.cpp.

◆ yflex_shrink()

Element yflex_shrink ( Element child)

在 Y 軸上在需要時最小化。

Definition at line 142 of file flex.cpp.

◆ notflex()

Element notflex ( Element child)

使元素不可伸縮。

Definition at line 148 of file flex.cpp.

◆ focusPositionRelative()

Decorator focusPositionRelative ( float x,
float y )

在 frame 內部使用,這會強制視圖滾動到給定位置。該位置以請求大小的比例表示。

例如:

  • (0, 0) 表示視圖滾動到左上方。
  • (1, 0) 表示視圖滾動到右上方。
  • (0, 1) 表示視圖滾動到左下方。

範例

Element document = huge_document()
| frame;
Decorator focusPositionRelative(float x, float y)
在 frame 內部使用,這會強制視圖滾動到給定位置。該位置以請求大小的比例表示。
Element frame(Element child)
允許元素顯示在「虛擬」區域內。其大小可以大於其容器。在這種情況下,只會顯示較小的一部分。視圖可滾動以使聚焦元素可見。
Definition frame.cpp:116

Definition at line 29 of file src/ftxui/dom/focus.cpp.

◆ focusPosition()

Decorator focusPosition ( int x,
int y )

在 frame 內部使用,這會強制視圖滾動到給定位置。該位置以單元格數表示。

範例

Element document = huge_document()
| focusPosition(10, 10)
| frame;
Decorator focusPosition(int x, int y)
在 frame 內部使用,這會強制視圖滾動到給定位置。該位置以單元格數表示。

Definition at line 66 of file src/ftxui/dom/focus.cpp.

◆ focus()

Element focus ( Element child)

將 child 設置為其同級元素中被聚焦的元素。

Parameters
child要被聚焦的元素。

Definition at line 101 of file frame.cpp.

◆ focusCursorBlock()

Element focusCursorBlock ( Element child)

與 focus 相同,但將游標形狀設置為靜止條狀。

See also
focus
focusCursorBlock
focusCursorBlockBlinking
focusCursorBar
focusCursorBarBlinking
focusCursorUnderline
focusCursorUnderlineBlinking

Definition at line 145 of file frame.cpp.

◆ focusCursorBlockBlinking()

Element focusCursorBlockBlinking ( Element child)

與 focus 相同,但將游標形狀設置為閃爍方塊。

See also
focus
focusCursorBlock
focusCursorBlockBlinking
focusCursorBar
focusCursorBarBlinking
focusCursorUnderline
focusCursorUnderlineBlinking

Definition at line 159 of file frame.cpp.

◆ focusCursorBar()

Element focusCursorBar ( Element child)

與 focus 相同,但將游標形狀設置為靜止條狀。

See also
focus
focusCursorBlock
focusCursorBlockBlinking
focusCursorBar
focusCursorBarBlinking
focusCursorUnderline
focusCursorUnderlineBlinking

Definition at line 173 of file frame.cpp.

◆ focusCursorBarBlinking()

Element focusCursorBarBlinking ( Element child)

與 focus 相同,但將游標形狀設置為閃爍條狀。

See also
focus
focusCursorBlock
focusCursorBlockBlinking
focusCursorBar
focusCursorBarBlinking
focusCursorUnderline
focusCursorUnderlineBlinking

Definition at line 187 of file frame.cpp.

◆ focusCursorUnderline()

Element focusCursorUnderline ( Element child)

與 focus 相同,但將游標形狀設置為靜止底線。

See also
focus
focusCursorBlock
focusCursorBlockBlinking
focusCursorBar
focusCursorBarBlinking
focusCursorUnderline
focusCursorUnderlineBlinking

Definition at line 201 of file frame.cpp.

◆ focusCursorUnderlineBlinking()

Element focusCursorUnderlineBlinking ( Element child)

與 focus 相同,但將游標形狀設置為閃爍底線。

See also
focus
focusCursorBlock
focusCursorBlockBlinking
focusCursorBar
focusCursorBarBlinking
focusCursorUnderline
focusCursorUnderlineBlinking

Definition at line 215 of file frame.cpp.

◆ gaugeDirection()

Element gaugeDirection ( float progress,
Direction direction )

繪製一個指定方向的高解析度進度條。

Parameters
progress填充區域的比例。範圍為 [0,1]。
direction進度條的進展方向。

Definition at line 203 of file src/ftxui/dom/gauge.cpp.

◆ gaugeRight()

Element gaugeRight ( float progress)

繪製一個從左到右進展的高解析度進度條。

Parameters
progress填充區域的比例。範圍為 [0,1]。

範例

一個儀表。它可以用來表示進度條。

Element gaugeRight(float progress)
繪製一個從左到右進展的高解析度進度條。

輸出

┌──────────────────────────────────────────────────────────────────────────┐
│█████████████████████████████████████ │
└──────────────────────────────────────────────────────────────────────────┘

Definition at line 225 of file src/ftxui/dom/gauge.cpp.

◆ gaugeLeft()

Element gaugeLeft ( float progress)

繪製一個從右到左進展的高解析度進度條。

Parameters
progress填充區域的比例。範圍為 [0,1]。

範例

一個儀表。它可以用來表示進度條。

Element gaugeLeft(float progress)
繪製一個從右到左進展的高解析度進度條。

輸出

┌──────────────────────────────────────────────────────────────────────────┐
│ █████████████████████████████████████│
└──────────────────────────────────────────────────────────────────────────┘

Definition at line 247 of file src/ftxui/dom/gauge.cpp.

◆ gaugeUp()

Element gaugeUp ( float progress)

繪製一個從下到上進展的高解析度進度條。

Parameters
progress填充區域的比例。範圍為 [0,1]。

範例

一個儀表。它可以用來表示進度條。

Element gaugeUp(float progress)
繪製一個從下到上進展的高解析度進度條。

輸出

┌─┐
│ │
│ │
│ │
│ │
│█│
│█│
│█│
│█│
└─┘

Definition at line 276 of file src/ftxui/dom/gauge.cpp.

◆ gaugeDown()

Element gaugeDown ( float progress)

繪製一個從上到下進展的高解析度進度條。

Parameters
progress填充區域的比例。範圍為 [0,1]。

範例

一個儀表。它可以用來表示進度條。

Element gaugeDown(float progress)
繪製一個從上到下進展的高解析度進度條。

輸出

┌─┐
│█│
│█│
│█│
│█│
│ │
│ │
│ │
│ │
└─┘

Definition at line 305 of file src/ftxui/dom/gauge.cpp.

◆ gauge()

Element gauge ( float progress)

繪製一個高解析度進度條。

Parameters
progress填充區域的比例。範圍為 [0,1]。

範例

一個儀表。它可以用來表示進度條。

Element gauge(float progress)
繪製一個高解析度進度條。

輸出

┌──────────────────────────────────────────────────────────────────────────┐
│█████████████████████████████████████ │
└──────────────────────────────────────────────────────────────────────────┘

Definition at line 327 of file src/ftxui/dom/gauge.cpp.

◆ gaugeCharset()

Element gaugeCharset ( float progress,
std::vector< std::string > charset,
Direction direction )

使用自訂字元集繪製高解析度進度條。

Parameters
progress要填滿的區域比例。屬於 [0,1]。
charset從「空」(索引 0)到「滿」(最後一個索引)的字符; 只有 2 個項目的字元集會產生單純無陰影的進度條。
direction進度條前進的方向。預設為 Right。

範例

使用自訂字元集而非預設方塊字符繪製的進度條。

border(gaugeCharset(0.5, {".", "#"}))
Element gaugeCharset(float progress, std::vector< std::string > charset, Direction direction=Direction::Right)
使用自訂字元集繪製高解析度進度條。

輸出

┌──────────────────────────────────────────────────────────────────────────┐
│#####################################.....................................│
└──────────────────────────────────────────────────────────────────────────┘

Definition at line 353 of file src/ftxui/dom/gauge.cpp.

◆ hyperlink() [1/2]

Element hyperlink ( std::string_view link,
Element child )

使渲染區域可點擊並使用網路瀏覽器開啟。 當用戶點擊時,連結將被開啟。 此功能僅在有限的終端模擬器中受支援。 List: https://github.com/Alhadis/OSC8-Adoption/

Parameters
link連結
child輸入元素。
Returns
帶有連結的輸出元素。

範例

Element document =
hyperlink("https://github.com/ArthurSonzogni/FTXUI", "link");
Element hyperlink(std::string_view link, Element child)
使渲染區域可點擊並使用網路瀏覽器開啟。 當用戶點擊時,連結將被開啟。 此功能僅在有限的終端模擬器中受支援。 List: https://github.com/Alhadis/OSC8-Adoption/
Definition hyperlink.cpp:52

Definition at line 52 of file hyperlink.cpp.

◆ hyperlink() [2/2]

Decorator hyperlink ( std::string_view link)

使用超連結裝飾。 當用戶點擊時,連結將被開啟。 此功能僅在有限的終端模擬器中受支援。 List: https://github.com/Alhadis/OSC8-Adoption/

Parameters
link用於將用戶重定向到的連結。
Returns
應用超連結的裝飾器。

範例

Element document =
text("red") | hyperlink("https://github.com/Arthursonzogni/FTXUI");

Definition at line 71 of file hyperlink.cpp.

◆ inverted()

Element inverted ( Element child)

添加一個濾鏡,它將反轉前景和背景 顏色。

Definition at line 34 of file inverted.cpp.

◆ italic()

Element italic ( Element child)

對文字應用雙底線。

Definition at line 17 of file italic.cpp.

◆ color() [3/4]

Element color ( const LinearGradient & gradient,
Element child )

使用線性漸變效果設定元素的前景色。

Parameters
gradient要應用於輸出元素的漸變效果。
child輸入元素。
Returns
已著色的輸出元素。

範例

color(LinearGradient{0, {Color::Red, Color::Blue}}, text("Hello"))

Definition at line 243 of file src/ftxui/dom/linear_gradient.cpp.

◆ bgcolor() [3/4]

Element bgcolor ( const LinearGradient & gradient,
Element child )

使用線性漸變效果設定元素的背景顏色。

Parameters
gradient要應用於輸出元素的漸變效果。
child輸入元素。
Returns
已著色的輸出元素。

範例

bgcolor(LinearGradient{0, {Color::Red, Color::Blue}}, text("Hello"))

Definition at line 259 of file src/ftxui/dom/linear_gradient.cpp.

◆ color() [4/4]

Decorator color ( const LinearGradient & gradient)

使用線性漸變效果裝飾前景色。

Parameters
gradient要應用於輸出元素的漸變效果。
Returns
應用顏色的 Decorator。

範例

text("Hello") | color(LinearGradient{0, {Color::Red, Color::Blue}})

Definition at line 274 of file src/ftxui/dom/linear_gradient.cpp.

◆ bgcolor() [4/4]

Decorator bgcolor ( const LinearGradient & gradient)

使用線性漸變效果裝飾背景顏色。

Parameters
gradient要應用於輸出元素的漸變效果。
Returns
應用顏色的 Decorator。

範例

text("Hello") | color(LinearGradient{0, {Color::Red, Color::Blue}})

Definition at line 289 of file src/ftxui/dom/linear_gradient.cpp.

◆ Render() [1/2]

void Render ( Screen & screen,
const Element & element )

在 ftxui::Screen 上顯示元素。

Definition at line 93 of file node.cpp.

◆ Render() [2/2]

void Render ( Screen & screen,
Node * node )

在 ftxui::Screen 上顯示元素。

Definition at line 100 of file node.cpp.

◆ paragraph()

Element paragraph ( std::string_view the_text)

回傳一個在多行上繪製段落的元素。

See also
flexbox.

Definition at line 48 of file src/ftxui/dom/paragraph.cpp.

◆ paragraphAlignLeft()

Element paragraphAlignLeft ( std::string_view the_text)

回傳一個在多行上繪製段落並靠左對齊的元素。

See also
flexbox.

Definition at line 55 of file src/ftxui/dom/paragraph.cpp.

◆ paragraphAlignRight()

Element paragraphAlignRight ( std::string_view the_text)

回傳一個在多行上繪製段落並靠右對齊的元素。

See also
flexbox.

Definition at line 65 of file src/ftxui/dom/paragraph.cpp.

◆ paragraphAlignCenter()

Element paragraphAlignCenter ( std::string_view the_text)

回傳一個在多行上繪製段落並置中對齊的元素。

See also
flexbox.

Definition at line 76 of file src/ftxui/dom/paragraph.cpp.

◆ paragraphAlignJustify()

Element paragraphAlignJustify ( std::string_view the_text)

回傳一個在多行上繪製段落並使用左右對齊的元素。

See also
flexbox.

Definition at line 87 of file src/ftxui/dom/paragraph.cpp.

◆ vscroll_indicator()

Element vscroll_indicator ( Element child)

在右側顯示一個垂直捲軸。 顏色與內容一致。

Definition at line 21 of file scroll_indicator.cpp.

◆ hscroll_indicator()

Element hscroll_indicator ( Element child)

在底部顯示一個水平捲軸。 顏色與內容一致。

Definition at line 76 of file scroll_indicator.cpp.

◆ separator() [1/2]

Element separator ( )

在兩個元素之間繪製垂直或水平分隔線。

See also
separator
separatorLight
separatorDashed
separatorDouble
separatorHeavy
separatorEmpty
separatorRounded
separatorStyled
separatorCharacter

在兩個元素之間添加視覺分隔。

範例

// 使用 'border' 作為函式...
Element document = vbox({
text("up"),
text("down"),
});
Element separator()
在兩個元素之間繪製垂直或水平分隔線。
Element vbox(Elements children)
一個垂直一個接一個顯示元素的容器。
Definition vbox.cpp:96

輸出

up
────
down

Definition at line 135 of file src/ftxui/dom/separator.cpp.

◆ separatorStyled()

Element separatorStyled ( BorderStyle style)

在兩個元素之間繪製垂直或水平分隔線。

Parameters
style分隔線的樣式。
See also
separator
separatorLight
separatorDashed
separatorDouble
separatorHeavy
separatorEmpty
separatorRounded
separatorStyled
separatorCharacter

在兩個元素之間添加視覺分隔。

範例

// 使用 'border' 作為函式...
Element document = vbox({
text("up"),
text("down"),
});
Element separatorStyled(BorderStyle style)
在兩個元素之間繪製垂直或水平分隔線。

輸出

up
════
down

Definition at line 172 of file src/ftxui/dom/separator.cpp.

◆ separatorLight()

Element separatorLight ( )

使用 LIGHT 樣式在兩個元素之間繪製垂直或水平分隔線。

See also
separator
separatorLight
separatorDashed
separatorDouble
separatorHeavy
separatorEmpty
separatorRounded
separatorStyled
separatorCharacter

在兩個元素之間添加視覺分隔。

範例

// 使用 'border' 作為函式...
Element document = vbox({
text("up"),
text("down"),
});
Element separatorLight()
使用 LIGHT 樣式在兩個元素之間繪製垂直或水平分隔線。

輸出

up
────
down

Definition at line 208 of file src/ftxui/dom/separator.cpp.

◆ separatorDashed()

Element separatorDashed ( )

使用 DASHED 樣式在兩個元素之間繪製垂直或水平分隔線。

See also
separator
separatorLight
separatorDashed
separatorDouble
separatorHeavy
separatorEmpty
separatorRounded
separatorStyled
separatorCharacter

在兩個元素之間添加視覺分隔。

範例

// 使用 'border' 作為函式...
Element document = vbox({
text("up"),
text("down"),
});

輸出

up
╍╍╍╍
down

Definition at line 244 of file src/ftxui/dom/separator.cpp.

◆ separatorHeavy()

Element separatorHeavy ( )

使用 HEAVY 樣式在兩個元素之間繪製垂直或水平分隔線。

See also
separator
separatorLight
separatorDashed
separatorDouble
separatorHeavy
separatorEmpty
separatorRounded
separatorStyled
separatorCharacter

在兩個元素之間添加視覺分隔。

範例

// 使用 'border' 作為函式...
Element document = vbox({
text("up"),
text("down"),
});
Element separatorHeavy()
使用 HEAVY 樣式在兩個元素之間繪製垂直或水平分隔線。

輸出

up
━━━━
down

Definition at line 280 of file src/ftxui/dom/separator.cpp.

◆ separatorDouble()

Element separatorDouble ( )

使用 DOUBLE 樣式在兩個元素之間繪製垂直或水平分隔線。

See also
separator
separatorLight
separatorDashed
separatorDouble
separatorHeavy
separatorEmpty
separatorRounded
separatorStyled
separatorCharacter

在兩個元素之間添加視覺分隔。

範例

// 使用 'border' 作為函式...
Element document = vbox({
text("up"),
text("down"),
});
Element separatorDouble()
使用 DOUBLE 樣式在兩個元素之間繪製垂直或水平分隔線。

輸出

up
════
down

Definition at line 316 of file src/ftxui/dom/separator.cpp.

◆ separatorEmpty()

Element separatorEmpty ( )

使用 EMPTY 樣式在兩個元素之間繪製垂直或水平分隔線。

See also
separator
separatorLight
separatorDashed
separatorDouble
separatorHeavy
separatorEmpty
separatorRounded
separatorStyled
separatorCharacter

在兩個元素之間添加視覺分隔。

範例

// 使用 'border' 作為函式...
Element document = vbox({
text("up"),
text("down"),
});

輸出

up
down

Definition at line 352 of file src/ftxui/dom/separator.cpp.

◆ separatorCharacter()

Element separatorCharacter ( std::string_view value)

在兩個元素之間繪製垂直或水平分隔線。

Parameters
value用於填充分隔線區域的字元。
See also
separator
separatorLight
separatorDashed
separatorDouble
separatorHeavy
separatorEmpty
separatorRounded
separatorStyled
separatorCharacter

在兩個元素之間添加視覺分隔。

範例

// 使用 'border' 作為函式...
Element document = vbox({
text("up"),
text("down"),
});

輸出

up
────
down

Definition at line 389 of file src/ftxui/dom/separator.cpp.

◆ separator() [2/2]

Element separator ( Cell pixel)

用指定的 pixel 填滿並在兩個元素之間繪製一條分隔線。

See also
separator
separatorLight
separatorDashed
separatorHeavy
separatorDouble
separatorStyled

範例

Cell empty;
Element document = vbox({
text("Up"),
separator(empty),
text("Down"),
})

輸出

Up
Down

Definition at line 420 of file src/ftxui/dom/separator.cpp.

◆ size()

Decorator size ( WidthOrHeight direction,
Constraint constraint,
int value )

對元素的大小套用限制。

Parameters
direction該元素的 WIDTH 或 HEIGHT 是否 受到限制。
constraint限制的類型。
value值。

Definition at line 89 of file src/ftxui/dom/size.cpp.

◆ spinner()

Element spinner ( int charset_index,
size_t image_index )

用於表示時間和/或事件的效果。這將顯示 一個 ASCII 藝術「影片」。

Parameters
charset_index「影片」的類型。
image_index「影片」的「影格」。您需要針對 每個「步驟」增加此值。

Definition at line 282 of file src/ftxui/dom/spinner.cpp.

◆ strikethrough()

Element strikethrough ( Element child)

對文字應用刪除線。

Definition at line 17 of file strikethrough.cpp.

◆ text() [1/2]

Element text ( std::string_view text)

顯示一段 UTF8 編碼的 Unicode 文字。

See also
ftxui::to_wstring

範例

Element document = text("Hello world!");

輸出

Hello world!

Definition at line 218 of file src/ftxui/dom/text.cpp.

◆ text() [2/2]

Element text ( std::wstring_view text)

顯示一段 Unicode 文字。

See also
ftxui::to_wstring

範例

Element document = text(L"Hello world!");

輸出

Hello world!

Definition at line 237 of file src/ftxui/dom/text.cpp.

◆ vtext() [1/2]

Element vtext ( std::string_view text)

垂直顯示一段 Unicode 文字。

See also
ftxui::to_wstring

範例

Element document = vtext("Hello world!");
Element vtext(std::string_view text)
垂直顯示一段 Unicode 文字。

輸出

H
e
l
l
o
w
o
r
l
d
!

Definition at line 267 of file src/ftxui/dom/text.cpp.

◆ vtext() [2/2]

Element vtext ( std::wstring_view text)

垂直顯示一段 Unicode 文字。

See also
ftxui::to_wstring

範例

Element document = vtext(L"Hello world!");

輸出

H
e
l
l
o
w
o
r
l
d
!

Definition at line 297 of file src/ftxui/dom/text.cpp.

◆ underlined()

Element underlined ( Element child)

為給定元素加上底線。

Definition at line 33 of file underlined.cpp.

◆ underlinedDouble()

Element underlinedDouble ( Element child)

對文字應用雙底線。

Definition at line 17 of file underlined_double.cpp.

◆ nothing()

Element nothing ( Element element)

一個什麼都不做的裝飾器。

Definition at line 28 of file dom/util.cpp.

◆ operator|() [1/3]

Decorator operator| ( Decorator a,
Decorator b )

將兩個裝飾器組合為一個。

範例

auto decorator = bold | blink;
Element blink(Element child)
繪製的文字在可見和隱藏之間交替。
Definition blink.cpp:33

Definition at line 40 of file dom/util.cpp.

◆ operator|() [2/3]

Elements operator| ( Elements elements,
Decorator decorator )

從一組元素中,對每個元素應用一個裝飾器。

Returns
一組被裝飾的元素。

Definition at line 48 of file dom/util.cpp.

◆ operator|() [3/3]

Element operator| ( Element element,
Decorator decorator )

從一個元素中,應用一個裝飾器。

Returns
被裝飾的元素。

範例

兩者是等效的:

bold(text("Hello"));
Element bold(Element child)
使用粗體字型,用於需要更多強調的元素。
Definition bold.cpp:33
text("Hello") | bold;

Definition at line 70 of file dom/util.cpp.

◆ operator|=()

Element & operator|= ( Element & e,
Decorator d )

對元素應用一個裝飾器。

Returns
被裝飾的元素。

範例

兩者是等效的:

auto element = text("Hello");
const Element & element
Definition node.hpp:92

Definition at line 85 of file dom/util.cpp.

◆ emptyElement()

Element emptyElement ( )

一個 0x0 大小,不繪製任何東西的元素。

Definition at line 140 of file dom/util.cpp.

◆ vbox()

Element vbox ( Elements children)

一個垂直一個接一個顯示元素的容器。

Parameters
children容器中的元素
Returns
容器。

範例

text("Up"),
text("Down"),
});

Definition at line 96 of file vbox.cpp.

◆ SetColorSupport()

void SetColorSupport ( Color color)

在自動偵測失敗時覆寫終端機顏色支援

Definition at line 346 of file terminal.cpp.