// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
+#include <dali-toolkit/public-api/controls/image-view/image-view.h>
namespace Dali
{
const char* const ACTOR_FOCUSABLE("focusable");
const char* const IS_FOCUS_GROUP("isFocusGroup");
-const char* FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "B16-8_TTS_focus.png";
-const Vector4 FOCUS_BORDER_IMAGE_BORDER = Vector4(7.0f, 7.0f, 7.0f, 7.0f);
+const char* FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "B16-8_TTS_focus.9.png";
const char* FOCUS_SOUND_FILE = DALI_SOUND_DIR "Focus.ogg";
const char* FOCUS_CHAIN_END_SOUND_FILE = DALI_SOUND_DIR "End_of_List.ogg";
// Firstly delete the actor from the focus chain if it's already there with a different focus order.
mFocusIDContainer.erase(GetFocusOrder(actor));
- // Create actor focusable property if not already created.
- Property::Index propertyActorFocusable = actor.GetPropertyIndex(ACTOR_FOCUSABLE);
- if(propertyActorFocusable == Property::INVALID_INDEX)
- {
- propertyActorFocusable = actor.RegisterProperty( ACTOR_FOCUSABLE, true, Property::READ_WRITE );
- }
+ // Create/retrieve actor focusable property
+ Property::Index propertyActorFocusable = actor.RegisterProperty( ACTOR_FOCUSABLE, true, Property::READ_WRITE );
if(order == 0)
{
{
if(actor)
{
- // Create focus group property if not already created.
- Property::Index propertyIsFocusGroup = actor.GetPropertyIndex(IS_FOCUS_GROUP);
- if(propertyIsFocusGroup == Property::INVALID_INDEX)
- {
- actor.RegisterProperty( IS_FOCUS_GROUP, isFocusGroup, Property::READ_WRITE );
- }
- else
- {
- actor.SetProperty(propertyIsFocusGroup, isFocusGroup);
- }
+ // Create/Set focus group property.
+ actor.RegisterProperty( IS_FOCUS_GROUP, isFocusGroup, Property::READ_WRITE );
}
}
{
if(actor)
{
- // Create actor focusable property if not already created.
- Property::Index propertyActorFocusable = actor.GetPropertyIndex(ACTOR_FOCUSABLE);
- if(propertyActorFocusable == Property::INVALID_INDEX)
- {
- actor.RegisterProperty( ACTOR_FOCUSABLE, focusable, Property::READ_WRITE );
- }
- else
- {
- actor.SetProperty(propertyActorFocusable, focusable);
- }
+ // Create/Set actor focusable property.
+ actor.RegisterProperty( ACTOR_FOCUSABLE, focusable, Property::READ_WRITE );
}
}
void AccessibilityManager::CreateDefaultFocusIndicatorActor()
{
// Create a focus indicator actor shared by all the focusable actors
- Image borderImage = ResourceImage::New(FOCUS_BORDER_IMAGE_PATH);
-
- ImageActor focusIndicator = ImageActor::New(borderImage);
- focusIndicator.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION_PLUS_LOCAL_POSITION );
- focusIndicator.SetStyle( ImageActor::STYLE_NINE_PATCH );
- focusIndicator.SetNinePatchBorder(FOCUS_BORDER_IMAGE_BORDER);
+ Toolkit::ImageView focusIndicator = Toolkit::ImageView::New(FOCUS_BORDER_IMAGE_PATH);
+ focusIndicator.SetParentOrigin( ParentOrigin::CENTER );
focusIndicator.SetPosition(Vector3(0.0f, 0.0f, 1.0f));
// Apply size constraint to the focus indicator
if(!mCurrentGesturedActor)
{
- DALI_LOG_ERROR("Gesture detected, but no hit actor");
+ DALI_LOG_ERROR("Gesture detected, but no hit actor\n");
}
}
if(!mCurrentGesturedActor)
{
- DALI_LOG_ERROR("no more gestured actor");
+ DALI_LOG_ERROR("no more gestured actor\n");
}
}
else
return mFocusedActorActivatedSignal;
}
-bool AccessibilityManager::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
-{
- Dali::BaseHandle handle( object );
-
- bool connected( true );
- AccessibilityManager* manager = dynamic_cast<AccessibilityManager*>( object );
-
- if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_CHANGED ) )
- {
- manager->FocusChangedSignal().Connect( tracker, functor );
- }
- else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_OVERSHOT ) )
- {
- manager->FocusOvershotSignal().Connect( tracker, functor );
- }
- else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUSED_ACTOR_ACTIVATED ) )
- {
- manager->FocusedActorActivatedSignal().Connect( tracker, functor );
- }
- else
- {
- // signalName does not match any signal
- connected = false;
- }
-
- return connected;
-}
-
} // namespace Internal
} // namespace Toolkit