(svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
authorrubidium
Mon, 19 May 2008 09:48:47 +0000
changeset 10641 13148f508e6d
parent 10640 5bef905df159
child 10646 75282aa308ad
(svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
src/airport_gui.cpp
src/autoreplace_gui.cpp
src/bridge_gui.cpp
src/build_vehicle_gui.cpp
src/cheat_gui.cpp
src/console.cpp
src/depot_gui.cpp
src/dock_gui.cpp
src/engine_gui.cpp
src/genworld_gui.cpp
src/graph_gui.cpp
src/group_gui.cpp
src/industry_gui.cpp
src/intro_gui.cpp
src/misc_gui.cpp
src/music_gui.cpp
src/network/network_gui.cpp
src/newgrf_gui.cpp
src/news_gui.cpp
src/order_gui.cpp
src/osk_gui.cpp
src/player_gui.cpp
src/rail_gui.cpp
src/road_gui.cpp
src/settings_gui.cpp
src/signs_gui.cpp
src/smallmap_gui.cpp
src/station_gui.cpp
src/statusbar_gui.cpp
src/subsidy_gui.cpp
src/terraform_gui.cpp
src/timetable_gui.cpp
src/toolbar_gui.cpp
src/town_gui.cpp
src/transparency_gui.cpp
src/tree_gui.cpp
src/vehicle_gui.cpp
src/window.cpp
src/window_gui.h
--- a/src/airport_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/airport_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -140,7 +140,6 @@
 	WC_BUILD_TOOLBAR, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 	_air_toolbar_widgets,
-	NULL
 };
 
 void ShowBuildAirToolbar()
@@ -282,7 +281,6 @@
 	WC_BUILD_STATION, WC_BUILD_TOOLBAR,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_build_airport_picker_widgets,
-	NULL
 };
 
 static void ShowBuildAirportPicker()
--- a/src/autoreplace_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/autoreplace_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -533,7 +533,6 @@
 	WC_REPLACE_VEHICLE, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_replace_vehicle_widgets,
-	NULL
 };
 
 static const WindowDesc _replace_vehicle_desc = {
@@ -541,7 +540,6 @@
 	WC_REPLACE_VEHICLE, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_replace_vehicle_widgets,
-	NULL
 };
 
 RailType ReplaceVehicleWindow::sel_railtype = RAILTYPE_RAIL;
--- a/src/bridge_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/bridge_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -283,7 +283,6 @@
 	WC_BUILD_BRIDGE, WC_BUILD_TOOLBAR,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
 	_build_bridge_widgets,
-	NULL
 };
 
 /**
--- a/src/build_vehicle_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/build_vehicle_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -1182,7 +1182,6 @@
 	WC_BUILD_VEHICLE, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 	_build_vehicle_widgets,
-	NULL
 };
 
 void ShowBuildVehicleWindow(TileIndex tile, VehicleType type)
--- a/src/cheat_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/cheat_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -226,7 +226,6 @@
 	WC_CHEATS, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_cheat_widgets,
-	NULL
 };
 
 
--- a/src/console.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/console.cpp	Mon May 19 09:48:47 2008 +0000
@@ -248,7 +248,6 @@
 	WC_CONSOLE, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_iconsole_window_widgets,
-	NULL,
 };
 
 void IConsoleInit()
--- a/src/depot_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/depot_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -107,7 +107,6 @@
 	WC_VEHICLE_DEPOT, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_depot_widgets,
-	NULL
 };
 
 static const WindowDesc _road_depot_desc = {
@@ -115,7 +114,6 @@
 	WC_VEHICLE_DEPOT, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_depot_widgets,
-	NULL
 };
 
 static const WindowDesc _ship_depot_desc = {
@@ -123,7 +121,6 @@
 	WC_VEHICLE_DEPOT, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_depot_widgets,
-	NULL
 };
 
 static const WindowDesc _aircraft_depot_desc = {
@@ -131,7 +128,6 @@
 	WC_VEHICLE_DEPOT, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_depot_widgets,
-	NULL
 };
 
 extern int WagonLengthToPixels(int len);
--- a/src/dock_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/dock_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -226,7 +226,6 @@
 	WC_BUILD_TOOLBAR, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 	_build_docks_toolb_widgets,
-	NULL
 };
 
 void ShowBuildDocksToolbar()
@@ -311,7 +310,6 @@
 	WC_BUILD_STATION, WC_BUILD_TOOLBAR,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_build_dock_station_widgets,
-	NULL
 };
 
 static void ShowBuildDockStationPicker()
@@ -386,7 +384,6 @@
 	WC_BUILD_DEPOT, WC_BUILD_TOOLBAR,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_build_docks_depot_widgets,
-	NULL
 };
 
 
--- a/src/engine_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/engine_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -107,7 +107,6 @@
 	WC_ENGINE_PREVIEW, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_engine_preview_widgets,
-	NULL
 };
 
 
--- a/src/genworld_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/genworld_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -554,7 +554,6 @@
 	WC_GENERATE_LANDSCAPE, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_generate_landscape_widgets,
-	NULL,
 };
 
 static const WindowDesc _heightmap_load_desc = {
@@ -562,7 +561,6 @@
 	WC_GENERATE_LANDSCAPE, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS,
 	_heightmap_load_widgets,
-	NULL,
 };
 
 static void _ShowGenerateLandscape(glwp_modes mode)
@@ -801,7 +799,6 @@
 	WC_GENERATE_LANDSCAPE, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS,
 	_create_scenario_widgets,
-	NULL,
 };
 
 void ShowCreateScenario()
@@ -823,7 +820,6 @@
 	WC_GENERATE_PROGRESS_WINDOW, WC_NONE,
 	WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_generate_progress_widgets,
-	NULL
 };
 
 struct tp_info {
--- a/src/graph_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/graph_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -101,7 +101,6 @@
 	WC_GRAPH_LEGEND, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_graph_legend_widgets,
-	NULL
 };
 
 static void ShowGraphLegend()
@@ -442,7 +441,6 @@
 	WC_OPERATING_PROFIT, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_operating_profit_widgets,
-	NULL
 };
 
 
@@ -482,7 +480,6 @@
 	WC_INCOME_GRAPH, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_income_graph_widgets,
-	NULL
 };
 
 void ShowIncomeGraph()
@@ -520,7 +517,6 @@
 	WC_DELIVERED_CARGO, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_delivered_cargo_graph_widgets,
-	NULL
 };
 
 void ShowDeliveredCargoGraph()
@@ -565,7 +561,6 @@
 	WC_PERFORMANCE_HISTORY, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_performance_history_widgets,
-	NULL
 };
 
 void ShowPerformanceHistoryGraph()
@@ -603,7 +598,6 @@
 	WC_COMPANY_VALUE, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_company_value_graph_widgets,
-	NULL
 };
 
 void ShowCompanyValueGraph()
@@ -728,7 +722,6 @@
 	WC_PAYMENT_RATES, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_cargo_payment_rates_widgets,
-	NULL
 };
 
 
@@ -817,7 +810,6 @@
 	WC_COMPANY_LEAGUE, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 	_company_league_widgets,
-	NULL
 };
 
 void ShowCompanyLeagueTable()
@@ -1049,7 +1041,6 @@
 	WC_PERFORMANCE_DETAIL, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_performance_rating_detail_widgets,
-	NULL
 };
 
 void ShowPerformanceRatingDetail()
--- a/src/group_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/group_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -757,7 +757,6 @@
 	WC_TRAINS_LIST, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_group_widgets,
-	NULL
 };
 
 void ShowPlayerGroup(PlayerID player, VehicleType vehicle_type)
--- a/src/industry_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/industry_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -91,7 +91,6 @@
 	WC_BUILD_INDUSTRY, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
 	_build_industry_widgets,
-	NULL,
 };
 
 class BuildIndustryWindow : public Window {
@@ -680,7 +679,6 @@
 	WC_INDUSTRY_VIEW, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_industry_view_widgets,
-	NULL
 };
 
 void ShowIndustryViewWindow(int industry)
@@ -968,7 +966,6 @@
 	WC_INDUSTRY_DIRECTORY, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_industry_directory_widgets,
-	NULL
 };
 
 void ShowIndustryDirectory()
--- a/src/intro_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/intro_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -133,7 +133,6 @@
 	WC_SELECT_GAME, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_select_game_widgets,
-	NULL
 };
 
 void ShowSelectGameWindow()
--- a/src/misc_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/misc_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -69,7 +69,6 @@
 	WC_LAND_INFO, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_land_info_widgets,
-	NULL
 };
 
 class LandInfoWindow : public Window {
@@ -219,7 +218,6 @@
 	WC_GAME_OPTIONS, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_about_widgets,
-	NULL
 };
 
 struct AboutWindow : public Window {
@@ -1074,7 +1072,6 @@
 	WC_QUERY_STRING, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_query_string_widgets,
-	NULL
 };
 
 /** Show a query popup window with a textbox in it.
@@ -1208,7 +1205,6 @@
 	WC_CONFIRM_POPUP_QUERY, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_DEF_WIDGET | WDF_MODAL,
 	_query_widgets,
-	NULL
 };
 
 /** Show a modal confirmation window with standard 'yes' and 'no' buttons
@@ -1589,7 +1585,6 @@
 	WC_SAVELOAD, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 	_load_dialog_widgets,
-	NULL,
 };
 
 static const WindowDesc _save_dialog_desc = {
@@ -1597,7 +1592,6 @@
 	WC_SAVELOAD, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 	_save_dialog_widgets,
-	NULL,
 };
 
 /** These values are used to convert the file/operations mode into a corresponding file type.
--- a/src/music_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/music_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -351,7 +351,6 @@
 	WC_MUSIC_TRACK_SELECTION, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_music_track_selection_widgets,
-	NULL
 };
 
 static void ShowMusicTrackSelection()
@@ -553,7 +552,6 @@
 	WC_MUSIC_WINDOW, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_music_window_widgets,
-	NULL
 };
 
 void ShowMusicWindow()
--- a/src/network/network_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/network/network_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -642,7 +642,6 @@
 	WC_NETWORK_WINDOW, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 	_network_game_window_widgets,
-	NULL,
 };
 
 void ShowNetworkGameWindow()
@@ -977,7 +976,6 @@
 	WC_NETWORK_WINDOW, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_network_start_server_window_widgets,
-	NULL,
 };
 
 static void ShowNetworkStartServerWindow()
@@ -1191,7 +1189,6 @@
 	WC_NETWORK_WINDOW, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_network_lobby_window_widgets,
-	NULL,
 };
 
 /* Show the networklobbywindow with the selected server
@@ -1237,12 +1234,11 @@
 {   WIDGETS_END},
 };
 
-static WindowDesc _client_list_desc = {
+static const WindowDesc _client_list_desc = {
 	WDP_AUTO, WDP_AUTO, 250, 1, 250, 1,
 	WC_CLIENT_LIST, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 	_client_list_widgets,
-	NULL
 };
 
 // Finds the Xth client-info that is active
@@ -1665,7 +1661,6 @@
 	WC_NETWORK_STATUS_WINDOW, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_MODAL,
 	_network_join_status_window_widget,
-	NULL,
 };
 
 void ShowJoinStatusWindow()
@@ -1909,7 +1904,6 @@
 	WC_SEND_NETWORK_MSG, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET,
 	_chat_window_widgets,
-	NULL
 };
 
 void ShowNetworkChatQueryWindow(DestType type, int dest)
@@ -2018,7 +2012,6 @@
 	WC_COMPANY_PASSWORD_WINDOW, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
 	_ncp_window_widgets,
-	NULL
 };
 
 void ShowNetworkCompanyPasswordWindow(Window *parent)
--- a/src/newgrf_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/newgrf_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -250,7 +250,6 @@
 	WC_SAVELOAD, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 	_newgrf_add_dlg_widgets,
-	NULL,
 };
 
 
@@ -552,7 +551,6 @@
 	WC_GAME_OPTIONS, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 	_newgrf_widgets,
-	NULL,
 };
 
 /** Callback function for the newgrf 'apply changes' confirmation window
--- a/src/news_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/news_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -445,7 +445,6 @@
 	WC_NEWS_WINDOW, WC_NONE,
 	WDF_DEF_WIDGET,
 	_news_type13_widgets,
-	NULL
 };
 
 static const Widget _news_type2_widgets[] = {
@@ -459,7 +458,6 @@
 	WC_NEWS_WINDOW, WC_NONE,
 	WDF_DEF_WIDGET,
 	_news_type2_widgets,
-	NULL
 };
 
 static const Widget _news_type0_widgets[] = {
@@ -475,7 +473,6 @@
 	WC_NEWS_WINDOW, WC_NONE,
 	WDF_DEF_WIDGET,
 	_news_type0_widgets,
-	NULL
 };
 
 
@@ -763,7 +760,6 @@
 	WC_MESSAGE_HISTORY, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_message_history_widgets,
-	NULL
 };
 
 /** Display window with news messages history */
@@ -971,7 +967,6 @@
 	WC_GAME_OPTIONS, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_message_options_widgets,
-	NULL
 };
 
 void ShowMessageOptions()
--- a/src/order_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/order_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -1063,7 +1063,6 @@
 	WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
 	_orders_train_widgets,
-	NULL
 };
 
 /**
@@ -1104,7 +1103,6 @@
 	WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
 	_orders_widgets,
-	NULL
 };
 
 /**
@@ -1145,7 +1143,6 @@
 	WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 	_other_orders_widgets,
-	NULL
 };
 
 void ShowOrdersWindow(const Vehicle *v)
--- a/src/osk_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/osk_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -283,12 +283,11 @@
 {   WIDGETS_END},
 };
 
-WindowDesc _osk_desc = {
+static const WindowDesc _osk_desc = {
 	WDP_CENTER, WDP_CENTER, 256, 140, 256, 140,
 	WC_OSK, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_osk_widgets,
-	NULL
 };
 
 /**
--- a/src/player_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/player_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -230,7 +230,6 @@
 	WC_FINANCES, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
 	_player_finances_widgets,
-	NULL
 };
 
 static const WindowDesc _player_finances_small_desc = {
@@ -238,7 +237,6 @@
 	WC_FINANCES, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
 	_player_finances_small_widgets,
-	NULL
 };
 
 /**
@@ -543,7 +541,6 @@
 	WC_PLAYER_COLOR, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_select_player_livery_widgets,
-	NULL
 };
 
 /**
@@ -1010,7 +1007,6 @@
 	WC_PLAYER_FACE, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_select_player_face_widgets,
-	NULL
 };
 
 /** advanced player face selection window description */
@@ -1019,7 +1015,6 @@
 	WC_PLAYER_FACE, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_select_player_face_adv_widgets,
-	NULL
 };
 
 /**
@@ -1348,7 +1343,6 @@
 	WC_COMPANY, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_player_company_widgets,
-	NULL
 };
 
 void ShowPlayerCompany(PlayerID player)
@@ -1407,7 +1401,6 @@
 	WC_BUY_COMPANY, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_buy_company_widgets,
-	NULL
 };
 
 
@@ -1578,7 +1571,6 @@
 	WC_HIGHSCORE, WC_NONE,
 	0,
 	_highscore_widgets,
-	NULL
 };
 
 static const WindowDesc _endgame_desc = {
@@ -1586,7 +1578,6 @@
 	WC_ENDSCREEN, WC_NONE,
 	0,
 	_highscore_widgets,
-	NULL
 };
 
 /** Show the highscore table for a given difficulty. When called from
--- a/src/rail_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/rail_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -801,7 +801,6 @@
 	WC_BUILD_TOOLBAR, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 	_build_rail_widgets,
-	NULL
 };
 
 
@@ -1323,7 +1322,6 @@
 	WC_BUILD_STATION, WC_BUILD_TOOLBAR,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_station_builder_widgets,
-	NULL
 };
 
 /** High level window description of the newGRF station-build window */
@@ -1332,7 +1330,6 @@
 	WC_BUILD_STATION, WC_BUILD_TOOLBAR,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_newstation_builder_widgets,
-	NULL
 };
 
 /** Open station build window */
@@ -1486,7 +1483,6 @@
 	WC_BUILD_SIGNAL, WC_BUILD_TOOLBAR,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_signal_builder_widgets,
-	NULL
 };
 
 /**
@@ -1561,7 +1557,6 @@
 	WC_BUILD_DEPOT, WC_BUILD_TOOLBAR,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_build_depot_widgets,
-	NULL
 };
 
 static void ShowBuildTrainDepotPicker()
@@ -1663,7 +1658,6 @@
 	WC_BUILD_DEPOT, WC_BUILD_TOOLBAR,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_build_waypoint_widgets,
-	NULL
 };
 
 static void ShowBuildWaypointPicker()
--- a/src/road_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/road_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -643,7 +643,6 @@
 	WC_BUILD_TOOLBAR, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 	_build_road_widgets,
-	NULL
 };
 
 /** Widget definition of the build tram toolbar */
@@ -672,7 +671,6 @@
 	WC_BUILD_TOOLBAR, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 	_build_tramway_widgets,
-	NULL
 };
 
 void ShowBuildRoadToolbar(RoadType roadtype)
@@ -709,7 +707,6 @@
 	WC_SCEN_BUILD_ROAD, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 	_build_road_scen_widgets,
-	NULL
 };
 
 void ShowBuildRoadScenToolbar()
@@ -789,7 +786,6 @@
 	WC_BUILD_DEPOT, WC_BUILD_TOOLBAR,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_build_road_depot_widgets,
-	NULL
 };
 
 static void ShowRoadDepotPicker()
@@ -932,7 +928,6 @@
 	WC_BUS_STATION, WC_BUILD_TOOLBAR,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_rv_station_picker_widgets,
-	NULL
 };
 
 static void ShowRVStationPicker(RoadStopType rs)
--- a/src/settings_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/settings_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -349,7 +349,6 @@
 	WC_GAME_OPTIONS, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_game_options_widgets,
-	NULL
 };
 
 
@@ -468,7 +467,6 @@
 	WC_GAME_OPTIONS, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_game_difficulty_widgets,
-	NULL
 };
 
 struct GameDifficultyWindow : public Window {
@@ -1064,7 +1062,6 @@
 	WC_GAME_OPTIONS, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_patches_selection_widgets,
-	NULL,
 };
 
 void ShowPatchesSelection()
@@ -1295,7 +1292,6 @@
 	WC_CUSTOM_CURRENCY, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_cust_currency_widgets,
-	NULL,
 };
 
 static void ShowCustCurrency()
--- a/src/signs_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/signs_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -139,7 +139,6 @@
 	WC_SIGN_LIST, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_sign_list_widget,
-	NULL
 };
 
 
@@ -300,7 +299,6 @@
 	WC_QUERY_STRING, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_query_sign_edit_widgets,
-	NULL
 };
 
 void ShowRenameSignWindow(const Sign *si)
--- a/src/smallmap_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/smallmap_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -1078,7 +1078,6 @@
 	WC_SMALLMAP, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_smallmap_widgets,
-	NULL
 };
 
 void ShowSmallMap()
@@ -1224,7 +1223,6 @@
 	WC_EXTRA_VIEW_PORT, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_extra_view_port_widgets,
-	NULL
 };
 
 void ShowExtraViewPortWindow(TileIndex tile)
--- a/src/station_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/station_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -615,7 +615,6 @@
 	WC_STATION_LIST, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_player_stations_widgets,
-	NULL
 };
 
 /**
@@ -987,7 +986,6 @@
 	WC_STATION_VIEW, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_station_view_widgets,
-	NULL
 };
 
 /**
--- a/src/statusbar_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/statusbar_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -168,7 +168,6 @@
 	WC_STATUS_BAR, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_main_status_widgets,
-	NULL
 };
 
 /**
--- a/src/subsidy_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/subsidy_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -179,7 +179,6 @@
 	WC_SUBSIDIES_LIST, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_subsidies_list_widgets,
-	NULL
 };
 
 
--- a/src/terraform_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/terraform_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -313,7 +313,6 @@
 	WC_SCEN_LAND_GEN, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 	_terraform_widgets,
-	NULL
 };
 
 void ShowTerraformToolbar(Window *link)
@@ -692,7 +691,6 @@
 	WC_SCEN_LAND_GEN, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 	_scen_edit_land_gen_widgets,
-	NULL,
 };
 
 void ShowEditorTerraformToolbar()
--- a/src/timetable_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/timetable_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -298,7 +298,6 @@
 	WC_VEHICLE_TIMETABLE, WC_VEHICLE_VIEW,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_timetable_widgets,
-	NULL
 };
 
 void ShowTimetableWindow(const Vehicle *v)
--- a/src/toolbar_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/toolbar_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -858,7 +858,6 @@
 	WC_MAIN_TOOLBAR, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET,
 	_toolb_normal_widgets,
-	NULL
 };
 
 
@@ -1107,7 +1106,6 @@
 	WC_MAIN_TOOLBAR, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_toolb_scen_widgets,
-	NULL
 };
 
 /* --- Rendering/handling the drop down menus --- */
--- a/src/town_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/town_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -264,7 +264,6 @@
 	WC_TOWN_AUTHORITY, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_town_authority_widgets,
-	NULL
 };
 
 static void ShowTownAuthorityWindow(uint town)
@@ -397,7 +396,6 @@
 	WC_TOWN_VIEW, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
 	_town_view_widgets,
-	NULL
 };
 
 void ShowTownViewWindow(TownID town)
@@ -583,7 +581,6 @@
 	WC_TOWN_DIRECTORY, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_town_directory_widgets,
-	NULL
 };
 
 void ShowTownDirectory()
@@ -710,7 +707,6 @@
 	WC_SCEN_TOWN_GEN, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 	_scen_edit_town_gen_widgets,
-	NULL,
 };
 
 void ShowBuildTownWindow()
--- a/src/transparency_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/transparency_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -125,7 +125,6 @@
 	WC_TRANSPARENCY_TOOLBAR, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 	_transparency_widgets,
-	NULL
 };
 
 void ShowTransparencyToolbar(void)
--- a/src/tree_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/tree_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -175,7 +175,6 @@
 	WC_BUILD_TREES, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 	_build_trees_widgets,
-	NULL
 };
 
 void ShowBuildTreesToolbar()
--- a/src/vehicle_gui.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/vehicle_gui.cpp	Mon May 19 09:48:47 2008 +0000
@@ -432,7 +432,6 @@
 	WC_VEHICLE_REFIT, WC_VEHICLE_VIEW,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 	_vehicle_refit_widgets,
-	NULL
 };
 
 /** Show the refit window for a vehicle
@@ -1158,7 +1157,6 @@
 	WC_TRAINS_LIST, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_vehicle_list_widgets,
-	NULL
 };
 
 static const WindowDesc _player_vehicle_list_road_veh_desc = {
@@ -1166,7 +1164,6 @@
 	WC_ROADVEH_LIST, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_vehicle_list_widgets,
-	NULL
 };
 
 static const WindowDesc _player_vehicle_list_ship_desc = {
@@ -1174,7 +1171,6 @@
 	WC_SHIPS_LIST, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_vehicle_list_widgets,
-	NULL
 };
 
 static const WindowDesc _player_vehicle_list_aircraft_desc = {
@@ -1182,7 +1178,6 @@
 	WC_AIRCRAFT_LIST, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_vehicle_list_widgets,
-	NULL
 };
 
 static void ShowVehicleListWindowLocal(PlayerID player, uint16 VLW_flag, VehicleType vehicle_type, uint16 unique_number)
@@ -1613,7 +1608,6 @@
 	WC_VEHICLE_DETAILS, WC_VEHICLE_VIEW,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 	_vehicle_details_widgets,
-	NULL
 };
 
 /** Shows the vehicle details window of the given vehicle. */
@@ -1655,7 +1649,6 @@
 	WC_VEHICLE_VIEW, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_vehicle_view_widgets,
-	NULL
 };
 
 /** Vehicle view window descriptor for trains. Only minimum_height and
@@ -1666,7 +1659,6 @@
 	WC_VEHICLE_VIEW, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 	_vehicle_view_widgets,
-	NULL
 };
 
 
--- a/src/window.cpp	Mon May 19 09:45:24 2008 +0000
+++ b/src/window.cpp	Mon May 19 09:48:47 2008 +0000
@@ -48,169 +48,6 @@
 byte _special_mouse_mode;
 
 
-/**
- * Call the window event handler for handling event \a e.
- * This is a temporary helper functions that will be removed
- * once all windows that still rely on WindowEvent and
- * WindowEventCodes have been rewritten to use the 'OnXXX'
- * event handlers.
- * @param e Window event to handle
- */
-void Window::HandleWindowEvent(WindowEvent *e)
-{
-	if (wndproc != NULL) wndproc(this, e);
-}
-
-void Window::OnPaint()
-{
-	WindowEvent e;
-	e.event = WE_PAINT;
-	this->HandleWindowEvent(&e);
-}
-
-Window::EventState Window::OnKeyPress(uint16 key, uint16 keycode)
-{
-	WindowEvent e;
-	e.event = WE_KEYPRESS;
-	e.we.keypress.key     = key;
-	e.we.keypress.keycode = keycode;
-	e.we.keypress.cont    = true;
-	this->HandleWindowEvent(&e);
-
-	return e.we.keypress.cont ? ES_NOT_HANDLED : ES_HANDLED;
-}
-
-Window::EventState Window::OnCTRLStateChange()
-{
-	WindowEvent e;
-	e.event = WE_CTRL_CHANGED;
-	e.we.ctrl.cont = true;
-	this->HandleWindowEvent(&e);
-
-	return e.we.ctrl.cont ? ES_NOT_HANDLED : ES_HANDLED;
-}
-
-void Window::OnClick(Point pt, int widget)
-{
-	WindowEvent e;
-	e.event = WE_CLICK;
-	e.we.click.pt     = pt;
-	e.we.click.widget = widget;
-	this->HandleWindowEvent(&e);
-}
-
-void Window::OnMouseLoop()
-{
-	WindowEvent e;
-	e.event = WE_MOUSELOOP;
-	this->HandleWindowEvent(&e);
-}
-
-void Window::OnTick()
-{
-	WindowEvent e;
-	e.event = WE_TICK;
-	this->HandleWindowEvent(&e);
-}
-
-void Window::OnHundredthTick()
-{
-	WindowEvent e;
-	e.event = WE_100_TICKS;
-	this->HandleWindowEvent(&e);
-}
-
-void Window::OnTimeout()
-{
-	WindowEvent e;
-	e.event = WE_TIMEOUT;
-	this->HandleWindowEvent(&e);
-}
-
-void Window::OnResize(Point new_size, Point delta)
-{
-	WindowEvent e;
-	e.event = WE_RESIZE;
-	e.we.sizing.size = new_size;
-	e.we.sizing.diff = delta;
-	this->HandleWindowEvent(&e);
-}
-
-void Window::OnDropdownSelect(int widget, int index)
-{
-	WindowEvent e;
-	e.event = WE_DROPDOWN_SELECT;
-	e.we.dropdown.button = widget;
-	e.we.dropdown.index  = index;
-	this->HandleWindowEvent(&e);
-}
-
-void Window::OnQueryTextFinished(char *str)
-{
-	WindowEvent e;
-	e.event = WE_ON_EDIT_TEXT;
-	e.we.edittext.str = str;
-	this->HandleWindowEvent(&e);
-}
-
-void Window::OnInvalidateData(int data)
-{
-	WindowEvent e;
-	e.event = WE_INVALIDATE_DATA;
-	e.we.invalidate.data = data;
-	this->HandleWindowEvent(&e);
-}
-
-void Window::OnPlaceObject(Point pt, TileIndex tile)
-{
-	WindowEvent e;
-	e.event = WE_PLACE_OBJ;
-	e.we.place.pt   = pt;
-	e.we.place.tile = tile;
-	this->HandleWindowEvent(&e);
-}
-
-void Window::OnPlaceObjectAbort()
-{
-	WindowEvent e;
-	e.event = WE_ABORT_PLACE_OBJ;
-	this->HandleWindowEvent(&e);
-}
-
-
-void Window::OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt)
-{
-	WindowEvent e;
-	e.event = WE_PLACE_DRAG;
-	e.we.place.select_method = select_method;
-	e.we.place.select_proc   = select_proc;
-	e.we.place.pt            = pt;
-	this->HandleWindowEvent(&e);
-}
-
-void Window::OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile)
-{
-	WindowEvent e;
-	e.event = WE_PLACE_MOUSEUP;
-	e.we.place.select_method = select_method;
-	e.we.place.select_proc   = select_proc;
-	e.we.place.pt            = pt;
-	e.we.place.tile          = end_tile;
-	e.we.place.starttile     = start_tile;
-	this->HandleWindowEvent(&e);
-}
-
-void Window::OnPlacePresize(Point pt, TileIndex tile)
-{
-	WindowEvent e;
-	e.event = WE_PLACE_PRESIZE;
-	e.we.place.pt   = pt;
-	e.we.place.tile = tile;
-	this->HandleWindowEvent(&e);
-}
-
-
-
 void CDECL Window::SetWidgetsDisabledState(bool disab_stat, int widgets, ...)
 {
 	va_list wdg_list;
@@ -581,9 +418,6 @@
 		child = FindChildWindow(this);
 	}
 
-	WindowEvent e;
-	e.event = WE_DESTROY;
-	this->HandleWindowEvent(&e);
 	if (this->viewport != NULL) DeleteWindowViewport(this);
 
 	this->SetDirty();
@@ -831,14 +665,13 @@
  * @param y offset in pixels from the top of the screen
  * @param min_width minimum width in pixels of the window
  * @param min_height minimum height in pixels of the window
- * @param *proc see WindowProc function to call when any messages/updates happen to the window
  * @param cls see WindowClass class of the window, used for identification and grouping
  * @param *widget see Widget pointer to the window layout and various elements
  * @param window_number number being assigned to the new window
  * @return Window pointer of the newly created window
  */
 void Window::Initialize(int x, int y, int min_width, int min_height,
-				WindowProc *proc, WindowClass cls, const Widget *widget, int window_number)
+				WindowClass cls, const Widget *widget, int window_number)
 {
 	/* We have run out of windows, close one and use that as the place for our new one */
 	if (_last_z_window == endof(_z_windows)) {
@@ -855,7 +688,6 @@
 	this->top = y;
 	this->width = min_width;
 	this->height = min_height;
-	this->wndproc = proc;
 	AssignWidgetToWindow(this, widget);
 	this->resize.width = min_width;
 	this->resize.height = min_height;
@@ -884,10 +716,6 @@
 
 	*wz = this;
 	_last_z_window++;
-
-	WindowEvent e;
-	e.event = WE_CREATE;
-	this->HandleWindowEvent(&e);
 }
 
 /**
@@ -969,7 +797,7 @@
  */
 Window::Window(int x, int y, int width, int height, WindowClass cls, const Widget *widget)
 {
-	this->Initialize(x, y, width, height, NULL, cls, widget, 0);
+	this->Initialize(x, y, width, height, cls, widget, 0);
 }
 
 
@@ -1161,10 +989,8 @@
 Window::Window(const WindowDesc *desc, WindowNumber window_number)
 {
 	Point pt = LocalGetWindowPlacement(desc, window_number);
-	this->Initialize(pt.x, pt.y, desc->minimum_width, desc->minimum_height, desc->proc, desc->cls, desc->widgets, window_number);
+	this->Initialize(pt.x, pt.y, desc->minimum_width, desc->minimum_height, desc->cls, desc->widgets, window_number);
 	this->desc_flags = desc->flags;
-
-	if (desc->proc != NULL) this->FindWindowPlacementAndResize(desc->default_width, desc->default_height);
 }
 
 /** Do a search for a window at specific coordinates. For this we start
--- a/src/window_gui.h	Mon May 19 09:45:24 2008 +0000
+++ b/src/window_gui.h	Mon May 19 09:48:47 2008 +0000
@@ -104,88 +104,6 @@
 void DrawFrameRect(int left, int top, int right, int bottom, int color, FrameFlags flags);
 
 /**
- * Available window events
- */
-enum WindowEventCodes {
-	WE_CREATE,       ///< Initialize the Window
-	WE_DESTROY,      ///< Prepare for deletion of the window
-	WE_PAINT,        ///< Repaint the window contents
-	WE_KEYPRESS,     ///< Key pressed
-	WE_CLICK,        ///< Left mouse button click
-	WE_MOUSELOOP,    ///< Event for each mouse event in the game (at least once every game tick)
-	WE_TICK,         ///< Regularly occurring event (every game tick)
-	WE_100_TICKS,    ///< Regularly occurring event (every 100 game ticks, approximatelly 3 seconds)
-	WE_TIMEOUT,
-	WE_PLACE_OBJ,
-	WE_ABORT_PLACE_OBJ,
-	WE_ON_EDIT_TEXT,
-	WE_PLACE_DRAG,
-	WE_PLACE_MOUSEUP,
-	WE_PLACE_PRESIZE,
-	WE_DROPDOWN_SELECT,
-	WE_RESIZE,          ///< Request to resize the window, @see WindowEvent.we.resize
-	WE_INVALIDATE_DATA, ///< Notification that data displayed by the window is obsolete
-	WE_CTRL_CHANGED,    ///< CTRL key has changed state
-};
-
-/**
- * Data structures for additional data associated with a window event
- * @see WindowEventCodes
- */
-struct WindowEvent {
-	byte event;
-	union {
-		struct {
-			Point pt;
-			int widget;
-		} click;
-
-		struct {
-			Point pt;
-			TileIndex tile;
-			TileIndex starttile;
-			ViewportPlaceMethod select_method;
-			ViewportDragDropSelectionProcess select_proc;
-		} place;
-
-		struct {
-			Point pt;
-			int widget;
-		} dragdrop;
-
-		struct {
-			Point size;
-			Point diff;
-		} sizing;
-
-		struct {
-			char *str;
-		} edittext;
-
-		struct {
-			int button;
-			int index;
-		} dropdown;
-
-		struct {
-			bool cont;      ///< continue the search? (default true)
-			uint16 key;     ///< 16-bit Unicode value of the key
-			uint16 keycode; ///< untranslated key (including shift-state)
-		} keypress;
-
-		struct {
-			int data;
-		} invalidate;
-
-		struct {
-			bool cont;     ///< continue the search? (default true)
-		} ctrl;
-	} we;
-};
-
-typedef void WindowProc(Window *w, WindowEvent *e);
-
-/**
  * High level window description
  */
 struct WindowDesc {
@@ -199,7 +117,6 @@
 	WindowClass parent_cls; ///< Class of the parent window, @see WindowClass
 	uint32 flags;           ///< Flags, @see WindowDefaultFlags
 	const Widget *widgets;  ///< List of widgets with their position and size for the window
-	WindowProc *proc;       ///< Window event handler function for the window
 };
 
 /**
@@ -271,13 +188,9 @@
 		ES_NOT_HANDLED,
 	};
 
-private:
-	WindowProc *wndproc;   ///< Event handler function for the window. Do not use directly, call HandleWindowEvent() instead.
-	void HandleWindowEvent(WindowEvent *e);
-
 protected:
 	void Initialize(int x, int y, int min_width, int min_height,
-			WindowProc *proc, WindowClass cls, const Widget *widget, int window_number);
+			WindowClass cls, const Widget *widget, int window_number);
 	void FindWindowPlacementAndResize(int def_width, int def_height);
 	void FindWindowPlacementAndResize(const WindowDesc *desc);
 
@@ -343,7 +256,7 @@
 	/**
 	 * This window is currently being repainted.
 	 */
-	virtual void OnPaint();
+	virtual void OnPaint() {}
 
 
 	/**
@@ -353,14 +266,14 @@
 	 * @return ES_HANDLED if the key press has been handled and no other
 	 *         window should receive the event.
 	 */
-	virtual EventState OnKeyPress(uint16 key, uint16 keycode);
+	virtual EventState OnKeyPress(uint16 key, uint16 keycode) { return ES_NOT_HANDLED; }
 
 	/**
 	 * The state of the control key has changed
 	 * @return ES_HANDLED if the change has been handled and no other
 	 *         window should receive the event.
 	 */
-	virtual EventState OnCTRLStateChange();
+	virtual EventState OnCTRLStateChange() { return ES_NOT_HANDLED; }
 
 
 	/**
@@ -368,7 +281,7 @@
 	 * @param pt     the point inside the window that has been clicked.
 	 * @param widget the clicked widget.
 	 */
-	virtual void OnClick(Point pt, int widget);
+	virtual void OnClick(Point pt, int widget) {}
 
 	/**
 	 * A double click with the left mouse button has been made on the window.
@@ -415,22 +328,22 @@
 	/**
 	 * Called for every mouse loop run, which is at least once per (game) tick.
 	 */
-	virtual void OnMouseLoop();
+	virtual void OnMouseLoop() {}
 
 	/**
 	 * Called once per (game) tick.
 	 */
-	virtual void OnTick();
+	virtual void OnTick() {}
 
 	/**
 	 * Called once every 100 (game) ticks.
 	 */
-	virtual void OnHundredthTick();
+	virtual void OnHundredthTick() {}
 
 	/**
 	 * Called when this window's timeout has been reached.
 	 */
-	virtual void OnTimeout();
+	virtual void OnTimeout() {}
 
 
 	/**
@@ -438,27 +351,27 @@
 	 * @param new_size the new size of the window.
 	 * @param delta    the amount of which the window size changed.
 	 */
-	virtual void OnResize(Point new_size, Point delta);
+	virtual void OnResize(Point new_size, Point delta) {}
 
 	/**
 	 * A dropdown option associated to this window has been selected.
 	 * @param widget the widget (button) that the dropdown is associated with.
 	 * @param index  the element in the dropdown that is selected.
 	 */
-	virtual void OnDropdownSelect(int widget, int index);
+	virtual void OnDropdownSelect(int widget, int index) {}
 
 	/**
 	 * The query window opened from this window has closed.
 	 * @param str the new value of the string or NULL if the window
 	 *            was cancelled.
 	 */
-	virtual void OnQueryTextFinished(char *str);
+	virtual void OnQueryTextFinished(char *str) {}
 
 	/**
 	 * Some data on this window has become invalid.
 	 * @param data information about the changed data.
 	 */
-	virtual void OnInvalidateData(int data = 0);
+	virtual void OnInvalidateData(int data = 0) {}
 
 
 	/**
@@ -467,12 +380,12 @@
 	 * @param pt   the exact point on the map that has been clicked.
 	 * @param tile the tile on the map that has been clicked.
 	 */
-	virtual void OnPlaceObject(Point pt, TileIndex tile);
+	virtual void OnPlaceObject(Point pt, TileIndex tile) {}
 
 	/**
 	 * The user cancelled a tile highlight mode that has been set.
 	 */
-	virtual void OnPlaceObjectAbort();
+	virtual void OnPlaceObjectAbort() {}
 
 
 	/**
@@ -482,7 +395,7 @@
 	 * @param select_proc   what will be created when the drag is over.
 	 * @param pt            the exact point on the map where the mouse is.
 	 */
-	virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt);
+	virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) {}
 
 	/**
 	 * The user has dragged over the map when the tile highlight mode
@@ -493,7 +406,7 @@
 	 * @param start_tile    the begin tile of the drag.
 	 * @param end_tile      the end tile of the drag.
 	 */
-	virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile);
+	virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) {}
 
 	/**
 	 * The user moves over the map when a tile highlight mode has been set
@@ -502,7 +415,7 @@
 	 * @param pt   the exact point on the map where the mouse is.
 	 * @param tile the tile on the map where the mouse is.
 	 */
-	virtual void OnPlacePresize(Point pt, TileIndex tile);
+	virtual void OnPlacePresize(Point pt, TileIndex tile) {}
 
 	/*** End of the event handling ***/
 };