Public Member Functions | Data Fields | Static Public Attributes

TextfileWindow Struct Reference

Window for displaying a textfile. More...

#include <textfile_gui.h>

Inheritance diagram for TextfileWindow:
Window MissingGlyphSearcher ZeroedMemoryAllocator NewGRFTextfileWindow ScriptTextfileWindow

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.
Scrollbarvscroll
 Vertical scrollbar.
Scrollbarhscroll
 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.

Detailed Description

Window for displaying a textfile.

Definition at line 23 of file textfile_gui.h.


Member Function Documentation

FontSize TextfileWindow::DefaultSize (  )  [virtual]

Get the default (font) size of the string.

Returns:
The font size.

Implements MissingGlyphSearcher.

Definition at line 117 of file textfile_gui.cpp.

bool TextfileWindow::Monospace (  )  [virtual]

Whether to search for a monospace font or not.

Returns:
True if searching for monospace.

Implements MissingGlyphSearcher.

Definition at line 129 of file textfile_gui.cpp.

const char * TextfileWindow::NextString (  )  [virtual]

Get the next string to search through.

Returns:
The next string or NULL if there is none.

Implements MissingGlyphSearcher.

Definition at line 122 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 112 of file textfile_gui.cpp.

References search_iterator.

void TextfileWindow::SetFontNames ( FreeTypeSettings settings,
const char *  font_name 
) [virtual]

Set the right font names.

Parameters:
settings The settings to modify.
font_name The new font name.

Implements MissingGlyphSearcher.

Definition at line 134 of file textfile_gui.cpp.

References lastof, and strecpy().


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