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

Method OnClick

src/dropdown.cpp:295–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293 }
294
295 void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
296 {
297 if (widget != WID_DM_ITEMS) return;
298 int result, click_result;
299 if (this->GetDropDownItem(result, click_result)) {
300 this->click_delay = 4;
301 this->selected_result = result;
302 this->selected_click_result = click_result;
303 this->SetDirty();
304 }
305 }
306
307 /** Rate limit how fast scrolling happens. */
308 const IntervalTimer<TimerWindow> scroll_interval = {std::chrono::milliseconds(30), [this](auto) {

Callers 1

GetDropDownItemMethod · 0.45

Calls 2

GetDropDownItemMethod · 0.95
SetDirtyMethod · 0.45

Tested by

no test coverage detected