Fix color of progressbar
authordarkleem <cdark.lim@samsung.com>
Fri, 14 Jul 2017 02:00:00 +0000 (11:00 +0900)
committerdarkleem <cdark.lim@samsung.com>
Fri, 14 Jul 2017 02:00:00 +0000 (11:00 +0900)
  - change color part

Change-Id: I39d5482aa74d0523453a5f7df6a5171b97e534eb
Signed-off-by: darkleem <cdark.lim@samsung.com>
src/ElmSharp/ElmSharp/ProgressBar.cs
test/ElmSharp.Test/ElmSharp.Test.csproj
test/ElmSharp.Test/TC/ProgressBarTest2.cs [new file with mode: 0644]

index d0121e6..28f6302 100755 (executable)
@@ -186,6 +186,21 @@ namespace ElmSharp
         }
 
         /// <summary>
+        /// Sets or gets the general or main color of the given Progressbar.
+        /// </summary>
+        public override Color Color
+        {
+            get
+            {
+                return GetPartColor("bar");
+            }
+            set
+            {
+                SetPartColor("bar", value);
+            }
+        }
+
+        /// <summary>
         /// Sets the part value of the give part of the Progressbar.
         /// </summary>
         /// <param name="part">Part of the Progressbar.</param>
index 3e94c09..e03a102 100755 (executable)
@@ -45,6 +45,7 @@
     <Compile Include="TC\BackgroundTest1.cs" />
     <Compile Include="TC\BackgroundTest2.cs" />
     <Compile Include="TC\BackgroundTest3.cs" />
+    <Compile Include="TC\ProgressBarTest2.cs" />
     <Compile Include="TC\TransitTest.cs" />
     <Compile Include="TC\EcoreTimerTest1.cs" />
     <Compile Include="TC\EntryTest3.cs" />
     <Content Include="tizen-manifest.xml" />
   </ItemGroup>
   <ItemGroup>
-    <Reference Include="ElmSharp, Version=1.2.0.0, Culture=neutral, PublicKeyToken=3836ec6cd2c91e8b, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\ElmSharp\bin\Debug\netstandard1.3\ElmSharp.dll</HintPath>
-    </Reference>
+    <ProjectReference Include="..\ElmSharp\ElmSharp.csproj">
+      <Project>{7a268128-a10d-478a-b813-19fd6264003c}</Project>
+      <Name>ElmSharp</Name>
+    </ProjectReference>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
diff --git a/test/ElmSharp.Test/TC/ProgressBarTest2.cs b/test/ElmSharp.Test/TC/ProgressBarTest2.cs
new file mode 100644 (file)
index 0000000..d85847e
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * 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 System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElmSharp.Test
+{
+    class ProgressBarTest2 : TestCaseBase
+    {
+        public override string TestName => "ProgressBarTest2";
+        public override string TestDescription => "To test basic operation of ProgressBar";
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box table = new Box(window)
+            {
+                BackgroundColor = Color.White,
+            };
+            conformant.SetContent(table);
+            table.Show();
+
+            ProgressBar pb1 = new ProgressBar(window)
+            {
+                Text = "ProgressBar Test",
+                Style = "process_medium",
+                Value = 0.1,
+                AlignmentX = 0,
+                AlignmentY = 0,
+                WeightX = 0,
+                WeightY = 1
+            };
+            pb1.PlayPulse();
+            Label lb1 = new Label(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1,
+            };
+
+            Button bt1 = new Button(window)
+            {
+                Text = "Increase Value",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            bt1.Clicked += (s, e) =>
+            {
+                Random rand = new Random(DateTime.UtcNow.Millisecond);
+                pb1.Color = new Color(rand.Next(255), rand.Next(255), rand.Next(255));
+                lb1.Text = pb1.Color.ToString();
+            };
+
+            Button bt2 = new Button(window)
+            {
+                Text = "zoom",
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1
+            };
+
+            bt2.Clicked += (s, e) =>
+            {
+                var map = new EvasMap(4);
+                var g = pb1.Geometry;
+                map.PopulatePoints(g, 0);
+                map.Zoom(2, 2, g.X, g.Y);
+                pb1.EvasMap = map;
+                pb1.IsMapEnabled = true;
+            };
+
+            table.PackEnd(pb1);
+            table.PackEnd(lb1);
+            table.PackEnd(bt1);
+            table.PackEnd(bt2);
+
+            pb1.Show();
+            lb1.Show();
+            bt1.Show();
+            bt2.Show();
+        }
+    }
+}
\ No newline at end of file