Make Up calls to control consistent so they are called at the end by derived classes 97/107897/9
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 30 Dec 2016 13:38:08 +0000 (13:38 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 6 Jan 2017 10:31:10 +0000 (10:31 +0000)
- 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

33 files changed:
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp
dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp
dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp
dali-toolkit/internal/controls/flex-container/flex-container-impl.h
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp
dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp
dali-toolkit/internal/controls/model3d-view/model3d-view-impl.cpp
dali-toolkit/internal/controls/navigation-view/navigation-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.cpp
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.h
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.h
dali-toolkit/internal/controls/table-view/table-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.h
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h
dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.h
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp
dali-toolkit/internal/controls/video-view/video-view-impl.cpp
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp
dali-toolkit/public-api/controls/control-impl.h
docs/content/shared-javascript-and-cpp-documentation/creating-custom-controls.md

index e8c266d..ed4d02c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -207,12 +207,12 @@ void DummyControlImplOverride::OnPinch(const PinchGesture& pinch) { pinchCalled
 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; }
index 9bfb68c..085772e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -277,8 +277,6 @@ void BloomView::OnInitialize()
 
 void BloomView::OnSizeSet(const Vector3& targetSize)
 {
-  Control::OnSizeSet( targetSize );
-
   mTargetSize = Vector2(targetSize);
   mChildrenRoot.SetSize(targetSize);
   mCompositeImageView.SetSize(targetSize);
@@ -300,16 +298,18 @@ void BloomView::OnSizeSet(const Vector3& 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 )
index 44bc39b..08cfc16 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -289,8 +289,6 @@ void EffectsView::OnInitialize()
 
 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
@@ -304,13 +302,15 @@ void EffectsView::OnSizeSet(const Vector3& targetSize)
   }
 
   mChildrenRoot.SetSize( targetSize );
+
+  Control::OnSizeSet( targetSize );
 }
 
 void EffectsView::OnStageConnection( int depth )
 {
-  Control::OnStageConnection( depth );
-
   Enable();
+
+  Control::OnStageConnection( depth );
 }
 
 void EffectsView::OnStageDisconnection()
@@ -328,12 +328,12 @@ 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 )
index 94a92a7..03d4583 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -465,8 +465,6 @@ Property::Value FlexContainer::GetProperty( BaseObject* object, Property::Index
 
 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 );
@@ -478,6 +476,8 @@ void FlexContainer::OnChildAdd( Actor& child )
   childNode.node->get_child = GetChildNodeAtIndex;
   childNode.node->is_dirty = IsNodeDirty;
   mChildrenNodes.push_back(childNode);
+
+  Control::OnChildAdd( child );
 }
 
 void FlexContainer::OnChildRemove( Actor& child )
@@ -562,11 +562,8 @@ void FlexContainer::OnSizeSet( const Vector3& size )
 
     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()
index f89c1f4..ce09e23 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -205,11 +205,6 @@ private: // From Control
    */
   virtual void OnSizeSet( const Vector3& size );
 
-  /**
-   * @copydoc CustomActorImpl::OnSizeAnimation(Animation&, const Vector3&)
-   */
-  virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
-
 private: // Implementation
 
   /**
index a202236..2dddad7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -330,8 +330,6 @@ void GaussianBlurView::OnInitialize()
 
 void GaussianBlurView::OnSizeSet(const Vector3& targetSize)
 {
-  Control::OnSizeSet( targetSize );
-
   mTargetSize = Vector2(targetSize);
 
   mChildrenRoot.SetSize(targetSize);
@@ -356,16 +354,18 @@ void GaussianBlurView::OnSizeSet(const Vector3& 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 )
index 12205a6..bb48404 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -288,8 +288,6 @@ void Magnifier::SetFrameVisibility(bool visible)
 
 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
@@ -297,6 +295,8 @@ void Magnifier::OnSizeSet(const Vector3& targetSize)
   // a constraint yet as Camera/CameraActor properties are not animatable/constrainable.
   mActorSize = targetSize;
   Update();
+
+  Control::OnSizeSet( targetSize );
 }
 
 float Magnifier::GetMagnificationFactor() const
index dd90747..9c22982 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -428,8 +428,6 @@ Property::Value Model3dView::GetProperty( BaseObject* object, Property::Index in
 
 void Model3dView::OnStageConnection( int depth )
 {
-  Control::OnStageConnection( depth );
-
   CustomActor self = Self();
   self.AddRenderer( mRenderer );
 
@@ -449,6 +447,8 @@ void Model3dView::OnStageConnection( int depth )
     constraint.AddSource( Source( self, Toolkit::Model3dView::Property::LIGHT_POSITION ) );
     constraint.Apply();
   }
+
+  Control::OnStageConnection( depth );
 }
 
 ///////////////////////////////////////////////////////////
index 1d15650..5ddf48c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -74,6 +74,8 @@ Toolkit::NavigationView NavigationView::New()
 void NavigationView::OnStageConnection( int depth )
 {
   Self().SetSensitive(true);
+
+  Control::OnStageConnection( depth );
 }
 
 void NavigationView::Push( Actor& actor )
index dc60e63..a66813a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -473,9 +473,9 @@ void PageTurnView::SetupShadowView()
 
 void PageTurnView::OnStageConnection( int depth )
 {
-  Control::OnStageConnection( depth );
-
   SetupShadowView();
+
+  Control::OnStageConnection( depth );
 }
 
 void PageTurnView::OnStageDisconnection()
index d12e273..9794921 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -1574,16 +1574,14 @@ bool Popup::OnDialogTouched( Actor actor, const TouchData& touch )
 
 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 )
   {
@@ -1594,6 +1592,8 @@ void Popup::OnChildAdd( Actor& child )
     mLayoutDirty = true;
     RelayoutRequest();
   }
+
+  Control::OnChildAdd( child );
 }
 
 void Popup::LayoutContext( const Vector2& size )
index 2192d5e..6e301cb 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -496,6 +496,8 @@ void ScrollBar::OnSizeSet( const Vector3& size )
   {
     mIndicator.SetSize(size.width, mIndicatorFixedHeight);
   }
+
+  Control::OnSizeSet( size );
 }
 
 void ScrollBar::SetScrollDirection( Toolkit::ScrollBar::Direction direction )
index 7770147..a5741ab 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -997,6 +997,8 @@ void ItemView::OnChildAdd(Actor& child)
                                         Toolkit::ItemView::Property::SCROLL_CONTENT_SIZE);
     }
   }
+
+  Scrollable::OnChildAdd( child );
 }
 
 bool ItemView::OnWheelEvent(const WheelEvent& event)
index 0d8becc..0da1660 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -701,8 +701,6 @@ void ScrollView::OnInitialize()
 
 void ScrollView::OnStageConnection( int depth )
 {
-  ScrollBase::OnStageConnection( depth );
-
   DALI_LOG_SCROLL_STATE("[0x%X]", this);
 
   if ( mSensitive )
@@ -710,11 +708,14 @@ void ScrollView::OnStageConnection( int depth )
     SetScrollSensitive( false );
     SetScrollSensitive( true );
   }
+
   if(IsOvershootEnabled())
   {
     // try and make sure property notifications are set
     EnableScrollOvershoot(true);
   }
+
+  ScrollBase::OnStageConnection( depth );
 }
 
 void ScrollView::OnStageDisconnection()
@@ -1941,6 +1942,8 @@ void ScrollView::OnSizeSet( const Vector3& size )
   {
     mOvershootIndicator->Reset();
   }
+
+  ScrollBase::OnSizeSet( size );
 }
 
 void ScrollView::OnChildAdd(Actor& child)
index b486fbb..c8605c1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -297,12 +297,12 @@ void ShadowView::OnInitialize()
 
 void ShadowView::OnChildAdd( Actor& child )
 {
-  Control::OnChildAdd( child );
-
   if( child != mChildrenRoot && child != mBlurRootActor)
   {
     mChildrenRoot.Add( child );
   }
+
+  Control::OnChildAdd( child );
 }
 
 void ShadowView::OnChildRemove( Actor& child )
index 1d2e001..f322618 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -205,10 +205,6 @@ void Slider::OnInitialize()
   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 ) );
index 7879f37..cbb23b0 100755 (executable)
@@ -2,7 +2,7 @@
 #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.
@@ -282,11 +282,6 @@ protected:
   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 );
index 4e74276..a93257d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -292,6 +292,8 @@ void SuperBlurView::OnSizeSet( const Vector3& targetSize )
       SetImage( mInputImage );
     }
   }
+
+  Control::OnSizeSet( targetSize );
 }
 
 void SuperBlurView::OnStageConnection( int depth )
@@ -301,7 +303,7 @@ 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();
@@ -310,6 +312,7 @@ void SuperBlurView::OnStageConnection( int depth )
     // 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 )
@@ -322,11 +325,6 @@ void SuperBlurView::OnStageConnection( int depth )
   }
 }
 
-void SuperBlurView::OnStageDisconnection( )
-{
-  Control::OnStageDisconnection();
-}
-
 Vector3 SuperBlurView::GetNaturalSize()
 {
   if( mInputImage )
index 4380a6e..0c782c9 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -132,11 +132,6 @@ private: // from Control
   virtual void OnStageConnection( int depth );
 
   /**
-   * @copydoc CustomActorImpl::OnStageDisconnection()
-   */
-  virtual void OnStageDisconnection();
-
-  /**
    * @copydoc CustomActorImpl::GetNaturalSize()
    */
   virtual Vector3 GetNaturalSize();
index dea576c..0bace7e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -795,6 +795,8 @@ void TableView::OnSizeSet( const Vector3& size )
   // 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 )
@@ -961,98 +963,101 @@ Property::Value TableView::GetProperty( BaseObject* object, Property::Index inde
 
 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 )
index fec052a..aab4f95 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -1374,13 +1374,13 @@ void TextEditor::KeyboardStatusChanged(bool keyboardShown)
 
 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 )
index 44dc851..63568e6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -1572,13 +1572,13 @@ void TextField::KeyboardStatusChanged(bool keyboardShown)
 
 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 )
index e4a8b53..9f7863f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -790,14 +790,6 @@ void TextLabel::OnStageConnect( Dali::Actor actor )
   }
 }
 
-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
index c928763..bc2459f 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -95,11 +95,6 @@ private: // From Control
    */
   virtual float GetHeightForWidth( float width );
 
-  /**
-   * @copydoc Control::OnStageConnection()
-   */
-  virtual void OnStageConnection( int depth );
-
 // From ControlInterface
 
   /**
index c91f71d..459e534 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -394,15 +394,6 @@ void TextSelectionPopup::OnInitialize()
   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();
index e2a9497..419720f 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -142,11 +142,6 @@ private: // From Control
    */
   virtual void OnInitialize();
 
-  /**
-   * @copydoc Control::OnStageConnection()
-   */
-  virtual void OnStageConnection( int depth );
-
 private: // Implementation
 
   void HideAnimationFinished( Animation& animation );
index 00c74f4..cdd2226 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -151,15 +151,6 @@ void TextSelectionToolbar::OnRelayout( const Vector2& size, RelayoutContainer& c
   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;
index 46e633b..d44daf0 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -97,11 +97,6 @@ private: // From Control
   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)
    */
index 851945d..441b640 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -317,8 +317,6 @@ void ToolBar::OnInitialize()
 
 void ToolBar::OnChildAdd(Actor& child)
 {
-  Control::OnChildAdd( child );
-
   if( !mInitializing )
   {
     // An actor is being added through the Actor's API.
@@ -335,6 +333,8 @@ void ToolBar::OnChildAdd(Actor& child)
   // 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
index 51bf9a2..2ec07ef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -439,13 +439,13 @@ void VideoView::SetDepthIndex( int depthIndex )
 
 void VideoView::OnStageConnection( int depth )
 {
-  Control::OnStageConnection( depth );
-
   if( mVisual )
   {
     CustomActor self = Self();
     Toolkit::GetImplementation(mVisual).SetOnStage( self );
   }
+
+  Control::OnStageConnection( depth );
 }
 
 void VideoView::OnStageDisconnection()
index ffa43e0..460ea31 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -246,8 +246,6 @@ void CubeTransitionEffect::Initialize()
 
 void CubeTransitionEffect::OnStageConnection( int depth )
 {
-  Control::OnStageConnection( depth );
-
   Geometry geometry = VisualFactoryCache::CreateQuadGeometry();
   Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
 
@@ -262,6 +260,8 @@ void CubeTransitionEffect::OnStageConnection( int depth )
 
   mCurrentRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, depth );
   Self().AddRenderer( mCurrentRenderer );
+
+  Control::OnStageConnection( depth );
 }
 
 void CubeTransitionEffect::OnStageDisconnection()
index 541d489..c21bdae 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -393,7 +393,7 @@ protected: // From CustomActorImpl, not to be used by application developers
 
   /**
    * @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 );
 
@@ -405,7 +405,7 @@ protected: // From CustomActorImpl, not to be used by application developers
 
   /**
    * @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 );
 
@@ -417,13 +417,13 @@ protected: // From CustomActorImpl, not to be used by application developers
 
   /**
    * @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 );
 
index a1451ee..24620d8 100644 (file)
@@ -341,10 +341,10 @@ An up call to the Control class is necessary if these methods are overridden.
 // 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}
@@ -371,10 +371,10 @@ An up call to the Control class is necessary if these methods are overridden.
 // 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}