diff options
author | rina6350.you <rina6350.you@samsung.com> | 2017-06-21 20:11:01 +0900 |
---|---|---|
committer | rina6350.you <rina6350.you@samsung.com> | 2017-06-21 20:11:01 +0900 |
commit | 7a9a7c7e40ca450ef537a050177697c588c133d8 (patch) | |
tree | 395c9cacce2c89742e015c6a53315fa40ef5ef34 /ElmSharp.Test | |
parent | 93a415d1d89a6222c4ef16549bd765fc054432ad (diff) | |
download | elm-sharp-7a9a7c7e40ca450ef537a050177697c588c133d8.tar.gz elm-sharp-7a9a7c7e40ca450ef537a050177697c588c133d8.tar.bz2 elm-sharp-7a9a7c7e40ca450ef537a050177697c588c133d8.zip |
Add the scenario for chekcing GenList operation
TASK=TCAPI-2500
Change-Id: I902c331881932ff2adb853cb513af0fbc14cf3da
Diffstat (limited to 'ElmSharp.Test')
-rwxr-xr-x[-rw-r--r--] | ElmSharp.Test/TC/GenListTest2.cs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/ElmSharp.Test/TC/GenListTest2.cs b/ElmSharp.Test/TC/GenListTest2.cs index 58d0952..a22311a 100644..100755 --- a/ElmSharp.Test/TC/GenListTest2.cs +++ b/ElmSharp.Test/TC/GenListTest2.cs @@ -16,6 +16,7 @@ using System; using ElmSharp; +using System.Collections.Generic; namespace ElmSharp.Test { @@ -55,14 +56,18 @@ namespace ElmSharp.Test return string.Format("{0} - {1}", (string)obj, part); } }; + GenListItem[] items = new GenListItem[100]; - for (int i = 0; i < 100; i++) + int i = 0; + for (i = 0; i < 100; i++) { items[i] = list.Append(defaultClass, string.Format("{0} Item", i)); } list.Show(); list.ItemSelected += List_ItemSelected; + GenListItem scroll = items[0]; + box.PackEnd(list); Button first = new Button(window) { @@ -76,9 +81,20 @@ namespace ElmSharp.Test AlignmentX = -1, WeightX = 1, }; + Button Add = new Button(window) + { + Text = "Add", + AlignmentX = -1, + WeightX = 1, + }; + Add.Clicked += (s, e) => + { + scroll = list.InsertBefore(defaultClass, string.Format("{0} Item", i++), scroll); + list.ScrollTo(scroll, ScrollToPosition.In, false); + }; first.Clicked += (s, e) => { - list.ScrollTo(items[0], ScrollToPosition.In, true); + list.ScrollTo(scroll, ScrollToPosition.In, true); }; last.Clicked += (s, e) => { @@ -86,8 +102,10 @@ namespace ElmSharp.Test }; first.Show(); last.Show(); + Add.Show(); box.PackEnd(first); box.PackEnd(last); + box.PackEnd(Add); } |