Simple SFML GUI  0.2a
HaveFocus.hpp
1 /*
2  * HaveFocus.hpp
3  *
4  * Created on: 21.04.2017
5  * Author: jakub
6  */
7 
8 #ifndef HAVEFOCUS_HPP_
9 #define HAVEFOCUS_HPP_
10 
11 #include "GlobalTimer.hpp"
12 
13 class TextInputable;
14 
15 class HaveFocus : public GlobalTimer {
16 public:
17  friend TextInputable;
18  HaveFocus(bool focus = false);
19  virtual ~HaveFocus();
20  bool isFocus() const;
21  void setFocus(bool focus);
22 
23  virtual void onFocusGain();
24  virtual void onFocusLost();
25 
26  static void unFocus();
27 
28 protected:
29  static HaveFocus* lastFocus;
30  static float timeFocused;
31  bool focus;
32 };
33 
34 #endif /* HAVEFOCUS_HPP_ */
Definition: GlobalTimer.hpp:15
Definition: TextInputable.hpp:6
Definition: HaveFocus.hpp:15