Content


NTL
Core
parent

parent


Search parent of specified type up to form level(excluding form itself). Return nullptr if control is empty or there is no parent of specified type in the control hierarchy. Second template argument indicates whether to include specified control in search or do not.

template<class Type, bool UseControl> Type *parent(IControl *control);

Example of searching closest CPanel in the hierarchy:

CPanel *panel{ parent<CPanel*, false>(control) };
Namespace: nitisa
Include: Nitisa/Core/Utils.h