16 text(
"FTXUI:一個用於構建使用者介面的強大函式庫。"),
17 text(
"享受豐富的組件和宣告式風格。"),
18 text(
"以最少的工作量建立美觀且回應迅速的使用者介面。"),
19 text(
"加入社群,體驗 FTXUI 的強大功能。"),
29 int selection_change_counter = 0;
30 std::string selection_content =
"";
31 screen.SelectionChange([&] {
32 selection_change_counter++;
33 selection_content = screen.GetSelection();
39 text(
"選取已變更: " + std::to_string(selection_change_counter) +
42 paragraph(selection_content) | vscroll_indicator | frame | border |
58 window(
text(
"Grid split with different style"),
85 screen.Loop(renderer);
static ButtonOption Animated()
創建一個 ButtonOption,使用動畫顏色。
static ScreenInteractive TerminalOutput()
Component Button(ButtonOption options)
繪製一個按鈕。點擊時執行一個函數。
Component Renderer(Component child, std::function< Element()>)
回傳一個新的元件,類似於 |child|,但使用 |render| 作為 Component::Render() 事件。
virtual void Render(Screen &screen)
Element window(Element title, Element content, BorderStyle border=ROUNDED)
繪製帶有標題和邊框的視窗。
Decorator size(WidthOrHeight, Constraint, int value)
限制元素的大小。
Element text(std::wstring text)
顯示一段 Unicode 文字。
Element separator()
在兩個元素之間繪製垂直或水平分隔線。
Element vbox(Elements)
一個垂直一個接一個顯示元素的容器。
std::shared_ptr< Node > Element
Decorator selectionStyle(std::function< void(Pixel &)> style)
設定元素被選取時的樣式。
Element hbox(Elements)
一個逐一水平顯示元素的容器。
Decorator selectionBackgroundColor(Color foreground)
設定元素被選取時的背景顏色。 請注意,此樣式會應用在現有樣式之上。
Decorator selectionColor(Color foreground)
設定元素被選取時的顏色。
Element selectionStyleReset(Element)
重設元素的選取樣式。
Elements paragraph(std::wstring text)