/// <since_tizen> preview </since_tizen>
public ColorSelectorItem AddPaletteColor(Color color)
{
- ColorSelectorItem item = new ColorSelectorItem();
+ ColorSelectorItem item = new ColorSelectorItem(this);
item.Handle = Interop.Elementary.elm_colorselector_palette_color_add(Handle, color.R, color.G, color.B, color.A);
return item;
}
{
}
+ internal ColorSelectorItem(EvasObject parent) : base(IntPtr.Zero, parent)
+ {
+ }
+
/// <summary>
/// Gets or sets the palette item's color.
/// </summary>
/// <since_tizen> preview </since_tizen>
public ContextPopupItem Append(string label, EvasObject icon)
{
- ContextPopupItem item = new ContextPopupItem(label, icon);
+ ContextPopupItem item = new ContextPopupItem(label, icon, this);
item.Handle = Interop.Elementary.elm_ctxpopup_item_append(RealHandle, label, icon, _onSelected, (IntPtr)item.Id);
AddInternal(item);
return item;
Icon = icon;
}
+ internal ContextPopupItem(string text, EvasObject icon, EvasObject parent) : base(IntPtr.Zero, parent)
+ {
+ Text = text;
+ Icon = icon;
+ }
+
/// <summary>
/// Gets the Text property of the given ContextPopupItem.
/// </summary>
/// </summary>
/// <since_tizen> preview </since_tizen>
public static event EventHandler EvasObjectRealized;
-
+
+ /// <summary>
+ /// ItemObjectRealized will be triggered when the ItemObject is realized.
+ /// </summary>
+ /// <since_tizen> preview </since_tizen>
+ public static event EventHandler ItemObjectRealized;
+
internal static void SendEvasObjectRealized(EvasObject obj)
{
EvasObjectRealized?.Invoke(obj, EventArgs.Empty);
}
+ internal static void SendItemObjectRealized(ItemObject obj)
+ {
+ ItemObjectRealized?.Invoke(obj, EventArgs.Empty);
+ }
+
/// <summary>
/// Gets or sets the configured finger size.
/// </summary>
/// <since_tizen> preview </since_tizen>
public FlipSelectorItem Append(string text)
{
- FlipSelectorItem item = new FlipSelectorItem(text);
+ FlipSelectorItem item = new FlipSelectorItem(text, this);
item.Handle = Interop.Elementary.elm_flipselector_item_append(Handle, text, null, (IntPtr)item.Id);
return item;
}
/// <since_tizen> preview </since_tizen>
public FlipSelectorItem Prepend(string text)
{
- FlipSelectorItem item = new FlipSelectorItem(text);
+ FlipSelectorItem item = new FlipSelectorItem(text, this);
item.Handle = Interop.Elementary.elm_flipselector_item_prepend(Handle, text, null, (IntPtr)item.Id);
return item;
}
Text = text;
}
+ /// <summary>
+ /// Creates and initializes a new instance of the FlipSelectorItem.
+ /// </summary>
+ /// <param name="text">FlipSelectorItem's text</param>
+ /// <param name="parent">Parent EvasObject</param>
+ /// <since_tizen> preview </since_tizen>
+ public FlipSelectorItem(string text, EvasObject parent) : base(IntPtr.Zero, parent)
+ {
+ Text = text;
+ }
+
internal void SendSelected()
{
Selected?.Invoke(this, EventArgs.Empty);
/// <since_tizen> preview </since_tizen>
public GenGridItem Append(GenItemClass itemClass, object data)
{
- GenGridItem item = new GenGridItem(data, itemClass);
- IntPtr handle = Interop.Elementary.elm_gengrid_item_append(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, null, (IntPtr)item.Id);
- item.Handle = handle;
+ GenGridItem item = new GenGridItem(data, itemClass, this);
+ item.Handle = Interop.Elementary.elm_gengrid_item_append(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, null, (IntPtr)item.Id);
AddInternal(item);
return item;
}
/// <since_tizen> preview </since_tizen>
public GenGridItem Prepend(GenItemClass itemClass, object data)
{
- GenGridItem item = new GenGridItem(data, itemClass);
- IntPtr handle = Interop.Elementary.elm_gengrid_item_prepend(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, null, (IntPtr)item.Id);
- item.Handle = handle;
+ GenGridItem item = new GenGridItem(data, itemClass, this);
+ item.Handle = Interop.Elementary.elm_gengrid_item_prepend(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, null, (IntPtr)item.Id);
AddInternal(item);
return item;
}
/// <since_tizen> preview </since_tizen>
public GenGridItem InsertBefore(GenItemClass itemClass, object data, GenGridItem before)
{
- GenGridItem item = new GenGridItem(data, itemClass);
- IntPtr handle = Interop.Elementary.elm_gengrid_item_insert_before(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, before, null, (IntPtr)item.Id);
- item.Handle = handle;
+ GenGridItem item = new GenGridItem(data, itemClass, this);
+ item.Handle = Interop.Elementary.elm_gengrid_item_insert_before(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, before, null, (IntPtr)item.Id);
AddInternal(item);
return item;
}
/// <since_tizen> preview </since_tizen>
public GenGridItem InsertAfter(GenItemClass itemClass, object data, GenGridItem after)
{
- GenGridItem item = new GenGridItem(data, itemClass);
- IntPtr handle = Interop.Elementary.elm_gengrid_item_insert_after(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, after, null, (IntPtr)item.Id);
- item.Handle = handle;
+ GenGridItem item = new GenGridItem(data, itemClass, this);
+ item.Handle = Interop.Elementary.elm_gengrid_item_insert_after(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, after, null, (IntPtr)item.Id);
AddInternal(item);
return item;
}
/// <since_tizen> preview </since_tizen>
public GenGridItem InsertSorted(GenItemClass itemClass, object data, Comparison<object> comparison)
{
- GenGridItem item = new GenGridItem(data, itemClass);
+ GenGridItem item = new GenGridItem(data, itemClass, this);
Interop.Elementary.Eina_Compare_Cb compareCallback = (handle1, handle2) =>
{
return comparison(first.Data, second.Data);
};
- IntPtr handle = Interop.Elementary.elm_gengrid_item_sorted_insert(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, compareCallback, null, (IntPtr)item.Id);
- item.Handle = handle;
+ item.Handle = Interop.Elementary.elm_gengrid_item_sorted_insert(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, compareCallback, null, (IntPtr)item.Id);
AddInternal(item);
return item;
}
{
}
+ internal GenGridItem(object data, GenItemClass itemClass, EvasObject parent) : base(data, itemClass, parent)
+ {
+ }
+
/// <summary>
/// Gets or sets whether a given gengrid item is selected.
/// If one gengrid item is selected, any other previously selected items get unselected in favor of this new one.
_tooltipCb = (d, obj, tooltip, item) => { return TooltipContentDelegate(); };
}
+ internal GenItem(object data, GenItemClass itemClass, EvasObject parent) : base(IntPtr.Zero, parent)
+ {
+ Data = data;
+ ItemClass = itemClass;
+ _tooltipCb = (d, obj, tooltip, item) => { return TooltipContentDelegate(); };
+ }
+
/// <summary>
/// Gets the item class that defines how to display data. It returns <see cref="GenItemClass"/> type.
/// </summary>
/// <since_tizen> preview </since_tizen>
public GenListItem Append(GenItemClass itemClass, object data, GenListItemType type, GenListItem parent)
{
- GenListItem item = new GenListItem(data, itemClass);
- IntPtr handle = Interop.Elementary.elm_genlist_item_append(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, parent, (int)type, null, (IntPtr)item.Id);
- item.Handle = handle;
+ GenListItem item = new GenListItem(data, itemClass, this);
+ item.Handle = Interop.Elementary.elm_genlist_item_append(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, parent, (int)type, null, (IntPtr)item.Id);
AddInternal(item);
return item;
}
/// <since_tizen> preview </since_tizen>
public GenListItem Prepend(GenItemClass itemClass, object data, GenListItemType type, GenListItem parent)
{
- GenListItem item = new GenListItem(data, itemClass);
- IntPtr handle = Interop.Elementary.elm_genlist_item_prepend(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, parent, (int)type, null, (IntPtr)item.Id);
- item.Handle = handle;
+ GenListItem item = new GenListItem(data, itemClass, this);
+ item.Handle = Interop.Elementary.elm_genlist_item_prepend(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, parent, (int)type, null, (IntPtr)item.Id);
AddInternal(item);
return item;
}
/// <since_tizen> preview </since_tizen>
public GenListItem InsertBefore(GenItemClass itemClass, object data, GenListItem before, GenListItemType type, GenListItem parent)
{
- GenListItem item = new GenListItem(data, itemClass);
+ GenListItem item = new GenListItem(data, itemClass, this);
// insert before the `before` list item
- IntPtr handle = Interop.Elementary.elm_genlist_item_insert_before(
+ item.Handle = Interop.Elementary.elm_genlist_item_insert_before(
RealHandle, // genlist handle
itemClass.UnmanagedPtr, // item class
(IntPtr)item.Id, // data
(int)type, // item type
null, // select callback
(IntPtr)item.Id); // callback data
- item.Handle = handle;
AddInternal(item);
return item;
}
/// <since_tizen> preview </since_tizen>
public GenListItem InsertAfter(GenItemClass itemClass, object data, GenListItem after, GenListItemType type, GenListItem parent)
{
- GenListItem item = new GenListItem(data, itemClass);
+ GenListItem item = new GenListItem(data, itemClass, this);
// insert before the `before` list item
- IntPtr handle = Interop.Elementary.elm_genlist_item_insert_before(
+ item.Handle = Interop.Elementary.elm_genlist_item_insert_before(
RealHandle, // genlist handle
itemClass.UnmanagedPtr, // item class
(IntPtr)item.Id, // data
(int)type, // item type
null, // select callback
(IntPtr)item.Id); // callback data
- item.Handle = handle;
AddInternal(item);
return item;
}
/// <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);
+ GenListItem item = new GenListItem(data, itemClass, this);
Interop.Elementary.Eina_Compare_Cb compareCallback = (handle1, handle2) =>
{
return comparison(first.Data, second.Data);
};
- IntPtr handle = Interop.Elementary.elm_genlist_item_sorted_insert(
+ item.Handle = Interop.Elementary.elm_genlist_item_sorted_insert(
RealHandle, // genlist handle
itemClass.UnmanagedPtr, // item clas
(IntPtr)item.Id, // data
compareCallback, // compare callback
null, //select callback
(IntPtr)item.Id); // callback data
- item.Handle = handle;
AddInternal(item);
return item;
}
{
}
+ internal GenListItem(object data, GenItemClass itemClass, EvasObject parent) : base(data, itemClass, parent)
+ {
+ }
+
/// <summary>
/// Gets or sets whether a given genlist item is selected.
/// </summary>
/// <since_tizen> preview </since_tizen>
public HoverselItem AddItem(string label)
{
- HoverselItem item = new HoverselItem();
+ HoverselItem item = new HoverselItem(this);
item.Label = label;
item.Handle = Interop.Elementary.elm_hoversel_item_add(RealHandle, label, null, 0, _onItemSelected, (IntPtr)item.Id);
return item;
{
}
+ internal HoverselItem(EvasObject parent) : base(IntPtr.Zero, parent)
+ {
+ }
+
/// <summary>
/// The HoverselItem's label.
/// </summary>
/// <since_tizen> preview </since_tizen>
public IndexItem Append(string label)
{
- IndexItem item = new IndexItem(label);
+ IndexItem item = new IndexItem(label, this);
item.Handle = Interop.Elementary.elm_index_item_append(RealHandle, label, null, (IntPtr)item.Id);
return item;
}
/// <since_tizen> preview </since_tizen>
public IndexItem Prepend(string label)
{
- IndexItem item = new IndexItem(label);
+ IndexItem item = new IndexItem(label, this);
item.Handle = Interop.Elementary.elm_index_item_prepend(RealHandle, label, null, (IntPtr)item.Id);
return item;
}
/// <since_tizen> preview </since_tizen>
public IndexItem InsertBefore(string label, IndexItem before)
{
- IndexItem item = new IndexItem(label);
+ IndexItem item = new IndexItem(label, this);
item.Handle = Interop.Elementary.elm_index_item_insert_before(RealHandle, before, label, null, (IntPtr)item.Id);
return item;
}
/// <since_tizen> preview </since_tizen>
public IndexItem InsertAfter(string label, IndexItem after)
{
- IndexItem item = new IndexItem(label);
+ IndexItem item = new IndexItem(label, this);
item.Handle = Interop.Elementary.elm_index_item_insert_after(RealHandle, after, label, null, (IntPtr)item.Id);
return item;
}
}
/// <summary>
+ /// Creates and initializes a new instance of the IndexItem class with parent
+ /// </summary>
+ /// <param name="text">The text is set to the Text. It's the 'string' type.</param>
+ /// <param name="parent">Parent EvasObject</param>
+ /// <since_tizen> preview </since_tizen>
+ public IndexItem(string text, EvasObject parent) : base(IntPtr.Zero, parent)
+ {
+ Text = text;
+ }
+
+ /// <summary>
/// Selected will be triggered when the index item is selected.
/// </summary>
/// <since_tizen> preview </since_tizen>
EvasObject _trackObject = null;
/// <summary>
+ /// Gets the parent object for ItemObject.
+ /// </summary>
+ /// <since_tizen> preview </since_tizen>
+ public EvasObject Parent { get; internal set; }
+
+ /// <summary>
/// Creates and initializes a new instance of the ItemObject class.
/// </summary>
/// <param name="handle">IntPtr</param>
_deleteCallback = DeleteCallbackHandler;
Id = GetNextId();
s_IdToItemTable[Id] = this;
+ Parent = null;
+ Handle = handle;
+ }
+
+ /// <summary>
+ /// Creates and initializes a new instance of the ItemObject class with parent object.
+ /// </summary>
+ /// <param name="handle">IntPtr</param>
+ /// <param name="parent">Parent EvasObject</param>
+ /// <since_tizen> preview </since_tizen>
+ protected ItemObject(IntPtr handle, EvasObject parent)
+ {
+ _deleteCallback = DeleteCallbackHandler;
+ Id = GetNextId();
+ s_IdToItemTable[Id] = this;
+ Parent = parent;
Handle = handle;
}
_handle = value;
SetDeleteCallback();
s_HandleToItemTable[Handle] = this;
+ if (_handle != IntPtr.Zero)
+ {
+ Elementary.SendItemObjectRealized(this);
+ }
}
}
void DeleteCallbackHandler(IntPtr data, IntPtr obj, IntPtr info)
{
Deleted?.Invoke(this, EventArgs.Empty);
+ Parent = null;
OnInvalidate();
if (s_IdToItemTable.ContainsKey(Id))
{
/// <since_tizen> preview </since_tizen>
public ListItem Append(string label, EvasObject leftIcon, EvasObject rightIcon)
{
- ListItem item = new ListItem(label, leftIcon, rightIcon);
+ ListItem item = new ListItem(label, leftIcon, rightIcon, this);
item.Handle = Interop.Elementary.elm_list_item_append(RealHandle, label, leftIcon, rightIcon, null, (IntPtr)item.Id);
AddInternal(item);
return item;
/// <since_tizen> preview </since_tizen>
public ListItem Prepend(string label, EvasObject leftIcon, EvasObject rigthIcon)
{
- ListItem item = new ListItem(label, leftIcon, rigthIcon);
+ ListItem item = new ListItem(label, leftIcon, rigthIcon, this);
item.Handle = Interop.Elementary.elm_list_item_prepend(RealHandle, label, leftIcon, rigthIcon, null, (IntPtr)item.Id);
AddInternal(item);
return item;
LeftIcon = leftIcon;
RightIcon = rightIcon;
}
+
+ internal ListItem(string text, EvasObject leftIcon, EvasObject rightIcon, EvasObject parent) : base(IntPtr.Zero, parent)
+ {
+ Text = text;
+ LeftIcon = leftIcon;
+ RightIcon = rightIcon;
+ }
/// <summary>
/// Gets the text for the list item.
/// <since_tizen> preview </since_tizen>
public EvasObject RightIcon { get; internal set; }
}
-}
\ No newline at end of file
+}
void OnItemAdded(object sender, MultiButtonEntryItemEventArgs e)
{
+ e.Item.Parent = this;
_children.Add(e.Item);
e.Item.Deleted += Item_Deleted;
ItemAdded?.Invoke(this, e);
// And since "item.added" event will be called before xx_append() method returns,
// ItemObject does NOT have an item that contains handle matched to "info" at this time.
// So, item should be created and added internally here.
+
MultiButtonEntryItem item = new MultiButtonEntryItem(info);
return new MultiButtonEntryItemEventArgs { Item = item };
}
}
-}
\ No newline at end of file
+}
Label = Interop.Elementary.elm_object_item_part_text_get(handle, null);
}
+ internal MultiButtonEntryItem(IntPtr handle, EvasObject parent) : base(handle, parent)
+ {
+ Label = Interop.Elementary.elm_object_item_part_text_get(handle, null);
+ }
+
/// <summary>
/// Gets the label of this item.
/// </summary>
NaviItem(IntPtr handle, EvasObject content) : base(handle)
{
+ InitializeItem(handle, content);
+ }
+
+ NaviItem(IntPtr handle, EvasObject content, EvasObject parent) : base(handle, parent)
+ {
+ InitializeItem(handle, content);
+ }
+
+ void InitializeItem(IntPtr handle, EvasObject content)
+ {
_isPopped = false;
_content = content;
_popped = (d, i) =>
Popped?.Invoke(this, EventArgs.Empty);
}
- internal static NaviItem FromNativeHandle(IntPtr handle, EvasObject content)
+ internal static NaviItem FromNativeHandle(IntPtr handle, EvasObject content, EvasObject parent)
{
- return new NaviItem(handle, content);
+ return new NaviItem(handle, content, parent);
}
}
}
public NaviItem Push(EvasObject content, string title, string style)
{
IntPtr item = Interop.Elementary.elm_naviframe_item_push(RealHandle, title, IntPtr.Zero, IntPtr.Zero, content.Handle, style);
- NaviItem naviItem = NaviItem.FromNativeHandle(item, content);
+ NaviItem naviItem = NaviItem.FromNativeHandle(item, content, this);
_itemStack.Add(naviItem);
naviItem.Popped += ItemPoppedHandler;
return naviItem;
public NaviItem InsertBefore(NaviItem before, EvasObject content, string title, string style)
{
IntPtr item = Interop.Elementary.elm_naviframe_item_insert_before(RealHandle, before, title, IntPtr.Zero, IntPtr.Zero, content, null);
- NaviItem naviItem = NaviItem.FromNativeHandle(item, content);
+ NaviItem naviItem = NaviItem.FromNativeHandle(item, content, this);
int idx = _itemStack.IndexOf(before);
_itemStack.Insert(idx, naviItem);
naviItem.Popped += ItemPoppedHandler;
public NaviItem InsertAfter(NaviItem after, EvasObject content, string title, string style)
{
IntPtr item = Interop.Elementary.elm_naviframe_item_insert_after(RealHandle, after, title, IntPtr.Zero, IntPtr.Zero, content, null);
- NaviItem naviItem = NaviItem.FromNativeHandle(item, content);
+ NaviItem naviItem = NaviItem.FromNativeHandle(item, content, this);
int idx = _itemStack.IndexOf(after);
_itemStack.Insert(idx + 1, naviItem);
naviItem.Popped += ItemPoppedHandler;
/// <since_tizen> preview </since_tizen>
public PopupItem Append(string label, EvasObject icon)
{
- PopupItem item = new PopupItem(label, icon);
+ PopupItem item = new PopupItem(label, icon, this);
item.Handle = Interop.Elementary.elm_popup_item_append(Handle, label, icon, null, (IntPtr)item.Id);
AddInternal(item);
return item;
Icon = icon;
}
+ internal PopupItem(string text, EvasObject icon, EvasObject parent) : base(IntPtr.Zero, parent)
+ {
+ Text = text;
+ Icon = icon;
+ }
+
/// <summary>
/// Gets the text label of the popupitem. Return value is string.
/// </summary>
/// <since_tizen> preview </since_tizen>
public ToolbarItem Append(string label, string icon)
{
- ToolbarItem item = new ToolbarItem(label, icon);
+ ToolbarItem item = new ToolbarItem(label, icon, this);
item.Handle = Interop.Elementary.elm_toolbar_item_append(RealHandle, icon, label, null, (IntPtr)item.Id);
return item;
}
/// <since_tizen> preview </since_tizen>
public ToolbarItem Prepend(string label, string icon)
{
- ToolbarItem item = new ToolbarItem(label, icon);
+ ToolbarItem item = new ToolbarItem(label, icon, this);
item.Handle = Interop.Elementary.elm_toolbar_item_prepend(RealHandle, icon, label, null, (IntPtr)item.Id);
return item;
}
/// <since_tizen> preview </since_tizen>
public ToolbarItem InsertBefore(ToolbarItem before, string label, string icon)
{
- ToolbarItem item = new ToolbarItem(label, icon);
+ ToolbarItem item = new ToolbarItem(label, icon, this);
item.Handle = Interop.Elementary.elm_toolbar_item_insert_before(RealHandle, before, icon, label, null, (IntPtr)item.Id);
return item;
}
/// <since_tizen> preview </since_tizen>
public ToolbarItem InsertAfter(ToolbarItem after, string label, string icon)
{
- ToolbarItem item = new ToolbarItem(label, icon);
+ ToolbarItem item = new ToolbarItem(label, icon, this);
item.Handle = Interop.Elementary.elm_toolbar_item_insert_after(RealHandle, after, icon, label, null, (IntPtr)item.Id);
return item;
}
{
string _icon;
string _text;
+
internal ToolbarItem(string text, string icon) : base(IntPtr.Zero)
{
_text = text;
_icon = icon;
}
+ internal ToolbarItem(string text, string icon, EvasObject parent) : base(IntPtr.Zero, parent)
+ {
+ _text = text;
+ _icon = icon;
+ }
+
/// <summary>
/// Sets or gets the icon path of the item.
/// </summary>
Console.WriteLine("ELM_PROFILE : {0}", profile);
Console.WriteLine("ELM_SCALE : {0}", Elementary.GetScale());
- Elementary.EvasObjectRealized += (s, e) =>
+ /*Elementary.EvasObjectRealized += (s, e) =>
{
var obj = (EvasObject)s;
- //Console.WriteLine("EvasObject Realized : ClassName = {0}", obj.ClassName);
+ Console.WriteLine("EvasObject Realized : {0}", obj.GetType());
};
+ Elementary.ItemObjectRealized += (s, e) =>
+ {
+ var obj = (ItemObject)s;
+ Console.WriteLine("ItemObject Realized : {0} (Parent : {1})", obj.GetType(), obj.Parent != null? obj.Parent.GetType() : null);
+ };*/
+
TestRunner testRunner = new TestRunner();
testRunner.Profile = profile;
testRunner.Run(args);