* Show a dropdown menu window near a widget of the parent window. * The result code of the items is their index in the \a strings list. * @param w Parent window that wants the dropdown menu. * @param strings Menu list. * @param selected Index of initial selected item. * @param button Button widget number of the parent window \a w that wants the dropdown menu. *
| 456 | * @param width Minimum width of the dropdown menu. |
| 457 | */ |
| 458 | void ShowDropDownMenu(Window *w, std::span<const StringID> strings, int selected, WidgetID button, uint32_t disabled_mask, uint32_t hidden_mask, uint width) |
| 459 | { |
| 460 | DropDownList list; |
| 461 | |
| 462 | uint i = 0; |
| 463 | for (auto string : strings) { |
| 464 | if (!HasBit(hidden_mask, i)) { |
| 465 | list.push_back(MakeDropDownListStringItem(string, i, HasBit(disabled_mask, i))); |
| 466 | } |
| 467 | ++i; |
| 468 | } |
| 469 | |
| 470 | if (!list.empty()) ShowDropDownList(w, std::move(list), selected, button, width, {}); |
| 471 | } |
no test coverage detected