4#ifndef FTXUI_COMPONENT_COMPONENT_OPTIONS_HPP
5#define FTXUI_COMPONENT_COMPONENT_OPTIONS_HPP
125 Color background_active,
126 Color foreground_active);
一個適配器。擁有或引用一個常數字串。為方便起見,此類別將多個不可變字串轉換為共享表示。
一個適配器。擁有或引用一個常數字串。為方便起見,此類別將多個可變字串轉換為共享表示。
static ButtonOption Animated()
創建一個 ButtonOption,使用動畫顏色。
std::function< void()> on_click
std::function< Element()> elements_prefix
static MenuOption Toggle()
帶有分隔線的水平選單標準選項。 這對於實現一個標籤頁列很有用。
animation::Duration follower_duration
animation::easing::Function leader_function
MenuEntryOption entries_option
static InputOption Default()
建立預設輸入樣式:
animation::easing::Function function
animation::Duration follower_delay
static ButtonOption Border()
創建一個 ButtonOption。按鈕使用邊框顯示,聚焦時反轉。 這是目前的預設值。
bool hover_down
可調整大小的底部是否被懸停。
const std::string & title
視窗的標題。
void SetAnimationFunction(animation::easing::Function f)
設定下劃線的動畫方式。
static InputOption Spacious()
具有高邊距的黑底白字樣式:
Ref< bool > insert
插入或覆蓋字元模式。
static CheckboxOption Simple()
標準Checkbox的選項。
std::function< void()> on_enter
static ButtonOption Simple()
創建一個 ButtonOption,在聚焦時反轉。
UnderlineOption underline
std::function< Element(const EntryState &state)> transform
static MenuOption Horizontal()
水平選單的標準選項。 這對於實現一個標籤頁列很有用。
static MenuOption VerticalAnimated()
動畫垂直選單的標準選項。 這對於實現一個可選項目列表很有用。
animation::Duration leader_duration
static MenuOption Vertical()
垂直選單的標準選項。 這對於實現一個可選項目列表很有用。
static ButtonOption Ascii()
創建一個 ButtonOption,使用 [] 字元突出顯示。
Ref< int > cursor_position
animation::Duration duration
void SetAnimation(animation::Duration d, animation::easing::Function f)
設定下劃線的動畫方式。
void SetAnimationDuration(animation::Duration d)
設定下劃線的動畫方式。
ConstStringListRef entries
animation::easing::Function follower_function
bool hover_right
可調整大小的右側是否被懸停。
Ref< bool > password
使用 '*' 隱藏輸入內容。
std::function< Element(InputState)> transform
std::function< Element()> elements_infix
Ref< bool > open
下拉式選單是開啟還是關閉:
StringRef placeholder
輸入框為空時的內容。
std::function< Element()> elements_postfix
AnimatedColorsOption animated_colors
bool hover_left
可調整大小的左側是否被懸停。
std::function< void()> on_change
bool hover_top
可調整大小的頂部是否被懸停。
void Set(Color inactive, Color active, animation::Duration duration=std::chrono::milliseconds(250), animation::easing::Function function=animation::easing::QuadraticInOut)
可動畫的顏色選項。 @params _inactive 當組件不活動時的顏色。 @params _active 當組件活動時的顏色。 @params _duration 動畫的持續時間。 @params...
animation::Duration leader_delay
std::function< Element(bool open, Element checkbox, Element radiobox)> transform
static MenuOption HorizontalAnimated()
動畫水平選單的標準選項。 這對於實現一個標籤頁列很有用。
Ref< bool > multiline
輸入框是否可以是多行。
static RadioboxOption Simple()
標準Radiobox的選項。
std::function< Element(const EntryState &)> transform
Dropdown 元件的選項。下拉式選單是開啟/關閉單選方塊的核取方塊。
Direction
Direction 是一個列舉,表示四個主要方向。
Color 是一個在終端使用者介面中表示顏色的類別。
float QuadraticInOut(float p)
std::function< float(float)> Function
std::chrono::duration< float > Duration
std::shared_ptr< Node > Element
std::shared_ptr< ComponentBase > Component
AnimatedColorOption foreground
AnimatedColorOption background
來自 |ButtonOption|、|CheckboxOption|、 |RadioboxOption|、|MenuEntryOption|、|MenuOption| 的轉換參數。
int index
條目的索引(如果適用),否則為 -1。
bool state
按鈕/核取方塊/單選方塊的狀態
std::function< Element()> separator_func
Ref< Direction > direction
std::function< void()> on_change
Ref< bool > resize_down
底部是否可調整大小?
Ref< bool > resize_left
左側是否可調整大小?
Ref< bool > resize_top
頂部是否可調整大小?
std::function< Element(const WindowRenderState &)> render
用於自訂視窗外觀的選用函式:
ConstStringRef title
此視窗顯示的標題。
Ref< bool > resize_right
右側是否可調整大小?