コード例 #1
0
        /// <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, this);

            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));
            };

            item.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
            AddInternal(item);
            return(item);
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
ファイル: ItemObjectExtension.cs プロジェクト: prjung/TizenFX
 /// <summary>
 /// Clear high light of item object
 /// </summary>
 /// <param name="obj">the item object which is cleared high light</param>
 /// <since_tizen> preview </since_tizen>
 public static void ClearHighlight(this ItemObject obj)
 {
     Interop.Elementary.elm_atspi_component_highlight_clear(obj.Handle);
 }
コード例 #5
0
        /// <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);
        }
コード例 #6
0
ファイル: GenItemClass.cs プロジェクト: yunmiha/TizenFX
        string GetTextCallback(IntPtr data, IntPtr obj, IntPtr part)
        {
            GenItem item = ItemObject.GetItemById((int)data) as GenItem;

            return(GetTextHandler?.Invoke(item?.Data, Marshal.PtrToStringAnsi(part)));
        }
コード例 #7
0
ファイル: GenGrid.cs プロジェクト: younghajung/TizenFX
        /// <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);
        }
コード例 #8
0
 internal static void SendItemObjectRealized(ItemObject obj)
 {
     ItemObjectRealized?.Invoke(obj, EventArgs.Empty);
 }