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=2527c3dede5998452ccbe0fd20959068262f684a;hp=cc42168008fa2b4050a39c929203b3b01813956a;hb=1730389b12a4a189b54c04ce357a7dba026dd7b8;hpb=edc5e7ec2426fcf1a21b1e4fb659bce603a28849;ds=sidebyside diff --git a/plugins/dali-swig/examples/scroll-view.cs b/plugins/dali-swig/examples/scroll-view.cs index cc42168..2527c3d 100755 --- a/plugins/dali-swig/examples/scroll-view.cs +++ b/plugins/dali-swig/examples/scroll-view.cs @@ -54,8 +54,8 @@ namespace MyCSharpExample // Create a scroll view _scrollView = new ScrollView(); - Size stageSize = stage.Size; - _scrollView.Size = new Position(stageSize.W, stageSize.H, 0.0f); + Size2D stageSize = stage.Size; + _scrollView.Size = new Position(stageSize.Width, stageSize.Height, 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.W, pageRow * stageSize.H, 0.0f); + pageActor.Position = new Position(pageColumn * stageSize.Width, pageRow * stageSize.Height, 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.W / imageColumns) - margin, (stageSize.H / imageRows) - margin, 0.0f); + Position imageSize = new Position((stageSize.Width / imageColumns) - margin, (stageSize.Height/ 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.W * 0.5f + imageSize.X * 0.5f, - margin * 0.5f + (imageSize.Y + margin) * row - stageSize.H * 0.5f + imageSize.Y * 0.5f, 0.0f ); + imageView.Position = new Position( margin * 0.5f + (imageSize.X + margin) * column - stageSize.Width * 0.5f + imageSize.X * 0.5f, + margin * 0.5f + (imageSize.Y + margin) * row - stageSize.Height * 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.W)); + RulerPtr scrollRulerX = new RulerPtr(new FixedRuler(stageSize.Width)); RulerPtr scrollRulerY = new RulerPtr(new DefaultRuler()); - scrollRulerX.SetDomain(new RulerDomain(0.0f, stageSize.W * pageColumns, true)); + scrollRulerX.SetDomain(new RulerDomain(0.0f, stageSize.Width * pageColumns, true)); scrollRulerY.Disable(); _scrollView.SetRulerX(scrollRulerX); _scrollView.SetRulerY(scrollRulerY); @@ -125,8 +125,7 @@ namespace MyCSharpExample _scrollView.WheelMoved += Onwheel; _scrollView.KeyInputFocusGained += OnKey; _text = new TextLabel("View Touch Event Handler Test"); - _text.ParentOrigin = NDalic.ParentOriginCenter; - _text.AnchorPoint = NDalic.AnchorPointCenter; + _text.AnchorPoint = NDalic.AnchorPointTopLeft; _text.HorizontalAlignment = "CENTER"; _text.PointSize = 48.0f;