Subject: [E-devel] [PATCH] Add new API elm_diskfileselector_item_num_get()
Kindly review and provide your comments on this patch, that adds new API
elm_diskfileselector_item_num_get().
Add elm_diskselector_display_item_num_get() API.
Added required documentation in docx and Elementary.h.in files.
Updated test programs to print number of items set - as a verification.
Make input param as const. Thanks SeoZ.
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@63107
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
*
* @note You can't set less than 3 items to be displayed.
*
+ * You can get the number of items in the diskselector by calling
+ * elm_diskselector_display_item_num_get(), as you can see here:
+ * @skipline elm_diskselector_add
+ *
* Finally, if a bounce effect is required, or you would like to see
* scrollbars, it is possible. But, for default theme, diskselector
* scrollbars will be invisible anyway.
// displayed item number setting example
disk = elm_diskselector_add(win);
elm_diskselector_display_item_num_set(disk, 5);
+ printf("Number of Items in DiskSelector : %d\n", elm_diskselector_display_item_num_get(disk));
for (idx = 0; idx < (int)(sizeof(month_list) / sizeof(month_list[0])); idx++)
{
// displayed item number setting example
disk = elm_diskselector_add(win);
elm_diskselector_display_item_num_set(disk, 7);
+ printf("Number of Items in DiskSelector : %d\n", elm_diskselector_display_item_num_get(disk));
for (idx = 1; idx < 31; idx++)
{
for (i = 0; i < sizeof(lbl) / sizeof(lbl[0]); i++)
elm_diskselector_item_append(ds, lbl[i], NULL, NULL, NULL);
elm_diskselector_display_item_num_set(ds, 5);
+ printf("Number of Items in DiskSelector : %d\n", elm_diskselector_display_item_num_get(ds));
evas_object_show(ds);
/* set bounce and scroller policy */
EAPI void elm_diskselector_display_item_num_set(Evas_Object *obj, int num) EINA_ARG_NONNULL(1);
/**
+ * Get the number of items in the diskselector object.
+ *
+ * @param obj The diskselector object.
+ *
+ * @ingroup Diskselector
+ */
+ EAPI int elm_diskselector_display_item_num_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+
+ /**
* Set bouncing behaviour when the scrolled content reaches an edge.
*
* Tell the internal scroller object whether it should bounce or not
wd->display_item_num = num;
wd->display_item_num_by_api = EINA_TRUE;
}
+
+EAPI int
+elm_diskselector_display_item_num_get(const Evas_Object *item)
+{
+ ELM_CHECK_WIDTYPE(item, widtype) (-1);
+ Widget_Data *wd = elm_widget_data_get(item);
+ if (!wd) return -1;
+ return wd->display_item_num;
+}