d2088a2a67858e5c11a0dbc91199c2805caaf293
[platform/core/csapi/nui.git] / NUISamples / NUISamples / NUISamples.Tizen / examples / positionUsesPivotPoint-test.cs
1 /*
2  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 using System;
19 using System.Runtime.InteropServices;
20 using Tizen.NUI;
21 using Tizen.NUI.UIComponents;
22 using Tizen.NUI.BaseComponents;
23 using Tizen.NUI.Constants;
24 //using Tizen.Applications;
25
26 //------------------------------------------------------------------------------
27 // <manual-generated />
28 //
29 // This file can only run on Tizen target. You should compile it with DaliApplication.cs, and
30 // add tizen c# application related library as reference.
31 //------------------------------------------------------------------------------
32 namespace PositionUsesPivotPointTest
33 {
34     class Example : NUIApplication
35     {
36         private TextLabel _text1;
37         private TextLabel _text2;
38         private Window _window;
39
40         public Example():base()
41         {
42         }
43
44         public Example(string stylesheet):base(stylesheet)
45         {
46         }
47
48         public Example(string stylesheet, WindowMode windowMode):base(stylesheet, windowMode)
49         {
50         }
51
52         protected override void OnCreate()
53         {
54             base.OnCreate();
55             Initialize();
56         }
57
58         private void Initialize()
59         {
60             // Connect the signal callback for window touched signal
61             _window = Window.Instance;
62             _text1 = new TextLabel("PositionUsesPivotPoint");
63             _text1.ParentOrigin = ParentOrigin.Center;
64             _text1.PivotPoint = PivotPoint.Center;
65             _text1.Position = new Position(0, 0, 0);
66             _text1.PositionUsesPivotPoint = true;
67             _text1.HorizontalAlignment = HorizontalAlignment.Center;
68             _text1.Size2D = new Size2D(200, 100);
69             _text1.PointSize = 10.0f;
70             _text1.BackgroundColor = Color.Blue;
71             _window.Add(_text1);
72
73             _text2 = new TextLabel("PositionNotUsesPivotPoint");
74             _text2.ParentOrigin = ParentOrigin.Center;
75             _text2.PivotPoint = PivotPoint.Center;
76             _text2.Position = new Position(0, 0, 0);
77             _text2.PositionUsesPivotPoint = false;
78             _text2.HorizontalAlignment = HorizontalAlignment.Center;
79             _text2.Size2D = new Size2D(200, 100);
80             _text2.PointSize = 10.0f;
81             _text2.BackgroundColor = Color.Red;
82             _window.Add(_text2);
83         }
84
85
86
87         /// <summary>
88         /// The main entry point for the application.
89         /// </summary>
90         [STAThread]
91         static void _Main(string[] args)
92         {
93             Tizen.Log.Debug("NUI", "Hello mono world.");
94             Example example = new Example("stylesheet", WindowMode.Transparent);
95             example.Run(args);
96         }
97     }
98 }