/// <summary> /// Prepends a new item to the MultiButtonEntry. /// </summary> /// <param name="label">The label of the new item.</param> /// <returns>A MultiButtonEntryItem to the item added.</returns> /// <since_tizen> preview </since_tizen> public MultiButtonEntryItem Prepend(string label) { var handle = Interop.Elementary.elm_multibuttonentry_item_prepend(RealHandle, label, null, IntPtr.Zero); MultiButtonEntryItem item = ItemObject.GetItemByHandle(handle) as MultiButtonEntryItem; return(item); }
/// <summary> /// Inserts an item in a GenList widget using a user-defined sort function. /// </summary> /// <param name="itemClass">The itemClass defines how to display the data.</param> /// <param name="data">The item data.</param> /// <param name="comparison">User-defined comparison function that defines the sort order based on the genlist item and its data.</param> /// <param name="type">The genlist item type.</param> /// <param name="parent">The parent item, otherwise null if there is no parent item.</param> /// <returns>Return a genlist item that contains the data and itemClass.</returns> /// <since_tizen> preview </since_tizen> public GenListItem InsertSorted(GenItemClass itemClass, object data, Comparison <object> comparison, GenListItemType type, GenListItem parent) { GenListItem item = new GenListItem(data, itemClass); Interop.Elementary.Eina_Compare_Cb compareCallback = (handle1, handle2) => { GenListItem first = (ItemObject.GetItemByHandle(handle1) as GenListItem) ?? item; GenListItem second = (ItemObject.GetItemByHandle(handle2) as GenListItem) ?? item; return(comparison(first.Data, second.Data)); }; IntPtr handle = Interop.Elementary.elm_genlist_item_sorted_insert( RealHandle, // genlist handle itemClass.UnmanagedPtr, // item clas (IntPtr)item.Id, // data parent, // parent (int)type, // item type compareCallback, // compare callback null, //select callback (IntPtr)item.Id); // callback data item.Handle = handle; AddInternal(item); return(item); }
/// <summary> /// Adds a new item to the MultiButtonEntry after the indicated object. /// </summary> /// <param name="after">The item after which to add it.</param> /// <param name="label">The label of new item.</param> /// <returns>A MultiButtonEntryItem to the item added.</returns> /// <since_tizen> preview </since_tizen> public MultiButtonEntryItem InsertAfter(MultiButtonEntryItem after, string label) { var handle = Interop.Elementary.elm_multibuttonentry_item_insert_after(RealHandle, after.Handle, label, null, IntPtr.Zero); MultiButtonEntryItem item = ItemObject.GetItemByHandle(handle) as MultiButtonEntryItem; return(item); }
internal static GenListItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) { GenListItem item = ItemObject.GetItemByHandle(info) as GenListItem; return(new GenListItemEventArgs { Item = item }); }
internal static MultiButtonEntryItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) { MultiButtonEntryItem item = ItemObject.GetItemByHandle(info) as MultiButtonEntryItem; return(new MultiButtonEntryItemEventArgs { Item = item }); }
internal static HoverselItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) { HoverselItem item = ItemObject.GetItemByHandle(info) as HoverselItem; return(new HoverselItemEventArgs { Item = item }); }
internal static ToolbarItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) { ToolbarItem item = ItemObject.GetItemByHandle(info) as ToolbarItem; return(new ToolbarItemEventArgs() { Item = item }); }
/// <summary> /// Inserts an item in a GenGrid widget using a user-defined sort function. /// </summary> /// <param name="itemClass">The itemClass defines how to display the data.</param> /// <param name="data">The item data.</param> /// <param name="comparison">User defined comparison function that defines the sort order based on the gengrid item and its data.</param> /// <returns>Return a gengrid item that contains the data and itemClass.</returns> /// <since_tizen> preview </since_tizen> public GenGridItem InsertSorted(GenItemClass itemClass, object data, Comparison <object> comparison) { GenGridItem item = new GenGridItem(data, itemClass, this); Interop.Elementary.Eina_Compare_Cb compareCallback = (handle1, handle2) => { GenGridItem first = (ItemObject.GetItemByHandle(handle1) as GenGridItem) ?? item; GenGridItem second = (ItemObject.GetItemByHandle(handle2) as GenGridItem) ?? item; return(comparison(first.Data, second.Data)); }; item.Handle = Interop.Elementary.elm_gengrid_item_sorted_insert(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, compareCallback, null, (IntPtr)item.Id); AddInternal(item); return(item); }
/// <summary> /// Gets the nth item in a given genlist widget, placed at position nth, in its internal items list. /// </summary> /// <param name="index">The number of the item to grab (0 being the first).</param> /// <returns></returns> /// <since_tizen> preview </since_tizen> public GenListItem GetItemByIndex(int index) { IntPtr handle = Interop.Elementary.elm_genlist_nth_item_get(RealHandle, index); return(ItemObject.GetItemByHandle(handle) as GenListItem); }
/// <summary> /// Gets the item that is at the X, Y canvas coordinates. /// </summary> /// <param name="x">The input X-coordinate.</param> /// <param name="y">The input Y-coordinate.</param> /// <param name="pos">The position relative to the item returned here. /// -1, 0, or 1 depending on whether the coordinate is on the upper portion of that item (-1), in the middle section (0), or on the lower part (1). /// </param> /// <returns>The item at the given coordinates.</returns> /// <since_tizen> preview </since_tizen> public GenListItem GetItemByPosition(int x, int y, out int pos) { IntPtr handle = Interop.Elementary.elm_genlist_at_xy_item_get(RealHandle, x, y, out pos); return(ItemObject.GetItemByHandle(handle) as GenListItem); }
/// <summary> /// Finds the item with that label in the toolbar. /// </summary> /// <param name="label">The label of the item.</param> /// <returns>The <see cref="ToolbarItem"/> into the toolbar.</returns> /// <since_tizen> preview </since_tizen> public ToolbarItem FindItemByLabel(string label) { IntPtr handle = Interop.Elementary.elm_toolbar_item_find_by_label(RealHandle, label); return(ItemObject.GetItemByHandle(handle) as ToolbarItem); }
/// <summary> /// Gets the item that is at the X, Y canvas coordinates. /// </summary> /// <param name="x">The input X coordinate.</param> /// <param name="y">The input Y coordinate.</param> /// <param name="portionX">The position relative to the item returned here. /// -1, 0, or 1, depending if the coordinate is on the left portion of that item(-1), on the middle section(0), or on the right part(1). /// </param> /// <param name="portionY">The position relative to the item returned here. /// -1, 0, or 1, depending if the coordinate is on the upper portion of that item (-1), on the middle section (0), or on the lower part (1). /// </param> /// <returns></returns> /// <since_tizen> preview </since_tizen> public GenGridItem GetItemByPosition(int x, int y, out int portionX, out int portionY) { IntPtr handle = Interop.Elementary.elm_gengrid_at_xy_item_get(RealHandle, x, y, out portionX, out portionY); return(ItemObject.GetItemByHandle(handle) as GenGridItem); }