25 #ifndef _TGUI_EDITBOX_INCLUDED_
26 #define _TGUI_EDITBOX_INCLUDED_
94 virtual void initialize();
117 virtual bool load(
const std::string& pathname);
127 virtual void setSize(
float width,
float height);
136 virtual Vector2u getSize()
const;
145 virtual Vector2f getScaledSize()
const;
155 virtual std::string getLoadedPathname()
const;
171 virtual void setText(
const sf::String& text);
180 virtual sf::String getText()
const;
190 virtual void setTextSize(
unsigned int textSize);
199 virtual unsigned int getTextSize()
const;
211 virtual void setTextFont(
const sf::Font& font);
220 virtual const sf::Font* getTextFont()
const;
235 virtual void setPasswordChar(
char passwordChar =
'\0');
245 virtual char getPasswordChar()
const;
256 virtual void setMaximumCharacters(
unsigned int maxChars = 0);
268 virtual unsigned int getMaximumCharacters()
const;
284 virtual void setBorders(
unsigned int leftBorder = 0,
285 unsigned int topBorder = 0,
286 unsigned int rightBorder = 0,
287 unsigned int bottomBorder = 0);
299 virtual void changeColors(
const sf::Color& textColor = sf::Color( 0, 0, 0),
300 const sf::Color& selectedTextColor = sf::Color(255, 255, 255),
301 const sf::Color& selectedTextBackgroundColor = sf::Color( 10, 110, 255),
302 const sf::Color& selectionPointColor = sf::Color(110, 110, 255));
310 virtual void setTextColor(
const sf::Color& textColor);
318 virtual void setSelectedTextColor(
const sf::Color& selectedTextColor);
326 virtual void setSelectedTextBackgroundColor(
const sf::Color& selectedTextBackgroundColor);
335 virtual const sf::Color& getTextColor()
const;
343 virtual const sf::Color& getSelectedTextColor()
const;
351 virtual const sf::Color& getSelectedTextBackgroundColor()
const;
363 virtual void limitTextWidth(
bool limitWidth);
374 virtual void setSelectionPointPosition(
unsigned int charactersBeforeSelectionPoint);
381 virtual bool mouseOnObject(
float x,
float y);
382 virtual void leftMousePressed(
float x,
float y);
383 virtual void leftMouseReleased(
float x,
float y);
384 virtual void mouseMoved(
float x,
float y);
385 virtual void keyPressed(sf::Keyboard::Key Key);
386 virtual void textEntered(sf::Uint32 Key);
387 virtual void objectUnfocused();
398 virtual unsigned int findSelectionPointPosition(
float PosX);
404 virtual void update();
411 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
429 bool m_SelectionPointVisible;
434 bool m_LimitTextWidth;
437 sf::String m_DisplayedText;
441 unsigned int m_TextSize;
444 unsigned int m_SelChars;
445 unsigned int m_SelStart;
446 unsigned int m_SelEnd;
453 unsigned int m_MaxChars;
459 unsigned int m_TextCropPosition;
462 sf::Color m_SelectedTextBgrColor;
468 sf::Text m_TextBeforeSelection;
469 sf::Text m_TextSelection;
470 sf::Text m_TextAfterSelection;
474 sf::Texture* m_TextureNormal_L;
475 sf::Texture* m_TextureNormal_M;
476 sf::Texture* m_TextureNormal_R;
478 sf::Texture* m_TextureHover_L;
479 sf::Texture* m_TextureHover_M;
480 sf::Texture* m_TextureHover_R;
482 sf::Texture* m_TextureFocused_L;
483 sf::Texture* m_TextureFocused_M;
484 sf::Texture* m_TextureFocused_R;
487 sf::Sprite m_SpriteNormal_L;
488 sf::Sprite m_SpriteNormal_M;
489 sf::Sprite m_SpriteNormal_R;
491 sf::Sprite m_SpriteHover_L;
492 sf::Sprite m_SpriteHover_M;
493 sf::Sprite m_SpriteHover_R;
495 sf::Sprite m_SpriteFocused_L;
496 sf::Sprite m_SpriteFocused_M;
497 sf::Sprite m_SpriteFocused_R;
500 std::string m_LoadedPathname;
503 bool m_PossibleDoubleClick;
513 #endif //_TGUI_EDITBOX_INCLUDED_
The text alignment.
Definition: EditBox.hpp:41
The parent struct for every object.
Definition: Objects.hpp:36
Parent struct for every object that has borders.
Definition: Objects.hpp:299
sf::Color selectionPointColor
The color of the flickering selection point.
Definition: EditBox.hpp:418
Center the text.
Definition: EditBox.hpp:49
unsigned int selectionPointWidth
The width in pixels of the flickering selection point.
Definition: EditBox.hpp:421
alignments
Definition: EditBox.hpp:43
Definition: EditBox.hpp:36
Put the text on the left side (default)
Definition: EditBox.hpp:46
Alignment::alignments textAlignment
The text alignment.
Definition: EditBox.hpp:424
Parent object for all objects that need to access the internal clock of the window.
Definition: Objects.hpp:338