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>
40 class TGUI_API EditBoxSlider :
public SubwidgetContainer
43 using Ptr = std::shared_ptr<EditBoxSlider>;
44 using ConstrPtr = std::shared_ptr<const EditBoxSlider>;
55 explicit EditBoxSlider(
const char* typeName =
StaticWidgetType,
bool initRenderer =
true);
70 EditBoxSlider&
operator=(
const EditBoxSlider& other);
75 EditBoxSlider&
operator=(EditBoxSlider&& other)
noexcept;
92 unsigned int decimal = 0,
278 bool inRange(
float value)
const;
283 void setString(
const String& str);
307 [[nodiscard]] std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers)
const override;
312 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
322 unsigned m_decimalPlaces = 0;
Definition EditBoxRenderer.hpp:35
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.
SignalFloat onValueChange
Value of the slider changed. Optional parameter: new value.
Definition EditBoxSlider.hpp:317
static constexpr char StaticWidgetType[]
Type name of the widget.
Definition EditBoxSlider.hpp:46
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.
std::shared_ptr< EditBoxSlider > Ptr
Shared widget pointer.
Definition EditBoxSlider.hpp:43
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.
EditBoxSlider(EditBoxSlider &&other) noexcept
Move constructor.
EditBoxRenderer * getEditBoxRenderer()
Returns the renderer of edit box part of widget.
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:44
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.
EditBoxSlider(const EditBoxSlider &other)
Copy constructor.
float getStep() const
Returns the number of positions the thumb advances with each move.
EditBoxSlider & operator=(const EditBoxSlider &other)
Overload of copy assignment operator.
EditBoxSlider & operator=(EditBoxSlider &&other) noexcept
Overload of move assignment operator.
SliderRenderer * getSliderSharedRenderer()
Returns the renderer of slider part of widget.
static EditBox::Ptr create()
Creates a new edit box widget.
std::shared_ptr< EditBox > Ptr
Shared widget pointer.
Definition EditBox.hpp:48
Class to store the position or size of a widget.
Definition Layout.hpp:320
Signal to which the user can subscribe to get callbacks from.
Definition Signal.hpp:59
Definition SliderRenderer.hpp:35
std::shared_ptr< Slider > Ptr
Shared widget pointer.
Definition Slider.hpp:41
static Slider::Ptr create(float minimum=0, float maximum=10)
Creates a new slider widget.
Wrapper class to store strings.
Definition String.hpp:94
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:37
HorizontalAlignment
The horizontal alignment.
Definition Layout.hpp:60
SignalTyped< float > SignalFloat
Signal with one "float" as optional unbound parameter.
Definition Signal.hpp:411