summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJonas M. Gastal <jgastal@profusion.mobi>2011-07-25 17:00:28 +0000
committerJonas M. Gastal <jgastal@profusion.mobi>2011-07-25 17:00:28 +0000
commitf69892056afbf4a83373261c3a91d6299d560746 (patch)
tree0c24f4e7de2a6730e783722b74355f9f78c2e9ad /doc
parentdca27d77372bb70f165421b9f1e61cbd54b3ad78 (diff)
Elementary: toggle documentation.
SVN revision: 61699
Diffstat (limited to 'doc')
-rw-r--r--doc/Makefile.am3
-rw-r--r--doc/examples.dox60
-rw-r--r--doc/index.doxy3
-rw-r--r--doc/widgets/Makefile.am4
-rw-r--r--doc/widgets/widget_preview_toggle.c11
5 files changed, 79 insertions, 2 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am
index f6aeb68b6..f9a208268 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -50,7 +50,8 @@ WGT_PREVIEW = \
50 anchorblock:preview-00.png:widget_preview_anchorblock:100:30 \ 50 anchorblock:preview-00.png:widget_preview_anchorblock:100:30 \
51 pager:preview-00.png:widget_preview_pager:100:100 \ 51 pager:preview-00.png:widget_preview_pager:100:100 \
52 separator:preview-00.png:widget_preview_separator:10:80 \ 52 separator:preview-00.png:widget_preview_separator:10:80 \
53 radio:preview-00.png:widget_preview_radio:60:20 53 radio:preview-00.png:widget_preview_radio:60:20 \
54 toggle:preview-00.png:widget_preview_toggle:150:30
54 55
55widget-build: 56widget-build:
56 @$(MAKE) -C widgets 57 @$(MAKE) -C widgets
diff --git a/doc/examples.dox b/doc/examples.dox
index 963fd2b84..c725f43aa 100644
--- a/doc/examples.dox
+++ b/doc/examples.dox
@@ -2964,6 +2964,66 @@
2964 */ 2964 */
2965 2965
2966/** 2966/**
2967 * @page tutorial_toggle Toggle example
2968 * @dontinclude toggle_example_01.c
2969 *
2970 * In this example we'll create 2 toggle widgets. The first will have an icon
2971 * and the state names will be the default "on"/"off", it will also change the
2972 * value of a variable directly. The second won't have a icon, the state names
2973 * will be "Enabled"/"Disabled", it will start "Enabled" and it won't set the
2974 * value of a variable.
2975 *
2976 * We start with the usual includes and prototype for callback which will be
2977 * implemented and detailed later on:
2978 * @until _cb2
2979 *
2980 * We then declare a static global variable(the one whose value will be changed
2981 * by the first toggle):
2982 * @until static
2983 *
2984 * We now have to create our window and all that usual stuff:
2985 * @until show(bx)
2986 *
2987 * The creation of a toggle is no more complicated than that of any other
2988 * widget:
2989 * @until add
2990 *
2991 * For our first toggle we don't set the states labels so they will stay the
2992 * default, however we do set a label for the toggle, an icon and the variable
2993 * whose value it should change:
2994 * @until show
2995 *
2996 * We also set the callback that will be called when the toggles value changes:
2997 * @until smart_callback
2998 *
2999 * For our second toggle it important to note that we set the states labels,
3000 * don't set an icon or variable, but set the initial state to
3001 * EINA_TRUE("Enabled"):
3002 * @until show
3003 *
3004 * For the second toggle we will use a different callback:
3005 * @until smart_callback
3006 *
3007 * We then ask the main loop to start:
3008 * @until ELM_MAIN
3009 *
3010 * The callback for our first toggle will look the value of @p val and print it:
3011 * @until }
3012 *
3013 * For our second callback we need to do a little bit more, since the second
3014 * toggle doesn't change the value of a variable we have to ask it what its
3015 * state is:
3016 * @until }
3017 *
3018 * This example will look like this:
3019 *
3020 * @image html screenshots/toggle_example_01.png
3021 * @image latex screenshots/toggle_example_01.eps width=\textwidth
3022 *
3023 * @example toggle_example_01.c
3024 */
3025
3026/**
2967 * @page bg_example_01_c bg_example_01.c 3027 * @page bg_example_01_c bg_example_01.c
2968 * @include bg_example_01.c 3028 * @include bg_example_01.c
2969 * @example bg_example_01.c 3029 * @example bg_example_01.c
diff --git a/doc/index.doxy b/doc/index.doxy
index 313c13b14..74da13de6 100644
--- a/doc/index.doxy
+++ b/doc/index.doxy
@@ -161,6 +161,9 @@
161 * @li @ref Spinner 161 * @li @ref Spinner
162 * @li @ref Thumb 162 * @li @ref Thumb
163 * @li @ref Toggle 163 * @li @ref Toggle
164 *
165 * @image html img/widget/toggle/preview-00.png
166 * @image latex img/widget/toggle/preview-00.eps
164 * @li @ref Toolbar 167 * @li @ref Toolbar
165 * @li @ref Tooltips 168 * @li @ref Tooltips
166 * @li @ref Video 169 * @li @ref Video
diff --git a/doc/widgets/Makefile.am b/doc/widgets/Makefile.am
index 4b0779725..a725d7f62 100644
--- a/doc/widgets/Makefile.am
+++ b/doc/widgets/Makefile.am
@@ -65,7 +65,8 @@ widget_preview_anchorblock \
65widget_preview_flip \ 65widget_preview_flip \
66widget_preview_pager \ 66widget_preview_pager \
67widget_preview_separator \ 67widget_preview_separator \
68widget_preview_radio 68widget_preview_radio \
69widget_preview_toggle
69 70
70LDADD = $(top_builddir)/src/lib/libelementary.la @ELEMENTARY_EWEATHER_LIBS@ @ELEMENTARY_EDBUS_LIBS@ @ELEMENTARY_EFREET_LIBS@ @ELEMENTARY_LIBS@ @EIO_LIBS@ @my_libs@ 71LDADD = $(top_builddir)/src/lib/libelementary.la @ELEMENTARY_EWEATHER_LIBS@ @ELEMENTARY_EDBUS_LIBS@ @ELEMENTARY_EFREET_LIBS@ @ELEMENTARY_LIBS@ @EIO_LIBS@ @my_libs@
71 72
@@ -113,5 +114,6 @@ EXTRA_DIST = \
113 widget_preview_pager.c \ 114 widget_preview_pager.c \
114 widget_preview_separator.c \ 115 widget_preview_separator.c \
115 widget_preview_radio.c \ 116 widget_preview_radio.c \
117 widget_preview_toggle.c \
116 widget_preview_tmpl_foot.c \ 118 widget_preview_tmpl_foot.c \
117 widget_preview_tmpl_head.c 119 widget_preview_tmpl_head.c
diff --git a/doc/widgets/widget_preview_toggle.c b/doc/widgets/widget_preview_toggle.c
new file mode 100644
index 000000000..a26930a77
--- /dev/null
+++ b/doc/widgets/widget_preview_toggle.c
@@ -0,0 +1,11 @@
1#include "widget_preview_tmpl_head.c"
2
3Evas_Object *o = elm_toggle_add(win);
4evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
5elm_win_resize_object_add(win, o);
6evas_object_show(o);
7
8elm_object_text_set(o, "toggle");
9elm_toggle_states_labels_set(o, "on", "off");
10
11#include "widget_preview_tmpl_foot.c"