From d123c41cd3ad4f0d55ae134be69e7ffd144dbb74 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 18 May 2021 22:05:19 +0200 Subject: Add mention autocomplete --- src/Entry.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Entry.cpp') diff --git a/src/Entry.cpp b/src/Entry.cpp index ba9718b..7e1b6d9 100644 --- a/src/Entry.cpp +++ b/src/Entry.cpp @@ -95,6 +95,14 @@ namespace QuickMedia { text.appendText(std::move(str)); } + void Entry::replace(size_t start_index, size_t length, const sf::String &insert_str) { + text.replace(start_index, length, insert_str); + } + + int Entry::get_caret_index() const { + return text.getCaretIndex(); + } + void Entry::set_position(const sf::Vector2f &pos) { background.set_position(pos); text.setPosition(pos + sf::Vector2f(background_margin_horizontal, background_margin_vertical)); -- cgit v1.2.3