diff options
author | Kangho Hur <kangho.hur@samsung.com> | 2017-07-18 06:33:30 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.ap-northeast-2.compute.internal> | 2017-07-18 06:33:30 +0000 |
commit | 08b9e97a8badfc5fc0d6730a9f2de01ef87e63df (patch) | |
tree | 1d0ce9c80dce7993c9c489340920f3892d2b8b5c | |
parent | 6f4611fbf03fd33673115ac2854c96a2d1e067de (diff) | |
parent | 96b3ebc90dfcfb33cf2bf9ad4692b6a3ce6c0a88 (diff) | |
download | elm-sharp-08b9e97a8badfc5fc0d6730a9f2de01ef87e63df.tar.gz elm-sharp-08b9e97a8badfc5fc0d6730a9f2de01ef87e63df.tar.bz2 elm-sharp-08b9e97a8badfc5fc0d6730a9f2de01ef87e63df.zip |
Merge "Fix color of progressbar" into tizen
-rwxr-xr-x | ElmSharp.Test/ElmSharp.Test.csproj | 9 | ||||
-rw-r--r-- | ElmSharp.Test/TC/ProgressBarTest2.cs | 106 | ||||
-rwxr-xr-x | ElmSharp/ElmSharp/ProgressBar.cs | 15 |
3 files changed, 126 insertions, 4 deletions
diff --git a/ElmSharp.Test/ElmSharp.Test.csproj b/ElmSharp.Test/ElmSharp.Test.csproj index 3e94c09..e03a102 100755 --- a/ElmSharp.Test/ElmSharp.Test.csproj +++ b/ElmSharp.Test/ElmSharp.Test.csproj @@ -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" /> @@ -181,10 +182,10 @@ <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/ElmSharp.Test/TC/ProgressBarTest2.cs b/ElmSharp.Test/TC/ProgressBarTest2.cs new file mode 100644 index 0000000..d85847e --- /dev/null +++ b/ElmSharp.Test/TC/ProgressBarTest2.cs @@ -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 diff --git a/ElmSharp/ElmSharp/ProgressBar.cs b/ElmSharp/ElmSharp/ProgressBar.cs index d0121e6..28f6302 100755 --- a/ElmSharp/ElmSharp/ProgressBar.cs +++ b/ElmSharp/ElmSharp/ProgressBar.cs @@ -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> |