| 1709 | |
| 1710 | template <typename T> |
| 1711 | void load ( |
| 1712 | const T& list |
| 1713 | ) |
| 1714 | { |
| 1715 | auto_mutex M(m); |
| 1716 | items.clear(); |
| 1717 | unsigned long i = 0; |
| 1718 | items.set_max_size(list.size()); |
| 1719 | items.set_size(list.size()); |
| 1720 | list.reset(); |
| 1721 | unsigned long max_width = 0; |
| 1722 | unsigned long total_height = 0; |
| 1723 | while (list.move_next()) |
| 1724 | { |
| 1725 | items[i].is_selected = false; |
| 1726 | items[i].name = list.element(); |
| 1727 | mfont->compute_size(items[i].name,items[i].width, items[i].height); |
| 1728 | |
| 1729 | if (items[i].width > max_width) |
| 1730 | max_width = items[i].width; |
| 1731 | total_height += items[i].height; |
| 1732 | |
| 1733 | ++i; |
| 1734 | } |
| 1735 | set_total_rect_size(max_width, total_height); |
| 1736 | |
| 1737 | parent.invalidate_rectangle(rect); |
| 1738 | last_selected = 0; |
| 1739 | } |
| 1740 | |
| 1741 | const S& operator[] ( |
| 1742 | unsigned long index |
no test coverage detected