OpenTTD Source
1.11.0-beta2
|
Go to the documentation of this file.
10 #ifndef TEXTFILE_GUI_H
11 #define TEXTFILE_GUI_H
26 std::vector<const char *>
lines;
36 void OnClick(
Point pt,
int widget,
int click_count)
override;
40 void Reset()
override;
FontSize DefaultSize() override
Get the default (font) size of the string.
virtual void LoadTextfile(const char *textfile, Subdirectory dir)
Loads the textfile text from file and setup lines.
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
Update size and resize step of a widget in the window.
A searcher for missing glyphs.
Dimensions (a width and height) of a rectangle in 2D.
void SetupScrollbars()
Set scrollbars to the right lengths.
std::vector< const char * > lines
text, split into lines in a table with lines.
void OnResize() override
Called after the window got resized.
static const int BOTTOM_SPACING
Additional spacing at the bottom of the WID_TF_BACKGROUND widget.
@ WD_FRAMETEXT_TOP
Top offset of the text of the frame.
TextfileType file_type
Type of textfile to view.
void SetFontNames(FreeTypeSettings *settings, const char *font_name, const void *os_data) override
Set the right font names.
ResizeInfo resize
Resize information.
static const int TOP_SPACING
Additional spacing at the top of the WID_TF_BACKGROUND widget.
@ WD_FRAMETEXT_BOTTOM
Bottom offset of the text of the frame.
const char * NextString() override
Get the next string to search through.
fluid_settings_t * settings
FluidSynth settings handle.
void OnClick(Point pt, int widget, int click_count) override
A click with the left mouse button has been made on the window.
Coordinates of a point in 2D.
char * text
Lines of text from the NewGRF's textfile.
Scrollbar * hscroll
Horizontal scrollbar.
void Reset() override
Reset the search, i.e.
uint search_iterator
Iterator for the font check search.
void DrawWidget(const Rect &r, int widget) const override
Draw the contents of a nested widget.
const char * GetTextfile(TextfileType type, Subdirectory dir, const char *filename)
Search a textfile file next to the given content.
bool Monospace() override
Whether to search for a monospace font or not.
Subdirectory
The different kinds of subdirectories OpenTTD uses.
Window for displaying a textfile.
FontSize
Available font sizes.
Data structure for an opened window.
TextfileType
Additional text files accompanying Tar archives.
uint GetContentHeight()
Get the total height of the content displayed in this window, if wrapping is disabled.
Specification of a rectangle with absolute coordinates of all edges.
Settings for the freetype fonts.
Scrollbar * vscroll
Vertical scrollbar.