mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-26 04:31:34 +08:00
Make cursor position public state (#57)
This commit is contained in:
parent
1cb08fd606
commit
c13621d1f9
@ -18,6 +18,7 @@ class Input : public Component {
|
|||||||
// State.
|
// State.
|
||||||
std::wstring content;
|
std::wstring content;
|
||||||
std::wstring placeholder;
|
std::wstring placeholder;
|
||||||
|
int cursor_position = 0;
|
||||||
|
|
||||||
// State update callback.
|
// State update callback.
|
||||||
std::function<void()> on_change = [] {};
|
std::function<void()> on_change = [] {};
|
||||||
@ -26,9 +27,6 @@ class Input : public Component {
|
|||||||
// Component implementation.
|
// Component implementation.
|
||||||
Element Render() override;
|
Element Render() override;
|
||||||
bool OnEvent(Event) override;
|
bool OnEvent(Event) override;
|
||||||
|
|
||||||
private:
|
|
||||||
int cursor_position = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ftxui
|
} // namespace ftxui
|
||||||
|
Loading…
Reference in New Issue
Block a user