Ejemplo n.º 1
0
			void SliderTheme::mouseMotion(const event::MouseEvent &e)
			{
				Slider *slider = static_cast<Slider*>(e.getSource());
				if(slider->isAdjusting())
				{
					int x = e.getX() - slider->getLocationOnScreen().x;
					float distance = static_cast<float>((static_cast<float>(x) / static_cast<float>(slider->getBounds().width) * static_cast<float>(slider->getMaximum()-slider->getMinimum()) + static_cast<float>(slider->getMinimum())));
					slider->setValue(distance);
				}
				else
				{
					int y = e.getY() - slider->getLocationOnScreen().y;
					float distance = static_cast<float>((static_cast<float>(y) / static_cast<float>(slider->getBounds().height) * static_cast<float>(slider->getMaximum()-slider->getMinimum()) + static_cast<float>(slider->getMinimum())));
					slider->setValue(distance);
				}
			}
Ejemplo n.º 2
0
	void CButton::mouseReleased(const event::MouseEvent& e){
		if(e.getSource() == this)
			emitReleasedButton();
	}
Ejemplo n.º 3
0
	void CButton::mouseEntered(const event::MouseEvent& e){
		if(e.getSource() == this)
			emitHighlightedButton();
	}