mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-28 16:29:34 +08:00
Add more documentation.
This commit is contained in:

committed by
Arthur Sonzogni

parent
f2dc080a35
commit
114ab4ae2a
@@ -7,27 +7,29 @@
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
/// @brief A Checkbox. It can be checked or unchecked.Display an element on a ftxui::Screen.
|
||||
/// @ingroup dom
|
||||
class CheckBox : public Component {
|
||||
public:
|
||||
// Constructor.
|
||||
CheckBox() = default;
|
||||
~CheckBox() override = default;
|
||||
|
||||
bool state = false;
|
||||
std::wstring label = L"label";
|
||||
bool state = false; // The current state. true=checked, false:unchecked.
|
||||
std::wstring label = L"label"; // The CheckBox label.
|
||||
|
||||
#if defined(_WIN32)
|
||||
std::wstring checked = L"[X] ";
|
||||
std::wstring unchecked = L"[ ] ";
|
||||
std::wstring checked = L"[X] "; /// Prefix for a "checked" state.
|
||||
std::wstring unchecked = L"[ ] "; /// Prefix for an "unchecked" state.
|
||||
#else
|
||||
std::wstring checked = L"▣ ";
|
||||
std::wstring unchecked = L"☐ ";
|
||||
std::wstring checked = L"▣ "; /// Prefix for a "checked" state.
|
||||
std::wstring unchecked = L"☐ "; /// Prefix for a "unchecked" state.
|
||||
#endif
|
||||
|
||||
Decorator focused_style = inverted;
|
||||
Decorator unfocused_style = nothing;
|
||||
Decorator focused_style = inverted; /// Decorator used when focused.
|
||||
Decorator unfocused_style = nothing; /// Decorator used when unfocused.
|
||||
|
||||
// State update callback.
|
||||
/// Called when the user change the state of the CheckBox.
|
||||
std::function<void()> on_change = []() {};
|
||||
|
||||
// Component implementation.
|
||||
|
Reference in New Issue
Block a user