+ }
+
+ _scrollView.SetAxisAutoLock(true);
+
+ // Set scroll view to have 3 pages in X axis and allow page snapping,
+ // and also disable scrolling in Y axis.
+ RulerPtr scrollRulerX = new RulerPtr(new FixedRuler(stageSize.W));
+ RulerPtr scrollRulerY = new RulerPtr(new DefaultRuler());
+ scrollRulerX.SetDomain(new RulerDomain(0.0f, stageSize.W * pageColumns, true));
+ scrollRulerY.Disable();
+ _scrollView.SetRulerX(scrollRulerX);
+ _scrollView.SetRulerY(scrollRulerY);
+
+ // Create a horizontal scroll bar in the bottom of scroll view (which is optional)
+ _scrollBar = new ScrollBar();
+ _scrollBar.ParentOrigin = NDalic.ParentOriginBottomLeft;
+ _scrollBar.AnchorPoint = NDalic.AnchorPointTopLeft;
+ _scrollBar.SetResizePolicy(ResizePolicyType.FIT_TO_CHILDREN, DimensionType.WIDTH);
+ _scrollBar.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.HEIGHT);
+ _scrollBar.Orientation = new Quaternion( new Radian( new Degree( 270.0f ) ), Vector3.ZAXIS );
+ _scrollBar.SetScrollDirection(ScrollBar.Direction.Horizontal);
+ _scrollView.Add(_scrollBar);
+
+ // Connect to the OnRelayout signal
+ _scrollView.OnRelayoutEvent += OnScrollViewRelayout;
+ _scrollView.Touched += OnTouch;
+ _scrollView.WheelMoved += Onwheel;
+ _scrollView.KeyInputFocusGained += OnKey;
+ _text = new TextLabel("View Touch Event Handler Test");
+ _text.ParentOrigin = NDalic.ParentOriginCenter;
+ _text.AnchorPoint = NDalic.AnchorPointCenter;
+ _text.HorizontalAlignment = "CENTER";
+ _text.PointSize = 48.0f;
+
+ _scrollView.Add(_text);
+ }