Skip to content
Snippets Groups Projects
Commit 113f678a authored by Bolla Péter's avatar Bolla Péter
Browse files

Update button.hpp

parent e23fa524
No related branches found
No related tags found
No related merge requests found
...@@ -7,23 +7,27 @@ ...@@ -7,23 +7,27 @@
class Button : public Widget class Button : public Widget
{ {
protected: protected:
bool pressed; bool pressed; //Only occupied can be pressed
bool active; //The squares pressed can move to
std::string _label; std::string _label;
std::function<void()> _f; std::function<void()> _f;
Square _s; int _ind;
Chess* _cb;
public: public:
Button(App*, int, int, int, int, std::function<void()>, Square); Button(App*, int, int, int, int, std::function<void()>,Chess*, int);
Button(); Button();
virtual void Draw() const override; virtual void Draw() const override;
virtual void Handle(genv::event ev) override; virtual void Handle(genv::event ev, Operation) override;
virtual std::string GetValue() const override;
virtual bool Pressed(); virtual bool Pressed();
virtual bool Active();
void action(); void action();
private: private:
void Press(); void Press();
void Release(); void Release();
void Activate();
void Deactivate();
}; };
#endif // BUTTON_HPP #endif // BUTTON_HPP
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment