summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authordivyesh purohit <div.purohit@samsung.com>2016-01-06 10:57:29 -0800
committerCedric BAIL <cedric@osg.samsung.com>2016-01-06 10:58:00 -0800
commit52e13710a3bdcfb3fcf79d6fc9212aa41b1e2e3e (patch)
treecbcccb3b5c6e576c4609384185e72e4a41ca20d8 /doc
parent7a2a98094aa278996c0f0bcfebcdbf2e005b55ca (diff)
combobox: add documentation and example
Summary: Added Documentation for Combobox Widget Signed-off-by: divyesh purohit <div.purohit@samsung.com> Test Plan: execute make doc Reviewers: shilpasingh, cedric Subscribers: rajeshps, govi Differential Revision: https://phab.enlightenment.org/D3539 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/Makefile.am2
-rw-r--r--doc/examples.dox68
-rw-r--r--doc/index.doxy4
-rw-r--r--doc/widgets/Makefile.am2
-rw-r--r--doc/widgets/widget_preview_combobox.c48
5 files changed, 124 insertions, 0 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 953809c74..a4461b7c2 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -26,6 +26,7 @@ WGT_PREVIEW = \
26 clock:preview-00.png:widget_preview_clock:200:100 \ 26 clock:preview-00.png:widget_preview_clock:200:100 \
27 colorselector:preview-00.png:widget_preview_colorselector:320:300 \ 27 colorselector:preview-00.png:widget_preview_colorselector:320:300 \
28 conformant:preview-00.png:widget_preview_conformant:200:400 \ 28 conformant:preview-00.png:widget_preview_conformant:200:400 \
29 combobox:preview-00.png:widget_preview_combobox:300:300 \
29 ctxpopup:preview-00.png:widget_preview_ctxpopup:200:130 \ 30 ctxpopup:preview-00.png:widget_preview_ctxpopup:200:130 \
30 datetime:preview-00.png:widget_preview_datetime1:360:60 \ 31 datetime:preview-00.png:widget_preview_datetime1:360:60 \
31 datetime:preview-01.png:widget_preview_datetime2:200:60 \ 32 datetime:preview-01.png:widget_preview_datetime2:200:60 \
@@ -101,6 +102,7 @@ WGT_TREE = \
101 colorselector \ 102 colorselector \
102 conformant \ 103 conformant \
103 container \ 104 container \
105 combobox \
104 ctxpopup \ 106 ctxpopup \
105 datetime \ 107 datetime \
106 dayselector \ 108 dayselector \
diff --git a/doc/examples.dox b/doc/examples.dox
index 3d425b1ad..8be745e75 100644
--- a/doc/examples.dox
+++ b/doc/examples.dox
@@ -29,6 +29,8 @@
29 * 29 *
30 * @ref calendar_example_06 30 * @ref calendar_example_06
31 * 31 *
32 * @ref combobox_example_01
33 *
32 * @ref spinner_example 34 * @ref spinner_example
33 * 35 *
34 * @ref slider_example 36 * @ref slider_example
@@ -6810,3 +6812,69 @@
6810 * @example location_example_01.c 6812 * @example location_example_01.c
6811 * @example naviframe_example.c 6813 * @example naviframe_example.c
6812 */ 6814 */
6815
6816/**
6817 * @page tutorial_combobox Combobox example
6818 * @dontinclude combobox_example_01.c
6819 *
6820 * In this example we will create a combobox with 1000 items.
6821 *
6822 * We will start with the normal creation of window stuff:
6823 * @until show(bg)
6824 *
6825 * Next we will create a box.
6826 * @until show(bx)
6827 *
6828 * And now we create our combobox and set some of it's properties. We set @p win
6829 * as its parent, set a text "A Simple List" (which acts as a placeholder).
6830 * We pack the combobox in box.
6831 * @until show(combobox)
6832 *
6833 * Next we create a new genlist item class and sets its properties:
6834 * item_style as deafult , callback for text_get and set others as NULL.
6835 * @until itc->func.del = NULL;
6836
6837 * Next we will append 1000 items to the combobox, this is similar to appending
6838 * items to the genlist
6839 * @until ));
6840 *
6841 * We also set a pair of callbacks to be called whenever any item is selected or
6842 * pressed.
6843 * when the combobox is activated, dismissed, expanded :
6844 * @until _combobox_item_pressed_cb, NULL);
6845 *
6846 * And then ask that our combobox be shown and run the main loop:
6847 * @until ELM_MAIN
6848 *
6849 * We now have the callback for setting text in the each item of genlist:
6850 * @until }
6851 *
6852 * Next we have the callback which is called when the combobox is clicked:
6853 * @until }
6854 *
6855 * Next we have the callback that is called whenever an item is selected and
6856 * text of that item is set on combobox:
6857 * @until }
6858
6859 * Next we have the callback that is called whenever an item is pressed and
6860 * text of that item is set on combobox and the hover is closed:
6861 * @until }
6862 *
6863 * Next we have the callback that is called whenever an item is double-clicked
6864 * or pressing (enter|return|spacebar) on an item also the text(event_info) of that item is set on
6865 * combobox and the hover is closed:
6866 * @until }
6867
6868 * And the callback that is called when the hover,genlist are closed.
6869 * @until }
6870 *
6871 * And finally the callback is called when hover,genlist are shown.
6872 * @until }
6873 *
6874 * Our example will initially look like this:
6875 *
6876 * @image html screenshots/combobox_example_01.png
6877 * @image latex screenshots/combobox_example_01.eps width=\textwidth
6878 *
6879 * @example combobox_example_01.c
6880 */ \ No newline at end of file
diff --git a/doc/index.doxy b/doc/index.doxy
index 8a35ddb84..f20bb0a2c 100644
--- a/doc/index.doxy
+++ b/doc/index.doxy
@@ -77,6 +77,10 @@
77 * 77 *
78 * @image html img/widget/ctxpopup/preview-00.png 78 * @image html img/widget/ctxpopup/preview-00.png
79 * @image latex img/widget/ctxpopup/preview-00.eps 79 * @image latex img/widget/ctxpopup/preview-00.eps
80 * @li @ref Combobox
81 *
82 * @image html img/widget/combobox/preview-00.png
83 * @image latex img/widget/combobox/preview-00.eps
80 * @li @ref Datetime 84 * @li @ref Datetime
81 * 85 *
82 * @image html img/widget/datetime/preview-00.png 86 * @image html img/widget/datetime/preview-00.png
diff --git a/doc/widgets/Makefile.am b/doc/widgets/Makefile.am
index 5cc58f39e..df26c7572 100644
--- a/doc/widgets/Makefile.am
+++ b/doc/widgets/Makefile.am
@@ -37,6 +37,7 @@ widget_preview_check2 \
37widget_preview_check3 \ 37widget_preview_check3 \
38widget_preview_clock \ 38widget_preview_clock \
39widget_preview_colorselector \ 39widget_preview_colorselector \
40widget_preview_combobox \
40widget_preview_conformant \ 41widget_preview_conformant \
41widget_preview_ctxpopup \ 42widget_preview_ctxpopup \
42widget_preview_datetime1 \ 43widget_preview_datetime1 \
@@ -118,6 +119,7 @@ EXTRA_DIST = \
118 widget_preview_clock.c \ 119 widget_preview_clock.c \
119 widget_preview_colorselector.c \ 120 widget_preview_colorselector.c \
120 widget_preview_conformant.c \ 121 widget_preview_conformant.c \
122 widget_preview_combobox.c \
121 widget_preview_slider.c \ 123 widget_preview_slider.c \
122 widget_preview_panes.c \ 124 widget_preview_panes.c \
123 widget_preview_toolbar.c \ 125 widget_preview_toolbar.c \
diff --git a/doc/widgets/widget_preview_combobox.c b/doc/widgets/widget_preview_combobox.c
new file mode 100644
index 000000000..2cde37a5d
--- /dev/null
+++ b/doc/widgets/widget_preview_combobox.c
@@ -0,0 +1,48 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#else
4# define EINA_UNUSED
5#endif
6
7#include <Elementary.h>
8
9static char *
10gl_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
11{
12 char buf[256];
13 snprintf(buf, sizeof(buf), "Item # %i", (int)(uintptr_t)data);
14 return strdup(buf);
15}
16
17unsigned char _func(void *data);
18
19#include "widget_preview_tmpl_head.c"
20
21Evas_Object *combobox = elm_combobox_add(win);
22evas_object_size_hint_weight_set(combobox, EVAS_HINT_EXPAND, 0);
23evas_object_size_hint_align_set(combobox, EVAS_HINT_FILL, 0);
24elm_object_part_text_set(combobox, "guide", "A long list");
25evas_object_resize(combobox, 300, 28);
26evas_object_show(combobox);
27
28Elm_Genlist_Item_Class *itc;
29itc = elm_genlist_item_class_new();
30itc->item_style = "default";
31itc->func.text_get = gl_text_get;
32itc->func.content_get = NULL;
33itc->func.state_get = NULL;
34itc->func.filter_get = NULL;
35itc->func.del = NULL;
36for (int i = 0; i < 1000; i++)
37 elm_genlist_item_append(combobox, itc, (void *)(uintptr_t)i,
38 NULL, ELM_GENLIST_ITEM_NONE, NULL,
39 (void*)(uintptr_t)(i * 10));
40ecore_timer_add(0.05, _func, combobox);
41
42#include "widget_preview_tmpl_foot.c"
43
44unsigned char _func(void *data)
45{
46 elm_combobox_hover_begin(data);
47 return 0;
48}