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.
19 using System.Collections.Generic;
21 namespace ElmSharp.Test
23 public class HoverselTest1 : TestCaseBase
25 public override string TestName => "HoverselTest1";
26 public override string TestDescription => "To test basic operation of Hoversel";
28 public override void Run(Window window)
30 Background bg = new Background(window)
39 window.AddResizeObject(bg);
41 Hoversel hoversel = new Hoversel(window)
47 hoversel.ItemSelected += (s, e) =>
49 Console.WriteLine("ItemSelected : " + e.Item.Label);
51 hoversel.Dismissed += (s, e) =>
53 Console.WriteLine("Hoversel is dismissed");
55 hoversel.Clicked += (s, e) =>
57 Console.WriteLine("Hoversel is Clicked");
59 hoversel.Expanded += (s, e) =>
61 Console.WriteLine("Hoversel is Expanded");
64 HoverselItem item1 = hoversel.AddItem("item1");
65 HoverselItem item2 = hoversel.AddItem("item2");
66 HoverselItem item3 = hoversel.AddItem("item3");
68 EventHandler handler = (s, e) =>
70 var item = s as HoverselItem;
71 Console.WriteLine($"{item?.Label} is selected");
73 item1.ItemSelected += handler;
74 item2.ItemSelected += handler;
75 item3.ItemSelected += handler;
77 hoversel.Resize(200, 100);
78 hoversel.Move(100, 100);
81 Button beginButton = new Button(window)
85 beginButton.Clicked += (s, e) =>
87 hoversel.HoverBegin();
89 beginButton.Resize(200, 100);
90 beginButton.Move(100, 500);