[DEV] change slider signal value type int32_t ==> float

This commit is contained in:
Edouard DUPIN 2014-10-19 23:04:27 +02:00
parent 06521163f6
commit 36495518ac
4 changed files with 12 additions and 12 deletions

View File

@ -75,16 +75,16 @@ void ewol::widget::Slider::onRegenerateDisplay() {
bool ewol::widget::Slider::onEventInput(const ewol::event::Input& _event) {
vec2 relativePos = relativePosition(_event.getPos());
EWOL_ERROR("Event on Slider ..." << _event);
//EWOL_DEBUG("Event on Slider ..." << _event);
if (1 == _event.getId()) {
if( ewol::key::statusSingle == _event.getStatus()
|| ewol::key::statusMove == _event.getStatus()) {
// get the new position :
EWOL_INFO("Event on Slider (" << relativePos.x() << "," << relativePos.y() << ")");
EWOL_VERBOSE("Event on Slider (" << relativePos.x() << "," << relativePos.y() << ")");
float oldValue = m_value.get();
updateValue(m_min + (float)(relativePos.x() - dotRadius) / (m_size.x()-2*dotRadius) * (m_max-m_min));
if (oldValue != m_value) {
EWOL_DEBUG(" new value : " << m_value << " in [" << m_min << ".." << m_max << "]");
EWOL_VERBOSE(" new value : " << m_value << " in [" << m_min << ".." << m_max << "]");
signalChange.emit(m_value);
}
return true;

View File

@ -24,7 +24,7 @@ namespace ewol {
class Slider : public ewol::Widget {
public:
// Event list of properties
ewol::object::Signal<int32_t> signalChange;
ewol::object::Signal<float> signalChange;
protected:
Slider();
void init();

View File

@ -109,28 +109,28 @@ etk::Color<> ewol::widget::ColorChooser::getColor() {
return m_currentColor;
}
void ewol::widget::ColorChooser::onCallbackColorChangeRed(const int32_t& _newColor) {
void ewol::widget::ColorChooser::onCallbackColorChangeRed(const float& _newColor) {
m_currentColor.setR(_newColor);
if (nullptr != m_widgetColorBar) {
m_widgetColorBar->setCurrentColor(m_currentColor);
}
signalChange.emit(m_currentColor);
}
void ewol::widget::ColorChooser::onCallbackColorChangeGreen(const int32_t& _newColor) {
void ewol::widget::ColorChooser::onCallbackColorChangeGreen(const float& _newColor) {
m_currentColor.setG(_newColor);
if (nullptr != m_widgetColorBar) {
m_widgetColorBar->setCurrentColor(m_currentColor);
}
signalChange.emit(m_currentColor);
}
void ewol::widget::ColorChooser::onCallbackColorChangeBlue(const int32_t& _newColor) {
void ewol::widget::ColorChooser::onCallbackColorChangeBlue(const float& _newColor) {
m_currentColor.setB(_newColor);
if (nullptr != m_widgetColorBar) {
m_widgetColorBar->setCurrentColor(m_currentColor);
}
signalChange.emit(m_currentColor);
}
void ewol::widget::ColorChooser::onCallbackColorChangeAlpha(const int32_t& _newColor) {
void ewol::widget::ColorChooser::onCallbackColorChangeAlpha(const float& _newColor) {
m_currentColor.setA(_newColor);
if (nullptr != m_widgetColorBar) {
m_widgetColorBar->setCurrentColor(m_currentColor);

View File

@ -45,10 +45,10 @@ namespace ewol {
std::shared_ptr<ewol::widget::Slider> m_widgetBlue;
std::shared_ptr<ewol::widget::Slider> m_widgetAlpha;
etk::Color<> m_currentColor;
void onCallbackColorChangeRed(const int32_t& _newColor);
void onCallbackColorChangeGreen(const int32_t& _newColor);
void onCallbackColorChangeBlue(const int32_t& _newColor);
void onCallbackColorChangeAlpha(const int32_t& _newColor);
void onCallbackColorChangeRed(const float& _newColor);
void onCallbackColorChangeGreen(const float& _newColor);
void onCallbackColorChangeBlue(const float& _newColor);
void onCallbackColorChangeAlpha(const float& _newColor);
void onCallbackColorChange(const etk::Color<>& _newColor);
};
};