Mana
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
TextBox Class Reference

A text box, meant to be used inside a scroll area. More...

#include <textbox.h>

Inheritance diagram for TextBox:

Public Member Functions

 TextBox ()
 
void setTextColor (const gcn::Color *color)
 
void setOutlineColor (const std::optional< gcn::Color > &color)
 
void setTextWrapped (const std::string &text, int minDimension)
 Sets the text after wrapping it to the current width of the widget.
 
int getMinWidth () const
 Get the minimum text width for the text box.
 
void draw (gcn::Graphics *graphics) override
 Draws the text.
 

Private Attributes

int mMinWidth
 
const gcn::Color * mTextColor
 
std::optional< gcn::Color > mOutlineColor
 

Detailed Description

A text box, meant to be used inside a scroll area.

Same as the Guichan text box except this one doesn't have a background or border, instead completely relying on the scroll area.

Definition at line 35 of file textbox.h.

Constructor & Destructor Documentation

◆ TextBox()

TextBox::TextBox ( )

Definition at line 31 of file textbox.cpp.

Member Function Documentation

◆ draw()

void TextBox::draw ( gcn::Graphics *  graphics)
override

Draws the text.

Overridden so we can customize the color and outline of the text.

Definition at line 158 of file textbox.cpp.

◆ getMinWidth()

int TextBox::getMinWidth ( ) const
inline

Get the minimum text width for the text box.

Definition at line 54 of file textbox.h.

◆ setOutlineColor()

void TextBox::setOutlineColor ( const std::optional< gcn::Color > &  color)
inline

Definition at line 43 of file textbox.h.

◆ setTextColor()

void TextBox::setTextColor ( const gcn::Color *  color)
inline

Definition at line 40 of file textbox.h.

◆ setTextWrapped()

void TextBox::setTextWrapped ( const std::string &  text,
int  minDimension 
)

Sets the text after wrapping it to the current width of the widget.

Definition at line 42 of file textbox.cpp.

Member Data Documentation

◆ mMinWidth

int TextBox::mMinWidth
private

Definition at line 62 of file textbox.h.

◆ mOutlineColor

std::optional<gcn::Color> TextBox::mOutlineColor
private

Definition at line 64 of file textbox.h.

◆ mTextColor

const gcn::Color* TextBox::mTextColor
private

Definition at line 63 of file textbox.h.


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