1 #ifndef TERMOX_WIDGET_WIDGETS_TEXTBOX_HPP
2 #define TERMOX_WIDGET_WIDGETS_TEXTBOX_HPP
5 #include <termox/painter/glyph_string.hpp>
6 #include <termox/system/key.hpp>
7 #include <termox/system/mouse.hpp>
8 #include <termox/widget/widgets/detail/textbox_base.hpp>
19 Align alignment = Align::Left;
20 Wrap wrap = Wrap::Word;
23 bool text_input =
true;
30 Wrap
wrap = Wrap::Word,
33 bool text_input =
true);
72 Wrap
wrap = Wrap::Word,
75 bool text_input =
true) -> std::unique_ptr<Textbox>;
78 [[nodiscard]]
auto textbox(Textbox::Parameters p) -> std::unique_ptr<Textbox>;
Holds the look of any paintable object with Traits and Colors.
Definition: brush.hpp:13
Holds a collection of Glyphs with a similar interface to std::string.
Definition: glyph_string.hpp:19
auto alignment() const -> Align
Return the currently used Alignment.
Definition: text_view.cpp:53
Brush insert_brush
Brush to be applied to all new incoming Glyphs, but not existing Glyphs.
Definition: text_view.hpp:33
auto wrap() const -> Wrap
Return the currently set text Wrap type.
Definition: text_view.cpp:61
auto text() -> Glyph_string &
Return the entire contents of the Text_view.
Definition: text_view.cpp:43
Interactive Glyph_string display with text wrapping, alignment, etc...
Definition: textbox.hpp:15
auto scroll_speed() const noexcept -> int
Return the current scroll wheel speed.
Definition: textbox.cpp:32
void set_scroll_speed(int x) noexcept
Set the number of lines scrolled vertically on scroll wheel events.
Definition: textbox.cpp:30
auto mouse_press_event(Mouse const &m) -> bool override
Move the cursor to the pressed, or nearest cell, that contains a Glyph.
Definition: textbox.cpp:99
void enable_text_input() noexcept
Enable the Textbox to take keyboard input.
Definition: textbox.cpp:34
auto key_press_event(Key k) -> bool override
Either input a Glyph from the Key, or move the cursor on arrow presses.
Definition: textbox.cpp:40
auto has_text_input() const noexcept -> bool
Return true if currently takes text keyboard input.
Definition: textbox.cpp:38
auto mouse_wheel_event(Mouse const &m) -> bool override
Scroll.
Definition: textbox.cpp:106
Textbox(Glyph_string text=U"", Align alignment=Align::Left, Wrap wrap=Wrap::Word, Brush insert_brush=Brush{}, int scroll_speed=1, bool text_input=true)
Construct a Textbox with initial contents and strong focus.
Definition: textbox.cpp:12
void disable_text_input() noexcept
Disable the Textbox from taking keyboard input.
Definition: textbox.cpp:36
Implements cursor movement on top of a Text_view, for use by Textbox.
Definition: textbox_base.hpp:14
Definition: textbox.hpp:17