| 1181 | BaseCargoGraphWindow(WindowDesc &desc, StringID format_str_y_axis) : BaseGraphWindow(desc, format_str_y_axis) {} |
| 1182 | |
| 1183 | void InitializeWindow(WindowNumber number, StringID footer_wallclock = STR_NULL, StringID footer_calendar = STR_NULL) |
| 1184 | { |
| 1185 | this->CreateNestedTree(); |
| 1186 | |
| 1187 | this->excluded_range = this->masked_range; |
| 1188 | this->cargo_types = this->GetCargoTypes(number); |
| 1189 | |
| 1190 | this->vscroll = this->GetScrollbar(WID_GRAPH_MATRIX_SCROLLBAR); |
| 1191 | this->vscroll->SetCount(CountBits(this->cargo_types)); |
| 1192 | |
| 1193 | auto *wid = this->GetWidget<NWidgetCore>(WID_GRAPH_FOOTER); |
| 1194 | wid->SetString(TimerGameEconomy::UsingWallclockUnits() ? footer_wallclock : footer_calendar); |
| 1195 | |
| 1196 | this->FinishInitNested(number); |
| 1197 | |
| 1198 | /* Initialise the dataset */ |
| 1199 | this->InvalidateData(); |
| 1200 | } |
| 1201 | |
| 1202 | virtual CargoTypes GetCargoTypes(WindowNumber number) const = 0; |
| 1203 | virtual CargoTypes &GetExcludedCargoTypes() const = 0; |
no test coverage detected