X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=plugins%2Fdali-swig%2Fexamples%2Fscroll-view.cs;h=4e7c3aca10070393dc3dca9f1081ed1a5371479d;hp=342c82be6bd93570b3c753757311337fb39c4697;hb=1e919141627d7a3a002d21fce45163bfd2cd3fc9;hpb=1820cf3dc1c6b820bf57191cf4b498d9fa197e1b diff --git a/plugins/dali-swig/examples/scroll-view.cs b/plugins/dali-swig/examples/scroll-view.cs index 342c82b..4e7c3ac 100644 --- a/plugins/dali-swig/examples/scroll-view.cs +++ b/plugins/dali-swig/examples/scroll-view.cs @@ -50,12 +50,12 @@ namespace MyCSharpExample private void CreateScrollView() { Stage stage = Stage.GetCurrent(); - stage.BackgroundColor = new Color("white"); + stage.BackgroundColor = Color.White; // Create a scroll view _scrollView = new ScrollView(); Size stageSize = stage.Size; - _scrollView.Size = new Position(stageSize.x, stageSize.y, 0.0f); + _scrollView.Size = new Position(stageSize.W, stageSize.H, 0.0f); _scrollView.ParentOrigin = NDalic.ParentOriginCenter; _scrollView.AnchorPoint = NDalic.AnchorPointCenter; stage.Add(_scrollView); @@ -71,13 +71,13 @@ namespace MyCSharpExample pageActor.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.ALL_DIMENSIONS); pageActor.ParentOrigin = NDalic.ParentOriginCenter; pageActor.AnchorPoint = NDalic.AnchorPointCenter; - pageActor.Position = new Position(pageColumn * stageSize.x, pageRow * stageSize.y, 0.0f); + pageActor.Position = new Position(pageColumn * stageSize.W, pageRow * stageSize.H, 0.0f); // Add images in a 3x4 grid layout for each page int imageRows = 4; int imageColumns = 3; float margin = 10.0f; - Position imageSize = new Position((stageSize.x / imageColumns) - margin, (stageSize.y / imageRows) - margin, 0.0f); + Position imageSize = new Position((stageSize.W / imageColumns) - margin, (stageSize.H / imageRows) - margin, 0.0f); for(int row = 0; row < imageRows; row++) { @@ -88,8 +88,8 @@ namespace MyCSharpExample imageView.ParentOrigin = NDalic.ParentOriginCenter; imageView.AnchorPoint = NDalic.AnchorPointCenter; imageView.Size = imageSize; - imageView.Position = new Position( margin * 0.5f + (imageSize.x + margin) * column - stageSize.x * 0.5f + imageSize.x * 0.5f, - margin * 0.5f + (imageSize.y + margin) * row - stageSize.y * 0.5f + imageSize.y * 0.5f, 0.0f ); + imageView.Position = new Position( margin * 0.5f + (imageSize.X + margin) * column - stageSize.W * 0.5f + imageSize.X * 0.5f, + margin * 0.5f + (imageSize.Y + margin) * row - stageSize.H * 0.5f + imageSize.Y * 0.5f, 0.0f ); pageActor.Add(imageView); } } @@ -102,9 +102,9 @@ namespace MyCSharpExample // 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.width)); + RulerPtr scrollRulerX = new RulerPtr(new FixedRuler(stageSize.W)); RulerPtr scrollRulerY = new RulerPtr(new DefaultRuler()); - scrollRulerX.SetDomain(new RulerDomain(0.0f, stageSize.width * pageColumns, true)); + scrollRulerX.SetDomain(new RulerDomain(0.0f, stageSize.W * pageColumns, true)); scrollRulerY.Disable(); _scrollView.SetRulerX(scrollRulerX); _scrollView.SetRulerY(scrollRulerY); @@ -115,7 +115,7 @@ namespace MyCSharpExample _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 ) ), Position.ZAXIS ); + _scrollBar.Orientation = new Quaternion( new Radian( new Degree( 270.0f ) ), Vector3.ZAXIS ); _scrollBar.SetScrollDirection(ScrollBar.Direction.Horizontal); _scrollView.Add(_scrollBar); @@ -166,8 +166,8 @@ namespace MyCSharpExample _animation = new Animation(1.0f); // 1 second of duration - _animation.AnimateTo(new Property(_text, Actor.Property.ORIENTATION), new Property.Value(new Quaternion( new Radian( new Degree( 180.0f ) ), Position.XAXIS )), new AlphaFunction(AlphaFunction.BuiltinFunction.LINEAR), new TimePeriod(0.0f, 0.5f)); - _animation.AnimateTo(new Property(_text, Actor.Property.ORIENTATION), new Property.Value(new Quaternion( new Radian( new Degree( 0.0f ) ), Position.XAXIS )), new AlphaFunction(AlphaFunction.BuiltinFunction.LINEAR), new TimePeriod(0.5f, 0.5f)); + _animation.AnimateTo(new Property(_text, Actor.Property.ORIENTATION), new Property.Value(new Quaternion( new Radian( new Degree( 180.0f ) ), Vector3.XAXIS )), new AlphaFunction(AlphaFunction.BuiltinFunction.LINEAR), new TimePeriod(0.0f, 0.5f)); + _animation.AnimateTo(new Property(_text, Actor.Property.ORIENTATION), new Property.Value(new Quaternion( new Radian( new Degree( 0.0f ) ), Vector3.XAXIS )), new AlphaFunction(AlphaFunction.BuiltinFunction.LINEAR), new TimePeriod(0.5f, 0.5f)); // Connect the signal callback for animaiton finished signal _animation.Finished += AnimationFinished;