# BuildSignalWindow Struct Reference

Inheritance diagram for BuildSignalWindow:

## Public Member Functions

| BuildSignalWindow (const WindowDesc *desc, Window *parent)
virtual void | SetStringParameters (int widget) const
| Initialize string parameters for a widget.
virtual void | OnPaint ()
| The window must be repainted.
virtual void | DrawWidget (const Rect &r, int widget) const
| Draw the contents of a nested widget.
virtual void | OnClick (Point pt, int widget, int click_count)
| A click with the left mouse button has been made on the window.
virtual void | OnInvalidateData (int data=0)
| Some data on this window has become invalid.

## Private Member Functions

void | DrawSignalSprite (byte widget_index, SpriteID image) const
| Draw dynamic a signal-sprite in a button in the signal GUI Draw the sprite +1px to the right and down if the button is lowered and change the sprite to sprite + 1 (red to green light).

## Detailed Description

Definition at line 1517 of file rail_gui.cpp.

## Member Function Documentation

void BuildSignalWindow::DrawSignalSprite | ( | byte | widget_index,
|  | SpriteID | image |
| ) |  |  | const`[inline, private]`

Draw dynamic a signal-sprite in a button in the signal GUI Draw the sprite +1px to the right and down if the button is lowered and change the sprite to sprite + 1 (red to green light).

Parameters:

  | widget_index | index of this widget in the window
  | image | the sprite to draw

Definition at line 1526 of file rail_gui.cpp.

References NWidgetBase::current_x, NWidgetBase::current_y, DrawSprite(), Sprite::height, Window::IsWidgetLowered(), NWidgetBase::pos_x, NWidgetBase::pos_y, ST_NORMAL, Sprite::width, Sprite::x_offs, and Sprite::y_offs.

Referenced by DrawWidget().

virtual void BuildSignalWindow::DrawWidget | ( | const Rect & | r,
|  | int | widget |
| ) |  |  | const`[inline, virtual]`

Draw the contents of a nested widget.

Parameters:

  | r | Rectangle occupied by the widget.
  | widget | Number of the widget to draw.

Note:
  This method may not change any state, it may only use drawing functions.

Reimplemented from Window.

Definition at line 1574 of file rail_gui.cpp.

References DrawSignalSprite(), and IsInsideMM().

virtual void BuildSignalWindow::OnClick | ( | Point | pt,
|  | int | widget,
|  | int | click_count |
| ) |  |  | `[inline, virtual]`

A click with the left mouse button has been made on the window.

Parameters:

  | pt | the point inside the window that has been clicked.
  | widget | the clicked widget.
  | click_count | Number of fast consecutive clicks at same position

Reimplemented from Window.

Definition at line 1590 of file rail_gui.cpp.

References _convert_signal_button, _cur_signal_type, _cur_signal_variant, _settings_client, GUISettings::drag_signals_density, ClientSettings::gui, Window::InvalidateData(), Window::RaiseWidget(), SetWindowDirty(), SIG_ELECTRIC, and SIG_SEMAPHORE.

virtual void BuildSignalWindow::OnInvalidateData | ( | int | data = `0` | ) | `[inline, virtual]`

Some data on this window has become invalid.

Parameters:

  | data | information about the changed data.

Reimplemented from Window.

Definition at line 1635 of file rail_gui.cpp.

References _convert_signal_button, _cur_signal_type, _cur_signal_variant, _settings_client, GUISettings::drag_signals_density, ClientSettings::gui, Window::LowerWidget(), Window::SetWidgetDisabledState(), Window::SetWidgetLoweredState(), and SIG_ELECTRIC.

virtual void BuildSignalWindow::OnPaint | ( |  | ) | `[inline, virtual]`

The window must be repainted.

Note:
  This method should not change any state, it should only use drawing functions.

Reimplemented from Window.

Definition at line 1569 of file rail_gui.cpp.

References Window::DrawWidgets().

virtual void BuildSignalWindow::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 1560 of file rail_gui.cpp.

References _settings_client, GUISettings::drag_signals_density, ClientSettings::gui, and SetDParam().

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

- src/rail_gui.cpp