// Toggle button requires the Leave event.
Actor self = Self();
self.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
+
+ DevelControl::SetAccessibilityConstructor( Self(), []( Dali::Actor actor ) {
+ return std::unique_ptr< Dali::Accessibility::Accessible >(
+ new AccessibleImpl( actor, Dali::Accessibility::Role::TOGGLE_BUTTON ) );
+ } );
}
void ToggleButton::SetProperty( BaseObject* object, Property::Index propertyIndex, const Property::Value& value )
}
case Toolkit::ToggleButton::Property::TOOLTIPS:
{
- Property::Array* tipArray = value.GetArray();
+ const Property::Array* tipArray = value.GetArray();
if( tipArray )
{
std::vector<std::string> tips;
RelayoutRequest();
}
+void ToggleButton::OnStateChange( State newState )
+{
+ // TODO: replace it with OnPropertySet hook once Button::Property::SELECTED will be consistently used
+ if (Dali::Accessibility::IsUp() && (newState == SELECTED_STATE || newState == UNSELECTED_STATE))
+ {
+ Dali::Accessibility::Accessible::Get(Self())->EmitStateChanged(
+ Dali::Accessibility::State::CHECKED, newState == SELECTED_STATE ? 1 : 0, 0
+ );
+ }
+}
+
} // namespace Internal
} // namespace Toolkit