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

Method HandleButtonClick

src/window.cpp:597–606  ·  view source on GitHub ↗

* Do all things to make a button look clicked and mark it to be * unclicked in a few ticks. * @param widget the widget to "click" */

Source from the content-addressed store, hash-verified

595 * @param widget the widget to "click"
596 */
597void Window::HandleButtonClick(WidgetID widget)
598{
599 /* Button click for this widget may already have been handled. */
600 if (this->IsWidgetLowered(widget) && this->timeout_timer == TIMEOUT_DURATION) return;
601
602 this->LowerWidget(widget);
603 this->SetTimeout();
604 this->SetWidgetDirty(widget);
605 SndClickBeep();
606}
607
608static void StartWindowDrag(Window *w);
609static void StartWindowSizing(Window *w, bool to_left);

Callers 15

OnClickMethod · 0.80
OnClickMethod · 0.80
OnClickMethod · 0.80
ToolbarZoomInClickFunction · 0.80
ToolbarZoomOutClickFunction · 0.80
ToolbarScenDateBackwardFunction · 0.80
ToolbarScenDateForwardFunction · 0.80
ToolbarScenGenLandFunction · 0.80
ToolbarScenGenIndustryFunction · 0.80
ToolbarScenBuildDocksFunction · 0.80
ToolbarScenPlantTreesFunction · 0.80
ToolbarScenPlaceSignFunction · 0.80

Calls 5

IsWidgetLoweredMethod · 0.95
LowerWidgetMethod · 0.95
SetTimeoutMethod · 0.95
SetWidgetDirtyMethod · 0.95
SndClickBeepFunction · 0.85

Tested by

no test coverage detected