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

Detailed Description

AUI Style Sheets selector is a predicate whether view suit certain rules or not.

Classes

struct  ass::on_state::Hovered
 Hovered LESS-style subselector. More...
 
struct  ass::on_state::Activated
 Activated LESS-style subselector. More...
 
struct  ass::on_state::Focused
 Focused LESS-style subselector. More...
 
struct  ass::on_state::Disabled
 Disabled LESS-style subselector. More...
 
struct  ass::Selected
 Wraps another selector matching Selected views. More...
 

Typedefs

using ass::sel = AAssSelector
 Runtime-type selector.
 
using ass::c = class_of
 Selects views that are of the specified classes.
 
template<typename T>
using ass::t = type_of<T>
 Selects views that are of the specified C++ types.
 

Typedef Documentation

◆ c

using ass::c = class_of

Selects views that are of the specified classes.

This selector selects views that are of the specified classes. The selector can be accessed explicitly via ass::class_of.

For example:

{
c(".btn"),
BackgroundSolid(...),
}
class_of c
Selects views that are of the specified classes.
Definition class_of.h:84

This will select all views that belong to ".btn" ASS class.

◆ sel

Runtime-type selector.

This type type-erases the selectors and allows to encapsulate.

◆ t

template<typename T>
using ass::t = type_of<T>

Selects views that are of the specified C++ types.

This selector selects views that are of the specified classes. The selector can be accessed explicitly via ass::type_of.

For example:

{
BackgroundSolid(...),
}
type_of< T > t
Selects views that are of the specified C++ types.
Definition type_of.h:71

This will select all AButtons.

Function Documentation

◆ operator&&()

AndSelector< L, R > ass::operator&& ( L l,
R r )

Makes a selector that applies two selectors.

In this example, we want to select all views that match both ".btn" and ".accent".

{
class_of(".btn-title") && class_of(".accent"),
BackgroundSolid { 0xe81123_rgb }
},
Definition class_of.h:57

◆ operator>()

template<typename L, typename R, std::enable_if_t< std::is_base_of_v< IAssSubSelector, L > &&std::is_base_of_v< IAssSubSelector, R >, bool > = true>
DirectParentSubSelector< L, R > ass::operator> ( L l,
R r )

Makes direct parent subselector.

In this example, we want to select all views that have direct parent matching ".window-title" ASS class and then select the hovered ".close" subselector within them.

{
class_of(".window-title") > class_of::hover(".close"),
BackgroundSolid { 0xe81123_rgb }
},

◆ operator>>()

template<typename L, typename R, std::enable_if_t< std::is_base_of_v< IAssSubSelector, L > &&std::is_base_of_v< IAssSubSelector, R >, bool > = true>
ParentSubSelector< L, R > ass::operator>> ( L l,
R r )

Makes indirect parent subselector.

Note
This selector is slower than direct parent subselector. If possible, use the latter.

In this example, we want to select all views that have indirect parent matching ".window-title" ASS class and then select the hovered ".close" subselector within them.

{
class_of(".window-title") >> class_of::hover(".close"),
BackgroundSolid { 0xe81123_rgb }
},
Collaboration diagram for ASS selectors: