NewGRFInspectWindow Struct Reference

Window used for inspecting NewGRFs. More...

Inheritance diagram for NewGRFInspectWindow:
Window ZeroedMemoryAllocator

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

Detailed Description

Window used for inspecting NewGRFs.

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

Parameters:
widget Widget number.

Reimplemented from Window.

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

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 291 of file newgrf_debug_gui.cpp.

References BOTTOM_OFFSET, FONT_HEIGHT_NORMAL, max(), NIW_MAINPANEL, and TOP_OFFSET.

void NewGRFInspectWindow::WARN_FORMAT ( ,
 
) 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

The currently editted parameter, to update the right one.

Definition at line 260 of file newgrf_debug_gui.cpp.

byte NewGRFInspectWindow::var60params = { {0} } [static]

The value for the variable 60 parameters.

Definition at line 257 of file newgrf_debug_gui.cpp.


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

Generated on Fri Feb 4 20:54:40 2011 for OpenTTD by  doxygen 1.6.1