25 #ifndef TGUI_EDIT_BOX_HPP 26 #define TGUI_EDIT_BOX_HPP 29 #include <TGUI/ClickableWidget.hpp> 114 bool load(
const std::string& configFileFilename,
const std::string& sectionName =
"EditBox");
124 const std::string& getLoadedConfigFile()
const;
140 virtual void setPosition(
float x,
float y);
151 void setSize(
float width,
float height);
167 void setText(
const sf::String& text);
176 sf::String getText()
const;
186 void setTextSize(
unsigned int textSize);
195 unsigned int getTextSize()
const;
207 void setTextFont(
const sf::Font& font);
216 const sf::Font* getTextFont()
const;
231 void setPasswordCharacter(
char passwordChar =
'\0');
241 char getPasswordCharacter()
const;
252 void setMaximumCharacters(
unsigned int maxChars = 0);
264 unsigned int getMaximumCharacters()
const;
298 virtual void setBorders(
unsigned int leftBorder = 0,
299 unsigned int topBorder = 0,
300 unsigned int rightBorder = 0,
301 unsigned int bottomBorder = 0);
313 void changeColors(
const sf::Color& textColor = sf::Color( 0, 0, 0),
314 const sf::Color& selectedTextColor = sf::Color(255, 255, 255),
315 const sf::Color& selectedTextBackgroundColor = sf::Color( 10, 110, 255),
316 const sf::Color& selectionPointColor = sf::Color(110, 110, 255));
325 void setTextColor(
const sf::Color& textColor);
334 void setSelectedTextColor(
const sf::Color& selectedTextColor);
343 void setSelectedTextBackgroundColor(
const sf::Color& selectedTextBackgroundColor);
352 void setSelectionPointColor(
const sf::Color& selectionPointColor);
361 const sf::Color& getTextColor()
const;
370 const sf::Color& getSelectedTextColor()
const;
379 const sf::Color& getSelectedTextBackgroundColor()
const;
388 const sf::Color& getSelectionPointColor()
const;
400 void limitTextWidth(
bool limitWidth);
411 void setSelectionPointPosition(
unsigned int charactersBeforeSelectionPoint);
420 void setSelectionPointWidth(
unsigned int width = 2);
429 unsigned int getSelectionPointWidth()
const;
440 void setNumbersOnly(
bool numbersOnly =
true);
453 virtual void setTransparency(
unsigned char transparency);
459 virtual void leftMousePressed(
float x,
float y);
464 virtual void mouseMoved(
float x,
float y);
469 virtual void keyPressed(
const sf::Event::KeyEvent& event);
474 virtual void textEntered(sf::Uint32 Key);
479 virtual void widgetUnfocused();
487 virtual bool setProperty(std::string property,
const std::string& value);
494 virtual bool getProperty(std::string property, std::string& value)
const;
502 virtual std::list< std::pair<std::string, std::string> > getPropertyList()
const;
513 unsigned int findSelectionPointPosition(
float PosX);
520 void deleteSelectedCharacters();
526 void recalculateTextPositions();
532 virtual void initialize(
Container *
const container);
538 virtual void update();
544 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
555 TextChanged = ClickableWidgetCallbacksCount * 1,
556 ReturnKeyPressed = ClickableWidgetCallbacksCount * 2,
557 AllEditBoxCallbacks = ClickableWidgetCallbacksCount * 4 - 1,
558 EditBoxCallbacksCount = ClickableWidgetCallbacksCount * 4
565 std::string m_LoadedConfigFile;
568 bool m_SelectionPointVisible;
573 bool m_LimitTextWidth;
576 sf::String m_DisplayedText;
580 unsigned int m_TextSize;
586 unsigned int m_SelChars;
587 unsigned int m_SelStart;
588 unsigned int m_SelEnd;
595 unsigned int m_MaxChars;
601 unsigned int m_TextCropPosition;
604 sf::RectangleShape m_SelectedTextBackground;
607 sf::RectangleShape m_SelectionPoint;
610 sf::Text m_TextBeforeSelection;
611 sf::Text m_TextSelection;
612 sf::Text m_TextAfterSelection;
628 bool m_PossibleDoubleClick;
631 bool m_SeparateHoverImage;
641 #endif // TGUI_EDIT_BOX_HPP Namespace that contains all TGUI functions and classes.
Definition: AnimatedPicture.hpp:33
The text alignment.
Definition: EditBox.hpp:47
Definition: TextureManager.hpp:52
EditBoxCallbacks
Defines specific triggers to EditBox.
Definition: EditBox.hpp:553
Center the text.
Definition: EditBox.hpp:56
Alignments
The text alignment.
Definition: EditBox.hpp:50
Put the text on the left side (default)
Definition: EditBox.hpp:53
Parent class for widgets that store multiple widgets.
Definition: Container.hpp:43
Definition: EditBox.hpp:37