25#ifndef TGUI_EDIT_BOX_SLIDER_HPP
26#define TGUI_EDIT_BOX_SLIDER_HPP
28#include <TGUI/SubwidgetContainer.hpp>
29#include <TGUI/Widgets/EditBox.hpp>
30#include <TGUI/Widgets/Slider.hpp>
34TGUI_MODULE_EXPORT
namespace tgui
44 using Ptr = std::shared_ptr<EditBoxSlider>;
45 using ConstrPtr = std::shared_ptr<const EditBoxSlider>;
47 static constexpr const char StaticWidgetType[] =
"EditBoxSlider";
56 EditBoxSlider(
const char* typeName = StaticWidgetType,
bool initRenderer =
true);
89 TGUI_NODISCARD
static EditBoxSlider::Ptr create(
float min = 0.0f,
float max = 10.0f,
float value = 0.0f,
unsigned int decimal = 0,
float step = 1.0f);
105 TGUI_NODISCARD
const EditBoxRenderer* getEditBoxSharedRenderer()
const;
119 TGUI_NODISCARD
const SliderRenderer* getSliderSharedRenderer()
const;
134 using SubwidgetContainer::setSize;
273 bool inRange(
const float value)
const;
278 void setString(
const String& str);
302 TGUI_NODISCARD std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers)
const override;
307 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
315 unsigned m_decimalPlaces = 0;
Definition EditBoxRenderer.hpp:35
Edit box slider widget.
Definition EditBoxSlider.hpp:41
static TGUI_NODISCARD EditBoxSlider::Ptr copy(const EditBoxSlider::ConstPtr &editBoxSlider)
Makes a copy of another edit box slider.
void setSize(const Layout2d &size) override
Changes the size of the edit box slider.
static TGUI_NODISCARD EditBoxSlider::Ptr create(float min=0.0f, float max=10.0f, float value=0.0f, unsigned int decimal=0, float step=1.0f)
Creates a new edit box slider widget.
bool setValue(float value)
Changes the current value.
TGUI_NODISCARD Vector2f getWidgetOffset() const override
Returns the distance between the position where the widget is drawn and where the widget is placed.
TGUI_NODISCARD float getMinimum() const
Returns the minimum value.
void setMaximum(float maximum)
Sets a maximum value.
TGUI_NODISCARD std::unique_ptr< DataIO::Node > save(SavingRenderersMap &renderers) const override
Saves the widget as a tree node in order to save it to a file.
void setStep(float step)
Changes how much the value changes on each arrow press.
TGUI_NODISCARD EditBoxRenderer * getEditBoxSharedRenderer()
Returns the renderer of edit box part of widget.
EditBoxSlider(const EditBoxSlider ©)
Copy constructor.
std::shared_ptr< EditBoxSlider > Ptr
Shared widget pointer.
Definition EditBoxSlider.hpp:44
void setMinimum(float minimum)
Sets a minimum value.
TGUI_NODISCARD float getMaximum() const
Returns the maximum value.
EditBoxSlider(EditBoxSlider &©) noexcept
Move constructor.
TGUI_NODISCARD SliderRenderer * getSliderSharedRenderer()
Returns the renderer of slider part of widget.
TGUI_NODISCARD EditBoxRenderer * getEditBoxRenderer()
Returns the renderer of edit box part of widget.
void setTextAlignment(HorizontalAlignment alignment)
Sets the alignment of the edit box text.
void load(const std::unique_ptr< DataIO::Node > &node, const LoadingRenderersMap &renderers) override
Loads the widget from a tree of nodes.
TGUI_NODISCARD unsigned int getDecimalPlaces() const
Returns the number of decimal places to display.
TGUI_NODISCARD SliderRenderer * getSliderRenderer()
Returns the renderer of slider part of widget.
std::shared_ptr< const EditBoxSlider > ConstrPtr
Shared const widget pointer.
Definition EditBoxSlider.hpp:45
TGUI_NODISCARD Vector2f getFullSize() const override
Returns the full size of the combined edit box and slider.
TGUI_NODISCARD Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
void setDecimalPlaces(unsigned int decimalPlaces)
Changes the number of decimal places to display.
TGUI_NODISCARD Signal & getSignal(String signalName) override
Retrieves a signal based on its name.
TGUI_NODISCARD float getValue() const
Returns the current value.
TGUI_NODISCARD HorizontalAlignment getTextAlignment() const
Returns the current text alignment of the edit box.
TGUI_NODISCARD float getStep() const
Returns the number of positions the thumb advances with each move.
std::shared_ptr< EditBox > Ptr
Shared widget pointer.
Definition EditBox.hpp:51
Class to store the position or size of a widget.
Definition Layout.hpp:313
Signal to which the user can subscribe to get callbacks from.
Definition Signal.hpp:61
Definition SliderRenderer.hpp:35
std::shared_ptr< Slider > Ptr
Shared widget pointer.
Definition Slider.hpp:42
Wrapper class to store strings.
Definition String.hpp:96
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:38
HorizontalAlignment
The horizontal alignment.
Definition Layout.hpp:61