2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 using System.Collections.Generic;
21 using System.Threading.Tasks;
23 namespace ElmSharp.Test
25 class SliderTest1 : TestCaseBase
27 public override string TestName => "SliderTest1";
28 public override string TestDescription => "To test basic operation of Slider";
30 public override void Run(Window window)
32 Conformant conformant = new Conformant(window);
34 Table table = new Table(window);
35 conformant.SetContent(table);
38 Slider sld1 = new Slider(window)
41 IndicatorFormat = "%1.2f meters",
49 IsIndicatorFocusable = true
52 Button btn = new Button(window)
58 Text = "Set IsIndicatorFocusable"
60 btn.Clicked += (s, e) =>
62 if (sld1.IsIndicatorFocusable)
64 sld1.IsIndicatorFocusable = false;
68 sld1.IsIndicatorFocusable = true;
72 Button btn2 = new Button(window)
78 Text = "Set IndicatorVisibleMode"
80 btn2.Clicked += (s, e) =>
82 if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.Default)
84 sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.Always;
87 else if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.Always)
89 sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.OnFocus;
90 btn2.Text = "OnFocus";
92 else if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.OnFocus)
94 sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.None;
99 sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.Default;
100 btn2.Text = "Default";
104 Label lb1 = new Label(window)
112 table.Pack(sld1, 1, 1, 2, 1);
113 table.Pack(btn, 1, 2, 2, 1);
114 table.Pack(btn2, 1, 3, 2, 1);
115 table.Pack(lb1, 1, 4, 2, 1);
122 sld1.ValueChanged += (s, e) =>
124 lb1.Text = string.Format("Value Changed: {0}", sld1.Value);
125 lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";