* Scrollbar widget. * @param tp Scrollbar type. (horizontal/vertical) * @param colour Colour of the scrollbar. * @param index Index of the widget. */
| 2570 | * @param index Index of the widget. |
| 2571 | */ |
| 2572 | NWidgetScrollbar::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 | |
| 2593 | void NWidgetScrollbar::SetupSmallestSize(Window *) |
| 2594 | { |
nothing calls this directly
no test coverage detected