Skip to content

ui::testing::VisualStates

Header: winui/testing/VisualStates.hpp.

Reads the interaction state a control draws in (Normal, Hover, Pressed, Disabled), which only a test looks at. The controls keep it protected; the free functions below are the way in.

Example:

ui::ButtonControl button{"OK"};
button.set_enabled(false);
REQUIRE(ui::testing::visual_state(button) == ui::ButtonState::Disabled);

visual_state

template <typename C>
static auto visual_state(const C& control)

up_visual_state

static ButtonState up_visual_state(const NumberBoxControl& box)

down_visual_state

static ButtonState down_visual_state(const NumberBoxControl& box)

previous_button_visual_state

static ButtonState previous_button_visual_state(const PipsPagerControl& pager)

next_button_visual_state

static ButtonState next_button_visual_state(const PipsPagerControl& pager)