Window used for inspecting NewGRFs. More...
Public Member Functions | |
NewGRFInspectWindow (const WindowDesc *desc, WindowNumber wno) | |
virtual void | SetStringParameters (int widget) const |
Initialize string parameters for a widget. | |
virtual void | UpdateWidgetSize (int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) |
Update size and resize step of a widget in the window. | |
void | WARN_FORMAT (4, 5) DrawString(const Rect &r |
Helper function to draw a string (line) in the window. | |
Static Public Member Functions | |
static bool | HasVariableParameter (uint variable) |
Check whether the given variable has a parameter. | |
Data Fields | |
byte | current_edit_param |
The currently editted parameter, to update the right one. | |
Scrollbar * | vscroll |
void int | offset |
void int const char * | format |
Static Public Attributes | |
static const int | LEFT_OFFSET = 5 |
Position of left edge. | |
static const int | RIGHT_OFFSET = 5 |
Position of right edge. | |
static const int | TOP_OFFSET = 5 |
Position of top edge. | |
static const int | BOTTOM_OFFSET = 5 |
Position of bottom edge. | |
static byte | var60params [GSF_FAKE_END][0x20] = { {0} } |
The value for the variable 60 parameters. |
Window used for inspecting NewGRFs.
Definition at line 251 of file newgrf_debug_gui.cpp.
static bool NewGRFInspectWindow::HasVariableParameter | ( | uint | variable | ) | [inline, static] |
Check whether the given variable has a parameter.
variable | the variable to check. |
Definition at line 270 of file newgrf_debug_gui.cpp.
References IsInsideBS().
virtual void NewGRFInspectWindow::SetStringParameters | ( | int | widget | ) | const [inline, virtual] |
Initialize string parameters for a widget.
Calls to this function are made during initialization to measure the size (that is as part of InitNested()), during drawing, and while re-initializing the window. Only for widgets that render text initializing is requested.
widget | Widget number. |
Reimplemented from Window.
Definition at line 285 of file newgrf_debug_gui.cpp.
References GetFeatureHelper(), GetFeatureIndex(), NIW_CAPTION, NIHelper::SetStringParameters(), and Window::window_number.
virtual void NewGRFInspectWindow::UpdateWidgetSize | ( | int | widget, | |
Dimension * | size, | |||
const Dimension & | padding, | |||
Dimension * | fill, | |||
Dimension * | resize | |||
) | [inline, virtual] |
Update size and resize step of a widget in the window.
After retrieval of the minimal size and the resize-steps of a widget, this function is called to allow further refinement, typically by computing the real maximal size of the content. Afterwards, size is taken to be the minimal size of the widget and resize is taken to contain the resize steps. For the convenience of the callee, padding contains the amount of padding between the content and the edge of the widget. This should be added to the returned size.
widget | Widget number. | |
size | Size of the widget. | |
padding | Recommended amount of space between the widget content and the widget edge. | |
fill | Fill step of the widget. | |
resize | Resize step of the widget. |
Reimplemented from Window.
Definition at line 292 of file newgrf_debug_gui.cpp.
References BOTTOM_OFFSET, FONT_HEIGHT_NORMAL, max(), NIW_MAINPANEL, and TOP_OFFSET.
void NewGRFInspectWindow::WARN_FORMAT | ( | 4 | , | |
5 | ||||
) | const |
Helper function to draw a string (line) in the window.
r | The (screen) rectangle we must draw within | |
offset | The offset (in lines) we want to draw for | |
format | The format string |
The currently editted parameter, to update the right one.
Definition at line 261 of file newgrf_debug_gui.cpp.
byte NewGRFInspectWindow::var60params = { {0} } [static] |
The value for the variable 60 parameters.
Definition at line 258 of file newgrf_debug_gui.cpp.