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 SliderTest2 : TestCaseBase
27 public override string TestName => "SliderTest2";
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 sld = new Slider(window)
41 IndicatorFormat = "%1.2f meters",
49 IsIndicatorFocusable = true
52 Label lb1 = new Label(window)
58 Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString()),
60 lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
62 Label lb2 = new Label(window)
68 Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString()),
70 lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
72 Button btn1 = new Button(window)
78 Text = "Change IndicatorVisibleMode"
80 btn1.Clicked += (s, e) =>
82 sld.IndicatorVisibleMode = (SliderIndicatorVisibleMode)(((int)sld.IndicatorVisibleMode + 1) % 4);
83 lb1.Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString());
84 lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
87 Button btn2 = new Button(window)
93 Text = "Change IsIndicatorVisible"
95 btn2.Clicked += (s, e) =>
97 sld.IsIndicatorVisible = !sld.IsIndicatorVisible;
98 lb2.Text = string.Format("IsIndicatorVisible={0}", sld.IsIndicatorVisible.ToString());
99 lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
102 table.Pack(sld, 1, 1, 2, 1);
103 table.Pack(lb1, 1, 2, 2, 1);
104 table.Pack(lb2, 1, 3, 2, 1);
105 table.Pack(btn1, 1, 4, 2, 1);
106 table.Pack(btn2, 1, 5, 2, 1);
114 sld.ValueChanged += (s, e) =>
116 lb1.Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString());
117 lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
119 lb2.Text = string.Format("IsIndicatorVisible={0}", sld.IsIndicatorVisible.ToString());
120 lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";