forked from enlightenment/efl
Moving label example to examples.dox, and improving
label docs. SVN revision: 61348
This commit is contained in:
parent
53cfa9d89b
commit
f80da45f3d
|
@ -1253,6 +1253,55 @@
|
||||||
* @example flip_example_01.c
|
* @example flip_example_01.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @page tutorial_label Label example
|
||||||
|
* @dontinclude label_example_01.c
|
||||||
|
*
|
||||||
|
* In this example we are going to create 6 labels, set some properties on
|
||||||
|
* them and see what changes in appearance those properties cause.
|
||||||
|
*
|
||||||
|
* We start with the setup code that by now you should be familiar with:
|
||||||
|
* @until show(bg)
|
||||||
|
*
|
||||||
|
* For our first label we have a moderately long text(that doesn't fit in the
|
||||||
|
* label's width) so we will make it a sliding label. Since the text isn't
|
||||||
|
* too long we don't need the animation to be very long, 3 seconds should
|
||||||
|
* give us a nice speed:
|
||||||
|
* @until show(label
|
||||||
|
*
|
||||||
|
* For our second label we have the same text, but this time we aren't going
|
||||||
|
* to have it slide, we're going to ellipsize it. Because we ask our label
|
||||||
|
* widget to ellipsize the text it will first diminsh the fontsize so that it
|
||||||
|
* can show as much of the text as possible:
|
||||||
|
* @until show(label
|
||||||
|
*
|
||||||
|
* For the third label we are going to ellipsize the text again, however this
|
||||||
|
* time to make sure the fontsize isn't diminshed we will set a line wrap.
|
||||||
|
* The wrap won't actually cause a line break because we set the label to
|
||||||
|
* ellipsize:
|
||||||
|
* @until show(label
|
||||||
|
*
|
||||||
|
* For our fourth label we will set line wrapping but won't set ellipsis, so
|
||||||
|
* that our text will indeed be wrapped instead of ellipsized. For this label
|
||||||
|
* we choose character wrap:
|
||||||
|
* @until show(label
|
||||||
|
*
|
||||||
|
* Just two more, for our fifth label we do the same as for the fourth
|
||||||
|
* except we set the wrap to word:
|
||||||
|
* @until show(label
|
||||||
|
*
|
||||||
|
* And last but not least for our sixth label we set the style to "marker" and
|
||||||
|
* the color to red(the default color is white which would be hard to see on
|
||||||
|
* our white background):
|
||||||
|
* @until show(label
|
||||||
|
*
|
||||||
|
* Our example will look like this:
|
||||||
|
* @image html screenshots/label_example_01.png
|
||||||
|
* @image latex screenshots/label_example_01.eps
|
||||||
|
*
|
||||||
|
* @example label_example_01.c
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @page bg_example_01_c bg_example_01.c
|
* @page bg_example_01_c bg_example_01.c
|
||||||
* @include bg_example_01.c
|
* @include bg_example_01.c
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 18 KiB |
|
@ -9,7 +9,7 @@
|
||||||
EAPI int
|
EAPI int
|
||||||
elm_main(int argc, char **argv)
|
elm_main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
Evas_Object *win, *bg, *label, *label2, *label3, *label4, *label5;
|
Evas_Object *win, *bg, *label, *label2, *label3, *label4, *label5, *label6;
|
||||||
|
|
||||||
win = elm_win_add(NULL, "label", ELM_WIN_BASIC);
|
win = elm_win_add(NULL, "label", ELM_WIN_BASIC);
|
||||||
elm_win_title_set(win, "Label");
|
elm_win_title_set(win, "Label");
|
||||||
|
@ -59,11 +59,19 @@ elm_main(int argc, char **argv)
|
||||||
elm_object_text_set(label5, "And for this label we choose a different text, "
|
elm_object_text_set(label5, "And for this label we choose a different text, "
|
||||||
"for no reason other than that we can.");
|
"for no reason other than that we can.");
|
||||||
elm_label_line_wrap_set(label5, ELM_WRAP_WORD);
|
elm_label_line_wrap_set(label5, ELM_WRAP_WORD);
|
||||||
evas_object_resize(label5, 200, 25);
|
evas_object_resize(label5, 200, 30);
|
||||||
evas_object_move(label5, 0, 75);
|
evas_object_move(label5, 0, 75);
|
||||||
evas_object_show(label5);
|
evas_object_show(label5);
|
||||||
|
|
||||||
evas_object_resize(win, 200, 105);
|
label6 = elm_label_add(win);
|
||||||
|
elm_object_text_set(label6, "Short text");
|
||||||
|
elm_object_style_set(label6, "marker");
|
||||||
|
evas_object_color_set(label6, 255, 0, 0, 255);
|
||||||
|
evas_object_resize(label6, 200, 15);
|
||||||
|
evas_object_move(label6, 0, 105);
|
||||||
|
evas_object_show(label6);
|
||||||
|
|
||||||
|
evas_object_resize(win, 200, 125);
|
||||||
evas_object_show(win);
|
evas_object_show(win);
|
||||||
|
|
||||||
elm_run();
|
elm_run();
|
||||||
|
|
|
@ -2619,56 +2619,16 @@ extern "C" {
|
||||||
* "scroll,drag,stop" - dragging the contents around has stopped
|
* "scroll,drag,stop" - dragging the contents around has stopped
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* @page tutorial_label Label example
|
|
||||||
* @dontinclude label_example_01.c
|
|
||||||
*
|
|
||||||
* In this example we are going to create 5 labels, set some properties on
|
|
||||||
* them and see what changes in appearance those properties cause.
|
|
||||||
*
|
|
||||||
* We start with the setup code that by now you should be familiar with:
|
|
||||||
* @until show(bg)
|
|
||||||
*
|
|
||||||
* For our first label we have a moderately long text(that doesn't fit in the
|
|
||||||
* label's width) so we will make it a sliding label. Since the text isn't
|
|
||||||
* too long we don't need the animation to be very long, 3 seconds should
|
|
||||||
* give us a nice speed:
|
|
||||||
* @until show(label
|
|
||||||
*
|
|
||||||
* For our second label we have the same text, but this time we aren't going
|
|
||||||
* to have it slide, we're going to ellipsize it. Because we ask our label
|
|
||||||
* widget to ellipsize the text it will first diminsh the fontsize so that it
|
|
||||||
* can show as much of the text as possible:
|
|
||||||
* @until show(label
|
|
||||||
*
|
|
||||||
* For the third label we are going to ellipsize the text again, however this
|
|
||||||
* time to make sure the fontsize isn't diminshed we will set a line wrap.
|
|
||||||
* The wrap won't actually cause a line break because we set the label to
|
|
||||||
* ellipsize:
|
|
||||||
* @until show(label
|
|
||||||
*
|
|
||||||
* For our fourth label we will set line wrapping but won't set ellipsis, so
|
|
||||||
* that our text will indeed be wrapped instead of ellipsized. For this label
|
|
||||||
* we choose character wrap:
|
|
||||||
* @until show(label
|
|
||||||
*
|
|
||||||
* And last but not least our fifth label we do the same as for the fourth
|
|
||||||
* except we set the wrap to word:
|
|
||||||
* @until show(label
|
|
||||||
*
|
|
||||||
* Our example will look like this:
|
|
||||||
* @image html screenshots/label_example_01.png
|
|
||||||
* @image latex screenshots/label_example_01.eps
|
|
||||||
*
|
|
||||||
* @example label_example_01.c
|
|
||||||
*/
|
|
||||||
/**
|
/**
|
||||||
* @defgroup Label Label
|
* @defgroup Label Label
|
||||||
*
|
*
|
||||||
* @brief Widget to display text, with simple html-like markup.
|
* @brief Widget to display text, with simple html-like markup.
|
||||||
*
|
*
|
||||||
* Elementary provides several themes for this widget:
|
* The Label widget @b doesn't allow text to overflow its boundaries, if the
|
||||||
|
* text doesn't fit the geometry of the label it will be ellipsized or be
|
||||||
|
* cut. Elementary provides several themes for this widget:
|
||||||
* @li default - No animation
|
* @li default - No animation
|
||||||
|
* @li marker - Centers the text in the label and make it bold by default
|
||||||
* @li slide_long - The entire text appears from the right of the screen and
|
* @li slide_long - The entire text appears from the right of the screen and
|
||||||
* slides until it disappears in the left of the screen(reappering on the
|
* slides until it disappears in the left of the screen(reappering on the
|
||||||
* right again).
|
* right again).
|
||||||
|
|
Loading…
Reference in New Issue