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

# NewGRFInspectWindow Struct Reference

Window used for inspecting NewGRFs. More...

Inheritance diagram for NewGRFInspectWindow:

## 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 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 uint32 | var60params [GSF_FAKE_END][0x20] = { {0} }
| The value for the variable 60 parameters.

## Detailed Description

Window used for inspecting NewGRFs.

Definition at line 280 of file newgrf_debug_gui.cpp.

## Member Function Documentation

static bool NewGRFInspectWindow::HasVariableParameter | ( | uint | variable | ) | `[inline, static]`

Check whether the given variable has a parameter.

Parameters:

  | variable | the variable to check.

Returns:
  true iff the variable has a parameter.

Definition at line 302 of file newgrf_debug_gui.cpp.

References IsInsideBS().

void NewGRFInspectWindow::SetCallerGRFID | ( | uint32 | grfid | ) | `[inline]`

Set the GRFID of the item opening this window.

Parameters:

  | grfid | GRFID of the item opening this window, or 0 if not opened by other window.

Definition at line 311 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.

Parameters:

  | widget | Widget number.

Reimplemented from Window.

Definition at line 327 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.

Parameters:

  | 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 334 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.

Parameters:

  | r | The (screen) rectangle we must draw within
  | offset | The offset (in lines) we want to draw for
  | format | The format string

## Field Documentation

uint32 NewGRFInspectWindow::caller_grfid

GRFID of the caller of this window, 0 if it has no caller.

Definition at line 290 of file newgrf_debug_gui.cpp.

Referenced by SetCallerGRFID().

byte NewGRFInspectWindow::current_edit_param

The currently editted parameter, to update the right one.

Definition at line 293 of file newgrf_debug_gui.cpp.

uint32 NewGRFInspectWindow::var60params = { {0} }`[static]`

The value for the variable 60 parameters.

Definition at line 287 of file newgrf_debug_gui.cpp.

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

- src/newgrf_debug_gui.cpp