- This makes the most sense in the majority of use cases and by defining this, it's an easy rule for
control developers to follow.
Change-Id: Icb1701fbefcca70d8f81436b6d70a318e3e6fc76
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void DummyControlImplOverride::OnPan(const PanGesture& pan) { panCalled = true; }
void DummyControlImplOverride::OnTap(const TapGesture& tap) { tapCalled = true; }
void DummyControlImplOverride::OnLongPress(const LongPressGesture& longPress) { longPressCalled = true; }
-void DummyControlImplOverride::OnStageConnection( int depth ) { Control::OnStageConnection( depth ); stageConnectionCalled = true; }
+void DummyControlImplOverride::OnStageConnection( int depth ) { stageConnectionCalled = true; Control::OnStageConnection( depth ); }
void DummyControlImplOverride::OnStageDisconnection() { stageDisconnectionCalled = true; Control::OnStageDisconnection(); }
-void DummyControlImplOverride::OnChildAdd(Actor& child) { childAddCalled = true; }
-void DummyControlImplOverride::OnChildRemove(Actor& child) { childRemoveCalled = true; }
-void DummyControlImplOverride::OnSizeSet(const Vector3& targetSize) { Control::OnSizeSet( targetSize ); sizeSetCalled = true; }
-void DummyControlImplOverride::OnSizeAnimation(Animation& animation, const Vector3& targetSize) { Control::OnSizeAnimation( animation, targetSize ); sizeAnimationCalled = true; }
+void DummyControlImplOverride::OnChildAdd(Actor& child) { childAddCalled = true; Control::OnChildAdd( child ); }
+void DummyControlImplOverride::OnChildRemove(Actor& child) { childRemoveCalled = true; Control::OnChildRemove( child ); }
+void DummyControlImplOverride::OnSizeSet(const Vector3& targetSize) { sizeSetCalled = true; Control::OnSizeSet( targetSize ); }
+void DummyControlImplOverride::OnSizeAnimation(Animation& animation, const Vector3& targetSize) { sizeAnimationCalled = true; Control::OnSizeAnimation( animation, targetSize ); }
bool DummyControlImplOverride::OnTouchEvent(const TouchEvent& event) { touchEventCalled = true; return false; }
bool DummyControlImplOverride::OnHoverEvent(const HoverEvent& event) { hoverEventCalled = true; return false; }
bool DummyControlImplOverride::OnWheelEvent(const WheelEvent& event) { wheelEventCalled = true; return false; }
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void BloomView::OnSizeSet(const Vector3& targetSize)
{
- Control::OnSizeSet( targetSize );
-
mTargetSize = Vector2(targetSize);
mChildrenRoot.SetSize(targetSize);
mCompositeImageView.SetSize(targetSize);
Deactivate();
Activate();
}
+
+ Control::OnSizeSet( targetSize );
}
void BloomView::OnChildAdd( Actor& child )
{
- Control::OnChildAdd( child );
-
if( child != mChildrenRoot && child != mInternalRoot)
{
mChildrenRoot.Add( child );
}
+
+ Control::OnChildAdd( child );
}
void BloomView::OnChildRemove( Actor& child )
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void EffectsView::OnSizeSet(const Vector3& targetSize)
{
- Control::OnSizeSet( targetSize );
-
mTargetSize = Vector2(targetSize);
// if we are already on stage, need to update render target sizes now to reflect the new size of this actor
}
mChildrenRoot.SetSize( targetSize );
+
+ Control::OnSizeSet( targetSize );
}
void EffectsView::OnStageConnection( int depth )
{
- Control::OnStageConnection( depth );
-
Enable();
+
+ Control::OnStageConnection( depth );
}
void EffectsView::OnStageDisconnection()
void EffectsView::OnChildAdd( Actor& child )
{
- Control::OnChildAdd( child );
-
if( child != mChildrenRoot && child != mCameraForChildren )
{
mChildrenRoot.Add( child );
}
+
+ Control::OnChildAdd( child );
}
void EffectsView::OnChildRemove( Actor& child )
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void FlexContainer::OnChildAdd( Actor& child )
{
- Control::OnChildAdd( child );
-
// Anchor actor to top left of the container
child.SetAnchorPoint( AnchorPoint::TOP_LEFT );
child.SetParentOrigin( ParentOrigin::TOP_LEFT );
childNode.node->get_child = GetChildNodeAtIndex;
childNode.node->is_dirty = IsNodeDirty;
mChildrenNodes.push_back(childNode);
+
+ Control::OnChildAdd( child );
}
void FlexContainer::OnChildRemove( Actor& child )
RelayoutRequest();
}
-}
-void FlexContainer::OnSizeAnimation( Animation& animation, const Vector3& targetSize )
-{
- // @todo Animate the children to their target size and position
+ Control::OnSizeSet( size );
}
void FlexContainer::ComputeLayout()
#define __DALI_TOOLKIT_INTERNAL_FLEX_CONTAINER_H__
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
virtual void OnSizeSet( const Vector3& size );
- /**
- * @copydoc CustomActorImpl::OnSizeAnimation(Animation&, const Vector3&)
- */
- virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
-
private: // Implementation
/**
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void GaussianBlurView::OnSizeSet(const Vector3& targetSize)
{
- Control::OnSizeSet( targetSize );
-
mTargetSize = Vector2(targetSize);
mChildrenRoot.SetSize(targetSize);
Deactivate();
Activate();
}
+
+ Control::OnSizeSet( targetSize );
}
void GaussianBlurView::OnChildAdd( Actor& child )
{
- Control::OnChildAdd( child );
-
if( child != mChildrenRoot && child != mInternalRoot)
{
mChildrenRoot.Add( child );
}
+
+ Control::OnChildAdd( child );
}
void GaussianBlurView::OnChildRemove( Actor& child )
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void Magnifier::OnSizeSet(const Vector3& targetSize)
{
- Control::OnSizeSet( targetSize );
-
// TODO: Once Camera/CameraActor properties function as proper animatable properties
// this code can disappear.
// whenever the size of the magnifier changes, the field of view needs to change
// a constraint yet as Camera/CameraActor properties are not animatable/constrainable.
mActorSize = targetSize;
Update();
+
+ Control::OnSizeSet( targetSize );
}
float Magnifier::GetMagnificationFactor() const
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void Model3dView::OnStageConnection( int depth )
{
- Control::OnStageConnection( depth );
-
CustomActor self = Self();
self.AddRenderer( mRenderer );
constraint.AddSource( Source( self, Toolkit::Model3dView::Property::LIGHT_POSITION ) );
constraint.Apply();
}
+
+ Control::OnStageConnection( depth );
}
///////////////////////////////////////////////////////////
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void NavigationView::OnStageConnection( int depth )
{
Self().SetSensitive(true);
+
+ Control::OnStageConnection( depth );
}
void NavigationView::Push( Actor& actor )
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void PageTurnView::OnStageConnection( int depth )
{
- Control::OnStageConnection( depth );
-
SetupShadowView();
+
+ Control::OnStageConnection( depth );
}
void PageTurnView::OnStageDisconnection()
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void Popup::OnStageConnection( int depth )
{
- Control::OnStageConnection( depth );
-
mLayoutDirty = true;
RelayoutRequest();
+
+ Control::OnStageConnection( depth );
}
void Popup::OnChildAdd( Actor& child )
{
- Control::OnChildAdd( child );
-
// Re-parent any children added by user to the body layer.
if( mAlterAddedChild )
{
mLayoutDirty = true;
RelayoutRequest();
}
+
+ Control::OnChildAdd( child );
}
void Popup::LayoutContext( const Vector2& size )
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
mIndicator.SetSize(size.width, mIndicatorFixedHeight);
}
+
+ Control::OnSizeSet( size );
}
void ScrollBar::SetScrollDirection( Toolkit::ScrollBar::Direction direction )
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Toolkit::ItemView::Property::SCROLL_CONTENT_SIZE);
}
}
+
+ Scrollable::OnChildAdd( child );
}
bool ItemView::OnWheelEvent(const WheelEvent& event)
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void ScrollView::OnStageConnection( int depth )
{
- ScrollBase::OnStageConnection( depth );
-
DALI_LOG_SCROLL_STATE("[0x%X]", this);
if ( mSensitive )
SetScrollSensitive( false );
SetScrollSensitive( true );
}
+
if(IsOvershootEnabled())
{
// try and make sure property notifications are set
EnableScrollOvershoot(true);
}
+
+ ScrollBase::OnStageConnection( depth );
}
void ScrollView::OnStageDisconnection()
{
mOvershootIndicator->Reset();
}
+
+ ScrollBase::OnSizeSet( size );
}
void ScrollView::OnChildAdd(Actor& child)
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void ShadowView::OnChildAdd( Actor& child )
{
- Control::OnChildAdd( child );
-
if( child != mChildrenRoot && child != mBlurRootActor)
{
mChildrenRoot.Add( child );
}
+
+ Control::OnChildAdd( child );
}
void ShadowView::OnChildRemove( Actor& child )
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
self.TouchSignal().Connect( this, &Slider::OnTouch );
}
-void Slider::OnSizeSet( const Vector3& size )
-{
-}
-
void Slider::OnRelayout( const Vector2& size, RelayoutContainer& container )
{
SetHitRegion( Vector2( size.x, GetHitRegion().y ) );
#define __DALI_TOOLKIT_INTERNAL_SLIDER_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
virtual ~Slider();
/**
- * @copydoc CustomActorImpl::OnSizeSet( const Vector3& size )
- */
- virtual void OnSizeSet( const Vector3& size );
-
- /**
* @copydoc CustomActorImpl::OnRelayout
*/
virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
SetImage( mInputImage );
}
}
+
+ Control::OnSizeSet( targetSize );
}
void SuperBlurView::OnStageConnection( int depth )
return;
}
- // Chaining up first ensures visuals have SetOnStage called to create their renderers
+ // Exception to the rule, chaining up first ensures visuals have SetOnStage called to create their renderers
Control::OnStageConnection( depth );
Actor self = Self();
// Note that the renderer indices are depending on the order they been added to the actor
// which might be different from the blur level of its texture.
// We can check the depth index of the renderer to know which blurred image it renders.
+ // All visuals WILL have renderers at this point as we are simply creating visuals with an Image handle.
Renderer renderer = self.GetRendererAt( i );
int depthIndex = renderer.GetProperty<int>(Renderer::Property::DEPTH_INDEX);
if( depthIndex > 0 )
}
}
-void SuperBlurView::OnStageDisconnection( )
-{
- Control::OnStageDisconnection();
-}
-
Vector3 SuperBlurView::GetNaturalSize()
{
if( mInputImage )
#define __DALI_TOOLKIT_INTERNAL_SUPER_BLUR_VIEW_H__
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
virtual void OnStageConnection( int depth );
/**
- * @copydoc CustomActorImpl::OnStageDisconnection()
- */
- virtual void OnStageDisconnection();
-
- /**
* @copydoc CustomActorImpl::GetNaturalSize()
*/
virtual Vector3 GetNaturalSize();
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// rows and columns must be recalculated or the new size will not take effect.
mRowDirty = mColumnDirty = true;
RelayoutRequest();
+
+ Control::OnSizeSet( size );
}
void TableView::OnRelayout( const Vector2& size, RelayoutContainer& container )
void TableView::OnChildAdd( Actor& child )
{
- Control::OnChildAdd( child );
-
- if( mLayoutingChild )
+ if( ! mLayoutingChild )
{
- // we're in the middle of laying out children so no point doing anything here
- return;
- }
+ // Ensure we're not in the middle of laying out children
- // Check child properties on actor to decide its position inside the table
- HorizontalAlignment::Type horizontalAlignment = HorizontalAlignment::LEFT;
- VerticalAlignment::Type verticalAlignment = VerticalAlignment::TOP;
+ // Check child properties on actor to decide its position inside the table
+ HorizontalAlignment::Type horizontalAlignment = HorizontalAlignment::LEFT;
+ VerticalAlignment::Type verticalAlignment = VerticalAlignment::TOP;
- if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT ) != Property::NONE )
- {
- std::string value = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT ).Get<std::string >();
- Scripting::GetEnumeration< HorizontalAlignment::Type >( value.c_str(),
- HORIZONTAL_ALIGNMENT_STRING_TABLE,
- HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT,
- horizontalAlignment );
- }
+ if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT ) != Property::NONE )
+ {
+ std::string value = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT ).Get<std::string >();
+ Scripting::GetEnumeration< HorizontalAlignment::Type >( value.c_str(),
+ HORIZONTAL_ALIGNMENT_STRING_TABLE,
+ HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT,
+ horizontalAlignment );
+ }
- if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT ) != Property::NONE )
- {
- std::string value = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT ).Get<std::string >();
- Scripting::GetEnumeration< VerticalAlignment::Type >( value.c_str(),
- VERTICAL_ALIGNMENT_STRING_TABLE,
- VERTICAL_ALIGNMENT_STRING_TABLE_COUNT,
- verticalAlignment );
- }
+ if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT ) != Property::NONE )
+ {
+ std::string value = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT ).Get<std::string >();
+ Scripting::GetEnumeration< VerticalAlignment::Type >( value.c_str(),
+ VERTICAL_ALIGNMENT_STRING_TABLE,
+ VERTICAL_ALIGNMENT_STRING_TABLE_COUNT,
+ verticalAlignment );
+ }
- Toolkit::TableView::CellPosition cellPosition;
- if( child.GetPropertyType( Toolkit::TableView::ChildProperty::ROW_SPAN ) != Property::NONE )
- {
- cellPosition.rowSpan = static_cast<unsigned int>( child.GetProperty( Toolkit::TableView::ChildProperty::ROW_SPAN ).Get<float>() );
- }
+ Toolkit::TableView::CellPosition cellPosition;
+ if( child.GetPropertyType( Toolkit::TableView::ChildProperty::ROW_SPAN ) != Property::NONE )
+ {
+ cellPosition.rowSpan = static_cast<unsigned int>( child.GetProperty( Toolkit::TableView::ChildProperty::ROW_SPAN ).Get<float>() );
+ }
- if( child.GetPropertyType( Toolkit::TableView::ChildProperty::COLUMN_SPAN ) != Property::NONE )
- {
- cellPosition.columnSpan = static_cast<unsigned int>( child.GetProperty( Toolkit::TableView::ChildProperty::COLUMN_SPAN ).Get<float>() );
- }
+ if( child.GetPropertyType( Toolkit::TableView::ChildProperty::COLUMN_SPAN ) != Property::NONE )
+ {
+ cellPosition.columnSpan = static_cast<unsigned int>( child.GetProperty( Toolkit::TableView::ChildProperty::COLUMN_SPAN ).Get<float>() );
+ }
- if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_INDEX ) != Property::NONE )
- {
- Vector2 indices = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_INDEX ).Get<Vector2 >();
- cellPosition.rowIndex = static_cast<unsigned int>( indices.x );
- cellPosition.columnIndex = static_cast<unsigned int>( indices.y );
+ if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_INDEX ) != Property::NONE )
+ {
+ Vector2 indices = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_INDEX ).Get<Vector2 >();
+ cellPosition.rowIndex = static_cast<unsigned int>( indices.x );
+ cellPosition.columnIndex = static_cast<unsigned int>( indices.y );
- AddChild( child, cellPosition );
- SetCellAlignment(cellPosition, horizontalAlignment, verticalAlignment);
+ AddChild( child, cellPosition );
+ SetCellAlignment(cellPosition, horizontalAlignment, verticalAlignment);
+ }
+ else
+ {
+ bool availableCellFound = false;
- // Do not continue
- return;
- }
+ // Find the first available cell to store the actor in
+ const unsigned int rowCount = mCellData.GetRows();
+ const unsigned int columnCount = mCellData.GetColumns();
+ for( unsigned int row = 0; row < rowCount && !availableCellFound; ++row )
+ {
+ for( unsigned int column = 0; column < columnCount && !availableCellFound; ++column )
+ {
+ if( !(mCellData[ row ][ column ].actor) )
+ {
+ // Put the actor in the cell
+ CellData data;
+ data.actor = child;
+ data.position.columnIndex = column;
+ data.position.rowIndex = row;
+ data.horizontalAlignment = horizontalAlignment;
+ data.verticalAlignment = verticalAlignment;
+ mCellData[ row ][ column ] = data;
+
+ availableCellFound = true;
+ break;
+ }
+ }
+ }
- // Find the first available cell to store the actor in
- const unsigned int rowCount = mCellData.GetRows();
- const unsigned int columnCount = mCellData.GetColumns();
- for( unsigned int row = 0; row < rowCount; ++row )
- {
- for( unsigned int column = 0; column < columnCount; ++column )
- {
- if( !(mCellData[ row ][ column ].actor) )
+ if( ! availableCellFound )
{
- // Put the actor in the cell
+ // No empty cells, so increase size of the table
+ unsigned int newColumnCount = ( columnCount > 0 ) ? columnCount : 1;
+ ResizeContainers( rowCount + 1, newColumnCount );
+
+ // Put the actor in the first cell of the new row
CellData data;
data.actor = child;
- data.position.columnIndex = column;
- data.position.rowIndex = row;
+ data.position.rowIndex = rowCount;
+ data.position.columnIndex = 0;
data.horizontalAlignment = horizontalAlignment;
data.verticalAlignment = verticalAlignment;
- mCellData[ row ][ column ] = data;
-
- // Don't continue
- RelayoutRequest();
- return;
+ mCellData[ rowCount ][ 0 ] = data;
}
+
+ RelayoutRequest();
}
}
- // No empty cells, so increase size of the table
- unsigned int newColumnCount = ( columnCount > 0 ) ? columnCount : 1;
- ResizeContainers( rowCount + 1, newColumnCount );
-
- // Put the actor in the first cell of the new row
- CellData data;
- data.actor = child;
- data.position.rowIndex = rowCount;
- data.position.columnIndex = 0;
- data.horizontalAlignment = horizontalAlignment;
- data.verticalAlignment = verticalAlignment;
- mCellData[ rowCount ][ 0 ] = data;
- RelayoutRequest();
+ Control::OnChildAdd( child );
}
void TableView::OnChildRemove( Actor& child )
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void TextEditor::OnStageConnection( int depth )
{
- // Call the Control::OnStageConnection() to set the depth of the background.
- Control::OnStageConnection( depth );
-
// Sets the depth to the visuals inside the text's decorator.
mDecorator->SetTextDepth( depth );
// The depth of the text renderer is set in the RenderText() called from OnRelayout().
+
+ // Call the Control::OnStageConnection() to set the depth of the background.
+ Control::OnStageConnection( depth );
}
bool TextEditor::OnTouched( Actor actor, const TouchData& touch )
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void TextField::OnStageConnection( int depth )
{
- // Call the Control::OnStageConnection() to set the depth of the background.
- Control::OnStageConnection( depth );
-
// Sets the depth to the visuals inside the text's decorator.
mDecorator->SetTextDepth( depth );
// The depth of the text renderer is set in the RenderText() called from OnRelayout().
+
+ // Call the Control::OnStageConnection() to set the depth of the background.
+ Control::OnStageConnection( depth );
}
bool TextField::OnTouched( Actor actor, const TouchData& touch )
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
}
-void TextLabel::OnStageConnection( int depth )
-{
- // Call the Control::OnStageConnection() to set the depth of the background.
- Control::OnStageConnection( depth );
-
- // The depth of the text renderer is set in the RenderText() called from OnRelayout().
-}
-
void TextLabel::ScrollingFinished()
{
// Pure Virtual from TextScroller Interface
#define DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
virtual float GetHeightForWidth( float width );
- /**
- * @copydoc Control::OnStageConnection()
- */
- virtual void OnStageConnection( int depth );
-
// From ControlInterface
/**
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
self.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
}
-void TextSelectionPopup::OnStageConnection( int depth )
-{
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextSelectionPopup::OnStageConnection\n" );
- // Call the Control::OnStageConnection() to set the depth of the background.
- Control::OnStageConnection( depth );
-
- // TextSelectionToolbar::OnStageConnection() will set the depths of all the popup's components.
-}
-
void TextSelectionPopup::HideAnimationFinished( Animation& animation )
{
Actor self = Self();
#define __DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_POPUP_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
virtual void OnInitialize();
- /**
- * @copydoc Control::OnStageConnection()
- */
- virtual void OnStageConnection( int depth );
-
private: // Implementation
void HideAnimationFinished( Animation& animation );
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
mScrollView.SetRulerX( mRulerX );
}
-void TextSelectionToolbar::OnStageConnection( int depth )
-{
- // Call the Control::OnStageConnection() to set the depth of the background.
- Control::OnStageConnection( depth );
-
- // Texts are controls, they have their own OnStageConnection() implementation.
- // Icons are inside a TableView. It has it's own OnStageConnection() implementation.
-}
-
void TextSelectionToolbar::SetPopupMaxSize( const Size& maxSize )
{
mMaxSize = maxSize;
#define DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_TOOLBAR_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
/**
- * @copydoc Control::OnStageConnection()
- */
- virtual void OnStageConnection( int depth );
-
- /**
* @brief Set max size of Popup
* @param[in] maxSize Size (Vector2)
*/
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void ToolBar::OnChildAdd(Actor& child)
{
- Control::OnChildAdd( child );
-
if( !mInitializing )
{
// An actor is being added through the Actor's API.
// No OnChildRemove method required because Actors are added to the mLayout table view, so if an
// actor is removed using the Actor::RemoveChild method it will not remove anything because the
// actor is in mLayout not in Self().
+
+ Control::OnChildAdd( child );
}
} // namespace Internal
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void VideoView::OnStageConnection( int depth )
{
- Control::OnStageConnection( depth );
-
if( mVisual )
{
CustomActor self = Self();
Toolkit::GetImplementation(mVisual).SetOnStage( self );
}
+
+ Control::OnStageConnection( depth );
}
void VideoView::OnStageDisconnection()
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void CubeTransitionEffect::OnStageConnection( int depth )
{
- Control::OnStageConnection( depth );
-
Geometry geometry = VisualFactoryCache::CreateQuadGeometry();
Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
mCurrentRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, depth );
Self().AddRenderer( mCurrentRenderer );
+
+ Control::OnStageConnection( depth );
}
void CubeTransitionEffect::OnStageDisconnection()
#define DALI_TOOLKIT_CONTROL_IMPL_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/**
* @copydoc CustomActorImpl::OnStageConnection()
- * @note If overridden, then an up-call to Control::OnStageConnection MUST be made at the start.
+ * @note If overridden, then an up-call to Control::OnStageConnection MUST be made at the end.
*/
virtual void OnStageConnection( int depth );
/**
* @copydoc CustomActorImpl::OnChildAdd()
- * @note If overridden, then an up-call to Control::OnChildAdd MUST be made at the start.
+ * @note If overridden, then an up-call to Control::OnChildAdd MUST be made at the end.
*/
virtual void OnChildAdd( Actor& child );
/**
* @copydoc CustomActorImpl::OnSizeSet()
- * @note If overridden, then an up-call to Control::OnSizeSet MUST be made at the start.
+ * @note If overridden, then an up-call to Control::OnSizeSet MUST be made at the end.
*/
virtual void OnSizeSet( const Vector3& targetSize );
/**
* @copydoc CustomActorImpl::OnSizeAnimation()
- * @note If overridden, then an up-call to Control::OnSizeAnimation MUST be made at the start.
+ * @note If overridden, then an up-call to Control::OnSizeAnimation MUST be made at the end.
*/
virtual void OnSizeAnimation( Animation& animation, const Vector3& targetSize );
// C++
void MyUIControlImpl::OnChildAdd( Actor& child );
{
- // Up call to Control first
- Control::OnChildAdd( child );
-
// Do any other operations required upon child addition
+
+ // Up call to Control at the end
+ Control::OnChildAdd( child );
}
~~~
~~~{.cpp}
// C++
void MyUIControlImpl::OnStageConnection( int depth )
{
- // Up call to Control first
- Control::OnStageConnection( depth );
-
// Do any other operations required upon stage connection
+
+ // Up call to Control at the end
+ Control::OnStageConnection( depth );
}
~~~
~~~{.cpp}