1 #include "lxgui/gui_edit_box.hpp"
2 #include "lxgui/gui_font_string.hpp"
3 #include "lxgui/gui_layout_node.hpp"
4 #include "lxgui/gui_out.hpp"
5 #include "lxgui/gui_parser_common.hpp"
54 auto fstr =
parse_region_(defaulted,
"ARTWORK",
"FontString");
56 fstr->set_manually_inherited(
true);
62 <<
"edit_box: font_string's anchors will be ignored." << std::endl;
67 <<
"edit_box: font_string's Size will be ignored." << std::endl;
71 font_string_node->bypass_access_check();
78 text_insets_node->get_attribute_value_or<
float>(
"left", 0.0f),
79 text_insets_node->get_attribute_value_or<
float>(
"right", 0.0f),
80 text_insets_node->get_attribute_value_or<
float>(
"top", 0.0f),
81 text_insets_node->get_attribute_value_or<
float>(
"bottom", 0.0f)));
void set_integer_only(bool integer_only)
Makes this edit_box allow integer numbers only.
void set_max_letters(std::size_t max_letters)
Sets the maximum number of letters to allow in this edit_box.
void set_text_insets(const bounds2f &insets)
Sets the insets used to render the content text.
void set_font_string(utils::observer_ptr< font_string > fstr)
Sets the font_string to use to render the content.
void parse_attributes_(const layout_node &node) override
void set_highlight_color(const color &c)
Sets the color of the highlight quad.
void parse_font_string_node_(const layout_node &node)
void set_positive_only(bool positive_only)
Makes this edit_box allow positive numbers only.
void parse_text_insets_node_(const layout_node &node)
void set_password_mode_enabled(bool enable)
Enables or disables password mode.
void set_numeric_only(bool numeric_only)
Makes this edit_box allow numeric characters only.
void set_arrows_ignored(bool arrows_ignored)
Sets whether keyboard arrows move the carret or not.
void set_blink_time(double blink_time)
Sets the carret's blink time.
void set_multi_line(bool multi_line)
Allows this edit_box to have several lines in it.
void set_max_history_lines(std::size_t max_history_lines)
Sets the maximum number of history lines this edit_box can keep.
void parse_all_nodes_before_children_(const layout_node &node) override
virtual void parse_all_nodes_before_children_(const layout_node &node)
void parse_attributes_(const layout_node &node) override
utils::observer_ptr< layered_region > parse_region_(const layout_node &node, const std::string &layer_name, const std::string &type)
An node in a layout file.
std::optional< std::string_view > try_get_attribute_value(std::string_view name) const noexcept
Returns the value of the attribute with the provided name, nullopt if not found.
std::string_view get_or_set_attribute_value(std::string_view name, std::string_view value)
Returns the value of the attribute with the provided name, or set it if none.
const layout_node * try_get_child(std::string_view name) const noexcept
Returns the first child with a given name, or null if none.
color parse_color_node_(const layout_node &node)
bounds2< float > bounds2f
Holds 2D bounds of a region (as floats).
const std::string warning
void warn_for_not_accessed_node(const layout_node &node)
Emit a warning if this node (or any of its attributes/children) was not read.