Window for displaying a textfile. More...
#include <textfile_gui.h>
Public Member Functions | |
TextfileWindow (TextfileType file_type) | |
virtual void | UpdateWidgetSize (int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) |
virtual void | DrawWidget (const Rect &r, int widget) const |
virtual void | OnResize () |
virtual void | Reset () |
Reset the search, i.e. | |
virtual FontSize | DefaultSize () |
Get the default (font) size of the string. | |
virtual const char * | NextString () |
Get the next string to search through. | |
virtual bool | Monospace () |
Whether to search for a monospace font or not. | |
virtual void | SetFontNames (FreeTypeSettings *settings, const char *font_name) |
Set the right font names. | |
virtual void | LoadTextfile (const char *textfile, Subdirectory dir) |
Loads the textfile text from file, and setup lines, max_length, and both scrollbars. | |
Data Fields | |
TextfileType | file_type |
Type of textfile to view. | |
int | line_height |
Height of a line in the display widget. | |
Scrollbar * | vscroll |
Vertical scrollbar. | |
Scrollbar * | hscroll |
Horizontal scrollbar. | |
char * | text |
Lines of text from the NewGRF's textfile. | |
SmallVector< const char *, 64 > | lines |
text, split into lines in a table with lines. | |
uint | max_length |
The longest line in the textfile (in pixels). | |
uint | search_iterator |
Iterator for the font check search. | |
Static Public Attributes | |
static const int | TOP_SPACING = WD_FRAMETEXT_TOP |
Additional spacing at the top of the WID_TF_BACKGROUND widget. | |
static const int | BOTTOM_SPACING = WD_FRAMETEXT_BOTTOM |
Additional spacing at the bottom of the WID_TF_BACKGROUND widget. |
Window for displaying a textfile.
Definition at line 23 of file textfile_gui.h.
FontSize TextfileWindow::DefaultSize | ( | ) | [virtual] |
Get the default (font) size of the string.
Implements MissingGlyphSearcher.
Definition at line 118 of file textfile_gui.cpp.
bool TextfileWindow::Monospace | ( | ) | [virtual] |
Whether to search for a monospace font or not.
Implements MissingGlyphSearcher.
Definition at line 130 of file textfile_gui.cpp.
const char * TextfileWindow::NextString | ( | ) | [virtual] |
Get the next string to search through.
Implements MissingGlyphSearcher.
Definition at line 123 of file textfile_gui.cpp.
References SmallVector< T, S >::Length(), lines, and search_iterator.
void TextfileWindow::Reset | ( | ) | [virtual] |
Reset the search, i.e.
begin from the beginning again.
Implements MissingGlyphSearcher.
Definition at line 113 of file textfile_gui.cpp.
References search_iterator.
void TextfileWindow::SetFontNames | ( | FreeTypeSettings * | settings, | |
const char * | font_name | |||
) | [virtual] |
Set the right font names.
settings | The settings to modify. | |
font_name | The new font name. |
Implements MissingGlyphSearcher.
Definition at line 135 of file textfile_gui.cpp.
References FreeTypeSubSetting::font, lastof, FreeTypeSettings::mono, and strecpy().