--- /dev/null
+// 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.NUI;
+using System.Collections.Generic;
+
+
+// 1) sibling order test\r
+namespace Test1
+{
+ class Example : NUIApplication
+ {
+ public Example() : base()
+ {
+ }
+
+ public Example(string stylesheet) : base(stylesheet)
+ {
+ }
+
+ public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode)
+ {
+ }
+
+ protected override void OnCreate()
+ {
+ base.OnCreate();
+ Initialize();
+ }
+
+ Stage _stage;
+ public void Initialize()
+ {
+ _stage = Stage.Instance;
+ _stage.BackgroundColor = Color.White;\r
+\r
+ // 1) sibling order test\r
+ SiblingTest();\r
+\r
+\r
+ }\r
+\r
+ public void SiblingTest()\r
+ {\r
+ View _prev = null;\r
+ Position2D _myPos = new Position2D(100, 100);\r
+ List<View> list_view = new List<View>();\r
+ TextLabel _txt = new TextLabel();\r
+\r
+ for (int i = 0; i < 10; i++)\r
+ {\r
+ View _view0 = new PushButton();\r
+ PushButton _view = _view0 as PushButton;\r
+\r
+ _view.Name = "sibling" + i;\r
+ _view.MinimumSize = new Size2D(100, 50);\r
+ _view.LabelText = "sibling" + i;\r
+ _view.ParentOrigin = ParentOrigin.TopLeft;\r
+ _view.AnchorPoint = AnchorPoint.TopLeft;\r
+ _view.Position2D = _myPos + new Position2D(20 * i, 10 * i);\r
+ _view.Clicked += (sender, ee) =>\r
+ {\r
+ View curr = sender as View;\r
+ Tizen.Log.Debug("NUI", "clicked curr view name=" + curr.Name + " sibling=" + curr.SiblingOrder);\r
+ curr.RaiseToTop();\r
+ if (_prev)\r
+ {\r
+ _prev.LowerToBottom();\r
+ Tizen.Log.Debug("NUI", "raise on top is called!curr sibling=" + curr.SiblingOrder + " prev name=" + _prev.Name + " sibling=" + _prev.SiblingOrder);\r
+ }\r
+ _prev = curr;\r
+ _txt.Text = "on top: " + curr.Name + ", sibling order=" + curr.SiblingOrder;\r
+ return true;\r
+ };\r
+ list_view.Add(_view);\r
+ }\r
+\r
+ for (int i = 0; i < 10; i++)\r
+ {\r
+ _stage.GetDefaultLayer().Add(list_view[i]);\r
+ Tizen.Log.Debug("NUI", list_view[i].Name + "'s sibling order=" + list_view[i].SiblingOrder);\r
+ }\r
+\r
+ _txt.ParentOrigin = ParentOrigin.TopLeft;\r
+ _txt.AnchorPoint = AnchorPoint.TopLeft;\r
+ _txt.Text = "on top: sibling#, sibling order=?";\r
+ _txt.Position2D = _myPos + new Position2D(-50, 200);\r
+ _txt.TextColor = Color.Blue;\r
+ _stage.GetDefaultLayer().Add(_txt);\r
+ }\r
+
+ [STAThread]
+ static void _Main(string[] args)
+ {
+ Example example = new Example();
+ example.Run(args);
+ }
+ }
+}