From: xb.teng Date: Wed, 25 Jan 2017 14:30:43 +0000 (+0800) Subject: Add Toggle button example for dashboard demo. X-Git-Tag: dali_1.2.25~3 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=e4e2db54e98334606cc5fa77c61b3d60386faed8 Add Toggle button example for dashboard demo. Change-Id: Ia6193084e2019e53814207811788d46ebaf5eb1b Signed-off-by: xb.teng --- diff --git a/plugins/dali-swig/examples/control-dashboard.cs b/plugins/dali-swig/examples/control-dashboard.cs index 756f651..6c9fc64 100755 --- a/plugins/dali-swig/examples/control-dashboard.cs +++ b/plugins/dali-swig/examples/control-dashboard.cs @@ -45,7 +45,7 @@ namespace MyCSharpExample // List of items private Item[] mViewList = { - new Item("PushButton", true), new Item("DropDown", false), new Item("Toggle", false), + new Item("PushButton", true), new Item("DropDown", false), new Item("Toggle", true), new Item("InputField", false), new Item("AnimateGif", false), new Item("Loading", false), new Item("ProgressBar", false), new Item("CheckBox", false), new Item("RadioButton", true), new Item("Tooltip", true), new Item("Popup", true), new Item("Toast", true), @@ -154,7 +154,28 @@ namespace MyCSharpExample } if (item.name.CompareTo("Toggle") == 0) { + ToggleButton toggleButton = new ToggleButton(); + Dali.Property.Array array = new Dali.Property.Array(); + array.Add( new Dali.Property.Value("./images/star-highlight.png") ); + array.Add( new Dali.Property.Value("./images/star-mod.png") ); + array.Add( new Dali.Property.Value("./images/star-dim.png") ); + toggleButton.StateVisuals = array; + + Dali.Property.Array tooltips = new Dali.Property.Array(); + tooltips.Add( new Dali.Property.Value("State A") ); + tooltips.Add( new Dali.Property.Value("State B") ); + tooltips.Add( new Dali.Property.Value("State C") ); + toggleButton.Tooltips = tooltips; + + toggleButton.WidthResizePolicy = "FILL_TO_PARENT"; + toggleButton.HeightResizePolicy = "FILL_TO_PARENT"; + toggleButton.Clicked += (obj, e) => + { + Console.WriteLine("Toggle button state changed."); + return true; + }; + _contentContainer.AddChild(toggleButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); } if (item.name.CompareTo("InputField") == 0) { diff --git a/plugins/dali-swig/examples/images/star-mod.png b/plugins/dali-swig/examples/images/star-mod.png new file mode 100644 index 0000000..2e3212e Binary files /dev/null and b/plugins/dali-swig/examples/images/star-mod.png differ