Change "PositionUsesAnchorPoint" to public.
authorFeng Jin <feng16.jin@samsung.com>
Tue, 18 Apr 2017 10:50:11 +0000 (18:50 +0800)
committerFeng Jin <feng16.jin@samsung.com>
Tue, 18 Apr 2017 10:52:44 +0000 (18:52 +0800)
Please run positionUsesAnchorPoint-test.cs to test it.

Change-Id: I300712cf423efaf926cf46208ed729384c0d4be2
Signed-off-by: Feng Jin <feng16.jin@samsung.com>
NUISamples/NUISamples/NUISamples.TizenTV/NUISamples.TizenTV.csproj
NUISamples/NUISamples/NUISamples.TizenTV/examples/Main.cs
NUISamples/NUISamples/NUISamples.TizenTV/examples/positionUsesAnchorPoint-test.cs [new file with mode: 0755]
src/Tizen.NUI/src/public/Actor.cs

index 113f1ab..4769ce7 100755 (executable)
@@ -65,6 +65,7 @@
     <Compile Include="examples\hello-world.cs" />\r
     <Compile Include="examples\image-view.cs" />\r
     <Compile Include="examples\Main.cs" />\r
+    <Compile Include="examples\positionUsesAnchorPoint-test.cs" />\r
     <Compile Include="examples\relative-vector.cs" />\r
     <Compile Include="examples\scroll-view.cs" />\r
     <Compile Include="examples\test1.cs" />\r
index fe11f26..46451ce 100755 (executable)
@@ -33,6 +33,7 @@ namespace NUISamples.TizenTV.examples
             //new VisualViewTest2.VisualSample().Run(args);
             //new VisualsUsingCustomView.VisualsExample().Run(args);    //o
             //new FirstScreen.FirstScreenApp().Run(args);               //o
+            //new PositionUsesAnchorPointTest.Example().Run(args);
         }
     }
 }
diff --git a/NUISamples/NUISamples/NUISamples.TizenTV/examples/positionUsesAnchorPoint-test.cs b/NUISamples/NUISamples/NUISamples.TizenTV/examples/positionUsesAnchorPoint-test.cs
new file mode 100755 (executable)
index 0000000..f62983e
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2016 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 Tizen.NUI.UIComponents;
+using Tizen.NUI.Constants;
+//using Tizen.Applications;
+
+//------------------------------------------------------------------------------
+// <manual-generated />
+//
+// This file can only run on Tizen target. You should compile it with DaliApplication.cs, and
+// add tizen c# application related library as reference.
+//------------------------------------------------------------------------------
+namespace PositionUsesAnchorPointTest
+{
+    class Example : NUIApplication
+    {
+        private TextLabel _text1;
+        private TextLabel _text2;
+        private Stage _stage;
+
+        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();
+        }
+
+        private void Initialize()
+        {
+            // Connect the signal callback for stage touched signal
+            _stage = Stage.Instance;
+            _text1 = new TextLabel("PositionUsesAnchorPoint");
+            _text1.ParentOrigin = ParentOrigin.Center;
+            _text1.AnchorPoint = AnchorPoint.Center;
+            _text1.Position = new Position(0, 0, 0);
+            _text1.PositionUsesAnchorPoint = true;
+            _text1.HorizontalAlignment = HorizontalAlignment.HorizontalAlignCenter;
+            _text1.Size2D = new Size2D(200, 100);
+            _text1.PointSize = 10.0f;
+            _text1.BackgroundColor = Color.Blue;
+            _stage.GetDefaultLayer().Add(_text1);
+
+            _text2 = new TextLabel("PositionNotUsesAnchorPoint");
+            _text2.ParentOrigin = ParentOrigin.Center;
+            _text2.AnchorPoint = AnchorPoint.Center;
+            _text2.Position = new Position(0, 0, 0);
+            _text2.PositionUsesAnchorPoint = false;
+            _text2.HorizontalAlignment = HorizontalAlignment.HorizontalAlignCenter;
+            _text2.Size2D = new Size2D(200, 100);
+            _text2.PointSize = 10.0f;
+            _text2.BackgroundColor = Color.Red;
+            _stage.GetDefaultLayer().Add(_text2);
+        }
+
+
+
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
+        [STAThread]
+        static void _Main(string[] args)
+        {
+            Tizen.Log.Debug("NUI", "Hello mono world.");
+            Example example = new Example("stylesheet", WindowMode.Transparent);
+            example.Run(args);
+        }
+    }
+}
index e58dd58..695efc2 100755 (executable)
@@ -157,7 +157,7 @@ namespace Tizen.NUI
         /// <remarks>If false, then the top-left of the actor is used for the position.
         /// Setting this to false will allow scaling or rotation around the anchor-point without affecting the actor's position.
         /// </remarks>
-        protected bool PositionUsesAnchorPoint
+        public bool PositionUsesAnchorPoint
         {
             get
             {