# TransparenciesWindow Class Reference

Inheritance diagram for TransparenciesWindow:

## Public Member Functions
| TransparenciesWindow (const WindowDesc *desc, int window_number)
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 Point | OnInitialPosition (const WindowDesc *desc, int16 sm_width, int16 sm_height, int window_number)
| Compute the initial position of the window.
virtual void | OnInvalidateData (int data)
| Some data on this window has become invalid.

## Detailed Description

Definition at line 44 of file transparency_gui.cpp.

## Member Function Documentation

virtual void TransparenciesWindow::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 58 of file transparency_gui.cpp.

References NWidgetBase::current_x, DrawFrameRect(), DrawSprite(), FR_LOWERED, HasBit(), NWidgetBase::pos_x, TTW_WIDGET_BEGIN, TTW_WIDGET_BRIDGES, TTW_WIDGET_BUILDINGS, TTW_WIDGET_BUTTONS, TTW_WIDGET_CATENARY, TTW_WIDGET_END, TTW_WIDGET_HOUSES, TTW_WIDGET_INDUSTRIES, TTW_WIDGET_LOADING, TTW_WIDGET_SIGNS, TTW_WIDGET_STRUCTURES, and TTW_WIDGET_TREES.

virtual void TransparenciesWindow::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 86 of file transparency_gui.cpp.

References _ctrl_pressed, NWidgetBase::current_x, IsInsideBS(), IsTransparencySet(), MarkWholeScreenDirty(), NWidgetBase::pos_x, Window::SetDirty(), Window::SetWidgetDirty(), ToggleInvisibility(), ToggleTransparency(), ToggleTransparencyLock(), TTW_WIDGET_BEGIN, TTW_WIDGET_BUTTONS, TTW_WIDGET_END, and TTW_WIDGET_LOADING.

virtual Point TransparenciesWindow::OnInitialPosition | ( | const WindowDesc * | desc,
|  | int16 | sm_width,
|  | int16 | sm_height,
|  | int | window_number |
| ) |  |  | `[inline, virtual]`

Compute the initial position of the window.

Parameters:

  | *desc | The pointer to the WindowDesc of the window to create.
  | sm_width | Smallest width of the window.
  | sm_height | Smallest height of the window.
  | window_number | The window number of the new window.

Returns:
  Initial position of the top-left corner of the window.

Reimplemented from Window.

Definition at line 121 of file transparency_gui.cpp.

References GetToolbarAlignedWindowPosition(), and TTW_WIDGET_BUTTONS.

virtual void TransparenciesWindow::OnInvalidateData | ( | int | data | ) | `[inline, virtual]`

Some data on this window has become invalid.

Parameters:

  | data | information about the changed data.

Reimplemented from Window.

Definition at line 128 of file transparency_gui.cpp.

References IsTransparencySet(), Window::SetWidgetLoweredState(), TTW_WIDGET_BEGIN, and TTW_WIDGET_END.

Referenced by OnPaint().

virtual void TransparenciesWindow::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 52 of file transparency_gui.cpp.

References Window::DrawWidgets(), and OnInvalidateData().

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

- src/transparency_gui.cpp