: mControlImpl( controlImpl ),
mBackground( NULL ),
mStartingPinchScale( NULL ),
- mKeyEventSignalV2(),
+ mKeyEventSignal(),
mPinchGestureDetector(),
mPanGestureDetector(),
mTapGestureDetector(),
Control& mControlImpl;
Background* mBackground; ///< Only create the background if we use it
Vector3* mStartingPinchScale; ///< The scale when a pinch gesture starts, TODO: consider removing this
- Toolkit::Control::KeyEventSignalV2 mKeyEventSignalV2;
+ Toolkit::Control::KeyEventSignalType mKeyEventSignal;
// Gesture Detection
PinchGestureDetector mPinchGestureDetector;
return false; // Accessibility value change action is not handled by default
}
-void Control::NegotiateSize( Vector2 allocatedSize, ActorSizeContainer& container )
+void Control::NegotiateSize( const Vector2& allocatedSize, ActorSizeContainer& container )
{
Vector2 size;
allocatedSize.x, allocatedSize.y,
size.x, size.y );
- Relayout( size, container );
+ // Avoids relayout again when OnSizeSet callback arrives as a function of us or deriving class calling SetSize()
+ mImpl->mInsideRelayout = true;
+ Self().SetSize( size );
+ // Only relayout controls which requested to be relaid out.
+ OnRelayout( size, container );
+ mImpl->mInsideRelayout = false;
}
void Control::SetAsKeyboardFocusGroup(bool isFocusGroup)
return connected;
}
-Toolkit::Control::KeyEventSignalV2& Control::KeyEventSignal()
+Toolkit::Control::KeyEventSignalType& Control::KeyEventSignal()
{
- return mImpl->mKeyEventSignalV2;
+ return mImpl->mKeyEventSignal;
}
bool Control::EmitKeyEventSignal( const KeyEvent& event )
bool consumed = false;
// signals are allocated dynamically when someone connects
- if ( !mImpl->mKeyEventSignalV2.Empty() )
+ if ( !mImpl->mKeyEventSignal.Empty() )
{
- consumed = mImpl->mKeyEventSignalV2.Emit( handle, event );
+ consumed = mImpl->mKeyEventSignal.Emit( handle, event );
}
if (!consumed)
styleManager.StyleChangeSignal().Connect( this, &Control::DoStyleChange );
// SetTheme
- GetImpl( styleManager ).ApplyThemeStyle( GetOwner() );
+ GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
}
SetRequiresHoverEvents(mImpl->mFlags & REQUIRES_HOVER_EVENTS);
}
}
-void Control::Relayout( Actor actor, Vector2 size, ActorSizeContainer& container )
+void Control::Relayout( Actor actor, const Vector2& size, ActorSizeContainer& container )
{
if ( actor )
{
void Control::OnThemeChange( Toolkit::StyleManager styleManager )
{
- GetImpl( styleManager ).ApplyThemeStyle( GetOwner() );
+ GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
}
void Control::OnFontChange( bool defaultFontChange, bool defaultFontSizeChange )
{
}
-void Control::OnRelaidOut( Vector2 size, ActorSizeContainer& container )
+void Control::OnRelayout( const Vector2& size, ActorSizeContainer& container )
{
unsigned int numChildren = Self().GetChildCount();
}
}
-void Control::Relayout(Vector2 size, ActorSizeContainer& container)
-{
- // Avoids relayout again when OnSizeSet callback arrives.
- mImpl->mInsideRelayout = true;
- Self().SetSize( size );
- // @todo this really needs to be at the end of method but not sure why the scope used to be only the SetSize, needs to be cleaned up in size negotiation rework
- mImpl->mInsideRelayout = false;
-
- // Only relayout controls which requested to be relaid out.
- OnRelaidOut( size, container );
-}
-
} // namespace Internal
} // namespace Toolkit