<Compile Include="ElmSharp\EvasMap.cs" />
<Compile Include="ElmSharp\EvasObject.cs" />
<Compile Include="ElmSharp\EvasObjectEvent.cs" />
+ <Compile Include="ElmSharp\FlipSelector.cs" />
+ <Compile Include="ElmSharp\FlipSelectorItem.cs" />
<Compile Include="ElmSharp\GenGrid.cs" />
<Compile Include="ElmSharp\GenGridItem.cs" />
<Compile Include="ElmSharp\GenItem.cs" />
<Compile Include="Interop\Interop.Elementary.CtxPopup.cs" />
<Compile Include="Interop\Interop.Elementary.DateTimePicker.cs" />
<Compile Include="Interop\Interop.Elementary.Entry.cs" />
+ <Compile Include="Interop\Interop.Elementary.FlipSelector.cs" />
<Compile Include="Interop\Interop.Elementary.GenGridView.cs" />
<Compile Include="Interop\Interop.Elementary.GenListView.cs" />
<Compile Include="Interop\Interop.Elementary.GestureLayer.cs" />
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+</Project>
\ No newline at end of file
<Compile Include="ElmSharp\EvasMap.cs" />
<Compile Include="ElmSharp\EvasObject.cs" />
<Compile Include="ElmSharp\EvasObjectEvent.cs" />
+ <Compile Include="ElmSharp\FlipSelector.cs" />
+ <Compile Include="ElmSharp\FlipSelectorItem.cs" />
<Compile Include="ElmSharp\FloatingButton.cs" />
<Compile Include="ElmSharp\GenGrid.cs" />
<Compile Include="ElmSharp\GenGridItem.cs" />
<Compile Include="ElmSharp\Window.cs" />
<Compile Include="ElmSharp\WrapType.cs" />
<Compile Include="Interop\Interop.Eina.cs" />
+ <Compile Include="Interop\Interop.Elementary.FlipSelector.cs" />
<Compile Include="Interop\Interop.Eo.cs" />
<Compile Include="Interop\Interop.Ecore.cs" />
<Compile Include="Interop\Interop.Elementary.Bg.cs" />
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace ElmSharp
+{
+ public class FlipSelector : Layout
+ {
+ SmartEvent _selected;
+ SmartEvent _overflowed;
+ SmartEvent _underflowed;
+
+ public FlipSelector(EvasObject parent) : base(parent)
+ {
+ _selected = new SmartEvent(this, Handle, "selected");
+ _overflowed = new SmartEvent(this, Handle, "overflowed");
+ _underflowed = new SmartEvent(this, Handle, "underflowed");
+
+ _selected.On += SelectedChanged;
+ _overflowed.On += OverflowedChanged;
+ _underflowed.On += UnderflowedChanged;
+ }
+
+ public event EventHandler Selected;
+ public event EventHandler Overflowed;
+ public event EventHandler Underflowed;
+
+ public double Interval
+ {
+ get
+ {
+ return Interop.Elementary.elm_flipselector_first_interval_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_flipselector_first_interval_set(Handle, value);
+ }
+ }
+
+ public FlipSelectorItem SelectedItem
+ {
+ get
+ {
+ IntPtr handle = Interop.Elementary.elm_flipselector_selected_item_get(Handle);
+ return ItemObject.GetItemByHandle(handle) as FlipSelectorItem;
+ }
+ }
+
+ public FlipSelectorItem FirstItem
+ {
+ get
+ {
+ IntPtr handle = Interop.Elementary.elm_flipselector_first_item_get(Handle);
+ return ItemObject.GetItemByHandle(handle) as FlipSelectorItem;
+ }
+ }
+
+ public FlipSelectorItem LastItem
+ {
+ get
+ {
+ IntPtr handle = Interop.Elementary.elm_flipselector_last_item_get(Handle);
+ return ItemObject.GetItemByHandle(handle) as FlipSelectorItem;
+ }
+ }
+
+ public FlipSelectorItem Append(string text)
+ {
+ FlipSelectorItem item = new FlipSelectorItem(text);
+ item.Handle = Interop.Elementary.elm_flipselector_item_append(Handle, text, null, (IntPtr)item.Id);
+ return item;
+ }
+
+ public FlipSelectorItem Prepend(string text)
+ {
+ FlipSelectorItem item = new FlipSelectorItem(text);
+ item.Handle = Interop.Elementary.elm_flipselector_item_prepend(Handle, text, null, (IntPtr)item.Id);
+ return item;
+ }
+
+ public void Remove(FlipSelectorItem item)
+ {
+ if (item as FlipSelectorItem != null)
+ item.Delete();
+ }
+
+ public void Next()
+ {
+ Interop.Elementary.elm_flipselector_flip_next(Handle);
+ }
+
+ public void Prev()
+ {
+ Interop.Elementary.elm_flipselector_flip_prev(Handle);
+ }
+
+ protected override IntPtr CreateHandle(EvasObject parent)
+ {
+ return Interop.Elementary.elm_flipselector_add(parent.Handle);
+ }
+
+ void SelectedChanged(object sender, EventArgs e)
+ {
+ SelectedItem?.SendSelected();
+ Selected?.Invoke(this, EventArgs.Empty);
+ }
+
+ void OverflowedChanged(object sender, EventArgs e)
+ {
+ Overflowed?.Invoke(this, e);
+ }
+
+ void UnderflowedChanged(object sender, EventArgs e)
+ {
+ Underflowed?.Invoke(this, e);
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+ public class FlipSelectorItem : ItemObject
+ {
+ public string Text { get; private set; }
+
+ public event EventHandler Selected;
+
+ public FlipSelectorItem(string text) : base(IntPtr.Zero)
+ {
+ Text = text;
+ }
+
+ internal void SendSelected()
+ {
+ Selected?.Invoke(this, EventArgs.Empty);
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_flipselector_add(IntPtr parent);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_flipselector_first_interval_get(IntPtr flipSelector);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_flipselector_first_interval_set(IntPtr flipSelector, double interval);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_flipselector_item_append(IntPtr flipSelector, string text, Evas.SmartCallback func, IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_flipselector_item_prepend(IntPtr flipSelector, string text, Evas.SmartCallback func, IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_flipselector_flip_next(IntPtr flipSelector);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_flipselector_flip_prev(IntPtr flipSelector);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_flipselector_selected_item_get(IntPtr flipSelector);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_flipselector_first_item_get(IntPtr flipSelector);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_flipselector_last_item_get(IntPtr flipSelector);
+ }
+}
<Compile Include="TC\BackgroundTest3.cs" />
<Compile Include="TC\DateTimeSelectorTest2.cs" />
<Compile Include="TC\EntryTest2.cs" />
+ <Compile Include="TC\FlipSelectorTest.cs" />
<Compile Include="TC\GenListTest9.cs" />
<Compile Include="TC\NaviframeTest3.cs" />
<Compile Include="TC\ScreenInformationTest.cs" />
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
-</Project>
+</Project>
\ No newline at end of file
--- /dev/null
+using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ public class FlipSelectorTest : TestCaseBase
+ {
+ public override string TestName => "FlipSelectorTest";
+ public override string TestDescription => "To test FlipSelector";
+
+ public override void Run(Window window)
+ {
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+
+ Box outterBox = new Box(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ IsHorizontal = false,
+ };
+ outterBox.Show();
+
+ Box box = new Box(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ IsHorizontal = true,
+ };
+ box.Show();
+
+ FlipSelector flip = new FlipSelector(window)
+ {
+ Interval = 1.0,
+ };
+
+ flip.Append("two");
+ flip.Prepend("one");
+
+ flip.Show();
+ box.PackEnd(flip);
+
+ conformant.SetContent(outterBox);
+ outterBox.PackEnd(box);
+
+ Button prev = new Button(window)
+ {
+ AlignmentX = -1,
+ WeightX = 1,
+ Text = "Prev"
+ };
+ prev.Clicked += (s, e) => { flip.Prev(); };
+ prev.Show();
+
+ Button next = new Button(window)
+ {
+ AlignmentX = -1,
+ WeightX = 1,
+ Text = "next"
+ };
+ next.Clicked += (s, e) => { flip.Next(); };
+ next.Show();
+
+ Button prepend = new Button(window)
+ {
+ AlignmentX = -1,
+ WeightX = 1,
+ Text = "prepend"
+ };
+ prepend.Clicked += (s, e) => {
+
+ var random = new Random();
+ int value = random.Next(99);
+ flip.Prepend(value.ToString());
+ };
+ prepend.Show();
+
+ Button append = new Button(window)
+ {
+ AlignmentX = -1,
+ WeightX = 1,
+ Text = "append"
+ };
+ append.Clicked += (s, e) => {
+
+ var random = new Random();
+ int value = random.Next(99);
+ flip.Append(value.ToString());
+ };
+ append.Show();
+
+ Button remove = new Button(window)
+ {
+ AlignmentX = -1,
+ WeightX = 1,
+ Text = "remove"
+ };
+ remove.Clicked += (s, e) => { flip.Remove(flip.SelectedItem); };
+ remove.Show();
+
+ outterBox.PackEnd(box);
+ outterBox.PackEnd(prev);
+ outterBox.PackEnd(next);
+ outterBox.PackEnd(append);
+ outterBox.PackEnd(prepend);
+ outterBox.PackEnd(remove);
+ }
+ }
+}