13 #include <SFML/Graphics.hpp> 15 #include "Pressable.hpp" 16 #include "HaveFont.hpp" 17 #include "HaveMargin.hpp" 18 #include "HaveOutline.hpp" 19 #include "HaveEnabled.hpp" 20 #include "HaveBackground.hpp" 21 #include "HaveText.hpp" 22 #include "FocusAction.hpp" 23 #include "TextInputable.hpp" 24 #include "NumericFilter.hpp" 25 #include "ColorAccess.hpp" 30 #define BACKSPACE_KEY 8 31 #define DELETE_KEY 127 35 bool ipFilter(sf::String& str);
36 bool portFilter(sf::String& str);
40 const char*
const submit =
"submittext";
41 const char*
const input =
"inputtext";
42 const char*
const erase =
"erasetext";
43 const char*
const update =
"updatetext";
62 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
override;
63 virtual void updateInput(sf::Uint32 code)
override;
64 virtual sf::Vector2f getSizeReal()
const;
65 const std::function<bool(sf::String&)>& getFilter()
const;
66 void setFilter(
const std::function<
bool(sf::String&)>& filter);
67 void moveCursor(
int n);
68 void setCursor(
int n);
69 int getCursor()
const;
70 virtual void setSize(sf::Vector2f)
override;
71 virtual void setFontSize(
unsigned int fontSize)
override;
72 virtual void setMargin(
float margin)
override;
73 virtual void setText(
const sf::String& text)
override;
74 float getRealHeight()
const;
76 static bool filterInteger(
const sf::String& str,
size_t numbers = 8);
77 static bool filterFloating(
const sf::String& str,
size_t integerNumbers = 8);
78 static void limiterInt(
TextInput& input,
int min,
int max);
79 static void limiterFloat(
TextInput& input,
float min,
float max);
83 std::function<bool(sf::String&)> filter;
88 typedef std::shared_ptr<TextInput> TextInputPtr;
Definition: TextInput.hpp:47
Definition: HaveBackground.hpp:28
Definition: Checkbox.hpp:13
Definition: ColorAccess.hpp:17
Definition: HaveEnabled.hpp:15
Definition: ColorAccess.hpp:26
Definition: HaveMargin.hpp:14
Definition: HaveOutline.hpp:15
Definition: HaveFont.hpp:19
Definition: TextInputable.hpp:6
Definition: Pressable.hpp:42
Definition: HaveText.hpp:14