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

Method OnClick

src/signs_gui.cpp:231–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229 }
230
231 void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
232 {
233 switch (widget) {
234 case WID_SIL_LIST: {
235 auto it = this->vscroll->GetScrolledItemFromWidget(this->signs, pt.y, this, WID_SIL_LIST, WidgetDimensions::scaled.framerect.top);
236 if (it == this->signs.end()) return;
237
238 const Sign *si = *it;
239 ScrollMainWindowToTile(TileVirtXY(si->x, si->y));
240 break;
241 }
242
243 case WID_SIL_FILTER_MATCH_CASE_BTN:
244 SignList::match_case = !SignList::match_case; // Toggle match case
245 this->SetWidgetLoweredState(WID_SIL_FILTER_MATCH_CASE_BTN, SignList::match_case); // Toggle button pushed state
246 this->InvalidateData(); // Rebuild the list of signs
247 break;
248 }
249 }
250
251 void OnResize() override
252 {

Callers

nothing calls this directly

Calls 6

ScrollMainWindowToTileFunction · 0.85
TileVirtXYFunction · 0.85
SetWidgetLoweredStateMethod · 0.80
endMethod · 0.45
InvalidateDataMethod · 0.45

Tested by

no test coverage detected