1 #ifndef LXGUI_GUI_SLIDER_HPP
2 #define LXGUI_GUI_SLIDER_HPP
4 #include "lxgui/gui_frame.hpp"
5 #include "lxgui/gui_orientation.hpp"
6 #include "lxgui/lxgui.hpp"
7 #include "lxgui/utils.hpp"
42 std::string
serialize(
const std::string& tab)
const override;
49 bool can_use_script(
const std::string& script_name)
const override;
138 void set_value(
float value,
bool silent =
false);
Stores a variable number of arguments for an event.
A region that can contain other regions and react to events.
An node in a layout file.
Manages the user interface.
The base class of all elements in the GUI.
A frame with a movable texture.
void set_value(float value, bool silent=false)
Sets this slider's value.
bool allow_clicks_outside_thumb_
void notify_borders_need_update() override
Tells this region that its borders need updating.
void set_orientation(orientation orient)
Sets the orientation of this slider.
void parse_attributes_(const layout_node &node) override
void set_min_value(float min_value)
Sets this slider's minimum value.
layer get_thumb_draw_layer() const
Returns the draw layer of this slider's thumb texture.
static constexpr const char * class_name
void fire_script(const std::string &script_name, const event_data &data=event_data{}) override
Calls a script.
bool is_in_region(const vector2f &position) const override
Checks if the provided coordinates are in the slider.
float get_value() const
Returns this slider's value.
void set_min_max_values(float min_value, float max_value)
Sets the slider's value range.
void set_thumb_texture(utils::observer_ptr< texture > tex)
Sets the texture to use for the thumb.
const utils::observer_ptr< texture > & get_thumb_texture()
Returns the texture used for the thumb.
void notify_thumb_texture_needs_update_()
void parse_all_nodes_before_children_(const layout_node &node) override
const std::vector< std::string > & get_type_list_() const override
utils::observer_ptr< texture > thumb_texture_
void update_thumb_texture_()
static void register_on_lua(sol::state &lua)
Registers this region class to the provided Lua state.
float get_value_step() const
Returns this slider's value step.
utils::observer_ptr< const texture > get_thumb_texture() const
Returns the texture used for the thumb.
orientation get_orientation() const
Returns the orientation of this slider.
bool can_use_script(const std::string &script_name) const override
Returns 'true' if this slider can use a script.
void set_thumb_draw_layer(layer thumb_layer)
Sets the draw layer of this slider's thumb texture.
void set_value_step(float value_step)
Sets this slider's value step.
float get_min_value() const
Returns this slider's minimum value.
void set_max_value(float max_value)
Sets this slider's maximum value.
bool are_clicks_outside_thumb_allowed() const
Checks if clicks are allowed outside of the thumb.
slider(utils::control_block &block, manager &mgr, const frame_core_attributes &attr)
Constructor.
void copy_from(const region &obj) override
Copies a region's parameters into this slider (inheritance).
void set_allow_clicks_outside_thumb(bool allow)
Allows the user to click anywhere in the slider to relocate the thumb.
float get_max_value() const
Returns this slider's maximum value.
std::string serialize(const std::string &tab) const override
Prints all relevant information about this region in a string.
layer
ID of a layer for rendering inside a frame.
Struct holding all the core information about a frame necessary for its creation.