+void TextInputPopup::CreateLayer( const Vector2& size )
+{
+ mLayer = Layer::New();
+ mLayer.SetParentOrigin(ParentOrigin::CENTER);
+ mLayer.SetAnchorPoint(AnchorPoint::CENTER);
+ mLayer.SetSize( size ); // matches stencil size
+ mLayer.SetName("popup-mLayer");
+}
+
+void TextInputPopup::CreateStencil( const Vector2& size )
+{
+ mStencil = CreateSolidColorActor( Color::BLUE );
+ mStencil.SetParentOrigin( Vector3( ParentOrigin::CENTER ) );
+ mStencil.SetAnchorPoint( AnchorPoint::CENTER );
+ mStencil.SetDrawMode( DrawMode::STENCIL );
+ mStencil.SetSize( size ); // slightly smaller than layer and stencil so over shoot always inside.
+ mStencil.SetVisible( true );
+ mStencil.SetName("popup-stencil");
+}
+
+void TextInputPopup::OnScrollStarted( const Vector3& position )
+{
+ mBackground.SetSensitive( false );
+}
+
+void TextInputPopup::OnScrollCompleted( const Vector3& position )
+{
+ mBackground.SetSensitive( true );
+}
+
+void TextInputPopup::CreateScrollView( const Vector2& domainSize, const Vector2& visibleSize )
+{
+ mScrollView = Toolkit::ScrollView::New();
+ mScrollView.SetName("popup-scroll-view");
+ mScrollView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mScrollView.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ mScrollView.SetSize( visibleSize.x, visibleSize.y );
+ mScrollView.SetScrollingDirection( PanGestureDetector::DIRECTION_HORIZONTAL, Degree( 40.0f ) );
+ mScrollView.SetAxisAutoLock( true );
+ mScrollView.ScrollStartedSignal().Connect( this, &TextInputPopup::OnScrollStarted );
+ mScrollView.ScrollCompletedSignal().Connect( this, &TextInputPopup::OnScrollCompleted );
+
+ RulerPtr rulerX = new DefaultRuler(); // IntrusivePtr which is unreferenced when ScrollView is destroyed.
+ RulerPtr rulerY = new DefaultRuler(); // IntrusivePtr which is unreferenced when ScrollView is destroyed.
+ rulerY->Disable();
+ rulerX->SetDomain( RulerDomain( 0, domainSize.width, true ) );
+ mScrollView.SetRulerX(rulerX);
+ mScrollView.SetRulerY(rulerY);
+}
+