src/graph_gui.cpp
branchcpp_gui
changeset 6258 a2f86b8fd99b
parent 6251 cd413fa2e252
child 6268 4b5241e5dd10
equal deleted inserted replaced
6257:2ffe947969ca 6258:a2f86b8fd99b
   241 
   241 
   242 /****************/
   242 /****************/
   243 /* GRAPH LEGEND */
   243 /* GRAPH LEGEND */
   244 /****************/
   244 /****************/
   245 
   245 
   246 static void GraphLegendWndProc(Window *w, WindowEvent *e)
   246 static void GraphLegendWndProc(BaseWindow *w, WindowEvent *e)
   247 {
   247 {
   248 	const Player* p;
   248 	const Player* p;
   249 
   249 
   250 	switch (e->event) {
   250 	switch (e->event) {
   251 	case WE_CREATE: {
   251 	case WE_CREATE: {
   290 		}
   290 		}
   291 		break;
   291 		break;
   292 	}
   292 	}
   293 }
   293 }
   294 
   294 
   295 static const Widget _graph_legend_widgets[] = {
   295 static const OldWidget _graph_legend_widgets[] = {
   296 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,                       STR_018B_CLOSE_WINDOW},
   296 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,                       STR_018B_CLOSE_WINDOW},
   297 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   249,     0,    13, STR_704E_KEY_TO_COMPANY_GRAPHS, STR_018C_WINDOW_TITLE_DRAG_THIS},
   297 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   249,     0,    13, STR_704E_KEY_TO_COMPANY_GRAPHS, STR_018C_WINDOW_TITLE_DRAG_THIS},
   298 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   249,    14,   113, 0x0,                            STR_NULL},
   298 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   249,    14,   113, 0x0,                            STR_NULL},
   299 {      WWT_PANEL,   RESIZE_NONE,    14,     2,   247,    16,    27, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
   299 {      WWT_PANEL,   RESIZE_NONE,    14,     2,   247,    16,    27, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
   300 {      WWT_PANEL,   RESIZE_NONE,    14,     2,   247,    28,    39, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
   300 {      WWT_PANEL,   RESIZE_NONE,    14,     2,   247,    28,    39, 0x0,                            STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
   315 	GraphLegendWndProc
   315 	GraphLegendWndProc
   316 };
   316 };
   317 
   317 
   318 static void ShowGraphLegend(void)
   318 static void ShowGraphLegend(void)
   319 {
   319 {
   320 	AllocateWindowDescFront(&_graph_legend_desc, 0);
   320 	BaseWindow::AllocateFront(&_graph_legend_desc, 0);
   321 }
   321 }
   322 
   322 
   323 /********************/
   323 /********************/
   324 /* OPERATING PROFIT */
   324 /* OPERATING PROFIT */
   325 /********************/
   325 /********************/
   353 
   353 
   354 	gd->year = yr;
   354 	gd->year = yr;
   355 	gd->month = mo;
   355 	gd->month = mo;
   356 }
   356 }
   357 
   357 
   358 static void OperatingProfitWndProc(Window *w, WindowEvent *e)
   358 static void OperatingProfitWndProc(BaseWindow *w, WindowEvent *e)
   359 {
   359 {
   360 	switch (e->event) {
   360 	switch (e->event) {
   361 	case WE_PAINT: {
   361 	case WE_PAINT: {
   362 		GraphDrawer gd;
   362 		GraphDrawer gd;
   363 		const Player* p;
   363 		const Player* p;
   395 			ShowGraphLegend();
   395 			ShowGraphLegend();
   396 		break;
   396 		break;
   397 	}
   397 	}
   398 }
   398 }
   399 
   399 
   400 static const Widget _operating_profit_widgets[] = {
   400 static const OldWidget _operating_profit_widgets[] = {
   401 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,                        STR_018B_CLOSE_WINDOW},
   401 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,                        STR_018B_CLOSE_WINDOW},
   402 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   525,     0,    13, STR_7025_OPERATING_PROFIT_GRAPH, STR_018C_WINDOW_TITLE_DRAG_THIS},
   402 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   525,     0,    13, STR_7025_OPERATING_PROFIT_GRAPH, STR_018C_WINDOW_TITLE_DRAG_THIS},
   403 { WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   526,   575,     0,    13, STR_704C_KEY,                    STR_704D_SHOW_KEY_TO_GRAPHS},
   403 { WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   526,   575,     0,    13, STR_704C_KEY,                    STR_704D_SHOW_KEY_TO_GRAPHS},
   404 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   575,    14,   173, 0x0,                             STR_NULL},
   404 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   575,    14,   173, 0x0,                             STR_NULL},
   405 {   WIDGETS_END},
   405 {   WIDGETS_END},
   414 };
   414 };
   415 
   415 
   416 
   416 
   417 void ShowOperatingProfitGraph(void)
   417 void ShowOperatingProfitGraph(void)
   418 {
   418 {
   419 	if (AllocateWindowDescFront(&_operating_profit_desc, 0)) {
   419 	if (BaseWindow::AllocateFront(&_operating_profit_desc, 0)) {
   420 		InvalidateWindow(WC_GRAPH_LEGEND, 0);
   420 		InvalidateWindow(WC_GRAPH_LEGEND, 0);
   421 	}
   421 	}
   422 }
   422 }
   423 
   423 
   424 
   424 
   425 /****************/
   425 /****************/
   426 /* INCOME GRAPH */
   426 /* INCOME GRAPH */
   427 /****************/
   427 /****************/
   428 
   428 
   429 static void IncomeGraphWndProc(Window *w, WindowEvent *e)
   429 static void IncomeGraphWndProc(BaseWindow *w, WindowEvent *e)
   430 {
   430 {
   431 	switch (e->event) {
   431 	switch (e->event) {
   432 	case WE_PAINT: {
   432 	case WE_PAINT: {
   433 		GraphDrawer gd;
   433 		GraphDrawer gd;
   434 		const Player* p;
   434 		const Player* p;
   467 			ShowGraphLegend();
   467 			ShowGraphLegend();
   468 		break;
   468 		break;
   469 	}
   469 	}
   470 }
   470 }
   471 
   471 
   472 static const Widget _income_graph_widgets[] = {
   472 static const OldWidget _income_graph_widgets[] = {
   473 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,              STR_018B_CLOSE_WINDOW},
   473 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,              STR_018B_CLOSE_WINDOW},
   474 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   525,     0,    13, STR_7022_INCOME_GRAPH, STR_018C_WINDOW_TITLE_DRAG_THIS},
   474 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   525,     0,    13, STR_7022_INCOME_GRAPH, STR_018C_WINDOW_TITLE_DRAG_THIS},
   475 { WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   526,   575,     0,    13, STR_704C_KEY,          STR_704D_SHOW_KEY_TO_GRAPHS},
   475 { WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   526,   575,     0,    13, STR_704C_KEY,          STR_704D_SHOW_KEY_TO_GRAPHS},
   476 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   575,    14,   141, 0x0,                   STR_NULL},
   476 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   575,    14,   141, 0x0,                   STR_NULL},
   477 {   WIDGETS_END},
   477 {   WIDGETS_END},
   485 	IncomeGraphWndProc
   485 	IncomeGraphWndProc
   486 };
   486 };
   487 
   487 
   488 void ShowIncomeGraph(void)
   488 void ShowIncomeGraph(void)
   489 {
   489 {
   490 	if (AllocateWindowDescFront(&_income_graph_desc, 0)) {
   490 	if (BaseWindow::AllocateFront(&_income_graph_desc, 0)) {
   491 		InvalidateWindow(WC_GRAPH_LEGEND, 0);
   491 		InvalidateWindow(WC_GRAPH_LEGEND, 0);
   492 	}
   492 	}
   493 }
   493 }
   494 
   494 
   495 /*******************/
   495 /*******************/
   496 /* DELIVERED CARGO */
   496 /* DELIVERED CARGO */
   497 /*******************/
   497 /*******************/
   498 
   498 
   499 static void DeliveredCargoGraphWndProc(Window *w, WindowEvent *e)
   499 static void DeliveredCargoGraphWndProc(BaseWindow *w, WindowEvent *e)
   500 {
   500 {
   501 	switch (e->event) {
   501 	switch (e->event) {
   502 	case WE_PAINT: {
   502 	case WE_PAINT: {
   503 		GraphDrawer gd;
   503 		GraphDrawer gd;
   504 		const Player* p;
   504 		const Player* p;
   537 			ShowGraphLegend();
   537 			ShowGraphLegend();
   538 		break;
   538 		break;
   539 	}
   539 	}
   540 }
   540 }
   541 
   541 
   542 static const Widget _delivered_cargo_graph_widgets[] = {
   542 static const OldWidget _delivered_cargo_graph_widgets[] = {
   543 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,                          STR_018B_CLOSE_WINDOW},
   543 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,                          STR_018B_CLOSE_WINDOW},
   544 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   525,     0,    13, STR_7050_UNITS_OF_CARGO_DELIVERED, STR_018C_WINDOW_TITLE_DRAG_THIS},
   544 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   525,     0,    13, STR_7050_UNITS_OF_CARGO_DELIVERED, STR_018C_WINDOW_TITLE_DRAG_THIS},
   545 { WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   526,   575,     0,    13, STR_704C_KEY,                      STR_704D_SHOW_KEY_TO_GRAPHS},
   545 { WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   526,   575,     0,    13, STR_704C_KEY,                      STR_704D_SHOW_KEY_TO_GRAPHS},
   546 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   575,    14,   141, 0x0,                               STR_NULL},
   546 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   575,    14,   141, 0x0,                               STR_NULL},
   547 {   WIDGETS_END},
   547 {   WIDGETS_END},
   555 	DeliveredCargoGraphWndProc
   555 	DeliveredCargoGraphWndProc
   556 };
   556 };
   557 
   557 
   558 void ShowDeliveredCargoGraph(void)
   558 void ShowDeliveredCargoGraph(void)
   559 {
   559 {
   560 	if (AllocateWindowDescFront(&_delivered_cargo_graph_desc, 0)) {
   560 	if (BaseWindow::AllocateFront(&_delivered_cargo_graph_desc, 0)) {
   561 		InvalidateWindow(WC_GRAPH_LEGEND, 0);
   561 		InvalidateWindow(WC_GRAPH_LEGEND, 0);
   562 	}
   562 	}
   563 }
   563 }
   564 
   564 
   565 /***********************/
   565 /***********************/
   566 /* PERFORMANCE HISTORY */
   566 /* PERFORMANCE HISTORY */
   567 /***********************/
   567 /***********************/
   568 
   568 
   569 static void PerformanceHistoryWndProc(Window *w, WindowEvent *e)
   569 static void PerformanceHistoryWndProc(BaseWindow *w, WindowEvent *e)
   570 {
   570 {
   571 	switch (e->event) {
   571 	switch (e->event) {
   572 	case WE_PAINT: {
   572 	case WE_PAINT: {
   573 		GraphDrawer gd;
   573 		GraphDrawer gd;
   574 		const Player* p;
   574 		const Player* p;
   609 			ShowPerformanceRatingDetail();
   609 			ShowPerformanceRatingDetail();
   610 		break;
   610 		break;
   611 	}
   611 	}
   612 }
   612 }
   613 
   613 
   614 static const Widget _performance_history_widgets[] = {
   614 static const OldWidget _performance_history_widgets[] = {
   615 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,                             STR_018B_CLOSE_WINDOW},
   615 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,                             STR_018B_CLOSE_WINDOW},
   616 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   475,     0,    13, STR_7051_COMPANY_PERFORMANCE_RATINGS, STR_018C_WINDOW_TITLE_DRAG_THIS},
   616 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   475,     0,    13, STR_7051_COMPANY_PERFORMANCE_RATINGS, STR_018C_WINDOW_TITLE_DRAG_THIS},
   617 { WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   526,   575,     0,    13, STR_704C_KEY,                         STR_704D_SHOW_KEY_TO_GRAPHS},
   617 { WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   526,   575,     0,    13, STR_704C_KEY,                         STR_704D_SHOW_KEY_TO_GRAPHS},
   618 { WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   476,   525,     0,    13, STR_PERFORMANCE_DETAIL_KEY,           STR_704D_SHOW_KEY_TO_GRAPHS},
   618 { WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   476,   525,     0,    13, STR_PERFORMANCE_DETAIL_KEY,           STR_704D_SHOW_KEY_TO_GRAPHS},
   619 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   575,    14,   237, 0x0,                                  STR_NULL},
   619 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   575,    14,   237, 0x0,                                  STR_NULL},
   628 	PerformanceHistoryWndProc
   628 	PerformanceHistoryWndProc
   629 };
   629 };
   630 
   630 
   631 void ShowPerformanceHistoryGraph(void)
   631 void ShowPerformanceHistoryGraph(void)
   632 {
   632 {
   633 	if (AllocateWindowDescFront(&_performance_history_desc, 0)) {
   633 	if (BaseWindow::AllocateFront(&_performance_history_desc, 0)) {
   634 		InvalidateWindow(WC_GRAPH_LEGEND, 0);
   634 		InvalidateWindow(WC_GRAPH_LEGEND, 0);
   635 	}
   635 	}
   636 }
   636 }
   637 
   637 
   638 /*****************/
   638 /*****************/
   639 /* COMPANY VALUE */
   639 /* COMPANY VALUE */
   640 /*****************/
   640 /*****************/
   641 
   641 
   642 static void CompanyValueGraphWndProc(Window *w, WindowEvent *e)
   642 static void CompanyValueGraphWndProc(BaseWindow *w, WindowEvent *e)
   643 {
   643 {
   644 	switch (e->event) {
   644 	switch (e->event) {
   645 	case WE_PAINT: {
   645 	case WE_PAINT: {
   646 		GraphDrawer gd;
   646 		GraphDrawer gd;
   647 		const Player* p;
   647 		const Player* p;
   680 			ShowGraphLegend();
   680 			ShowGraphLegend();
   681 		break;
   681 		break;
   682 	}
   682 	}
   683 }
   683 }
   684 
   684 
   685 static const Widget _company_value_graph_widgets[] = {
   685 static const OldWidget _company_value_graph_widgets[] = {
   686 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,                STR_018B_CLOSE_WINDOW},
   686 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,                STR_018B_CLOSE_WINDOW},
   687 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   525,     0,    13, STR_7052_COMPANY_VALUES, STR_018C_WINDOW_TITLE_DRAG_THIS},
   687 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   525,     0,    13, STR_7052_COMPANY_VALUES, STR_018C_WINDOW_TITLE_DRAG_THIS},
   688 { WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   526,   575,     0,    13, STR_704C_KEY,            STR_704D_SHOW_KEY_TO_GRAPHS},
   688 { WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   526,   575,     0,    13, STR_704C_KEY,            STR_704D_SHOW_KEY_TO_GRAPHS},
   689 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   575,    14,   237, 0x0,                     STR_NULL},
   689 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   575,    14,   237, 0x0,                     STR_NULL},
   690 {   WIDGETS_END},
   690 {   WIDGETS_END},
   698 	CompanyValueGraphWndProc
   698 	CompanyValueGraphWndProc
   699 };
   699 };
   700 
   700 
   701 void ShowCompanyValueGraph(void)
   701 void ShowCompanyValueGraph(void)
   702 {
   702 {
   703 	if (AllocateWindowDescFront(&_company_value_graph_desc, 0)) {
   703 	if (BaseWindow::AllocateFront(&_company_value_graph_desc, 0)) {
   704 		InvalidateWindow(WC_GRAPH_LEGEND, 0);
   704 		InvalidateWindow(WC_GRAPH_LEGEND, 0);
   705 	}
   705 	}
   706 }
   706 }
   707 
   707 
   708 /*****************/
   708 /*****************/
   709 /* PAYMENT RATES */
   709 /* PAYMENT RATES */
   710 /*****************/
   710 /*****************/
   711 
   711 
   712 static void CargoPaymentRatesWndProc(Window *w, WindowEvent *e)
   712 static void CargoPaymentRatesWndProc(BaseWindow *w, WindowEvent *e)
   713 {
   713 {
   714 	switch (e->event) {
   714 	switch (e->event) {
   715 	case WE_CREATE: {
   715 	case WE_CREATE: {
   716 		uint i;
   716 		uint i;
   717 		for (i = 3; i < w->widget_count; i++) {
   717 		for (i = 3; i < w->widget_count; i++) {
   779 		}
   779 		}
   780 	} break;
   780 	} break;
   781 	}
   781 	}
   782 }
   782 }
   783 
   783 
   784 static const Widget _cargo_payment_rates_widgets[] = {
   784 static const OldWidget _cargo_payment_rates_widgets[] = {
   785 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,                     STR_018B_CLOSE_WINDOW},
   785 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,                     STR_018B_CLOSE_WINDOW},
   786 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   567,     0,    13, STR_7061_CARGO_PAYMENT_RATES, STR_018C_WINDOW_TITLE_DRAG_THIS},
   786 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   567,     0,    13, STR_7061_CARGO_PAYMENT_RATES, STR_018C_WINDOW_TITLE_DRAG_THIS},
   787 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   567,    14,   141, 0x0,                          STR_NULL},
   787 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   567,    14,   141, 0x0,                          STR_NULL},
   788 {      WWT_PANEL,   RESIZE_NONE,    12,   493,   562,    24,    31, 0x0,                          STR_7064_TOGGLE_GRAPH_FOR_CARGO},
   788 {      WWT_PANEL,   RESIZE_NONE,    12,   493,   562,    24,    31, 0x0,                          STR_7064_TOGGLE_GRAPH_FOR_CARGO},
   789 {      WWT_PANEL,   RESIZE_NONE,    12,   493,   562,    32,    39, 0x0,                          STR_7064_TOGGLE_GRAPH_FOR_CARGO},
   789 {      WWT_PANEL,   RESIZE_NONE,    12,   493,   562,    32,    39, 0x0,                          STR_7064_TOGGLE_GRAPH_FOR_CARGO},
   809 };
   809 };
   810 
   810 
   811 
   811 
   812 void ShowCargoPaymentRates(void)
   812 void ShowCargoPaymentRates(void)
   813 {
   813 {
   814 	AllocateWindowDescFront(&_cargo_payment_rates_desc, 0);
   814 	BaseWindow::AllocateFront(&_cargo_payment_rates_desc, 0);
   815 }
   815 }
   816 
   816 
   817 /************************/
   817 /************************/
   818 /* COMPANY LEAGUE TABLE */
   818 /* COMPANY LEAGUE TABLE */
   819 /************************/
   819 /************************/
   848 	const Player* p2 = *(const Player* const*)elem2;
   848 	const Player* p2 = *(const Player* const*)elem2;
   849 
   849 
   850 	return p2->old_economy[1].performance_history - p1->old_economy[1].performance_history;
   850 	return p2->old_economy[1].performance_history - p1->old_economy[1].performance_history;
   851 }
   851 }
   852 
   852 
   853 static void CompanyLeagueWndProc(Window *w, WindowEvent *e)
   853 static void CompanyLeagueWndProc(BaseWindow *w, WindowEvent *e)
   854 {
   854 {
   855 	switch (e->event) {
   855 	switch (e->event) {
   856 		case WE_PAINT: {
   856 		case WE_PAINT: {
   857 			const Player* plist[MAX_PLAYERS];
   857 			const Player* plist[MAX_PLAYERS];
   858 			const Player* p;
   858 			const Player* p;
   882 		}
   882 		}
   883 	}
   883 	}
   884 }
   884 }
   885 
   885 
   886 
   886 
   887 static const Widget _company_league_widgets[] = {
   887 static const OldWidget _company_league_widgets[] = {
   888 {   WWT_CLOSEBOX, RESIZE_NONE, 14,   0,  10,  0, 13, STR_00C5,                      STR_018B_CLOSE_WINDOW},
   888 {   WWT_CLOSEBOX, RESIZE_NONE, 14,   0,  10,  0, 13, STR_00C5,                      STR_018B_CLOSE_WINDOW},
   889 {    WWT_CAPTION, RESIZE_NONE, 14,  11, 387,  0, 13, STR_7053_COMPANY_LEAGUE_TABLE, STR_018C_WINDOW_TITLE_DRAG_THIS},
   889 {    WWT_CAPTION, RESIZE_NONE, 14,  11, 387,  0, 13, STR_7053_COMPANY_LEAGUE_TABLE, STR_018C_WINDOW_TITLE_DRAG_THIS},
   890 {  WWT_STICKYBOX, RESIZE_NONE, 14, 388, 399,  0, 13, STR_NULL,                      STR_STICKY_BUTTON},
   890 {  WWT_STICKYBOX, RESIZE_NONE, 14, 388, 399,  0, 13, STR_NULL,                      STR_STICKY_BUTTON},
   891 {      WWT_PANEL, RESIZE_NONE, 14,   0, 399, 14, 96, 0x0,                           STR_NULL},
   891 {      WWT_PANEL, RESIZE_NONE, 14,   0, 399, 14, 96, 0x0,                           STR_NULL},
   892 {   WIDGETS_END},
   892 {   WIDGETS_END},
   900 	CompanyLeagueWndProc
   900 	CompanyLeagueWndProc
   901 };
   901 };
   902 
   902 
   903 void ShowCompanyLeagueTable(void)
   903 void ShowCompanyLeagueTable(void)
   904 {
   904 {
   905 	AllocateWindowDescFront(&_company_league_desc,0);
   905 	BaseWindow::AllocateFront(&_company_league_desc,0);
   906 }
   906 }
   907 
   907 
   908 /*****************************/
   908 /*****************************/
   909 /* PERFORMANCE RATING DETAIL */
   909 /* PERFORMANCE RATING DETAIL */
   910 /*****************************/
   910 /*****************************/
   911 
   911 
   912 static void PerformanceRatingDetailWndProc(Window *w, WindowEvent *e)
   912 static void PerformanceRatingDetailWndProc(BaseWindow *w, WindowEvent *e)
   913 {
   913 {
   914 	static PlayerID _performance_rating_detail_player = INVALID_PLAYER;
   914 	static PlayerID _performance_rating_detail_player = INVALID_PLAYER;
   915 
   915 
   916 	switch (e->event) {
   916 	switch (e->event) {
   917 		case WE_PAINT: {
   917 		case WE_PAINT: {
  1104 			break;
  1104 			break;
  1105 		}
  1105 		}
  1106 	}
  1106 	}
  1107 }
  1107 }
  1108 
  1108 
  1109 static const Widget _performance_rating_detail_widgets[] = {
  1109 static const OldWidget _performance_rating_detail_widgets[] = {
  1110 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,               STR_018B_CLOSE_WINDOW},
  1110 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,               STR_018B_CLOSE_WINDOW},
  1111 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   298,     0,    13, STR_PERFORMANCE_DETAIL, STR_018C_WINDOW_TITLE_DRAG_THIS},
  1111 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   298,     0,    13, STR_PERFORMANCE_DETAIL, STR_018C_WINDOW_TITLE_DRAG_THIS},
  1112 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   298,    14,    27, 0x0,                    STR_NULL},
  1112 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   298,    14,    27, 0x0,                    STR_NULL},
  1113 
  1113 
  1114 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   298,    28,    47, 0x0,                    STR_PERFORMANCE_DETAIL_VEHICLES_TIP},
  1114 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   298,    28,    47, 0x0,                    STR_PERFORMANCE_DETAIL_VEHICLES_TIP},
  1141 	PerformanceRatingDetailWndProc
  1141 	PerformanceRatingDetailWndProc
  1142 };
  1142 };
  1143 
  1143 
  1144 void ShowPerformanceRatingDetail(void)
  1144 void ShowPerformanceRatingDetail(void)
  1145 {
  1145 {
  1146 	AllocateWindowDescFront(&_performance_rating_detail_desc, 0);
  1146 	BaseWindow::AllocateFront(&_performance_rating_detail_desc, 0);
  1147 }
  1147 }