Window used for inspecting NewGRFs. More...
Public Member Functions | |
void | SetCallerGRFID (uint32 grfid) |
Set the GRFID of the item opening this window. | |
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 | |
uint32 | caller_grfid |
GRFID of the caller of this window, 0 if it has no caller. | |
byte | current_edit_param |
The currently edited 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 uint32 | var60params [GSF_FAKE_END][0x20] = { {0} } |
The value for the variable 60 parameters. |
Window used for inspecting NewGRFs.
Definition at line 269 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 291 of file newgrf_debug_gui.cpp.
References IsInsideBS().
void NewGRFInspectWindow::SetCallerGRFID | ( | uint32 | grfid | ) | [inline] |
Set the GRFID of the item opening this window.
grfid | GRFID of the item opening this window, or 0 if not opened by other window. |
Definition at line 300 of file newgrf_debug_gui.cpp.
References caller_grfid, and Window::SetDirty().
Referenced by ShowNewGRFInspectWindow().
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 316 of file newgrf_debug_gui.cpp.
References GetFeatureHelper(), GetFeatureIndex(), NIHelper::SetStringParameters(), WID_NGRFI_CAPTION, 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 323 of file newgrf_debug_gui.cpp.
References BOTTOM_OFFSET, FONT_HEIGHT_NORMAL, max(), TOP_OFFSET, and WID_NGRFI_MAINPANEL.
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 |
GRFID of the caller of this window, 0 if it has no caller.
Definition at line 279 of file newgrf_debug_gui.cpp.
Referenced by SetCallerGRFID().
The currently edited parameter, to update the right one.
Definition at line 282 of file newgrf_debug_gui.cpp.
uint32 NewGRFInspectWindow::var60params = { {0} } [static] |
The value for the variable 60 parameters.
Definition at line 276 of file newgrf_debug_gui.cpp.