27 class ParamController;
31 static std::shared_ptr<UISlider>
Create(std::weak_ptr<Window> parent_window, std::shared_ptr<ParamController> controller);
64 UISlider(std::weak_ptr<Window> parent_window, std::shared_ptr<ParamController> controller);
66 void Init(std::shared_ptr<ParamController> controller);
67 std::weak_ptr<ParamController> controller;
68 std::shared_ptr<SDLTextTexture> name_texture;
71 float current_range_min, current_range_max;
74 bool text_textures_invalid =
true;
75 std::shared_ptr<SDLTextTexture> value_texture, value_texture_big;
76 std::shared_ptr<SDLTextTexture> range_min_texture, range_max_texture;
86 inline int GetBodyStart()
const{
return (mode ==
Mode::Slider)? 12 : 0 ;}
91 std::shared_ptr<UIHBox> edit_box;
92 std::shared_ptr<UITextEntry> edit_entry_min;
93 std::shared_ptr<UITextEntry> edit_entry_val;
94 std::shared_ptr<UITextEntry> edit_entry_max;
96 void SetEditMode(
bool enabled);
97 void ApplyEdittedValues();
103 #endif // UISLIDER_HPP
void SetMode(Mode m)
Definition: UISlider.hpp:57
Definition: Utilities.hpp:104
Definition: UIContainer.hpp:27
Definition: DrawContext.hpp:65
Mode
Definition: UISlider.hpp:53
void SetName(std::string name)
MouseButton
Definition: Utilities.hpp:190
Definition: UISlider.hpp:29
std::string param_id
Definition: UISlider.hpp:62
virtual void CustomMouseLeave(Point2D pos) override
UISlider(std::weak_ptr< Window > parent_window, std::shared_ptr< ParamController > controller)
void CustomDraw(DrawContext &c) override
void SetRangeMin(float x)
static std::shared_ptr< UISlider > Create(std::weak_ptr< Window > parent_window, std::shared_ptr< ParamController > controller)
int width
Definition: Utilities.hpp:46
virtual void CustomResize(Size2D size) override
Definition: Alertable.hpp:26
virtual void OnFocusChanged(bool has_focus) override
Point2D a
Definition: Utilities.hpp:105
void SetRangeMax(float x)
Rect GetRelativeOutputRect() const
virtual bool CustomMousePress(bool down, MouseButton b, Point2D pos) override
Rect GetAbsoluteOutputRect() const
void DragStep(Point2D_< float > offset)
virtual void CustomMouseEnter(Point2D pos) override
virtual Point2D GetChildPos() const override
Definition: UISlider.hpp:39
virtual void CustomMouseMotion(Point2D pos1, Point2D pos2) override
Rect GetInputRect() const
Definition: Utilities.hpp:40