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); } }
void CButton::mouseReleased(const event::MouseEvent& e){ if(e.getSource() == this) emitReleasedButton(); }
void CButton::mouseEntered(const event::MouseEvent& e){ if(e.getSource() == this) emitHighlightedButton(); }