Public Member Functions | Data Fields | Static Public Attributes | Private Member Functions | Private Attributes

NewGRFTextfileWindow Struct Reference

Window for displaying the textfile of a NewGRF. More...

Inheritance diagram for NewGRFTextfileWindow:
Window MissingGlyphSearcher ZeroedMemoryAllocator

Public Member Functions

 NewGRFTextfileWindow (const WindowDesc *desc, const GRFConfig *c, TextfileType file_type)
virtual void UpdateWidgetSize (int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
virtual void SetStringParameters (int widget) const
virtual void DrawWidget (const Rect &r, int widget) const
virtual void OnResize ()

Data Fields

const GRFConfiggrf_config
 View the textfile of this GRFConfig.
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).

Static Public Attributes

static const int TOP_SPACING = WD_FRAMETEXT_TOP
 Additional spacing at the top of the GTW_WIDGET_BACKGROUND widget.
static const int BOTTOM_SPACING = WD_FRAMETEXT_BOTTOM
 Additional spacing at the bottom of the GTW_WIDGET_BACKGROUND widget.

Private Member Functions

void Reset ()
 Reset the search, i.e.
FontSize DefaultSize ()
 Get the default (font) size of the string.
const char * NextString ()
 Get the next string to search through.
bool Monospace ()
 Whether to search for a monospace font or not.
void SetFontNames (FreeTypeSettings *settings, const char *font_name)
 Set the right font names.
void LoadTextfile ()
 Load the NewGRF's textfile text from file, and setup lines, max_length, and both scrollbars.

Private Attributes

uint search_iterator
 Iterator for the font check search.

Detailed Description

Window for displaying the textfile of a NewGRF.

Definition at line 478 of file newgrf_gui.cpp.


Member Function Documentation

FontSize NewGRFTextfileWindow::DefaultSize (  )  [inline, private, virtual]

Get the default (font) size of the string.

Returns:
The font size.

Implements MissingGlyphSearcher.

Definition at line 567 of file newgrf_gui.cpp.

bool NewGRFTextfileWindow::Monospace (  )  [inline, private, virtual]

Whether to search for a monospace font or not.

Returns:
True if searching for monospace.

Implements MissingGlyphSearcher.

Definition at line 579 of file newgrf_gui.cpp.

const char* NewGRFTextfileWindow::NextString (  )  [inline, private, virtual]

Get the next string to search through.

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

Implements MissingGlyphSearcher.

Definition at line 572 of file newgrf_gui.cpp.

References SmallVector< T, S >::Length(), lines, and search_iterator.

void NewGRFTextfileWindow::Reset (  )  [inline, private, virtual]

Reset the search, i.e.

begin from the beginning again.

Implements MissingGlyphSearcher.

Definition at line 562 of file newgrf_gui.cpp.

References search_iterator.

void NewGRFTextfileWindow::SetFontNames ( FreeTypeSettings settings,
const char *  font_name 
) [inline, private, virtual]

Set the right font names.

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

Implements MissingGlyphSearcher.

Definition at line 584 of file newgrf_gui.cpp.

References lastof, and strecpy().


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