We can retrieve the content of the selection

This commit is contained in:
Clement Roblot
2024-12-02 16:47:13 +07:00
committed by ArthurSonzogni
parent dc70091203
commit 307d8b51bf
6 changed files with 83 additions and 9 deletions

View File

@@ -69,8 +69,7 @@ class ScreenInteractive : public Screen {
void ForceHandleCtrlZ(bool force);
// Selection API.
// TODO: Implement somethings here.
std::string GetSelectedContent(void);
std::string GetSelectedContent(Component component);
void onSelectionModified(std::function<void(void)> callback);
private:

View File

@@ -48,6 +48,8 @@ class Node {
// Step 4: Draw this element.
virtual void Render(Screen& screen);
virtual std::string GetSelectedContent(Selection& selection);
// Layout may not resolve within a single iteration for some elements. This
// allows them to request additionnal iterations. This signal must be
// forwarded to children at least once.
@@ -66,6 +68,7 @@ class Node {
void Render(Screen& screen, const Element& element);
void Render(Screen& screen, Node* node);
void Render(Screen& screen, Node* node, Selection& selection);
std::string GetNodeSelectedContent(Screen& screen, Node* node, Selection& selection);
} // namespace ftxui