OpenTTD Source 20241224-master-gee860a5c8e
window_type.h File Reference

Types related to windows. More...

Go to the source code of this file.

Typedefs

using WidgetID = int
 Widget ID.
 
typedef int32_t WindowNumber
 Number to differentiate different windows of the same class.
 

Enumerations

enum  WindowNumberEnum {
  WN_GAME_OPTIONS_AI = 0 , WN_GAME_OPTIONS_GS , WN_GAME_OPTIONS_ABOUT , WN_GAME_OPTIONS_NEWGRF_STATE ,
  WN_GAME_OPTIONS_GAME_OPTIONS , WN_GAME_OPTIONS_GAME_SETTINGS , WN_QUERY_STRING = 0 , WN_QUERY_STRING_SIGN ,
  WN_CONFIRM_POPUP_QUERY = 0 , WN_CONFIRM_POPUP_QUERY_BOOTSTRAP , WN_NETWORK_WINDOW_GAME = 0 , WN_NETWORK_WINDOW_CONTENT_LIST ,
  WN_NETWORK_WINDOW_START , WN_NETWORK_STATUS_WINDOW_JOIN = 0 , WN_NETWORK_STATUS_WINDOW_CONTENT_DOWNLOAD
}
 Window numbers. More...
 
enum  WindowClass {
  WC_NONE , WC_MAIN_WINDOW = WC_NONE , WC_MAIN_TOOLBAR , WC_STATUS_BAR ,
  WC_BUILD_TOOLBAR , WC_SCEN_BUILD_TOOLBAR , WC_BUILD_TREES , WC_TRANSPARENCY_TOOLBAR ,
  WC_BUILD_SIGNAL , WC_SMALLMAP , WC_ERRMSG , WC_TOOLTIPS ,
  WC_QUERY_STRING , WC_CONFIRM_POPUP_QUERY , WC_GOAL_QUESTION , WC_SAVELOAD ,
  WC_LAND_INFO , WC_DROPDOWN_MENU , WC_OSK , WC_SET_DATE ,
  WC_SCRIPT_SETTINGS , WC_GRF_PARAMETERS , WC_TEXTFILE , WC_TOWN_AUTHORITY ,
  WC_VEHICLE_DETAILS , WC_VEHICLE_REFIT , WC_VEHICLE_ORDERS , WC_REPLACE_VEHICLE ,
  WC_VEHICLE_TIMETABLE , WC_COMPANY_COLOUR , WC_COMPANY_MANAGER_FACE , WC_SELECT_STATION ,
  WC_NEWS_WINDOW , WC_TOWN_DIRECTORY , WC_SUBSIDIES_LIST , WC_INDUSTRY_DIRECTORY ,
  WC_MESSAGE_HISTORY , WC_SIGN_LIST , WC_SCRIPT_LIST , WC_GOALS_LIST ,
  WC_STORY_BOOK , WC_STATION_LIST , WC_TRAINS_LIST , WC_ROADVEH_LIST ,
  WC_SHIPS_LIST , WC_AIRCRAFT_LIST , WC_TOWN_VIEW , WC_VEHICLE_VIEW ,
  WC_STATION_VIEW , WC_VEHICLE_DEPOT , WC_WAYPOINT_VIEW , WC_INDUSTRY_VIEW ,
  WC_COMPANY , WC_BUILD_OBJECT , WC_BUILD_HOUSE , WC_BUILD_VEHICLE ,
  WC_BUILD_BRIDGE , WC_BUILD_STATION , WC_BUS_STATION , WC_TRUCK_STATION ,
  WC_BUILD_DEPOT , WC_BUILD_WAYPOINT , WC_FOUND_TOWN , WC_BUILD_INDUSTRY ,
  WC_SELECT_GAME , WC_SCEN_LAND_GEN , WC_GENERATE_LANDSCAPE , WC_MODAL_PROGRESS ,
  WC_NETWORK_WINDOW , WC_CLIENT_LIST , WC_NETWORK_STATUS_WINDOW , WC_NETWORK_ASK_RELAY ,
  WC_NETWORK_ASK_SURVEY , WC_SEND_NETWORK_MSG , WC_INDUSTRY_CARGOES , WC_GRAPH_LEGEND ,
  WC_FINANCES , WC_INCOME_GRAPH , WC_OPERATING_PROFIT , WC_DELIVERED_CARGO ,
  WC_PERFORMANCE_HISTORY , WC_COMPANY_VALUE , WC_COMPANY_LEAGUE , WC_PAYMENT_RATES ,
  WC_PERFORMANCE_DETAIL , WC_INDUSTRY_PRODUCTION , WC_COMPANY_INFRASTRUCTURE , WC_BUY_COMPANY ,
  WC_ENGINE_PREVIEW , WC_MUSIC_WINDOW , WC_MUSIC_TRACK_SELECTION , WC_GAME_OPTIONS ,
  WC_CUSTOM_CURRENCY , WC_CHEATS , WC_EXTRA_VIEWPORT , WC_CONSOLE ,
  WC_BOOTSTRAP , WC_HIGHSCORE , WC_ENDSCREEN , WC_SCRIPT_DEBUG ,
  WC_NEWGRF_INSPECT , WC_SPRITE_ALIGNER , WC_LINKGRAPH_LEGEND , WC_SAVE_PRESET ,
  WC_FRAMERATE_DISPLAY , WC_FRAMETIME_GRAPH , WC_SCREENSHOT , WC_HELPWIN ,
  WC_INVALID = 0xFFFF
}
 Window classes. More...
 
enum  GameOptionsInvalidationData {
  GOID_DEFAULT = 0 , GOID_NEWGRF_RESCANNED , GOID_NEWGRF_CURRENT_LOADED , GOID_NEWGRF_LIST_EDITED ,
  GOID_NEWGRF_CHANGES_MADE , GOID_NEWGRF_CHANGES_APPLIED
}
 Data value for Window::OnInvalidateData() of windows with class WC_GAME_OPTIONS. More...
 
enum  EventState { ES_HANDLED , ES_NOT_HANDLED }
 State of handling an event. More...
 

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 18 of file window_type.h.

◆ WindowNumber

typedef int32_t WindowNumber

Number to differentiate different windows of the same class.

Definition at line 740 of file window_type.h.

Enumeration Type Documentation

◆ EventState

enum EventState

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 743 of file window_type.h.

◆ GameOptionsInvalidationData

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

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.

GOID_NEWGRF_CHANGES_APPLIED 

The active NewGRF list changes have been applied.

Definition at line 728 of file window_type.h.

◆ WindowClass

Window classes.

Enumerator
WC_NONE 

No window, redirects to WC_MAIN_WINDOW.

WC_MAIN_WINDOW 

Main window; Window numbers:

WC_MAIN_TOOLBAR 

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

WC_STATUS_BAR 

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

WC_BUILD_TOOLBAR 

Build toolbar; Window numbers:

WC_SCEN_BUILD_TOOLBAR 

Scenario build toolbar; Window numbers:

WC_BUILD_TREES 

Build trees toolbar; Window numbers:

WC_TRANSPARENCY_TOOLBAR 

Transparency toolbar; Window numbers:

WC_BUILD_SIGNAL 

Build signal toolbar; Window numbers:

WC_SMALLMAP 

Small map; Window numbers:

WC_ERRMSG 

Error message; Window numbers:

WC_TOOLTIPS 

Tooltip window; Window numbers:

WC_QUERY_STRING 

Query string window; Window numbers:

WC_CONFIRM_POPUP_QUERY 

Popup with confirm question; Window numbers:

WC_GOAL_QUESTION 

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

Window numbers:

WC_SAVELOAD 

Saveload window; Window numbers:

WC_LAND_INFO 

Land info window; Window numbers:

WC_DROPDOWN_MENU 

Drop down menu; Window numbers:

WC_OSK 

On Screen Keyboard; Window numbers:

WC_SET_DATE 

Set date; Window numbers:

WC_SCRIPT_SETTINGS 

Script settings; Window numbers:

WC_GRF_PARAMETERS 

NewGRF parameters; Window numbers:

WC_TEXTFILE 

textfile; Window numbers:

WC_TOWN_AUTHORITY 

Town authority; Window numbers:

WC_VEHICLE_DETAILS 

Vehicle details; Window numbers:

WC_VEHICLE_REFIT 

Vehicle refit; Window numbers:

WC_VEHICLE_ORDERS 

Vehicle orders; Window numbers:

WC_REPLACE_VEHICLE 

Replace vehicle window; Window numbers:

WC_VEHICLE_TIMETABLE 

Vehicle timetable; Window numbers:

WC_COMPANY_COLOUR 

Company colour selection; Window numbers:

WC_COMPANY_MANAGER_FACE 

Alter company face window; Window numbers:

WC_SELECT_STATION 

Select station (when joining stations); Window numbers:

WC_NEWS_WINDOW 

News window; Window numbers:

WC_TOWN_DIRECTORY 

Town directory; Window numbers:

WC_SUBSIDIES_LIST 

Subsidies list; Window numbers:

WC_INDUSTRY_DIRECTORY 

Industry directory; Window numbers:

WC_MESSAGE_HISTORY 

News history list; Window numbers:

WC_SIGN_LIST 

Sign list; Window numbers:

WC_SCRIPT_LIST 

Scripts list; Window numbers:

WC_GOALS_LIST 

Goals list; Window numbers:

WC_STORY_BOOK 

Story book; Window numbers:

WC_STATION_LIST 

Station list; Window numbers:

WC_TRAINS_LIST 

Trains list; Window numbers:

WC_ROADVEH_LIST 

Road vehicle list; Window numbers:

WC_SHIPS_LIST 

Ships list; Window numbers:

WC_AIRCRAFT_LIST 

Aircraft list; Window numbers:

WC_TOWN_VIEW 

Town view; Window numbers:

WC_VEHICLE_VIEW 

Vehicle view; Window numbers:

WC_STATION_VIEW 

Station view; Window numbers:

WC_VEHICLE_DEPOT 

Depot view; Window numbers:

WC_WAYPOINT_VIEW 

Waypoint view; Window numbers:

WC_INDUSTRY_VIEW 

Industry view; Window numbers:

WC_COMPANY 

Company view; Window numbers:

WC_BUILD_OBJECT 

Build object; Window numbers:

WC_BUILD_HOUSE 

Build house; Window numbers:

WC_BUILD_VEHICLE 

Build vehicle; Window numbers:

WC_BUILD_BRIDGE 

Build bridge; Window numbers:

WC_BUILD_STATION 

Build station; Window numbers:

WC_BUS_STATION 

Build bus station; Window numbers:

WC_TRUCK_STATION 

Build truck station; Window numbers:

WC_BUILD_DEPOT 

Build depot; Window numbers:

WC_BUILD_WAYPOINT 

Build waypoint; Window numbers:

WC_FOUND_TOWN 

Found a town; Window numbers:

WC_BUILD_INDUSTRY 

Build industry; Window numbers:

WC_SELECT_GAME 

Select game window; Window numbers:

WC_SCEN_LAND_GEN 

Landscape generation (in Scenario Editor); Window numbers:

WC_GENERATE_LANDSCAPE 

Generate landscape (newgame); Window numbers:

WC_MODAL_PROGRESS 

Progress report of landscape generation; Window numbers:

WC_NETWORK_WINDOW 

Network window; Window numbers:

WC_CLIENT_LIST 

Client list; Window numbers:

WC_NETWORK_STATUS_WINDOW 

Network status window; Window numbers:

WC_NETWORK_ASK_RELAY 

Network ask relay window; Window numbers:

WC_NETWORK_ASK_SURVEY 

Network ask survey window; Window numbers:

WC_SEND_NETWORK_MSG 

Chatbox; Window numbers:

WC_INDUSTRY_CARGOES 

Industry cargoes chain; Window numbers:

WC_GRAPH_LEGEND 

Legend for graphs; Window numbers:

WC_FINANCES 

Finances of a company; Window numbers:

WC_INCOME_GRAPH 

Income graph; Window numbers:

  • 0 = #CompanyValueWidgets
WC_OPERATING_PROFIT 

Operating profit graph; Window numbers:

  • 0 = #CompanyValueWidgets
WC_DELIVERED_CARGO 

Delivered cargo graph; Window numbers:

  • 0 = #CompanyValueWidgets
WC_PERFORMANCE_HISTORY 

Performance history graph; Window numbers:

  • 0 = #PerformanceHistoryGraphWidgets
WC_COMPANY_VALUE 

Company value graph; Window numbers:

  • 0 = #CompanyValueWidgets
WC_COMPANY_LEAGUE 

Company league window; Window numbers:

  • 0 = #CompanyLeagueWidgets
WC_PAYMENT_RATES 

Payment rates graph; Window numbers:

  • 0 = #CargoPaymentRatesWidgets
WC_PERFORMANCE_DETAIL 

Performance detail window; Window numbers:

WC_INDUSTRY_PRODUCTION 

Industry production history graph; Window numbers:

  • IndustryID = #IndustryProductionGraphWidgets
WC_COMPANY_INFRASTRUCTURE 

Company infrastructure overview; Window numbers:

WC_BUY_COMPANY 

Buyout company (merger); Window numbers:

WC_ENGINE_PREVIEW 

Engine preview window; Window numbers:

WC_MUSIC_WINDOW 

Music window; Window numbers:

WC_MUSIC_TRACK_SELECTION 

Music track selection; Window numbers:

  • 0 = MusicTrackSelectionWidgets
WC_GAME_OPTIONS 

Game options window; Window numbers:

WC_CUSTOM_CURRENCY 

Custom currency; Window numbers:

WC_CHEATS 

Cheat window; Window numbers:

WC_EXTRA_VIEWPORT 

Extra viewport; Window numbers:

WC_CONSOLE 

Console; Window numbers:

WC_BOOTSTRAP 

Bootstrap; Window numbers:

WC_HIGHSCORE 

Highscore; Window numbers:

WC_ENDSCREEN 

Endscreen; Window numbers:

WC_SCRIPT_DEBUG 

Script debug window; Window numbers:

WC_NEWGRF_INSPECT 

NewGRF inspect (debug); Window numbers:

WC_SPRITE_ALIGNER 

Sprite aligner (debug); Window numbers:

WC_LINKGRAPH_LEGEND 

Linkgraph legend; Window numbers:

  • 0 = #LinkGraphWidgets
WC_SAVE_PRESET 

Save preset; Window numbers:

WC_FRAMERATE_DISPLAY 

Framerate display; Window numbers:

  • 0 = #FramerateDisplayWidgets
WC_FRAMETIME_GRAPH 

Frame time graph; Window numbers:

WC_SCREENSHOT 

Screenshot window; Window numbers:

  • 0 = #ScreenshotWidgets
WC_INVALID 

Invalid window.

Definition at line 44 of file window_type.h.

◆ WindowNumberEnum

Window numbers.

Enumerator
WN_GAME_OPTIONS_AI 

AI settings.

WN_GAME_OPTIONS_GS 

GS settings.

WN_GAME_OPTIONS_ABOUT 

About window.

WN_GAME_OPTIONS_NEWGRF_STATE 

NewGRF settings.

WN_GAME_OPTIONS_GAME_OPTIONS 

Game options.

WN_GAME_OPTIONS_GAME_SETTINGS 

Game settings.

WN_QUERY_STRING 

Query string.

WN_QUERY_STRING_SIGN 

Query string for signs.

WN_CONFIRM_POPUP_QUERY 

Query popup confirm.

WN_CONFIRM_POPUP_QUERY_BOOTSTRAP 

Query popup confirm for bootstrap.

WN_NETWORK_WINDOW_GAME 

Network game window.

WN_NETWORK_WINDOW_CONTENT_LIST 

Network content list.

WN_NETWORK_WINDOW_START 

Network start server.

WN_NETWORK_STATUS_WINDOW_JOIN 

Network join status.

WN_NETWORK_STATUS_WINDOW_CONTENT_DOWNLOAD 

Network content download status.

Definition at line 21 of file window_type.h.