MCPcopy Create free account
hub / github.com/davisking/dlib / load

Method load

dlib/gui_widgets/widgets.h:1711–1739  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 3

find_max_globalFunction · 0.45
set_dirMethod · 0.45
on_root_clickMethod · 0.45

Calls 7

set_max_sizeMethod · 0.80
compute_sizeMethod · 0.80
clearMethod · 0.45
sizeMethod · 0.45
set_sizeMethod · 0.45
resetMethod · 0.45
move_nextMethod · 0.45

Tested by

no test coverage detected