28 lines
751 B
C++
28 lines
751 B
C++
#pragma once
|
|
|
|
#include "widget.h"
|
|
#include <functional>
|
|
#include <SFML/Graphics/RectangleShape.hpp>
|
|
#include <SFML/Graphics/Text.hpp>
|
|
|
|
class BPMCalculatorWidget : public Widget
|
|
{
|
|
public:
|
|
BPMCalculatorWidget();
|
|
|
|
virtual void input(const sf::Event& event) override;
|
|
virtual void update() override;
|
|
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const override;
|
|
virtual void setRect(const sf::FloatRect& rect) override;
|
|
virtual void setPosition(const sf::Vector2f& position) override;
|
|
virtual bool isUnderMouse(int mouse_x, int mouse_y) const override;
|
|
|
|
private:
|
|
sf::RectangleShape _button_content;
|
|
sf::Text _button_text;
|
|
bool _pressed;
|
|
|
|
std::function<void(void)> _on_click_callback;
|
|
};
|
|
|