TypeAction ACTION_TYPE_1( CONTROL_TYPE, Toolkit::Control::ACTION_CONTROL_ACTIVATED, &Internal::Control::DoAction );
+SignalConnectorType SIGNAL_CONNECTOR_1( CONTROL_TYPE, Toolkit::Control::SIGNAL_KEY_EVENT, &Internal::Control::DoConnectSignal );
+SignalConnectorType SIGNAL_CONNECTOR_2( CONTROL_TYPE, Toolkit::Control::SIGNAL_TAPPED, &Internal::Control::DoConnectSignal );
+SignalConnectorType SIGNAL_CONNECTOR_3( CONTROL_TYPE, Toolkit::Control::SIGNAL_PANNED, &Internal::Control::DoConnectSignal );
+SignalConnectorType SIGNAL_CONNECTOR_4( CONTROL_TYPE, Toolkit::Control::SIGNAL_PINCHED, &Internal::Control::DoConnectSignal );
+SignalConnectorType SIGNAL_CONNECTOR_5( CONTROL_TYPE, Toolkit::Control::SIGNAL_LONG_PRESSED, &Internal::Control::DoConnectSignal );
+
/**
* Structure which holds information about the background of a control
*/
{
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>( constrainingIndex,
controlImpl.SetBackground( image );
}
}
- else if ( value.Get< Property::Map >().empty() )
+ else if ( value.Get< Property::Map >().Empty() )
{
// An empty map means the background is no longer required
controlImpl.ClearBackground();
Image image = imageActor.GetImage();
Property::Map imageMap;
Scripting::CreatePropertyMap( image, imageMap );
- map.push_back( Property::StringValuePair( "image", imageMap ) );
+ map[ "image" ] = imageMap;
}
}
Toolkit::Control::SizePolicy mWidthPolicy :3; ///< Stores the width policy. 3 bits covers 8 values
Toolkit::Control::SizePolicy mHeightPolicy :3; ///< Stores the height policy. 3 bits covers 8 values
- ControlBehaviour mFlags :4; ///< Flags passed in from constructor. Need to increase this size when new enums are added
+ ControlBehaviour mFlags :6; ///< Flags passed in from constructor. Need to increase this size when new enums are added
bool mInsideRelayout:1; ///< Detect when were in Relayout
bool mIsKeyboardNavigationSupported:1; ///< Stores whether keyboard navigation is supported by the control.
bool mIsKeyboardFocusGroup:1; ///< Stores whether the control is a focus group.
Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
// Register for style changes
- styleManager.StyleChangeSignal().Connect( this, &ControlImpl::DoStyleChange );
+ styleManager.StyleChangeSignal().Connect( this, &Control::DoStyleChange );
// SetTheme
GetImpl( styleManager ).ApplyThemeStyle( GetOwner() );
}
+ SetRequiresHoverEvents(mImpl->mFlags & REQUIRES_HOVER_EVENTS);
+ SetRequiresMouseWheelEvents(mImpl->mFlags & REQUIRES_MOUSE_WHEEL_EVENTS);
+
mImpl->mInitialized = true;
}
return false; // Do not consume
}
+bool Control::OnHoverEvent(const HoverEvent& event)
+{
+ return false; // Do not consume
+}
+
bool Control::OnKeyEvent(const KeyEvent& event)
{
return false; // Do not consume
return ret;
}
+bool Control::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
+{
+ Dali::BaseHandle handle( object );
+
+ bool connected( false );
+ Toolkit::Control control = Toolkit::Control::DownCast(handle);
+ if ( control )
+ {
+ Control& controlImpl( control.GetImplementation() );
+ connected = true;
+
+ if ( Toolkit::Control::SIGNAL_KEY_EVENT == signalName )
+ {
+ controlImpl.KeyEventSignal().Connect( tracker, functor );
+ }
+ else if( Toolkit::Control::SIGNAL_TAPPED == signalName )
+ {
+ controlImpl.EnableGestureDetection( Gesture::Tap );
+ controlImpl.GetTapGestureDetector().DetectedSignal().Connect( tracker, functor );
+ }
+ else if( Toolkit::Control::SIGNAL_PANNED == signalName )
+ {
+ controlImpl.EnableGestureDetection( Gesture::Pan );
+ controlImpl.GetPanGestureDetector().DetectedSignal().Connect( tracker, functor );
+ }
+ else if( Toolkit::Control::SIGNAL_PINCHED == signalName )
+ {
+ controlImpl.EnableGestureDetection( Gesture::Pinch );
+ controlImpl.GetPinchGestureDetector().DetectedSignal().Connect( tracker, functor );
+ }
+ else if( Toolkit::Control::SIGNAL_LONG_PRESSED == signalName )
+ {
+ controlImpl.EnableGestureDetection( Gesture::LongPress );
+ controlImpl.GetLongPressGestureDetector().DetectedSignal().Connect( tracker, functor );
+ }
+ else
+ {
+ // signalName does not match any signal
+ connected = false;
+ }
+ }
+ return connected;
+}
+
void Control::DoStyleChange( Toolkit::StyleManager styleManager, StyleChange change )
{
if( change.themeChange )
}
else if( change.defaultFontChange || change.defaultFontSizeChange )
{
- // This OnStyleChange(StyleChange change ) is deprecated, use OnFontChange instead
- OnStyleChange( change );
-
OnFontChange( change.defaultFontChange, change.defaultFontSizeChange );
}
}
mImpl->SignalDisconnected( slotObserver, callback );
}
-std::size_t Control::GetConnectionCount() const
-{
- return mImpl->GetConnectionCount();
-}
-
-Control::Control( bool requiresTouchEvents )
-: CustomActorImpl( requiresTouchEvents ),
- mImpl(new Impl(*this))
-{
-}
-
Control::Control( ControlBehaviour behaviourFlags )
: CustomActorImpl( behaviourFlags & REQUIRES_TOUCH_EVENTS ),
mImpl(new Impl(*this))