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

Method select_first_item

dlib/gui_widgets/base_widgets.cpp:1638–1654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1636// ----------------------------------------------------------------------------------------
1637
1638 void popup_menu::
1639 select_first_item (
1640 )
1641 {
1642 auto_mutex M(wm);
1643 close_submenu();
1644 selected_item = items.size();
1645 for (unsigned long i = 0; i < items.size(); ++i)
1646 {
1647 if ((items[i]->has_click_event() || submenus[i]) && item_enabled[i])
1648 {
1649 selected_item = i;
1650 break;
1651 }
1652 }
1653 invalidate_rectangle(cur_rect);
1654 }
1655
1656// ----------------------------------------------------------------------------------------
1657

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
has_click_eventMethod · 0.45

Tested by

no test coverage detected