/** @file * @author Edouard DUPIN * @copyright 2011, Edouard DUPIN, all right reserved * @license MPL v2.0 (see license file) */ #pragma once #include #include #include #include #include #include namespace ewol { namespace widget { class Slider; using Slider = ememory::Ptr; using SliderWeak = ememory::WeakPtr; /** * @ingroup ewolWidgetGroup */ class Slider : public Widget { public: // signals esignal::Signal signalChange; public: //eproperty::Value propertyShape; //!< name of the shape used eproperty::Value propertyValue; //!< current value of the Slider eproperty::Value propertyMinimum; //!< minimum value of the slider eproperty::Value propertyMaximum; //!< maximum value of the slider eproperty::Value propertyStep; //!< step of every iteration of the slider (increment/precision) protected: Slider(); public: DECLARE_WIDGET_FACTORY(Slider, "Slider"); ~Slider(); public: // TODO : Rewoek the color in the theme ... void setColor(etk::Color<> _newColor) { this.textColorFg = _newColor; }; protected: ewol::compositing::Drawing this.draw; //!< drawing tool. etk::Color<> this.textColorFg; //!< Text color etk::Color<> this.textColorBg; //!< Background color void updateValue(float _newValue); public: // Derived function void onDraw() ; void calculateMinMaxSize() ; void onRegenerateDisplay() ; boolean onEventInput( ewol::event::Input _event) ; protected: void onChangePropertyValue(); void onChangePropertyMinimum(); void onChangePropertyMaximum(); void onChangePropertyStep(); }; } }