MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / OnClick

Method OnClick

src/bridge_gui.cpp:262–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260 }
261
262 void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
263 {
264 switch (widget) {
265 default: break;
266 case WID_BBS_BRIDGE_LIST: {
267 auto it = this->vscroll->GetScrolledItemFromWidget(this->bridges, pt.y, this, WID_BBS_BRIDGE_LIST);
268 if (it != this->bridges.end()) {
269 this->BuildBridge(it->index);
270 this->Close();
271 }
272 break;
273 }
274
275 case WID_BBS_DROPDOWN_ORDER:
276 this->bridges.ToggleSortOrder();
277 this->SetDirty();
278 break;
279
280 case WID_BBS_DROPDOWN_CRITERIA:
281 ShowDropDownMenu(this, BuildBridgeWindow::sorter_names, this->bridges.SortType(), WID_BBS_DROPDOWN_CRITERIA, 0, 0);
282 break;
283 }
284 }
285
286 void OnDropdownSelect(WidgetID widget, int index, int) override
287 {

Callers

nothing calls this directly

Calls 8

BuildBridgeMethod · 0.95
ShowDropDownMenuFunction · 0.85
ToggleSortOrderMethod · 0.80
SortTypeMethod · 0.80
endMethod · 0.45
CloseMethod · 0.45
SetDirtyMethod · 0.45

Tested by

no test coverage detected