Simple SFML GUI  0.2a
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
TextLabel Class Reference
Inheritance diagram for TextLabel:
Inheritance graph
[legend]
Collaboration diagram for TextLabel:
Collaboration graph
[legend]

Public Member Functions

 TextLabel (const sf::String &name=sf::String(), const sf::String &text=sf::String())
 
 TextLabel (const sf::String &name, const sf::String &text, bool autoResize)
 
 TextLabel (const sf::String &name, bool autoResize)
 
virtual void draw (sf::RenderTarget &target, sf::RenderStates states) override
 
virtual bool update (sf::Vector2f mp, bool pressLeft, bool pressRight, bool aboveHover) override
 
virtual void updateArea () override
 
virtual bool setColor (ColorId::Type colorId, StateId::Type stateId, sf::Color color) override
 
virtual bool setColorEnabled (ColorId::Type colorId, StateId::Type stateId, bool enabled) override
 
virtual void setText (const sf::String &text) override
 
virtual void fontChangeEvent () override
 
void setAlign (Align align)
 
void setVAlign (VAlign valign)
 
void setAutoResize (bool autoResize)
 
void setAutoResizeParentLimit (bool value)
 
bool autoResizeUpdate ()
 
void updateLines ()
 
void setMinimumVisibleLines (size_t value)
 
void revalidateTextAlign ()
 
void setLinePrefix (const sf::String &value)
 
sf::String getLinePrefix () const
 
- Public Member Functions inherited from TextLine
 TextLine (const TextLine &line)
 
- Public Member Functions inherited from Element
 Element (const Element *parent=nullptr)
 
 Element (const Element &element)
 
Elementoperator= (const Element &)
 
void mainDraw (sf::RenderTarget &target, const sf::RenderStates &states=sf::RenderStates())
 
void mainUpdate (sf::RenderWindow &rw)
 
void setParent (const Element *parent)
 
const ElementgetParent () const
 
virtual bool setRelativeViewport (sf::RenderTarget &target, const sf::FloatRect *area=nullptr) const
 
bool isMaximized () const
 
void setMaximized (bool maximized)
 
void setMaximizationMode (MaximizationMode value)
 
sf::Vector2f getPosition () const
 
sf::Vector2f getSize () const
 
virtual void setSize (sf::Vector2f)
 
virtual void setPosition (sf::Vector2f)
 
void move (sf::Vector2f)
 
sf::FloatRect & getArea ()
 
const sf::FloatRect & getArea () const
 
void fitToWindow (const sf::RenderWindow &rw)
 
void setArea (const sf::FloatRect &area)
 
const sf::FloatRect & getRelativeArea () const
 
sf::Vector2f getRelativeViewportCenterShift () const
 
sf::Vector2f getViewportCenterShift () const
 
void setViewportCenterShift (const sf::Vector2f &value)
 
sf::String getParentName () const
 
sf::String getTypeName () const
 
sf::FloatRect getClippedArea () const
 
sf::FloatRect computeRelativeArea () const
 
- Public Member Functions inherited from HaveName
 HaveName (const sf::String &n=L"")
 
const sf::String & getName () const
 
void setName (const sf::String &name)
 
- Public Member Functions inherited from HaveFocus
 HaveFocus (bool focus=false)
 
bool isFocus () const
 
void setFocus (bool focus)
 
virtual void onFocusGain ()
 
virtual void onFocusLost ()
 
- Public Member Functions inherited from HaveVisible
 HaveVisible (bool v=true)
 
bool isVisible () const
 
void setVisible (bool visible)
 
- Public Member Functions inherited from HaveText
const sf::String & getText () const
 
- Public Member Functions inherited from HaveEnabled
 HaveEnabled (ColorProvider &colorProvider, bool e=true)
 
bool isEnabled () const
 
void setEnabled (bool enabled)
 
- Public Member Functions inherited from HaveHover
 HaveHover (ColorProvider &colorProvider, bool h=false)
 
bool isHover () const
 
void setHover (bool hover)
 
virtual bool updateHover (const sf::Vector2f &pointer, const sf::FloatRect &clippedArea)
 
void setTooltip (const sf::String &value)
 
- Public Member Functions inherited from HavePressed
 HavePressed (ColorProvider &colorProvider, bool p=false, bool pa=false)
 
virtual bool isPressed () const
 
virtual bool setPressed (bool pressed)
 
virtual bool isPressedAlt () const
 
virtual bool setPressedAlt (bool value)
 
- Public Member Functions inherited from HaveLineSize
 HaveLineSize (ColorProvider &colorProvider)
 
 HaveLineSize (ColorProvider &colorProvider, const HaveLineSize &copy)
 
- Public Member Functions inherited from HaveFont
 HaveFont (ColorProvider &colorProvider)
 
 HaveFont (ColorProvider &colorProvider, const HaveFont &copy)
 
virtual void setFont (const sf::String &name)
 
virtual void setFont (const std::shared_ptr< sf::Font > &font)
 
std::shared_ptr< sf::Font > getFont () const
 
size_t getFontSize () const
 
virtual void setFontSize (unsigned int fontSize)
 
virtual void setFontOutlineSize (float fontOutlineSize)
 
sf::Uint32 getFontStyle () const
 
virtual void setFontStyle (sf::Uint32 fontStyle)
 
- Public Member Functions inherited from HaveWordWrap
 HaveWordWrap (bool wrap=true)
 
bool isWordWrap () const
 
void setWordWrap (bool wordWrap)
 
- Public Member Functions inherited from SetColorAccess
 SetColorAccess (ColorProvider &colorProvider)
 
virtual bool setColorFrom (const SetColorAccess &colorAccess)
 
- Public Member Functions inherited from GetColorAccess
 GetColorAccess (ColorProvider &colorProvider)
 
virtual bool colorDeduce (const ColorRef &colorRef) const
 
virtual bool getColor (ColorId::Type colorId, StateId::Type stateId, sf::Color &result) const
 
- Public Member Functions inherited from HaveMargin
virtual void setMargin (float margin)
 
float getMargin () const
 
void setMarginUnit (MarginUnit marginUnit)
 
float relativeMargin (sf::FloatRect area) const
 
MarginMode getMarginMode () const
 
void setMarginMode (MarginMode value)
 

Public Attributes

friend Lang
 
friend FontManager
 
friend Button
 
- Public Attributes inherited from TextLine
friend TextUpdater
 
friend TextLabel
 
- Public Attributes inherited from HaveFocus
friend TextInputable
 
- Public Attributes inherited from GlobalTimer
friend Element
 
- Public Attributes inherited from HaveEnabled
friend Element
 
- Public Attributes inherited from HaveHover
friend Element
 
- Public Attributes inherited from HavePressed
friend Element
 
- Public Attributes inherited from HaveFont
friend Element
 
friend FontManager
 

Protected Member Functions

std::vector< TextLineparseLines (const sf::String &lines)
 
void lineToDefault (TextLine &line)
 
void lazyRevalidateTextAlign ()
 
- Protected Member Functions inherited from Element
sf::Vector2f computeRelativeViewportCenterShift () const
 
sf::FloatRect computeClipped () const
 
sf::FloatRect clipArea (const sf::FloatRect &scissors, sf::FloatRect toCut) const
 
ColorProvidergetColorProvider ()
 
- Protected Member Functions inherited from HaveLineSize
void computeLineSizeReal ()
 
- Protected Member Functions inherited from HaveColorProviderReference
 HaveColorProviderReference (const HaveColorProviderReference &)=delete
 
HaveColorProviderReferenceoperator= (const HaveColorProviderReference &)
 
 HaveColorProviderReference (ColorProvider &colorProvider)
 

Static Protected Member Functions

static void updateAllLines ()
 
- Static Protected Member Functions inherited from HaveFont
static void releaseAllFonts ()
 

Protected Attributes

TextUpdater textUpdater
 
Align align = Align::Left
 
VAlign valign = VAlign::Top
 
sf::String linePrefix
 
std::vector< TextLinelines
 
std::vector< TextLinewrapped
 
float lastAreaHeight = 0.f
 
float lastAreaWidth = 0.f
 
bool dirtyFlag = false
 
- Protected Attributes inherited from TextLine
Align align
 
- Protected Attributes inherited from Element
const Elementparent = nullptr
 
sf::FloatRect area
 
sf::FloatRect lastArea
 
sf::FloatRect relativeParentArea
 
sf::FloatRect relativeArea
 
sf::FloatRect clippedArea
 
sf::Vector2f viewportCenterShift
 
sf::Vector2f relativeViewportCenterShift
 
MaximizationMode maximizationMode = MaximizationMode::Both
 
bool relativeParentSizeChanged = false
 
bool relativeParentWidthChanged = false
 
bool relativeParentHeightChanged = false
 
bool areaChanged = false
 
bool maximized = false
 
- Protected Attributes inherited from HaveName
sf::String name
 
- Protected Attributes inherited from HaveFocus
bool focus
 
- Protected Attributes inherited from HaveVisible
bool visible
 
- Protected Attributes inherited from HaveText
sf::String text
 
- Protected Attributes inherited from HaveEnabled
bool enabled
 
- Protected Attributes inherited from HaveHover
bool hover
 
sf::String tooltip
 
- Protected Attributes inherited from HavePressed
bool pressed = false
 
bool lastPressLeft = false
 
bool pressedAlt = false
 
bool lastPressRight = false
 
- Protected Attributes inherited from HaveLineSize
float lineSize = 0.f
 
float lineSizeReal = 0.f
 
- Protected Attributes inherited from HaveFont
sf::Uint32 fontStyle
 
unsigned int fontSize
 
float fontOutlineSize
 
std::shared_ptr< sf::Font > font
 
- Protected Attributes inherited from HaveWordWrap
bool wordWrap
 
- Protected Attributes inherited from HaveColorProviderReference
ColorProvidercolorProviderReference
 
- Protected Attributes inherited from HaveMargin
float margin
 
MarginUnit marginUnit
 
MarginMode marginMode
 

Static Protected Attributes

static std::map< std::wstring, std::function< void(TextLine &, const std::wstring &value)> > parseFunctions
 
static std::set< TextLabel * > textLabelSet
 
- Static Protected Attributes inherited from HaveFocus
static HaveFocuslastFocus = nullptr
 
static float timeFocused =0.f
 
- Static Protected Attributes inherited from HaveFont
static std::set< HaveFont * > haveFontSet
 
static sf::Mutex haveFontSetMutex
 

Additional Inherited Members

- Static Public Member Functions inherited from HaveFocus
static void unFocus ()
 
- Static Public Attributes inherited from GlobalTimer
static const sf::Clock & dclock = GlobalTimer::drawClock
 
static const sf::Clock & rclock = GlobalTimer::runtimeClock
 
static const float & dtime = GlobalTimer::drawTime
 
static const float & rtime = GlobalTimer::runTime
 
static const float & fps = GlobalTimer::framesPerSecond
 

The documentation for this class was generated from the following files: