#include <limits>
#include <stack>
#include <dali/public-api/actors/image-actor.h>
-#include <dali/devel-api/actors/mesh-actor.h>
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/animation/constraints.h>
-#include <dali/devel-api/geometry/mesh.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/devel-api/object/type-registry-helper.h>
#include <dali/devel-api/scripting/scripting.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/focus-manager/keyinput-focus-manager.h>
+#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
#include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/devel-api/styling/style-manager.h>
namespace
{
-const float BACKGROUND_ACTOR_Z_POSITION( -0.1f );
-
/**
* Creates control through type registry
*/
* @return true if action has been accepted by this control
*/
const char* ACTION_CONTROL_ACTIVATED = "control-activated";
-static bool DoAction( BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes )
+static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes )
{
bool ret = false;
/**
* Creates a white coloured Mesh.
*/
-Mesh CreateMesh()
+Vector3 CreateMesh()
{
Vector3 white( Color::WHITE );
-
+ /*
MeshData meshData;
// Create vertices with a white color (actual color is set by actor color)
meshData.SetVertices( vertices );
meshData.SetFaceIndices( faces );
meshData.SetHasColor( true );
-
- return Mesh::New( meshData );
+ */
+ return white;
+ //return Mesh::New( meshData );
}
/**
actor.SetColor( color );
actor.SetPositionInheritanceMode( USE_PARENT_POSITION_PLUS_LOCAL_POSITION );
actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
- actor.SetZ( BACKGROUND_ACTOR_Z_POSITION );
actor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
}
actor.SetColor( color );
actor.SetPositionInheritanceMode( USE_PARENT_POSITION_PLUS_LOCAL_POSITION );
actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
- actor.SetZ( BACKGROUND_ACTOR_Z_POSITION );
Constraint constraint = Constraint::New<Vector3>( actor,
constrainingIndex,
mLongPressGestureDetector(),
mFlags( Control::ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
mIsKeyboardNavigationSupported( false ),
- mIsKeyboardFocusGroup( false )
+ mIsKeyboardFocusGroup( false ),
+ mAddRemoveBackgroundChild( false )
{
}
ControlBehaviour mFlags :CONTROL_BEHAVIOUR_FLAG_COUNT; ///< Flags passed in from constructor.
bool mIsKeyboardNavigationSupported :1; ///< Stores whether keyboard navigation is supported by the control.
bool mIsKeyboardFocusGroup :1; ///< Stores whether the control is a focus group.
+ bool mAddRemoveBackgroundChild:1; ///< Flag to know when we are adding or removing our own actor to avoid call to OnControlChildAdd
// Properties - these need to be members of Internal::Control::Impl as they need to function within this class.
static PropertyRegistration PROPERTY_1;
// Just set the actor color
background.actor.SetColor( color );
}
+ /*
else
{
// Create Mesh Actor
SetupBackgroundActorConstrained( meshActor, Actor::Property::SCALE, color );
- // Set the background actor before adding so that we do not inform deriving classes
background.actor = meshActor;
- Self().Add( meshActor );
+ // Set the flag to avoid notifying children
+ mImpl->mAddRemoveBackgroundChild = true;
+ // use insert to guarantee its the first child (so that OVERLAY mode works)
+ Self().Insert( 0, meshActor );
+ mImpl->mAddRemoveBackgroundChild = false;
}
+ */
background.color = color;
}
if ( background.actor )
{
- // Remove Current actor, unset AFTER removal so that we do not inform deriving classes
+ // Remove Current actor, unset AFTER removal
+ mImpl->mAddRemoveBackgroundChild = true;
Self().Remove( background.actor );
+ mImpl->mAddRemoveBackgroundChild = false;
background.actor.Reset();
}
+ /*
ImageActor imageActor = ImageActor::New( image );
SetupBackgroundActor( imageActor, background.color );
// Set the background actor before adding so that we do not inform derived classes
background.actor = imageActor;
- Self().Add( imageActor );
+ mImpl->mAddRemoveBackgroundChild = true;
+ // use insert to guarantee its the first child (so that OVERLAY mode works)
+ Self().Insert( 0, imageActor );
+ mImpl->mAddRemoveBackgroundChild = false;
+ */
}
void Control::ClearBackground()
if ( mImpl->mBackground )
{
Background& background( mImpl->GetBackground() );
+ mImpl->mAddRemoveBackgroundChild = true;
Self().Remove( background.actor );
+ mImpl->mAddRemoveBackgroundChild = false;
delete mImpl->mBackground;
mImpl->mBackground = NULL;
return false; // Accessibility value change action is not handled by default
}
-Actor Control::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled)
+Actor Control::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled)
{
return Actor();
}
void Control::OnChildAdd(Actor& child)
{
- // If this is the background actor, then we do not want to relayout or inform deriving classes
- if ( mImpl->mBackground && ( child == mImpl->mBackground->actor ) )
+ // If this is the background actor, then we do not want to inform deriving classes
+ if ( mImpl->mAddRemoveBackgroundChild )
{
return;
}
void Control::OnChildRemove(Actor& child)
{
- // If this is the background actor, then we do not want to relayout or inform deriving classes
- if ( mImpl->mBackground && ( child == mImpl->mBackground->actor ) )
+ // If this is the background actor, then we do not want to inform deriving classes
+ if ( mImpl->mAddRemoveBackgroundChild )
{
return;
}