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

Function MakeTopKeys

src/osk_gui.cpp:245–254  ·  view source on GitHub ↗

Construct the top row keys (cancel, ok, backspace). */

Source from the content-addressed store, hash-verified

243
244/** Construct the top row keys (cancel, ok, backspace). */
245static std::unique_ptr<NWidgetBase> MakeTopKeys()
246{
247 auto hor = std::make_unique<NWidgetHorizontal>();
248 hor->SetPIP(0, INTER_KEY_SPACE, 0);
249
250 AddKey(hor, TOP_KEY_PADDING, 6 * 2, WWT_TEXTBTN, WID_OSK_CANCEL, WidgetData{.string = STR_BUTTON_CANCEL});
251 AddKey(hor, TOP_KEY_PADDING, 6 * 2, WWT_TEXTBTN, WID_OSK_OK, WidgetData{.string = STR_BUTTON_OK});
252 AddKey(hor, TOP_KEY_PADDING, 2 * 2, WWT_PUSHIMGBTN, WID_OSK_BACKSPACE, WidgetData{.sprite = SPR_OSK_BACKSPACE});
253 return hor;
254}
255
256/** Construct the row containing the digit keys. */
257static std::unique_ptr<NWidgetBase> MakeNumberKeys()

Callers

nothing calls this directly

Calls 2

AddKeyFunction · 0.85
SetPIPMethod · 0.80

Tested by

no test coverage detected