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

# LandInfoWindow Class Reference

Inheritance diagram for LandInfoWindow:

## Public Member Functions
virtual void | DrawWidget (const Rect &r, int widget) const
| Draw the contents of a nested 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.
| LandInfoWindow (TileIndex tile)
virtual void | OnInit ()
| Notification that the nested widget tree gets initialized.
virtual bool | IsNewGRFInspectable () const
| Is the data related to this window NewGRF inspectable?
virtual void | ShowNewGRFInspectWindow () const
| Show the NewGRF inspection window.
virtual void | OnInvalidateData (int data=0, bool gui_scope=true)
| Some data on this window has become invalid.
## Data Fields
char | landinfo_data [LAND_INFO_LINE_END][LAND_INFO_LINE_BUFF_SIZE]
TileIndex | tile
## Private Types
enum | LandInfoLines { LAND_INFO_CENTERED_LINES = 12, LAND_INFO_MULTICENTER_LINE = LAND_INFO_CENTERED_LINES, LAND_INFO_LINE_END }
## Static Private Attributes
static const uint | LAND_INFO_LINE_BUFF_SIZE = 512

## Detailed Description

Definition at line 59 of file misc_gui.cpp.

## Member Enumeration Documentation

enum LandInfoWindow::LandInfoLines`[private]`

Enumerator:

  LAND_INFO_CENTERED_LINES | Up to 12 centered lines.
  LAND_INFO_MULTICENTER_LINE | One multicenter line.

Definition at line 60 of file misc_gui.cpp.

## Member Function Documentation

virtual void LandInfoWindow::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 72 of file misc_gui.cpp.

References DrawString(), DrawStringMultiLine(), FONT_HEIGHT_NORMAL, LAND_INFO_MULTICENTER_LINE, SA_CENTER, SA_HOR_CENTER, SetDParamStr(), StrEmpty(), WD_FRAMETEXT_LEFT, WD_FRAMETEXT_RIGHT, WD_TEXTPANEL_BOTTOM, and WID_LI_BACKGROUND.

virtual bool LandInfoWindow::IsNewGRFInspectable | ( |  | ) | const`[inline, virtual]`

Is the data related to this window NewGRF inspectable?

Returns:
  true iff it is inspectable.

Reimplemented from Window.

Definition at line 316 of file misc_gui.cpp.

References GetGrfSpecFeature().

virtual void LandInfoWindow::OnInit | ( |  | ) | `[inline, virtual]`

Notification that the nested widget tree gets initialized.

The event can be used to perform general computations.

Note:
  nested_root and/or nested_array (normally accessed via GetWidget()) may not exist during this call.

Reimplemented from Window.

Definition at line 135 of file misc_gui.cpp.

References _current_company, _local_company, _settings_game, TileDesc::airport_class, TileDesc::airport_name, TileDesc::airport_tile_name, TileDesc::build_date, ClosestTownFromTile(), CMD_LANDSCAPE_CLEAR, DC_NONE, EconomySettings::dist_local_authority, DoCommand(), TileDesc::dparam, GameSettings::economy, CargoSpec::Get(), CommandCost::GetCost(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), GetNameOfOwner(), GetTileZ(), TileDesc::grf, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, INVALID_DATE, LAND_INFO_CENTERED_LINES, LAND_INFO_MULTICENTER_LINE, lastof, lengthof, CompanyProperties::money, TileDesc::owner, OWNER_NONE, TileDesc::owner_type, OWNER_WATER, TileDesc::rail_speed, SetDParam(), SetDParamStr(), TileDesc::station_class, TileDesc::station_name, TileDesc::str, CommandCost::Succeeded(), TileX(), and TileY().

virtual void LandInfoWindow::OnInvalidateData | ( | int | data = `0`,
|  | bool | gui_scope = `true` |
| ) |  |  | `[inline, virtual]`

Some data on this window has become invalid.

Parameters:

  | data | Information about the changed data.
  | gui_scope | Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See InvalidateWindowData() for details.

Reimplemented from Window.

Definition at line 331 of file misc_gui.cpp.

References Window::ReInit().

virtual void LandInfoWindow::ShowNewGRFInspectWindow | ( |  | ) | const`[inline, virtual]`

Show the NewGRF inspection window.

When this function is called it is up to the window to call and pass the right parameters to the ShowInspectWindow function.

Precondition:
  this->IsNewGRFInspectable()

Reimplemented from Window.

Definition at line 321 of file misc_gui.cpp.

References GetGrfSpecFeature().

virtual void LandInfoWindow::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 91 of file misc_gui.cpp.

References FONT_HEIGHT_NORMAL, GetStringBoundingBox(), GetStringHeight(), LAND_INFO_MULTICENTER_LINE, max(), min(), SetDParamStr(), StrEmpty(), WD_FRAMETEXT_LEFT, WD_TEXTPANEL_TOP, WID_LI_BACKGROUND, and Window::width.

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

- src/misc_gui.cpp