diff options
author | Seungkeun Lee <sngn.lee@samsung.com> | 2017-05-12 15:11:46 +0900 |
---|---|---|
committer | Seungkeun Lee <sngn.lee@samsung.com> | 2017-05-15 13:57:35 +0900 |
commit | ccbcef9361801816269881be3556d66a89e0b96d (patch) | |
tree | 60ec93a692d55504aa53c66e1983dee85be71f5c /ElmSharp.Test | |
parent | 267230a4a801adab807b41eeb0b99e5eae2d0815 (diff) | |
download | elm-sharp-ccbcef9361801816269881be3556d66a89e0b96d.tar.gz elm-sharp-ccbcef9361801816269881be3556d66a89e0b96d.tar.bz2 elm-sharp-ccbcef9361801816269881be3556d66a89e0b96d.zip |
Add BackButtonPressed/MoreButtonPressed event on EvasObject
- Using eext_object_event_callback_add
- It automatically routing Button event depend on Z-order
Change-Id: I29759e6cdad3d176b5f493f54400a3fd64d33b40
Diffstat (limited to 'ElmSharp.Test')
-rw-r--r-- | ElmSharp.Test/TC/PopupTest1.cs | 7 | ||||
-rw-r--r-- | ElmSharp.Test/TestRunner.cs | 27 |
2 files changed, 17 insertions, 17 deletions
diff --git a/ElmSharp.Test/TC/PopupTest1.cs b/ElmSharp.Test/TC/PopupTest1.cs index c3e0a5d..90eda9c 100644 --- a/ElmSharp.Test/TC/PopupTest1.cs +++ b/ElmSharp.Test/TC/PopupTest1.cs @@ -62,13 +62,18 @@ namespace ElmSharp.Test popup.TimedOut += (s, e) => { Console.WriteLine("Popup time out"); - popup.Show(); }; popup.Append("Label1"); popup.Append("Label2"); popup.Append("Label3"); + popup.BackButtonPressed += (s, e) => + { + Console.WriteLine("!!! BackButtonPressed Event on Popup!!"); + popup.Hide(); + }; + btn.Clicked += (s, e) => { popup.Show(); diff --git a/ElmSharp.Test/TestRunner.cs b/ElmSharp.Test/TestRunner.cs index ebdab32..3ee156b 100644 --- a/ElmSharp.Test/TestRunner.cs +++ b/ElmSharp.Test/TestRunner.cs @@ -107,27 +107,19 @@ namespace ElmSharp.Test window.Show(); if (isSecond) { - window.KeyGrab(EvasKeyEventArgs.PlatformBackButtonName, true); - window.KeyUp += (s, e) => + window.BackButtonPressed += (s, e) => { - if (e.KeyName == EvasKeyEventArgs.PlatformBackButtonName) - { - window.Hide(); - window.Unrealize(); - GC.Collect(); - GC.WaitForPendingFinalizers(); - } + window.Hide(); + window.Unrealize(); + GC.Collect(); + GC.WaitForPendingFinalizers(); }; } else { - window.KeyGrab(EvasKeyEventArgs.PlatformBackButtonName, false); - window.KeyUp += (s, e) => + window.BackButtonPressed += (s, e) => { - if (e.KeyName == EvasKeyEventArgs.PlatformBackButtonName) - { - UIExit(); - } + UIExit(); }; } return window; @@ -147,7 +139,10 @@ namespace ElmSharp.Test WeightY = 1, }; box.Show(); - conformant.SetContent(box); + var bg = new Background(_firstPageWindow); + bg.Color = Color.White; + bg.SetContent(box); + conformant.SetContent(bg); GenList list = new GenList(_firstPageWindow) { |