12 #include <SFML/Graphics.hpp>    13 #include "HaveHover.hpp"    14 #include "HavePressed.hpp"    15 #include "HaveVisible.hpp"    16 #include "HaveFocus.hpp"    17 #include "HaveSelected.hpp"    18 #include "HaveGUIManagerInfo.hpp"    19 #include "FocusAction.hpp"    21 #include "TextInputable.hpp"    27         const char* 
const hold = 
"holdpress";
    28         const char* 
const click= 
"clickpress";
    29         const char* 
const gain = 
"gainpress";
    30         const char* 
const lost = 
"lostpress";
    34         const char* 
const hold = 
"holdpressalt";
    35         const char* 
const click= 
"clickpressalt";
    36         const char* 
const gain = 
"gainpressalt";
    37         const char* 
const lost = 
"lostpressalt";
    51         hotKey(sf::Keyboard::Unknown),
    56         ignoreTextInputable(
false)
    59     virtual bool setPressed(
bool pressed) {
    60         if(stickyPress && pressed) {
    64         if((this->hover || hotPress) && this->pressed && !pressed) {
    67             this->doAction(ActionType::Press::click);
    68             this->pressed = pressed;
    71         this->pressed = pressed;
    75     virtual bool setPressedAlt(
bool pressed) {
    76         if(stickyPress && pressed) {
    80         if(this->hover && this->pressedAlt && !pressed) {
    82             this->doAction(ActionType::PressAlt::click);
    83             this->pressedAlt = pressed;
    86         this->pressedAlt = pressed;
    90     sf::Keyboard::Key getHotKey()
 const {
    94     void setHotKey(sf::Keyboard::Key hotKey) {
    95         this->hotKey = hotKey;
    98     virtual bool update(sf::Vector2f mp = sf::Vector2f(0.f,0.f), 
bool pressLeft = 
false, 
bool pressRight = 
false, 
bool aboveHover = 
false) {
   101         bool lastPressed = pressed;
   102         bool lastPressedAlt = pressedAlt;
   105         if(aboveHover && ((!ignoreAbove && !stickyPress) || (!ignoreDialogs && anyDialogExist()))) {
   109                 this->doAction(ActionType::Press::lost);
   112                 this->doAction(ActionType::PressAlt::lost);
   114             lastPressLeft = pressLeft;
   115             lastPressRight = pressRight;
   119         if(hotKey != sf::Keyboard::Unknown) {
   120             hp = sf::Keyboard::isKeyPressed(hotKey);
   121             if(hp && !ignoreTextInputable && TextInputable::isFocused()) {
   130                 if(hotPress && !pressLeft)
   139                     if(pressLeft && pressed && this->lastFocus == 
this) {
   142                     } 
else if(this->hover && pressLeft && (!lastPressLeft || pressed)) {
   148                     if(pressRight && pressedAlt && this->lastFocus == 
this) {
   151                     } 
else if(this->hover && pressRight && (!lastPressRight || pressedAlt)) {
   154                         setPressedAlt(
false);
   158                     setPressedAlt(
false);
   161                 if(this->visible && this->hover) {
   162                     if(pressLeft && (!lastPressLeft || pressed)) {
   167                     if(pressRight && (!lastPressRight || pressedAlt)) {
   170                         setPressedAlt(
false);
   174                     setPressedAlt(
false);
   181                 this->doAction(ActionType::Press::hold);
   183                 this->doAction(ActionType::Press::lost);
   187                 this->doAction(ActionType::Press::gain);
   193                 this->doAction(ActionType::PressAlt::hold);
   195                 this->doAction(ActionType::PressAlt::lost);
   199                 this->doAction(ActionType::PressAlt::gain);
   203         lastPressLeft = pressLeft;
   207     void setStickyPress(
bool stickyPress) {
   208         this->stickyPress = stickyPress;
   211     void setIgnoreAbove(
bool value) {
   215     void setIgnoreDialogs(
bool value) {
   216         ignoreDialogs = value;
   219     void setIgnoreTextInputable(
bool value) {
   220         ignoreTextInputable = value;
   225     sf::Keyboard::Key hotKey;
   231     bool ignoreTextInputable;
 
Definition: Checkbox.hpp:13
Definition: HaveSelected.hpp:6
Definition: FocusAction.hpp:27
Definition: HaveGUIManagerInfo.hpp:5
Definition: Pressable.hpp:42
Definition: HavePressed.hpp:14