26 #ifndef TGUI_CHAT_BOX_HPP 27 #define TGUI_CHAT_BOX_HPP 30 #include <TGUI/Widget.hpp> 98 bool load(
const std::string& configFileFilename,
const std::string& sectionName =
"ChatBox");
108 const std::string& getLoadedConfigFile()
const;
120 void setSize(
float width,
float height);
131 virtual sf::Vector2f getSize()
const;
142 virtual sf::Vector2f getFullSize()
const;
156 void addLine(
const sf::String& text);
171 void addLine(
const sf::String& text,
unsigned int textSize);
186 void addLine(
const sf::String& text,
const sf::Color& color);
201 void addLine(
const sf::String& text,
const sf::Color& color,
unsigned int textSize,
const sf::Font* font =
nullptr);
214 sf::String getLine(
unsigned int lineIndex);
226 bool removeLine(
unsigned int lineIndex);
233 void removeAllLines();
242 unsigned int getLineAmount();
254 void setLineLimit(
unsigned int maxLines);
266 void setTextFont(
const sf::Font& font);
275 const sf::Font* getTextFont()
const;
285 void setTextSize(
unsigned int size);
294 unsigned int getTextSize()
const;
303 void setTextColor(
const sf::Color& color);
312 const sf::Color& getTextColor()
const;
324 virtual void setBorders(
unsigned int leftBorder = 0,
325 unsigned int topBorder = 0,
326 unsigned int rightBorder = 0,
327 unsigned int bottomBorder = 0);
336 void setBackgroundColor(
const sf::Color& backgroundColor);
345 void setBorderColor(
const sf::Color& borderColor);
354 const sf::Color& getBackgroundColor()
const;
363 const sf::Color& getBorderColor()
const;
378 void setLineSpacing(
unsigned int lineSpacing);
390 void setLinesStartFromBottom(
bool startFromBottom);
404 bool setScrollbar(
const std::string& scrollbarConfigFileFilename);
413 void removeScrollbar();
426 virtual void setTransparency(
unsigned char transparency);
432 virtual bool mouseOnWidget(
float x,
float y);
437 virtual void leftMousePressed(
float x,
float y);
442 virtual void leftMouseReleased(
float x,
float y);
447 virtual void mouseMoved(
float x,
float y);
452 virtual void mouseWheelMoved(
int delta,
int x,
int y);
457 virtual void mouseNotOnWidget();
462 virtual void mouseNoLongerDown();
470 virtual bool setProperty(std::string property,
const std::string& value);
477 virtual bool getProperty(std::string property, std::string& value)
const;
485 virtual std::list< std::pair<std::string, std::string> > getPropertyList()
const;
494 unsigned int getLineSpacing(
unsigned int lineNumber);
504 virtual void initialize(
Container *
const parent);
511 void updateDisplayedText();
518 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
529 AllChatBoxCallbacks = WidgetCallbacksCount - 1,
530 ChatBoxCallbacksCount = WidgetCallbacksCount
537 std::string m_LoadedConfigFile;
539 unsigned int m_LineSpacing;
540 unsigned int m_TextSize;
541 sf::Color m_TextColor;
542 sf::Color m_BorderColor;
544 unsigned int m_MaxLines;
546 float m_FullTextHeight;
548 bool m_LinesStartFromBottom;
564 #endif // TGUI_TEXT_BOX_HPP Namespace that contains all TGUI functions and classes.
Definition: AnimatedPicture.hpp:33
ChatBoxCallbacks
Defines specific triggers to ChatBox.
Definition: ChatBox.hpp:527
A static container of widgets. The background color can be solid or transparent.
Definition: Panel.hpp:39
Parent class for widgets that store multiple widgets.
Definition: Container.hpp:43
Definition: ChatBox.hpp:41