summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungkeun Lee <sngn.lee@samsung.com>2017-05-31 02:29:22 +0000
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>2017-05-31 02:29:22 +0000
commit18604b62a7509bcb4b1bd312fd8f19b03188b663 (patch)
treee6b8be3c6a625c5fd64b83d820bccabb76814147
parentb8310b445102d33193cca29fce2788bf39ad9eea (diff)
parent3547560e29ee5f63b954d0a8e000e4c11c8be090 (diff)
downloadelm-sharp-18604b62a7509bcb4b1bd312fd8f19b03188b663.tar.gz
elm-sharp-18604b62a7509bcb4b1bd312fd8f19b03188b663.tar.bz2
elm-sharp-18604b62a7509bcb4b1bd312fd8f19b03188b663.zip
Merge "Add the Toolbar TC for changing the background color of Toolbar and ToolbarItem" into tizen
-rwxr-xr-x[-rw-r--r--]ElmSharp.Test/ElmSharp.Test.csproj1
-rwxr-xr-xElmSharp.Test/TC/ToolbarTest3.cs76
2 files changed, 77 insertions, 0 deletions
diff --git a/ElmSharp.Test/ElmSharp.Test.csproj b/ElmSharp.Test/ElmSharp.Test.csproj
index 68c9815..8457572 100644..100755
--- a/ElmSharp.Test/ElmSharp.Test.csproj
+++ b/ElmSharp.Test/ElmSharp.Test.csproj
@@ -110,6 +110,7 @@
<Compile Include="TC\SpinnerTest1.cs" />
<Compile Include="TC\ToolbarTest1.cs" />
<Compile Include="TC\ToolbarTest2.cs" />
+ <Compile Include="TC\ToolbarTest3.cs" />
<Compile Include="TC\WindowInternalTest.cs" />
<Compile Include="TestCaseBase.cs" />
<Compile Include="TestRunner.cs" />
diff --git a/ElmSharp.Test/TC/ToolbarTest3.cs b/ElmSharp.Test/TC/ToolbarTest3.cs
new file mode 100755
index 0000000..6261aed
--- /dev/null
+++ b/ElmSharp.Test/TC/ToolbarTest3.cs
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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 ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+ public class ToolbarTest3 : TestCaseBase
+ {
+ Dictionary<ToolbarItem, int> _itemTable = new Dictionary<ToolbarItem, int>();
+ Dictionary<int, ToolbarItem> _reverseItemTable = new Dictionary<int, ToolbarItem>();
+ public override string TestName => "ToolbarTest3";
+ public override string TestDescription => "To test basic operation of Toolbar for changing bg color";
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Box outterBox = new Box(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ IsHorizontal = false,
+ BackgroundColor = Color.Aqua,
+ };
+ outterBox.Show();
+
+ Toolbar toolbar = new Toolbar(window)
+ {
+ AlignmentX = -1,
+ WeightX = 1,
+ };
+
+ var rnd = new Random();
+ toolbar.BackgroundColor = Color.FromRgb(rnd.Next(255), rnd.Next(255), rnd.Next(255));
+ toolbar.Show();
+ outterBox.PackEnd(toolbar);
+
+ for (int i = 0; i < 5; i++)
+ {
+ ToolbarItem item = toolbar.Append(string.Format("{0} home", i), "home");
+ Color bgColor = Color.FromRgb(rnd.Next(255), rnd.Next(255), rnd.Next(255));
+ item.SetPartColor("bg", bgColor);
+ }
+
+ toolbar.Selected += (s, e) =>
+ {
+ e.Item.DeletePartColor("bg");
+ };
+
+ Label lb = new Label(window)
+ {
+ Text = "Please, click an item for delete part color",
+ };
+ lb.Show();
+ outterBox.PackEnd(lb);
+ conformant.SetContent(outterBox);
+ }
+ }
+}