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 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.
void setSize(const Layout2d &size) override
Changes the size of the edit box slider.
Vector2f getFullSize() const override
Returns the full size of the combined edit box and slider.
Signal & getSignal(String signalName) override
Retrieves a signal based on its name.
HorizontalAlignment getTextAlignment() const
Returns the current text alignment of the edit box.
bool setValue(float value)
Changes the current value.
float getValue() const
Returns the current value.
void setMaximum(float maximum)
Sets a maximum value.
void setStep(float step)
Changes how much the value changes on each arrow press.
float getMinimum() const
Returns the minimum value.
SliderRenderer * getSliderRenderer()
Returns the renderer of slider 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.
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.
EditBoxRenderer * getEditBoxSharedRenderer()
Returns the renderer of edit box part of widget.
EditBoxRenderer * getEditBoxRenderer()
Returns the renderer of edit box part of widget.
EditBoxSlider(EditBoxSlider &©) noexcept
Move constructor.
unsigned int getDecimalPlaces() const
Returns the number of decimal places to display.
float getMaximum() const
Returns the maximum value.
static EditBoxSlider::Ptr copy(const EditBoxSlider::ConstPtr &editBoxSlider)
Makes a copy of another edit box slider.
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.
Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
std::shared_ptr< const EditBoxSlider > ConstrPtr
Shared const widget pointer.
Definition EditBoxSlider.hpp:45
void setDecimalPlaces(unsigned int decimalPlaces)
Changes the number of decimal places to display.
Vector2f getWidgetOffset() const override
Returns the distance between the position where the widget is drawn and where the widget is placed.
float getStep() const
Returns the number of positions the thumb advances with each move.
SliderRenderer * getSliderSharedRenderer()
Returns the renderer of slider part of widget.
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:323
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:62