<commit_before>/*
 * Spreading_Window.cpp
 *
 *  Created on: 29 avr. 2017
 *      Author: guill
 */

#include "Application/Windows/Spreading_Window.h"
#include "iostream"

Spreading_Window::Spreading_Window(Picaso::Serial_Commander& lcd) : Window_Template(lcd),
m_title(lcd, "Spreading window", Picaso::Color::WHITE, 70, 20, 250, 40, 2, Picaso::Alignment_H::CENTER, Picaso::Alignment_V::CENTER, false),
m_heigth(lcd, Picaso::Color::WHITE, Picaso::Color::GRAY, Picaso::Color::WHITESMOKE, 20, 80, 40, 270-80-20, false),
m_spread(lcd, Picaso::Color::WHITE, Picaso::Color::GRAY, Picaso::Color::WHITESMOKE, 20 +40 +10, 80 + 270-80-20-40, 270, 40, false)
{
	m_touch_dispatcher.register_widget(m_heigth);
	m_touch_dispatcher.register_widget(m_spread);

	m_heigth.add_receiver(*this);
	m_spread.add_receiver(*this);

	add_event_handler<Picaso::Slider_Moved>(&Spreading_Window::slider_moved_handler, this);
}

Spreading_Window::~Spreading_Window()
{

}

void Spreading_Window::custom_show()
{
	m_title.show();
	m_heigth.show();
	m_spread.show();
}

void Spreading_Window::slider_moved_handler(Sender& s, const Event& event)
{
	unsigned int id = ((Picaso::Widget&)s).get_id();

	if(id==m_heigth.get_id())
		heigth_change(((Picaso::Slider&)s).get_per_cent());
	else if(id==m_spread.get_id())
		spread_change(((Picaso::Slider&)s).get_per_cent());
}

void Spreading_Window::heigth_change(float value)
{
	std::cout << "heigth : " << value << std::endl;
}

void Spreading_Window::spread_change(float value)
{
	std::cout << "spread : " << value << std::endl;
}<commit_msg>update spreading_window<commit_after>/*
 * Spreading_Window.cpp
 *
 *  Created on: 29 avr. 2017
 *      Author: guill
 */

#include "Application/Windows/Spreading_Window.h"
#include "iostream"

Spreading_Window::Spreading_Window(Picaso::Serial_Commander& lcd) : Window_Template(lcd),
m_title(lcd, "Spreading window", Picaso::Color::WHITE, 70, 20, 250, 40, 2, Picaso::Alignment_H::CENTER, Picaso::Alignment_V::CENTER, false),
m_heigth(lcd, Picaso::Color::WHITE, Picaso::Color::GRAY, Picaso::Color::WHITESMOKE, 20, 80, 40, 270-80-20, false),
m_spread(lcd, Picaso::Color::WHITE, Picaso::Color::GRAY, Picaso::Color::WHITESMOKE, 20 +40 +10, 80 + 270-80-20-40, 270, 40, false)
{
	m_touch_dispatcher.register_widget(m_heigth);
	m_touch_dispatcher.register_widget(m_spread);

	m_heigth.add_receiver(*this);
	m_spread.add_receiver(*this);

	add_event_handler<Picaso::Slider_Moved>(&Spreading_Window::slider_moved_handler, this);
}

Spreading_Window::~Spreading_Window()
{

}

void Spreading_Window::custom_show()
{
	m_title.show();
	m_heigth.show();
	m_spread.show();
}

void Spreading_Window::slider_moved_handler(Sender& s, const Event& event)
{
	unsigned int id = ((Picaso::Widget&)s).get_id();

	if(id==m_heigth.get_id())
		heigth_change(((Picaso::SliderV&)s).get_per_cent());
	else if(id==m_spread.get_id())
		spread_change(((Picaso::SliderH&)s).get_per_cent());
}

void Spreading_Window::heigth_change(float value)
{
	std::cout << "heigth : " << value << std::endl;
}

void Spreading_Window::spread_change(float value)
{
	std::cout << "spread : " << value << std::endl;
}
{'fraction_non_alphanumeric': 0.17413572343149808, 'fraction_numerical': 0.03265044814340589, 'mean_word_length': 7.538251366120218, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7649927', 'n_tokens_mistral': 1388, 'n_tokens_neox': 1256, 'n_words': 181}