using System.Collections.Generic;
-// 1) sibling order test\r
+// 1) sibling order test
namespace Test1
{
class Example : NUIApplication
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
+ _stage.BackgroundColor = Color.White;
+
+ // 1) sibling order test
+ SiblingTest();
+
+
+ }
+
+ public void SiblingTest()
+ {
+ View _prev = null;
+ Position2D _myPos = new Position2D(100, 100);
+ List<View> list_view = new List<View>();
+ TextLabel _txt = new TextLabel();
+
+ for (int i = 0; i < 10; i++)
+ {
+ View _view0 = new PushButton();
+ PushButton _view = _view0 as PushButton;
+
+ _view.Name = "sibling" + i;
+ _view.MinimumSize = new Size2D(100, 50);
+ _view.LabelText = "sibling" + i;
+ _view.ParentOrigin = ParentOrigin.TopLeft;
+ _view.AnchorPoint = AnchorPoint.TopLeft;
+ _view.Position2D = _myPos + new Position2D(20 * i, 10 * i);
+ _view.Clicked += (sender, ee) =>
+ {
+ View curr = sender as View;
+ Tizen.Log.Debug("NUI", "clicked curr view name=" + curr.Name + " sibling=" + curr.SiblingOrder);
+ curr.RaiseToTop();
+ if (_prev)
+ {
+ _prev.LowerToBottom();
+ Tizen.Log.Debug("NUI", "raise on top is called!curr sibling=" + curr.SiblingOrder + " prev name=" + _prev.Name + " sibling=" + _prev.SiblingOrder);
+ }
+ _prev = curr;
+ _txt.Text = "on top: " + curr.Name + ", sibling order=" + curr.SiblingOrder;
+ return true;
+ };
+ list_view.Add(_view);
+ }
+
+ for (int i = 0; i < 10; i++)
+ {
+ _stage.GetDefaultLayer().Add(list_view[i]);
+ Tizen.Log.Debug("NUI", list_view[i].Name + "'s sibling order=" + list_view[i].SiblingOrder);
+ }
+
+ _txt.ParentOrigin = ParentOrigin.TopLeft;
+ _txt.AnchorPoint = AnchorPoint.TopLeft;
+ _txt.Text = "on top: sibling#, sibling order=?";
+ _txt.Position2D = _myPos + new Position2D(-50, 200);
+ _txt.TextColor = Color.Blue;
+ _stage.GetDefaultLayer().Add(_txt);
+ }
[STAThread]
static void _Main(string[] args)