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

Method NWidgetScrollbar

src/widget.cpp:2572–2591  ·  view source on GitHub ↗

* Scrollbar widget. * @param tp Scrollbar type. (horizontal/vertical) * @param colour Colour of the scrollbar. * @param index Index of the widget. */

Source from the content-addressed store, hash-verified

2570 * @param index Index of the widget.
2571 */
2572NWidgetScrollbar::NWidgetScrollbar(WidgetType tp, Colours colour, WidgetID index) : NWidgetCore(tp, colour, index, 1, 1, {}, STR_NULL), Scrollbar(tp != NWID_HSCROLLBAR)
2573{
2574 assert(tp == NWID_HSCROLLBAR || tp == NWID_VSCROLLBAR);
2575
2576 switch (this->type) {
2577 case NWID_HSCROLLBAR:
2578 this->SetResize(1, 0);
2579 this->SetFill(1, 0);
2580 this->SetToolTip(STR_TOOLTIP_HSCROLL_BAR_SCROLLS_LIST);
2581 break;
2582
2583 case NWID_VSCROLLBAR:
2584 this->SetResize(0, 1);
2585 this->SetFill(0, 1);
2586 this->SetToolTip(STR_TOOLTIP_VSCROLL_BAR_SCROLLS_LIST);
2587 break;
2588
2589 default: NOT_REACHED();
2590 }
2591}
2592
2593void NWidgetScrollbar::SetupSmallestSize(Window *)
2594{

Callers

nothing calls this directly

Calls 4

NOT_REACHEDFunction · 0.85
SetResizeMethod · 0.80
SetFillMethod · 0.80
SetToolTipMethod · 0.80

Tested by

no test coverage detected