AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
UIMatcher Class Reference

Member Function Documentation

> All members, including inherited

◆ findNearestTo()

UIMatcher UIMatcher::findNearestTo ( UIMatcher matcher)
inline

Finds the nearest view to the bottom right corner of the specified view. The bottom right corner is chosen in order to simulate human eye scanning (which is from top-left to bottom-right).

Useful when finding fields by their labels:

_new<ALabel>("Login"),
_new<ATextField>(),
_new<ALabel>("Password"),
_new<ATextField>(),
...
By::type<ATextField>().findNearestTo(By::text("Login")) // <- matches the first ATextField
By::type<ATextField>().findNearestTo(By::text("Password")) // <- matches the second ATextField
Editable field with text to receive a text input from the user.
Definition ATextField.h:24
UIMatcher findNearestTo(UIMatcher matcher)
Finds the nearest view to the specified one.
Definition UIMatcher.h:113
Parameters
matcherUIMatcher of a view to find the nearest to. The UIMatcher is expected to match only one view.
Returns
the nearest view