bool handle_text_input(const SDL_Event &event)
bool show_scrollbar() const
virtual void update_location(const SDL_Rect &rect) override
textbox(int width, const std::string &text="", bool editable=true, std::size_t max_size=256, int font_size=font::SIZE_PLUS, double alpha=0.4, double alpha_focus=0.2, const bool auto_join=true)
virtual void set_inner_location(const SDL_Rect &) override
virtual void scroll(unsigned int pos) override
const std::string text() const
void set_cursor_pos(const int cursor_pos)
void set_selection(const int selstart, const int selend)
void pass_event_to_target(const SDL_Event &event)
void set_text(const std::string &text, const color_t &color=font::NORMAL_COLOR)
virtual void draw_contents() override
void draw_cursor(int pos) const
void set_font_size(int fs)
void set_editable(bool value)
void handle_event(const SDL_Event &event, bool was_forwarded)
bool handle_key_down(const SDL_Event &event)
std::vector< int > char_x_
bool requires_event_focus(const SDL_Event *event=nullptr) const override
virtual void layout() override
Called by draw_manager to validate layout.
void set_edit_target(textbox *target)
void append_text(const std::string &text, bool auto_scroll=false, const color_t &color=font::NORMAL_COLOR)
void update_text_cache(bool reset=false, const color_t &color=font::NORMAL_COLOR)
std::vector< int > char_y_
texture add_text_line(const std::u32string &text, const color_t &color=font::NORMAL_COLOR)
virtual void handle_text_changed(const std::u32string &)
Wrapper class to encapsulate creation and management of an SDL_Texture.