From 9c3ba8303da72248d978696fc9363a2b47528b29 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 3 Nov 2013 19:30:43 +0300 Subject: add batch draw to slider. --- src/guichan/include/guichan/widgets/slider.hpp | 15 ------- src/guichan/widgets/slider.cpp | 61 -------------------------- 2 files changed, 76 deletions(-) (limited to 'src/guichan') diff --git a/src/guichan/include/guichan/widgets/slider.hpp b/src/guichan/include/guichan/widgets/slider.hpp index c4229a514..c925df45f 100644 --- a/src/guichan/include/guichan/widgets/slider.hpp +++ b/src/guichan/include/guichan/widgets/slider.hpp @@ -207,21 +207,6 @@ namespace gcn */ double getStepLength() const; - // Inherited from MouseListener. - - virtual void mousePressed(MouseEvent& mouseEvent) override; - - virtual void mouseDragged(MouseEvent& mouseEvent) override; - - virtual void mouseWheelMovedUp(MouseEvent& mouseEvent) override; - - virtual void mouseWheelMovedDown(MouseEvent& mouseEvent) override; - - - // Inherited from KeyListener - - virtual void keyPressed(KeyEvent& keyEvent) override; - protected: /** * Converts a marker position to a value in the scale. diff --git a/src/guichan/widgets/slider.cpp b/src/guichan/widgets/slider.cpp index 322f2ef76..9a328f2cc 100644 --- a/src/guichan/widgets/slider.cpp +++ b/src/guichan/widgets/slider.cpp @@ -120,47 +120,6 @@ namespace gcn mScaleEnd = scaleEnd; } - void Slider::mousePressed(MouseEvent& mouseEvent) - { - if (mouseEvent.getButton() == gcn::MouseEvent::LEFT - && mouseEvent.getX() >= 0 - && mouseEvent.getX() <= getWidth() - && mouseEvent.getY() >= 0 - && mouseEvent.getY() <= getHeight()) - { - if (getOrientation() == HORIZONTAL) - { - setValue(markerPositionToValue( - mouseEvent.getX() - getMarkerLength() / 2)); - } - else - { - setValue(markerPositionToValue(getHeight() - - mouseEvent.getY() - getMarkerLength() / 2)); - } - - distributeActionEvent(); - } - } - - void Slider::mouseDragged(MouseEvent& mouseEvent) - { - if (getOrientation() == HORIZONTAL) - { - setValue(markerPositionToValue(mouseEvent.getX() - - getMarkerLength() / 2)); - } - else - { - setValue(markerPositionToValue(getHeight() - - mouseEvent.getY() - getMarkerLength() / 2)); - } - - distributeActionEvent(); - - mouseEvent.consume(); - } - void Slider::setValue(double value) { if (value > getScaleEnd()) @@ -193,10 +152,6 @@ namespace gcn mMarkerLength = length; } - void Slider::keyPressed(KeyEvent& keyEvent A_UNUSED) - { - } - void Slider::setOrientation(Slider::Orientation orientation) { mOrientation = orientation; @@ -254,20 +209,4 @@ namespace gcn { return valueToMarkerPosition(getValue()); } - - void Slider::mouseWheelMovedUp(MouseEvent& mouseEvent) - { - setValue(getValue() + getStepLength()); - distributeActionEvent(); - - mouseEvent.consume(); - } - - void Slider::mouseWheelMovedDown(MouseEvent& mouseEvent) - { - setValue(getValue() - getStepLength()); - distributeActionEvent(); - - mouseEvent.consume(); - } } // namespace gcn -- cgit v1.2.3-60-g2f50