26 #ifndef _TGUI_TEXT_BOX_INCLUDED_
27 #define _TGUI_TEXT_BOX_INCLUDED_
55 TextBox(
const TextBox& copy);
67 TextBox& operator= (
const TextBox& right);
73 virtual void initialize();
79 virtual TextBox* clone();
97 virtual bool load(
unsigned int width,
unsigned int height,
unsigned int textSize,
const std::string& scrollbarPathname =
"");
106 virtual void setSize(
float width,
float height);
112 virtual Vector2u getSize()
const;
118 virtual Vector2f getScaledSize()
const;
126 virtual std::string getLoadedScrollbarPathname()
const;
132 virtual void setText(
const sf::String& text);
138 virtual void addText(
const sf::String& text);
144 virtual sf::String getText()
const;
153 virtual void setTextFont(
const sf::Font& font);
159 virtual const sf::Font* getTextFont()
const;
166 virtual void setTextSize(
unsigned int size);
172 virtual unsigned int getTextSize()
const;
180 virtual void setMaximumCharacters(
unsigned int maxChars = 0);
188 virtual unsigned int getMaximumCharacters()
const;
199 virtual void setBorders(
unsigned int leftBorder = 0,
200 unsigned int topBorder = 0,
201 unsigned int rightBorder = 0,
202 unsigned int bottomBorder = 0);
215 virtual void changeColors(
const sf::Color& backgroundColor = sf::Color( 50, 50, 50),
216 const sf::Color& textColor = sf::Color( 0, 0, 0),
217 const sf::Color& selectedTextColor = sf::Color(255, 255, 255),
218 const sf::Color& selectedTextBackgroundColor = sf::Color( 10, 110, 255),
219 const sf::Color& borderColor = sf::Color( 0, 0, 0),
220 const sf::Color& selectionPointColor = sf::Color(110, 110, 255));
227 virtual void setBackgroundColor(
const sf::Color& backgroundColor);
234 virtual void setTextColor(
const sf::Color& textColor);
241 virtual void setSelectedTextColor(
const sf::Color& selectedTextColor);
248 virtual void setSelectedTextBackgroundColor(
const sf::Color& selectedTextBackgroundColor);
255 virtual void setBorderColor(
const sf::Color& borderColor);
261 virtual const sf::Color& getBackgroundColor()
const;
266 virtual const sf::Color& getTextColor()
const;
271 virtual const sf::Color& getSelectedTextColor()
const;
276 virtual const sf::Color& getSelectedTextBackgroundColor()
const;
281 virtual const sf::Color& getBorderColor()
const;
289 virtual void setSelectionPointPosition(
unsigned int charactersBeforeSelectionPoint);
297 virtual bool setScrollbar(
const std::string& scrollbarPathname);
305 virtual void removeScrollbar();
311 virtual void setSelectionPointWidth(
unsigned int width = 2);
318 virtual bool mouseOnObject(
float x,
float y);
319 virtual void leftMousePressed(
float x,
float y);
320 virtual void leftMouseReleased(
float x,
float y);
321 virtual void mouseMoved(
float x,
float y);
322 virtual void keyPressed(sf::Keyboard::Key Key);
323 virtual void textEntered(sf::Uint32 Key);
324 virtual void mouseWheelMoved(
int delta);
325 virtual void mouseNotOnObject();
326 virtual void mouseNoLongerDown();
327 virtual void objectUnfocused();
338 virtual unsigned int findSelectionPointPosition(
float posX,
float posY);
345 virtual void selectText(
float posX,
float posY);
352 virtual void updateDisplayedText();
359 virtual void updateSelectionTexts(
float maxLineWidth);
365 virtual void update();
372 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
393 sf::String m_DisplayedText;
394 unsigned int m_TextSize;
395 unsigned int m_LineHeight;
396 unsigned int m_Lines;
399 unsigned int m_MaxChars;
402 unsigned int m_TopLine;
403 unsigned int m_VisibleLines;
406 unsigned int m_SelChars;
407 unsigned int m_SelStart;
408 unsigned int m_SelEnd;
411 sf::Vector2u m_SelectionPointPosition;
412 bool m_SelectionPointVisible;
415 bool m_SelectionTextsNeedUpdate;
418 sf::Color m_BackgroundColor;
419 sf::Color m_SelectedTextBgrColor;
420 sf::Color m_BorderColor;
423 sf::Text m_TextBeforeSelection;
424 sf::Text m_TextSelection1;
425 sf::Text m_TextSelection2;
426 sf::Text m_TextAfterSelection1;
427 sf::Text m_TextAfterSelection2;
429 std::vector<float> m_MultilineSelectionRectWidth;
435 std::string m_LoadedScrollbarPathname;
438 bool m_PossibleDoubleClick;
448 #endif //_TGUI_TEXT_BOX_INCLUDED_
The parent struct for every object.
Definition: Objects.hpp:36
Definition: TextBox.hpp:44
Parent struct for every object that has borders.
Definition: Objects.hpp:299
unsigned int selectionPointWidth
The width in pixels of the flickering selection pointer.
Definition: TextBox.hpp:382
sf::Color selectionPointColor
The color of the flickering selection pointer.
Definition: TextBox.hpp:379
Parent object for all objects that need to access the internal clock of the window.
Definition: Objects.hpp:338