FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
component.hpp File Reference

Go to the source code of this file.

Namespaces

namespace  ftxui
 FTXUI 的 ftxui:: 命名空間
 
namespace  ftxui::Container
 

Typedefs

using ComponentDecorator = std::function<Component(Component)>
 
using ElementDecorator = std::function<Element(Element)>
 

Functions

template<class T , class... Args>
std::shared_ptr< T > Make (Args &&... args)
 
Component operator| (Component component, ComponentDecorator decorator)
 
Component operator| (Component component, ElementDecorator decorator)
 
Componentoperator|= (Component &component, ComponentDecorator decorator)
 
Componentoperator|= (Component &component, ElementDecorator decorator)
 
Component Vertical (Components children)
 一個元件列表,垂直地一個接一個繪製,並使用上/下箭頭鍵或 'j'/'k' 鍵進行垂直導航。
 
Component Vertical (Components children, int *selector)
 一個元件列表,垂直地一個接一個繪製,並使用上/下箭頭鍵或 'j'/'k' 鍵進行垂直導航。 這對於實作選單很有用。
 
Component Horizontal (Components children)
 一個元件列表,水平地一個接一個繪製,並使用左/右箭頭鍵或 'h'/'l' 鍵進行水平導航。
 
Component Horizontal (Components children, int *selector)
 一個元件列表,水平地一個接一個繪製,並使用左/右箭頭鍵或 'h'/'l' 鍵進行水平導航。
 
Component Tab (Components children, int *selector)
 一個元件列表,一次只繪製一個並與之互動。|selector| 給出所選元件的索引。這對於實作分頁很有用。
 
Component Stacked (Components children)
 一個元件列表,將彼此堆疊。 事件會傳播到第一個元件,如果未處理則傳播到第二個,依此類推。 元件以給定的相反順序繪製。 當一個元件獲得焦點時,它會被放到最前面,而不改變其他元素的相對順序。
 
Component Button (ButtonOption option)
 繪製一個按鈕。點擊時執行一個函數。
 
Component Button (ConstStringRef label, std::function< void()> on_click, ButtonOption option)
 繪製一個按鈕。點擊時執行一個函數。
 
Component Checkbox (CheckboxOption options)
 
Component Checkbox (ConstStringRef label, bool *checked, CheckboxOption option)
 繪製可勾選元素。
 
Component Input (InputOption option)
 用於編輯文字的輸入框。
 
Component Input (StringRef content, InputOption option)
 用於編輯文字的輸入框。
 
Component Input (StringRef content, StringRef placeholder, InputOption option)
 用於編輯文字的輸入框。
 
Component Menu (MenuOption option)
 文字列表。選定的元素會被聚焦。
 
Component Menu (ConstStringListRef entries, int *selected, MenuOption option)
 文字列表。選定的元素會被聚焦。
 
Component MenuEntry (MenuEntryOption option)
 一個特定的菜單條目。它們可以放入 Container::Vertical 中以形成菜單。
 
Component MenuEntry (ConstStringRef label, MenuEntryOption option)
 一個特定的菜單條目。它們可以放入 Container::Vertical 中以形成菜單。
 
Component Radiobox (RadioboxOption option)
 元素清單,只能選擇一個。
 
Component Radiobox (ConstStringListRef entries, int *selected, RadioboxOption option)
 元素清單,只能選擇一個。
 
Component Dropdown (ConstStringListRef entries, int *selected)
 下拉式選單。
 
Component Dropdown (DropdownOption option)
 下拉式選單。
 
Component Toggle (ConstStringListRef entries, int *selected)
 元素的水平列表。使用者可以在其中導航。
 
template<typename T >
Component Slider (SliderOption< T > options)
 
Component Slider (ConstStringRef label, Ref< int > value, ConstRef< int > min, ConstRef< int > max, ConstRef< int > increment)
 水平滑桿。
 
Component Slider (ConstStringRef label, Ref< float > value, ConstRef< float > min=0.f, ConstRef< float > max=100.f, ConstRef< float > increment=5.f)
 
Component Slider (ConstStringRef label, Ref< long > value, ConstRef< long > min=0L, ConstRef< long > max=100L, ConstRef< long > increment=5L)
 
Component ResizableSplit (ResizableSplitOption options)
 兩個元件之間的分隔。
 
Component ResizableSplitLeft (Component main, Component back, int *main_size)
 兩個元件之間的水平分割,可透過滑鼠設定。
 
Component ResizableSplitRight (Component main, Component back, int *main_size)
 兩個元件之間的水平分割,可透過滑鼠設定。
 
Component ResizableSplitTop (Component main, Component back, int *main_size)
 兩個元件之間的垂直分割,可透過滑鼠設定。
 
Component ResizableSplitBottom (Component main, Component back, int *main_size)
 兩個元件之間的垂直分割,可透過滑鼠設定。
 
Component Renderer (Component child, std::function< Element()> render)
 回傳一個新的元件,類似於 |child|,但使用 |render| 作為 Component::Render() 事件。
 
Component Renderer (std::function< Element()> render)
 建立一個元件,使用 |render| 來繪製其介面。
 
Component Renderer (std::function< Element(bool)> render)
 建立一個可聚焦的元件,使用 |render| 來繪製其介面。
 
ComponentDecorator Renderer (ElementDecorator decorator)
 裝飾一個元件,透過裝飾它所呈現的內容。
 
Component CatchEvent (Component child, std::function< bool(Event)>)
 
ComponentDecorator CatchEvent (std::function< bool(Event)> on_event)
 裝飾一個元件,使用 |on_event| 捕捉事件。當事件已處理時,此函式必須傳回 true,否則傳回 false。
 
Component Maybe (Component child, const bool *show)
 裝飾一個組件 |child|。它只在 |show| 為 true 時顯示。
 
Component Maybe (Component child, std::function< bool()> show)
 裝飾一個組件 |child|。它只在 |show| 返回 true 時顯示。
 
ComponentDecorator Maybe (const bool *show)
 裝飾一個組件。它只在 |show| 為 true 時顯示。
 
ComponentDecorator Maybe (std::function< bool()> show)
 裝飾一個組件。它只在 |show| 函數返回 true 時顯示。
 
Component Modal (Component main, Component modal, const bool *show_modal)
 
ComponentDecorator Modal (Component modal, const bool *show_modal)
 
Component Collapsible (ConstStringRef label, Component child, Ref< bool > show)
 可折疊元件。它顯示一個帶有箭頭的核取方塊。一旦啟用,子元件就會顯示。
 
Component Hoverable (Component component, bool *hover)
 包裝一個元件。提供能力以判斷滑鼠是否懸停在其上方。
 
Component Hoverable (Component component, std::function< void()> on_enter, std::function< void()> on_leave)
 包裝一個元件。使用回呼函數。
 
Component Hoverable (Component component, std::function< void(bool)> on_change)
 包裝一個元件。提供能力以判斷滑鼠是否懸停在其上方。
 
ComponentDecorator Hoverable (bool *hover)
 包裝一個元件。提供能力以判斷滑鼠是否懸停在其上方。
 
ComponentDecorator Hoverable (std::function< void()> on_enter, std::function< void()> on_leave)
 包裝一個元件。提供能力以判斷滑鼠是否懸停在其上方。
 
ComponentDecorator Hoverable (std::function< void(bool)> on_change)
 包裝一個元件。提供能力以判斷滑鼠是否懸停在其上方。
 
Component Window (WindowOptions option)
 一個可拖曳/可調整大小的視窗。要使用多個視窗,它們必須透過 Container::Stacked({...}) 元件堆疊。