OpenTTD Source 20260531-master-g0e951f3528
window_type.h File Reference

Types related to windows. More...

Go to the source code of this file.

Data Structures

struct  WindowNumber
 Number to differentiate different windows of the same class. More...

Typedefs

using WidgetID = int
 Widget ID.

Enumerations

enum class  GameOptionsWindowNumber : uint8_t {
  AI , GS , About , NewGRFState ,
  GameOptions
}
 Window numbers for GameOptions windows. More...
enum class  QueryStringWindowNumber : uint8_t { Default , Sign }
 Window numbers for QueryString windows. More...
enum class  ConfirmPopupQueryWindowNumber : uint8_t { Default , Bootstrap }
 Window numbers for PopupQuery windows. More...
enum class  NetworkWindowNumber : uint8_t { Game , ContentList , StartServer }
 Window numbers for network windows. More...
enum class  NetworkStatusWindowNumber : uint8_t { Join , ContentDownload }
 Window number for network status windows. More...
enum class  WindowClass : uint16_t {
  None , MainWindow = WindowClass::None , MainToolbar , Statusbar ,
  BuildToolbar , ScenarioBuildToolbar , BuildTrees , TransparencyToolbar ,
  BuildSignal , SmallMap , ErrorMessage , ToolTips ,
  QueryString , ConfirmPopupQuery , GoalQuestion , SaveLoad ,
  LandInfo , DropdownMenu , OnScreenKeyboard , SetDate ,
  ScriptSettings , NewGRFParameters , Textfile , TownAuthority ,
  VehicleDetails , VehicleRefit , VehicleOrders , ReplaceVehicle ,
  VehicleTimetable , CompanyLivery , CompanyManagerFace , JoinStation ,
  News , TownDirectory , SubsidyList , IndustryDirectory ,
  MessageHistory , SignList , ScriptList , GoalList ,
  StoryBook , StationList , TrainList , RoadVehicleList ,
  ShipList , AircraftList , TownView , VehicleView ,
  StationView , VehicleDepot , WaypointView , IndustryView ,
  Company , BuildObject , BuildHouse , BuildVehicle ,
  BuildBridge , BuildStation , BuildBusStation , BuildTruckStation ,
  BuildDepot , BuildWaypoint , FoundTown , BuildIndustry ,
  SelectGame , ScenarioGenerateLandscape , GenerateLandscape , ModalProgress ,
  Network , NetworkClientList , NetworkStatus , NetworkAskRelay ,
  NetworkAskSurvey , NetworkChat , IndustryCargoes , GraphLegend ,
  Finances , IncomeGraph , OperatingProfitGraph , DeliveredCargoGraph ,
  PerformanceGraph , CompanyValueGraph , CompanyLeague , CargoPaymentRatesGraph ,
  PerformanceDetail , IndustryProductionGraph , TownCargoGraph , CompanyInfrastructure ,
  BuyCompany , EnginePreview , Music , MusicTrackSelection ,
  GameOptions , CustomCurrenty , Cheat , ExtraViewport ,
  Console , Bootstrap , Highscore , Endscreen ,
  ScriptDebug , NewGRFInspect , SpriteAligner , LinkGraphLegend ,
  SavePreset , FramerateDisplay , FrametimeGraph , Screenshot ,
  Help , Invalid = 0xFFFF
}
 Window classes. More...
enum  GameOptionsInvalidationData : uint8_t {
  GOID_DEFAULT = 0 , GOID_NEWGRF_RESCANNED , GOID_NEWGRF_CURRENT_LOADED , GOID_NEWGRF_LIST_EDITED ,
  GOID_NEWGRF_CHANGES_MADE
}
 Data value for Window::OnInvalidateData() of windows with class ::WindowClass::GameOptions. More...
enum  EventState : uint8_t { ES_HANDLED , ES_NOT_HANDLED }
 State of handling an event. More...

Variables

static constexpr WidgetID INVALID_WIDGET = -1
 An invalid widget index.

Detailed Description

Types related to windows.

Definition in file window_type.h.

Typedef Documentation

◆ WidgetID

using WidgetID = int

Widget ID.

Even though the ID is signed, actual IDs must be non-negative. Negative IDs are used for special cases, like denoting 'no widget'.

Definition at line 21 of file window_type.h.

Enumeration Type Documentation

◆ ConfirmPopupQueryWindowNumber

enum class ConfirmPopupQueryWindowNumber : uint8_t
strong

Window numbers for PopupQuery windows.

Enumerator
Default 

Query popup confirm.

Bootstrap 

Query popup confirm for bootstrap.

Definition at line 42 of file window_type.h.

◆ EventState

enum EventState : uint8_t

State of handling an event.

Enumerator
ES_HANDLED 

The passed event is handled.

ES_NOT_HANDLED 

The passed event is not handled.

Definition at line 816 of file window_type.h.

◆ GameOptionsInvalidationData

Data value for Window::OnInvalidateData() of windows with class ::WindowClass::GameOptions.

Enumerator
GOID_NEWGRF_RESCANNED 

NewGRFs were just rescanned.

GOID_NEWGRF_CURRENT_LOADED 

The current list of active NewGRF has been loaded.

GOID_NEWGRF_LIST_EDITED 

List of active NewGRFs is being edited.

GOID_NEWGRF_CHANGES_MADE 

Changes have been made to a given NewGRF either through the palette or its parameters.

Definition at line 750 of file window_type.h.

◆ GameOptionsWindowNumber

enum class GameOptionsWindowNumber : uint8_t
strong

Window numbers for GameOptions windows.

Enumerator
AI 

AI settings.

GS 

GS settings.

About 

About window.

NewGRFState 

NewGRF settings.

GameOptions 

Game options.

Definition at line 27 of file window_type.h.

◆ NetworkStatusWindowNumber

enum class NetworkStatusWindowNumber : uint8_t
strong

Window number for network status windows.

Enumerator
Join 

Network join status.

ContentDownload 

Network content download status.

Definition at line 55 of file window_type.h.

◆ NetworkWindowNumber

enum class NetworkWindowNumber : uint8_t
strong

Window numbers for network windows.

Enumerator
Game 

Network game window.

ContentList 

Network content list.

StartServer 

Network start server.

Definition at line 48 of file window_type.h.

◆ QueryStringWindowNumber

enum class QueryStringWindowNumber : uint8_t
strong

Window numbers for QueryString windows.

Enumerator
Default 

Query string.

Sign 

Query string for signs.

Definition at line 36 of file window_type.h.

◆ WindowClass

enum class WindowClass : uint16_t
strong

Window classes.

Enumerator
None 

No window, redirects to WindowClass::MainWindow.

MainWindow 

Main window; Window numbers:

MainToolbar 

Main toolbar (the long bar at the top); Window numbers:

Statusbar 

Statusbar (at the bottom of your screen); Window numbers:

BuildToolbar 

Build toolbar; Window numbers:

ScenarioBuildToolbar 

Scenario build toolbar; Window numbers:

BuildTrees 

Build trees toolbar; Window numbers:

TransparencyToolbar 

Transparency toolbar; Window numbers:

BuildSignal 

Build signal toolbar; Window numbers:

SmallMap 

Small map; Window numbers:

ErrorMessage 

Error message; Window numbers:

ToolTips 

Tooltip window; Window numbers:

QueryString 

Query string window; Window numbers:

ConfirmPopupQuery 

Popup with confirm question; Window numbers:

GoalQuestion 

Popup with a set of buttons, designed to ask the user a question from a GameScript.

Window numbers:

SaveLoad 

Saveload window; Window numbers:

LandInfo 

Land info window; Window numbers:

DropdownMenu 

Drop down menu; Window numbers:

OnScreenKeyboard 

On Screen Keyboard; Window numbers:

SetDate 

Set date; Window numbers:

ScriptSettings 

Script settings; Window numbers:

NewGRFParameters 

NewGRF parameters; Window numbers:

Textfile 

textfile; Window numbers:

TownAuthority 

Town authority; Window numbers:

VehicleDetails 

Vehicle details; Window numbers:

VehicleRefit 

Vehicle refit; Window numbers:

VehicleOrders 

Vehicle orders; Window numbers:

ReplaceVehicle 

Replace vehicle window; Window numbers:

VehicleTimetable 

Vehicle timetable; Window numbers:

CompanyLivery 

Company colour selection; Window numbers:

CompanyManagerFace 

Alter company face window; Window numbers:

JoinStation 

Select station (when joining stations); Window numbers:

News 

News window; Window numbers:

TownDirectory 

Town directory; Window numbers:

SubsidyList 

Subsidies list; Window numbers:

IndustryDirectory 

Industry directory; Window numbers:

MessageHistory 

News history list; Window numbers:

SignList 

Sign list; Window numbers:

ScriptList 

Scripts list; Window numbers:

GoalList 

Goals list; Window numbers:

StoryBook 

Story book; Window numbers:

StationList 

Station list; Window numbers:

TrainList 

Trains list; Window numbers:

RoadVehicleList 

Road vehicle list; Window numbers:

ShipList 

Ships list; Window numbers:

AircraftList 

Aircraft list; Window numbers:

TownView 

Town view; Window numbers:

VehicleView 

Vehicle view; Window numbers:

StationView 

Station view; Window numbers:

VehicleDepot 

Depot view; Window numbers:

WaypointView 

Waypoint view; Window numbers:

IndustryView 

Industry view; Window numbers:

Company 

Company view; Window numbers:

BuildObject 

Build object; Window numbers:

BuildHouse 

Build house; Window numbers:

BuildVehicle 

Build vehicle; Window numbers:

BuildBridge 

Build bridge; Window numbers:

BuildStation 

Build station; Window numbers:

BuildBusStation 

Build bus station; Window numbers:

BuildTruckStation 

Build truck station; Window numbers:

BuildDepot 

Build depot; Window numbers:

BuildWaypoint 

Build waypoint; Window numbers:

FoundTown 

Found a town; Window numbers:

BuildIndustry 

Build industry; Window numbers:

SelectGame 

Select game window; Window numbers:

ScenarioGenerateLandscape 

Landscape generation (in Scenario Editor); Window numbers:

GenerateLandscape 

Generate landscape (newgame); Window numbers:

ModalProgress 

Progress report of landscape generation; Window numbers:

Network 

Network window; Window numbers:

NetworkClientList 

Client list; Window numbers:

NetworkStatus 

Network status window; Window numbers:

NetworkAskRelay 

Network ask relay window; Window numbers:

NetworkAskSurvey 

Network ask survey window; Window numbers:

NetworkChat 

Chatbox; Window numbers:

IndustryCargoes 

Industry cargoes chain; Window numbers:

GraphLegend 

Legend for graphs; Window numbers:

Finances 

Finances of a company; Window numbers:

IncomeGraph 

Income graph; Window numbers:

  • 0 = #CompanyValueWidgets
OperatingProfitGraph 

Operating profit graph; Window numbers:

  • 0 = #CompanyValueWidgets
DeliveredCargoGraph 

Delivered cargo graph; Window numbers:

  • 0 = #CompanyValueWidgets
PerformanceGraph 

Performance history graph; Window numbers:

  • 0 = #PerformanceHistoryGraphWidgets
CompanyValueGraph 

Company value graph; Window numbers:

  • 0 = #CompanyValueWidgets
CompanyLeague 

Company league window; Window numbers:

  • 0 = #CompanyLeagueWidgets
CargoPaymentRatesGraph 

Payment rates graph; Window numbers:

  • 0 = #CargoPaymentRatesWidgets
PerformanceDetail 

Performance detail window; Window numbers:

IndustryProductionGraph 

Industry production history graph; Window numbers:

  • #IndustryID = #IndustryProductionGraphWidgets
TownCargoGraph 

Town cargo history graph; Window numbers:

CompanyInfrastructure 

Company infrastructure overview; Window numbers:

BuyCompany 

Buyout company (merger); Window numbers:

EnginePreview 

Engine preview window; Window numbers:

Music 

Music window; Window numbers:

MusicTrackSelection 

Music track selection; Window numbers:

GameOptions 

Game options window; Window numbers:

CustomCurrenty 

Custom currency; Window numbers:

Cheat 

Cheat window; Window numbers:

ExtraViewport 

Extra viewport; Window numbers:

Console 

Console; Window numbers:

Bootstrap 

Bootstrap; Window numbers:

Highscore 

Highscore; Window numbers:

Endscreen 

Endscreen; Window numbers:

ScriptDebug 

Script debug window; Window numbers:

NewGRFInspect 

NewGRF inspect (debug); Window numbers:

SpriteAligner 

Sprite aligner (debug); Window numbers:

LinkGraphLegend 

Linkgraph legend; Window numbers:

  • 0 = #LinkGraphWidgets
SavePreset 

Save preset; Window numbers:

FramerateDisplay 

Framerate display; Window numbers:

  • 0 = #FramerateDisplayWidgets
FrametimeGraph 

Frame time graph; Window numbers:

Screenshot 

Screenshot window; Window numbers:

  • 0 = #ScreenshotWidgets
Help 

Help and manuals window; Window numbers:

Invalid 

Invalid window.

Definition at line 61 of file window_type.h.

Variable Documentation

◆ INVALID_WIDGET