X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbuttons%2Fbutton-impl.cpp;h=6c6ab02892a12dc45040e9cbdfe8891024197cea;hp=3bebcdefcc22efabc60667b8c118b0be4594c063;hb=8a647e87a01c5c78451653c1264a9eea81ac9b20;hpb=ef15505c94dffeb0639c91d9d3cd374918c21c4f diff --git a/dali-toolkit/internal/controls/buttons/button-impl.cpp b/dali-toolkit/internal/controls/buttons/button-impl.cpp index 3bebcde..6c6ab02 100644 --- a/dali-toolkit/internal/controls/buttons/button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/button-impl.cpp @@ -379,7 +379,7 @@ void Button::CreateVisualsForComponent( Property::Index index, const Property::V else { // if its not a string then get a Property::Map from the property if possible. - Property::Map *map = value.GetMap(); + const Property::Map *map = value.GetMap(); if( map && !map->Empty() ) // Empty map results in current visual removal. { DALI_LOG_INFO( gLogButtonFilter, Debug::Verbose, "CreateVisualsForComponent Using Map(%d)\n", index ); @@ -620,7 +620,7 @@ void Button::OnInitialize() self.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true ); - self.TouchSignal().Connect( this, &Button::OnTouch ); + self.TouchedSignal().Connect( this, &Button::OnTouch ); } bool Button::OnAccessibilityActivated() @@ -1151,11 +1151,11 @@ void Button::SetProperty( BaseObject* object, Property::Index index, const Prope else { // Get a Property::Map from the property if possible. - Property::Map* setPropertyMap = value.GetMap(); + const Property::Map* setPropertyMap = value.GetMap(); if( setPropertyMap ) { - TextVisual::ConvertStringKeysToIndexKeys( *setPropertyMap ); - GetImplementation( button ).MergeWithExistingLabelProperties( *setPropertyMap, outTextVisualProperties ); + Property::Map indexKeys = TextVisual::ConvertStringKeysToIndexKeys( *setPropertyMap ); + GetImplementation( button ).MergeWithExistingLabelProperties( indexKeys, outTextVisualProperties ); } } @@ -1313,6 +1313,28 @@ Padding Button::GetForegroundPadding() return mForegroundPadding; } +std::string Button::AccessibleImpl::GetNameRaw() +{ + auto slf = Toolkit::Button::DownCast( self ); + + Property::Map label = slf.GetProperty( Toolkit::Button::Property::LABEL ); + + std::string labelText; + label.Find( Toolkit::TextVisual::Property::TEXT )->Get( labelText ); + + return labelText; +} + +Dali::Accessibility::States Button::AccessibleImpl::CalculateStates() +{ + auto tmp = Control::Impl::AccessibleImpl::CalculateStates(); + tmp[Dali::Accessibility::State::SELECTABLE] = true; + auto slf = Toolkit::Button::DownCast( self ); + tmp[Dali::Accessibility::State::ENABLED] = !slf.GetProperty( Toolkit::Button::Property::DISABLED ); + tmp[Dali::Accessibility::State::CHECKED] = slf.GetProperty( Toolkit::Button::Property::SELECTED ); + return tmp; +} + } // namespace Internal } // namespace Toolkit