#ifndef CHECKBUTTON_H
#define CHECKBUTTON_H
#include "absButton.h"
namespace glan
{
class CheckButton : public absButton
{
public:
CheckButton(std::string adressN, std::string adressC, sf::Text accText,
std::string adressF = std::string(), std::string adressP = std::string(), std::string adressD = std::string(),
std::string adressCF = std::string(), std::string adressCP = std::string(), std::string adressCD = std::string());
// Arguments :
//
// adressN : the adress of the texture shown when the Button is in normal state (not focused, not pressed, not disabled).
//
// adressC : the adress of the texture shown when de Button is only checked (not focused, not pressed, not disabled).
//
// adressF : the adress of the texture shown when the Button is focused.
// If the default value is used, Tfocused is set to Tnormal.
//
// adressP : the adress of the texture shown when the Button is pressed.
// If the default value is used, Tpressed is set to Tnormal.
//
// adressD : the adress of the texture show when the Button is disabled.
// If the default value is used, Tdisabled is set to Tnormal.
//
// adressCF : the adress of the texture shown when the Button is focused and checked.
// If the default value is used, TcheckedFocused is set to Tchecked.
//
// adressCP : the adress of the texture shown when the Button is pressed and checked.
// If the default value is used, TcheckedPressed is set to Tchecked.
//
// adressCD : the adress of the texture show when the Button is disabled and checked.
// If the default value is used, TcheckedDisabled is set to Tchecked.
~CheckButton();
virtual void checkClicked(sf::Event const& event, sf::Window const& relativeTo);
// Checks if the buttons is focused, pressed or released.
// Returns false if the button does not have focus and is not pressed neither, else returns true.
// If the button is clicked (focused and released), the member std::function 'effect' il executed.
virtual void updateText();
// Updates the position ans the size of the 'text' member.
protected:
bool checked;
sf::Texture Tchecked, TcheckedFocused, TcheckedPressed, TcheckedDisabled;
private:
sf::Text text;
};
} // namespace glan
#endif // CHECKBUTTON_H