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

Method add

dlib/gui_widgets/base_widgets.cpp:1313–1346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1311// ----------------------------------------------------------------------------------------
1312
1313 void widget_group::
1314 add (
1315 drawable& widget,
1316 unsigned long x,
1317 unsigned long y
1318 )
1319 {
1320 auto_mutex M(m);
1321 drawable* w = &widget;
1322 relpos rp;
1323 rp.x = x;
1324 rp.y = y;
1325 if (widgets.is_in_domain(w))
1326 {
1327 widgets[w].x = x;
1328 widgets[w].y = y;
1329 }
1330 else
1331 {
1332 widgets.add(w,rp);
1333 }
1334 if (is_hidden())
1335 widget.hide();
1336 else
1337 widget.show();
1338
1339 if (is_enabled())
1340 widget.enable();
1341 else
1342 widget.disable();
1343
1344 widget.set_z_order(z_order());
1345 widget.set_pos(x+rect.left(),y+rect.top());
1346 }
1347
1348// ----------------------------------------------------------------------------------------
1349

Callers

nothing calls this directly

Calls 10

set_z_orderMethod · 0.80
addFunction · 0.50
addMethod · 0.45
hideMethod · 0.45
showMethod · 0.45
enableMethod · 0.45
disableMethod · 0.45
set_posMethod · 0.45
leftMethod · 0.45
topMethod · 0.45

Tested by

no test coverage detected