Wiki pages widgets_pg created: 1 main and 31 PG + images + index

Signed-off-by: Clément Bénier <clement.benier@openwide.fr>
This commit is contained in:
Clément Bénier 2015-08-19 16:24:05 +02:00 committed by Cedric BAIL
parent b2acd6b5a7
commit e34bce0427
86 changed files with 4605 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
media/widgets_button.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
media/widgets_check.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
media/widgets_ctxpopup.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
media/widgets_datetime.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
media/widgets_entry.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

BIN
media/widgets_flip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
media/widgets_flip_tree.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
media/widgets_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

BIN
media/widgets_icon_tree.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
media/widgets_image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
media/widgets_label.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
media/widgets_list.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
media/widgets_list_tree.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
media/widgets_map.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 KiB

BIN
media/widgets_map_tree.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
media/widgets_notify.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
media/widgets_panel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
media/widgets_photocam.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
media/widgets_plug_tree.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
media/widgets_radio.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
media/widgets_slider.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
media/widgets_spinner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 796 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
media/widgets_toolbar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
media/widgets_win.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 B

BIN
media/widgets_win_tree.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -58,6 +58,7 @@ Go check the current available version of EFL on each distro/platform:
* [[program_guide/basic_application_structure_pg|Basic Application structure PG]]
* [[program_guide/containers_pg|Containers PG]]
* [[program_guide/widgets_pg|Widgets PG]]
=== Samples ===

View File

@ -1,4 +1,5 @@
++++Programming Guide Menu|
* [[program_guide/basic_application_structure_pg|Basic Application structure PG]]
* [[program_guide/containers_pg|Container PG]]
* [[program_guide/widgets_pg|Widgets PG]]
++++

View File

@ -0,0 +1,88 @@
~~Title: Background Widget PG~~
{{page>widgets_index}}
----
===== Background Widgets =====
{{ :widgets_background_tree.png }}{{ :widgets_background.png }}
The background widget can be used to set a solid background decoration to a
window or to a container object. It works like an image, but has some
background specific properties, for example it can be set to tiled, centered,
scaled or stretched mode. There are no specific signals relative to background
object
=== Table of Contents ===
* [[#Adding_a_Background|Adding a Background]]
* [[#Change_Color_of_the_Background|Change Color of the Background]]
* [[#Change_Image_of_the_Background|Change Image of the Background]]
* [[#Using_Overlay|Using Overlay]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Bg.html|Background Widget API]]
^Background Examples^^^
|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/bg_01_example_page.html|Plain color background]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/bg_02_example_page.html|Image background]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/bg_03_example_page.html|Background preperties]]|
==== Adding a Background ====
A background is created with the ''elm_bg_add()''.
<code c>
Evas_Object *bg;
// Creating a background
bg = elm_bg_add(parent);
</code>
==== Change Color of the Background ====
You can set the color of the bg with ''elm_bg_color_set()''. Here we set the
background color to red.
<code c>
Evas_Object *bg;
// Use red color for background
elm_bg_color_set(bg, 0xFF, 0x00, 0x00);
</code>
==== Change Image of the Background ====
It is also possible to set an image or an Edje group with
''elm_bg_file_set()''.
The display mode of the image in the background can be chosen with
''elm_bg_option_set()'', where the following modes are available:
* ''ELM_BG_OPTION_CENTER'': center the background image
* ''ELM_BG_OPTION_SCALE'': scale the background image, retaining aspect ratio
* ''ELM_BG_OPTION_STRETCH'': stretch the background image to fill the widget's area
* ''ELM_BG_OPTION_TILE'': tile background image at its original size
<code c>
Evas_Object *bg;
// Set a file on the disk as background image
elm_bg_file_set(bg, "/path/to/the/image", NULL);
// Set an edje group as background image
elm_bg_file_set(bg, "/path/to/the/edje", "edje_group");
elm_bg_option_set(bg, ELM_BG_OPTION_STRETCH)
</code>
==== Using Overlay ====
An overlay can be set using the "overlay" part name.
<code c>
elm_object_part_content_set(bg, "overlay", over);
</code>
Here, over is an Edje object that will be displayed on top of the current bg
object.
\\
^Background Examples^^^
|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/bg_01_example_page.html|Plain color background]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/bg_02_example_page.html|Image background]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/bg_03_example_page.html|Background preperties]]|
\\
----
{{page>widgets_index}}

View File

@ -0,0 +1,120 @@
~~Title: Elementary Basics PG~~
{{page>widgets_index}}
----
===== Elementary Basics =====
Elementary widgets are built in a hierarchical fashion. The idea is to
factorize as much code as possible between widgets that behave in a similar
manner, so as to facilitate the creation of new widgets. The Elementary
widgets that we will use inherit a lot of their code from the container
widgets and the layout widget (a container widget that takes a standard Edje
design file and wraps it very thinly). We can therefore use the container and
layout functions on them. We can also use Elementary object functions on them,
such as ''elm_object_part_content_set()'', ''elm_object_part_content_get()'', and
''elm_object_part_content_unset()''.
This programming guide does not describe the container widgets. More
information about containers can be found in
[[/program_guide/containers_pg|Container Widgets]].
Generally, an Elementary widget can be added with the
''elm_[widget_name]_add()''
function, which returns an Evas object (''Evas_Object*''). The Evas object is then
be passed to the functions that are used to configure the widget.
At the end of your application, the ''elm_shutdown()'' function takes care of
freeing the allocated Elementary objects, so there is no need to separately
deallocate widgets.
==== First Use of the Elementary Library ====
A minimal Elementary application looks like this:
<code c>
#include <Elementary.h>
int main(int argc, char **argv)
{
elm_init(argc, argv);
elm_run();
elm_shutdown();
return 0;
}
</code>
First of all, before using the Elementary library, it has to be initialized
with the ''elm_init()'' function. The Elementary main loop can then be started
with the ''elm_run()'' function, which will not return, and will constantly loop
and run the event and processing tasks. A call to the ''elm_exit()'' function will
tell the main loop to stop and return to the main function. At the end of the
application, the ''elm_shutdown()'' function will clean up all resources that were
allocated with Elementary in the main loop, and finally shut down Elementary.
<note>
An Elementary application should use the ''ELM_MAIN()'' macro, which already
calls the ''elm_init()'' function. [[docs/efl/start|EFL Hello World Tutorial]]
shows a basic Elementary application that uses this macro.
</note>
==== Elementary Objects ====
Objects created using Elementary are always of type ''Evas_Object*''. This
means that Evas and Elementary functions can be used on an Elementary object.
However, use Elementary functions on Elementary objects only when you do not
know which API to use.
Since an Elementary object can take up a lot of memory, the
''Elm_Object_Item'' type has been created for situations where you need to use
a lot of items, such as in a genlist or gengrid widget, and save memory. Using
the ''Elm_Object_Item'' type, an Elementary widget can, in theory, contain a
lot of items while maintaining a small memory footprint. In practice,
''Elm_Object_Item'' is bigger than expected, but it is still a good idea to
use it.
==== Elementary callbacks ====
Several callbacks can be registered on an Elementary object. The following is
an overview of the different callback types and how they differ. For more
information about events, see [[/coming_soon|Handling Events]]. For more
information about Evas objects and smart objects, see [[/coming_soon|Rendering
Concept and Method in Evas]].
=== Evas Event Callback ===
Using the ''evas_object_event_callback_add()'' function, this callback can be
registered on an Elementary object. It adds a callback for input events (key
up, key down, mouse wheel) on an Evas object. In the case of an Elementary
object, the callback will be registered on the underlying Evas object without
considering the Elementary object infrastructure (no event propagation).
=== Evas Smart Callback ===
Using the ''evas_object_smart_callback_add()'' function, this callback can be
registered on a "smart event" emitted by an Elementary object. Smart callbacks
can only be registered on smart objects, and the "smart event" we want to
register must be implemented by the corresponding smart object. Otherwise, the
callback will do nothing. The callback has nothing to do with input events
(keyboard or mouse)
=== Edje Signal Callbacks ===
Using the ''edje_object_signal_callback_add()'' function, this callback can be
registered on a signal coming from an Edje object (a theme object).
=== Elementary Signal Callback ===
Using the ''elm_object_signal_callback_add()'' function, this callback can be
registered on a signal coming from an Elementary widget's theme. The callback
has nothing to do with input events (keyboard or mouse).
=== Elementary Event Callback ===
Using the ''elm_object_event_callback_add()'' function, this callback can be
registered on an input event (keyboard or mouse) coming from an Elementary
object. In contrast to the Evas event callback, the Elementary event callback
takes the hierarchy of the object into account: the event can be propagated to
the parents of the object, and the parents can then process the event.
\\
----
{{page>widgets_index}}

View File

@ -0,0 +1,142 @@
~~Title: Button Container PG~~
{{page>widgets_index}}
----
===== Button Widgets =====
{{ :widgets_button_tree.png }}{{ :widgets_button.png }}
The Elementary button widget is a simple push button. It is composed of a
label icon and an icon object and has autorepeat feature.
=== Table of Contents ===
* [[#Adding_a_Button|Adding a Button]]
* [[#Adding_an_Icon_Inside_a_Button|Adding an Icon Inside a Button]]
* [[#Adding_Text_Inside_a_Button|Adding Text Inside a Button]]
* [[#Using_Button_Style|Using Button Style]]
* [[#Using_Button_Callbacks|Using Button Callbacks]]
* [[#Using_Autorepeat_Feature|Using Autorepeat Feature]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Button.html|Button Widget API]]
* [[/tutorial/basic/button|Basic Button Tutorial]]
^Button Examples^^
|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/button_example_00.html|Hello, Button!]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/button_example_01.html|Complete Example]]|
==== Adding a Button ====
<code c>
//Creating a button
Evas_Object *button = elm_button_add(parent);
</code>
==== Adding an Icon Inside a Button ====
The icon can be updated with ''elm_object_part_content_set()'' function with the
"icon" part name.
<code c>
Evas_Object *ic;
ic = elm_icon_add(button);
elm_image_file_set(ic, "icon.png", NULL);
elm_object_part_content_set(button, "icon", ic);
</code>
==== Adding Text Inside a Button ====
The label can be modified using the ''elm_object_text_set()'' function.
<code c>
elm_object_text_set(button, "Click me!");
</code>
==== Using Button Style ====
Also, defined in the default theme, the button has the following styles
available:
* ''default'': a normal button.
* ''anchor'': Like default, but the button fades away when the mouse is not over it, leaving only the text or icon.
* ''hoversel_vertical'': Internally used by Hoversel to give a continuous look across its options.
* ''hoversel_vertical_entry'': Another internal for Hoversel.
* ''naviframe'': Internally used by Naviframe for its back button.
* ''colorselector'': Internally used by Colorselector for its left and right buttons.
To change the style of the button, we call the ''elm_object_style_set()'' function
on our button object.
<code c>
elm_object_style_set(button,"naviframe");
</code>
==== Using Button Callbacks ====
Button emits the following signals:
* ''"clicked"'': the user clicked the button (press/release).
* ''"repeated"'': the user pressed the button without releasing it.
* ''"pressed"'': button was pressed.
* ''"unpressed"'': button was released after being pressed.
* ''"focused"'': When the button has received focus. (since 1.8)
* ''"unfocused"'': When the button has lost focus. (since 1.8) In all cases, the event parameter of the callback will be NULL.
For all these signals the ''event_info'' parameter returned in the callback is
NULL.
This is an example to register and define callback function called by the
clicked signal.
<code c>
evas_object_smart_callback_add(button, "clicked", _clicked_cb, data);
// Callback function for the "clicked" signal
// This callback is called when the button is clicked by the user
static void
_clicked_cb (void *data, Evas_Object *obj, void *event_info)
{
printf("Button clicked\n");
}
</code>
==== Using Autorepeat Feature ====
The autorepeat feature (enabled by default) consists of calling the "repeated"
signal when the user keeps the button pressed. This feature can be disabled
with the ''elm_button_autorepeat_set()'' function. The autorepeat is configured
with
* ''elm_button_autorepeat_initial_timeout_set()'': to set the initial timeout before the autorepeat event is generated
* ''elm_button_autorepeat_gap_timeout_set()'': to set the interval between two autorepeat events
Disable the autorepeat feature:
<code c>
elm_button_autorepeat_set(button, EINA_FALSE);
</code>
Enable the autorepeat feature (enabled by default):
<code c>
elm_button_autorepeat_set(button, EINA_TRUE);
</code>
Set the initial timeout to five seconds:
<code c>
elm_button_autorepeat_initial_timeout_set(button, 5.0);
</code>
Set the gap between two signals to 0.5 seconds:
<code c>
elm_button_autorepeat_gap_timeout_set(button, 0.5);
</code>
\\
^Button Examples^^
|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/button_example_00.html|Hello, Button!]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/button_example_01.html|Complete Example]]|
\\
----
{{page>widgets_index}}

View File

@ -0,0 +1,135 @@
~~Title: Check Widget PG~~
{{page>widgets_index}}
----
===== Check Widgets =====
{{ :widgets_check_tree.png }}{{ :widgets_check.png }}
The check widget is similar to the radio widget, except that it does not work
as a group. It toggles the value of a boolean between true and false.
This widget inherits from the layout widget. All layout functions can be used
on the check widget.
=== Table of Contents ===
* [[#Adding_a_Check|Adding a Check]]
* [[#Modifying_Check_Styles|Modifying Check Styles]]
* [[#Using_Check_Widget|Using Check Widget]]
* [[#Using_Check_Callbacks|Using Check Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Check.html|Check Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_check.html|A Check Example]]
==== Adding a Check ====
This is how to create a check widget.
<code c>
Evas_Object *check;
check = elm_check_add(parent);
</code>
==== Modifying Check Styles ====
Check widget style can be set with the ''elm_object_style_set()'' function. The
following styles are available:
* ''"default"''
* ''"toggle"''
''elm_object_style_get()'' allows to get the current style.
==== Using Check Widget ====
After having created a check object, it is possible to set its boolean value
to ''EINA_TRUE''.
<code c>
elm_check_state_set(check, EINA_TRUE);
</code>
We can also retrieve the current value of the check object.
<code c>
Eina_Bool value = elm_check_state_get(check);
</code>
As with the radio object, an icon and a label can be set.
Default content parts of the check widget that you can use for are:
* ''"icon"'' - An icon of the check
Default text parts of the check widget that you can use for are:
* ''"default"'' - A label of the check
* ''"on"'' - On state label of the check (only valid for "toggle" style.)
* ''"off"'' - Off state label of the check (only valid for "toggle" style.)
<code c>
// Create a Home icon
Evas_Object *icon;
icon = elm_icon_add(parent);
elm_icon_standard_set(icon, "home");
// Set it to the check object
elm_object_part_content_set(check, "icon", icon);
// Set the check label
elm_object_text_set(check, "Check label");
</code>
We can also modify the "on" and "off" labels (only valid for '"toggle" style).
<code c>
elm_object_part_text_set(check, "on", "True");
elm_object_part_text_set(check, "off", "False");
</code>
The get functions of the elementary object API can be used to retrieve the
content set to the check object.
<code c>
// Get the current set text of the check label
char *text = elm_object_text_get(check);
// Get the content set in the icon part
Evas_Object *icon = elm_object_part_content_get(check, "icon");
</code>
==== Using Check Callbacks ====
This widget emits the following signals, besides the ones sent from Layout:
* ''"changed"'' - This is called whenever the user changes the state of the check objects (event_info is always NULL).
* ''"focused"'' - When the check has received focus. (since 1.8)
* ''"unfocused"'' - When the check has lost focus. (since 1.8)
* ''"language,changed"'' - the program's language changed (since 1.9)
When the value is changed by the user, the ''changed'' signal is emitted.
''event_info'' parameter is ''NULL''.
This example shows how to register a callback on this signal.
<code c>
evas_object_smart_callback_add(check, "changed", _changed_cb, data);
// Callback function for the "changed" signal
// This callback is called when the check value changes
static void
_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("The value has changed\n");
}
</code>
\\
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_check.html|A Check Example]]__**//
\\
----
{{page>widgets_index}}

View File

@ -0,0 +1,183 @@
~~Title: Colorselector Widget PG~~
{{page>widgets_index}}
----
===== Colorselector Widgets =====
{{ :widgets_colorselector_tree.png }}{{ :widgets_colorselector.png }}
The colorselector widget provides a color selection solution to the user.
There are different modes available, each of them showing a different
configuration of the colorselector widget.
The Palette mode displays several color items that enable the user to choose a
color in the items displayed. It is possible to add new items, or to update
the color of the current item. The list of color items is called a palette, it
is associated with a unique identifier. This enable the developer to create
new series of colors (new palette) and save it under another identifier. By
default, the color palette is using the "default" identifier.
This widget inherits from the layout widget, so all function concerning the
layout widget can also be used on the colorselector widget.
=== Table of Contents ===
* [[#Adding_a_Colorselector|Adding a Colorselector]]
* [[#Setting_Colorselector_Modes|Setting Colorselector Modes]]
* [[#Using_Colorselector_Callbacks|Using Colorselector Callbacks]]
* [[#Clear_the_Palette|Clear the Palette]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Colorselector.html|Colorselector Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_colorselector.html|A Colorselector Example]]
==== Adding a Colorselector ====
This is how to create a colorselector object.
<code c>
Evas_Object *colorsel = elm_colorselector_add(parent);
</code>
==== Setting Coloselector Modes ====
There are 7 enumeration macros that defines the different modes supported by a
colorselector object.
^Mode^Description^
|''ELM_COLORSELECTOR_PALETTE''|Only the color palette is displayed|
|''ELM_COLORSELECTOR_COMPONENTS''|Only the color selector is displayed|
|''ELM_COLORSELECTOR_BOTH''|Both the Palette and the selector is displayed, default|
|''ELM_COLORSELECTOR_PICKER''|Only the color picker is displayed|
|''ELM_COLORSELECTOR_PLANE''|Only the color plane is displayed|
|''ELM_COLORSELECTOR_PALETTE_PLANE''|Both the palette and the plane is displayed|
|''ELM_COLORSELECTOR_ALL''|All possible color selectors are displayed|
This is how to set the mode of the colorselector to the palette mode.
<code c>
elm_colorselector_mode_set(colorsel, ELM_COLORSELECTOR_PALETTE);
</code>
We want to create a new palette called "mypalette". This new palette will be
saved by elementary config and it will be loaded again later. Three colors are
then added in "mypalette": red, green, and blue.
<code c>
elm_colorselector_palette_name_set(colorsel, "mypalette");
elm_colorselector_palette_color_add(colorsel, 255, 0, 0, 255);
elm_colorselector_palette_color_add(colorsel, 0, 255, 0, 255);
elm_colorselector_palette_color_add(colorsel, 0, 0, 255, 255);
</code>
The "default" palette already contains 14 colors.
<code c>
elm_colorselector_palette_name_set(colorsel, "default");
</code>
''elm_colorselector_palette_name_get()'' allows to get the palette name.
When the user clicks on the color elements, it changes the color that is set
to the colorselector widget. The function allows to get the
current selected color.
<code c>
int r, g, b, a;
elm_colorselector_color_get(colorsel, &r, &g, &b, &a);
</code>
''elm_colorselector_color_set()'' color the current selected color.
==== Using Colorselector Callbacks ====
The colorselector emits the following signals:
* "changed" - When the color value changes on selector event_info is NULL.
* "color,item,selected" - When user clicks on color item. The event_info parameter of the callback will be the selected color item.
* "color,item,longpressed" - When user long presses on color item. The event info parameter of the callback contains selected color item.
* "focused" - When the colorselector has received focus. (since 1.8)
* "unfocused" - When the colorselector has lost focus. (since 1.8)
* "language,changed" - the program's language changed (since 1.9)
To register a callback on the "changed" signal:
<code c>
evas_object_smart_callback_add(colorsel, "changed", _changed_cb, data);
</code>
The callback function changed the color of data to the current color of the
colorselector.
<code c>
static void
_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
int r, g, b, a;
elm_colorselector_color_get(obj, r, g, b, a);
//ensure colors are pre-multiplierd by alpha
evas_color_argb_premul(a, &r, &g, &b);
evas_object_color_set(data, r, g, b, a);
}
</code>
''elm_colorselector_mode_get()'' returns the colorselector's mode.
==== The Colorselector Items ====
According to the mode, several items of the colorselector are set, the palette
list is available with:
<code c>
Eina_list palette_items = elm_colorselector_palette_items_get(colorsel);
</code>
You can get or set/unset the selected one (''NULL'' if none is selected):
<code c>
Evas_Object_Item *item_selected = elm_colorselector_palette_selected_item_get(colorsel);
if(item_selected)
{
/* unset */
elm_colorselector_palette_selected_item_set(item_selected, EINA_FALSE);
/* set */
elm_colorselector_palette_selected_item_set(item_selected, EINA_TRUE);
}
</code>
Plus, ''elm_colorselector_palette_item_selected_get()'' returns the selected state of color palette item.
You finally can get and set the color of palette item with the two following
functions, in the example below each palette item sets its color to the next
item in the list:
<code c>
const Eina_List * items = elm_colorselector_palette_items_get(colorsel);
Elm_Object_Item *item, *first_item = NULL;
int r = 0, g = 0, b = 0, a = 0;
int r_prec = 0, g_prec = 0, b_prec = 0, a_prec = 0;
Eina_Iterator *itr = eina_list_iterator_new(items);
EINA_ITERATOR_FOREACH(itr, item)
{
if(!first_item) first_item = item;
elm_colorselector_palette_item_color_get(item, &r, &g, &b, &a);
elm_colorselector_palette_item_color_set(item, r_prec, g_prec, b_prec, a_prec);
r_prec = r; g_prec = g; b_prec = b, a_prec = a;
}
elm_colorselector_palette_item_color_set(first_item, r_prec, g_prec, b_prec, a_prec);
eina_iterator_free(itr);
</code>
==== Clear the Palette ====
To clear the palette items:
<code c>
elm_colorselector_palette_clear(colorsel);
</code>
\\
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_colorselector.html|A Colorselector Example]]__**//
\\
----
{{page>widgets_index}}

View File

@ -0,0 +1,378 @@
~~Title: Config Widget PG~~
{{page>widgets_index}}
----
===== Elementary configuration =====
An Elementary configuration is composed of a set of options linked to a given
Elementary profile. Once loaded, the Elementary profile will configure all
these options and affect the look and feel of your entire Elementary
application.
An Elementary configuration can be used to store the desired set
of options that fits your application. Below, we list the different options
that can be saved in an Elementary profile.
=== Table of Contents ===
* [[#General_functions|General functions]]
* [[#Managing_profiles|Managing profiles]]
* [[#Widget_scaling|Widget scaling]]
* [[#Configuring_cache|Configuring cache]]
* [[#Theme|Theme]]
* [[#Configuring_focus|Configuring focus]]
* [[#Configuring_gesture_layer|Configuring gesture layer]]
* [[#Configuring_scrolling|Configuring scrolling]]
* [[#Configuring_longpress|Configuring longpress]]
* [[#Configuring_tooltip|Configuring tooltip]]
* [[#Configuring_password_show_last|Configuring password show last]]
* [[#Configuring_Elementary_engine|Configuring Elementary engine]]
* [[#Configuring_access_mode|Configuring access mode]]
* [[#Configuring_selection|Configuring selection]]
* [[#Configuring_mirroring|Configuring mirroring]]
* [[#Configuring_frame_rate|Configuring frame rate]]
==== General Functions ====
The ''elm_config_save()'' function provides a way to save the current
Elementary configuration so that it can be reused in another session:
<code c>
elm_config_save();
</code>
When a profile is selected, we can ask Elementary to reload its configuration
with the saved profile:
<code c>
elm_config_reload();
</code>
==== Managing Profiles ====
A profile is a set of preconfigured options that affects the entire look and
feel of an application.
We can list the existing profiles:
<code c>
Eina_List *list = elm_config_profile_list_get();
</code>
We can set a particular profile:
<code c>
elm_config_profile_set("myprofile");
</code>
We can get the current profile:
<code c>
char *profile = elm_config_profile_get();
</code>
==== Scaling Widgets ====
An Elementary configuration allows you to configure widget scaling both in
terms of interactive areas and readable areas. For more information about
widget scaling, see [[/coming_soon|Scaling Widgets]].
Setting the global scaling factor to 2.0 will double the size of all scalable
widgets:
<code c>
elm_config_scale_set(2.0);
</code>
We can also set the finger size:
<code c>
elm_config_finger_size_set(1.5);
</code>
==== Configuring the Cache ====
We can enable the globally configured cache flush, and we can then set the
flush interval to 60 seconds:
<code c>
elm_config_cache_flush_enabled_set(EINA_TRUE);
elm_config_cache_flush_interval_set(60);
</code>
We can configure the font cache size to 500 bytes and the image cache size to
5 000 000 bytes:
<code c>
elm_config_cache_font_cache_size_set(500);
elm_config_cache_image_cache_size_set(5000000);
</code>
Finally, we can set the Edje collection cache size and the Edje file cache
size:
<code c>
elm_config_cache_edje_file_cache_size_set(500);
elm_config_cache_edje_collection_cache_size_set(500);
</code>
==== Customizing Themes ====
Elementary uses Edje to theme its widgets. Edje provides a default theme for
each widget. This theme can be changed per application using the ''ELM_THEME''
environment variable, or it can be modified globally with the
''elementary_config'' utility.
When you need custom styles, use extensions. Extensions allow you to write
styles for specific widgets. Once set, the extension will completely replace
the default theme of the widget.
<note>
When developing an extension, to respect the signals emitted and the elements
that need to be in place, it is important to know how the widget is themed. If
something is missing from the extension, it can break the widget's behavior.
</note>
The ''elm_theme_extension_add()'' function is used to add the new extension to
the list of Elementary themes. The style can then be applied to the widget
with the ''elm_object_style_set()'' function.
Overlay is another solution to modify Elementary themes. It can replace the
look of all widgets by overriding the default styles. As with extensions, it
is up to you to write the correct overlay theme for a widget. When looking for
a theme to apply, Elementary first checks the list of overlays, then the set
theme, and finally the list of extensions. With overlays, it is therefore
possible to replace the default view so that every widget is affected. This is
very similar to setting the theme for the whole application, and will probably
clash with end user options. It also runs the risk of none-matching styles
across the application. Unless you have a very good reason to use them, avoid
overlays. An overlay can be added with the ''elm_theme_overlay_add()''
function. It can be removed with the ''elm_theme_overlay_del()'' function.
For more information about widget theme customization, see
[[/coming_soon|Customizing Widgets]].
==== Configuring Focus ====
When an Elementary object has the focus, input events are directly passed to
that object in the window of the application. The focused object can also
change its decoration to show the user where the focus is. The focus can be
set to an Elementary object at any time with the ''elm_object_focus_set()''
function. This will take the focus away from the previous focused object and
give the focus to the new object. In an Elementary application, only one
object can have the focus at a time. It is also possible to make an object
unfocusable with the ''elm_object_focus_allow_set()'' function, so that the
object will never take the focus.
<note>
Only visible objects can be focused.
</note>
Elementary also supports focus chains, which allow you to cycle through all
the focusable objects in a window. By default, the focus chain is defined by
the order in which the widgets were added to the code. It is also possible to
define custom focus chains when needed.
To define a custom focus chain, create an ''Eina_List'', and add the
Elementary objects to it in the desired focus order. After you have inserted
all the objects to the ''Eina_List'', use the
''elm_object_focus_custom_chain_set()'' function to set this list as the
custom focus chain of the parent object (here ''container_object'').
<code c>
Eina_List *obj_list = NULL;
list = eina_list_append(list, obj1);
list = eina_list_append(list, obj4);
list = eina_list_append(list, obj2);
list = eina_list_append(list, obj3);
elm_object_focus_custom_chain_set(container_object, list);
</code>
Use the ''elm_object_focus_custom_chain_unset()'' function to remove the
custom focus chain and use the default focus chain instead.
Use the ''elm_object_focus_next()'' function to programmatically cycle through
the focus chain.
For detailed information about focus, see
[[/coming_soon|Managing Widget Focus]].
We can show a highlight on the focused object:
<code c>
elm_config_focus_highlight_enabled_set(EINA_TRUE);
</code>
We can also activate an animation when the focus shifts from one object to
another:
<code c>
elm_config_focus_highlight_animate_set(EINA_TRUE);
</code>
==== Configuring the Gesture Layer ====
We can configure the duration of the long tap and double tap events on gesture
layer objects. Here, we set the duration to 500 ms:
<code c>
elm_config_glayer_long_tap_start_timeout_set(0.5);
elm_config_glayer_double_tap_timeout_set(0.5);
</code>
==== Configuring Scrolling ====
An Elementary configuration provides several functions for configuring
scrolling in widgets.
You can enable bouncing, which makes the scroller bounce when it reaches its
viewport's edge during scrolling:
<code c>
elm_config_scroll_bounce_enabled_set(EINA_TRUE);
</code>
You can control the inertia of the bounce animation. Here, the inertia is set
to 0.5:
<code c>
elm_config_scroll_bounce_friction_set(0.5);
</code>
You can also set the friction for a page scroll, include animations, and zoom
animations.
You can use the ''elm_config_scroll_thumbscroll_enabled_set()'' function to
set the scroller to be draggable. You can configure several drag options, such
as friction, sensitivity, acceleration, and momentum.
Here, we set the scroller to be draggable, and we set the number of pixels one
should travel while dragging the scroller's view to actually trigger scrolling
to 20 pixels:
<code c>
// Set the scroller to be draggable
elm_config_scroll_thumbscroll_enabled_set(EINA_TRUE);
// Set the thumbscroll threshold to 20 pixels
elm_config_scroll_thumbscroll_threshold_set(20);
</code>
==== Configuring Long Press ====
Long press events can be configured using the ''elm_config'' API. Here, we get
the current timeout before a long press event happens and increase it by 1
second:
<code c>
// Get the long press timeout
double lp_timeout = elm_config_longpress_timeout_get();
// Increase it by 1 second
elm_config_longpress_timeout_set(lp_timeout + 1.0);
</code>
==== Configuring Tooltips ====
The duration after which a tooltip is shown can be configured through the
''elm_config'' API. Here, we set the delay to 2 seconds:
<code c>
elm_config_tooltip_delay_set(2.0);
</code>
==== Configuring the Password Show Last Feature ====
The password show last feature enables users to view the last input entered
for a few seconds before it is masked. The following functions allow you to
set this feature in the password mode of the entry widget and to change the
duration over which the input has to be visible.
First, we enable the password show last feature:
<code c>
elm_config_password_show_last_set(EINA_TRUE);
</code>
Then, we set the visibility timeout to 5 seconds:
<code c>
elm_config_password_show_last_timeout_set(5.0);
</code>
==== Configuring the Elementary Engine ====
We can use ''elm_config'' to set the rendering engine that Elementary will use
to draw the windows. The following rendering engines are supported:
* "software_x11"
* "fb"
* "directfb"
* "software_16_x11"
* "software_8_x11"
* "xrender_x11"
* "opengl_x11"
* "software_gdi"
* "software_16_wince_gdi"
* "sdl"
* "software_16_sdl"
* "opengl_sdl"
* "buffer"
* "ews"
* "opengl_cocoa"
* "psl1ght"
Here, we set the engine to "opengl_x11":
<code c>
elm_config_engine_set("opengl_x11");
</code>
==== Configuring the Access Mode ====
When the access mode is active, information about an Elementary object is read
when the object receives an ''EVAS_CALLBACK_MOUSE_IN'' event. Here, we
activate the access mode:
<code c>
elm_config_access_set(EINA_TRUE);
</code>
==== Configuring Selection ====
Selection behavior can be set to be cleared when the entry widget is
unfocused:
==== Configuring Mirroring ====
<code c>
elm_config_selection_unfocused_clear_set(EINA_TRUE);
</code>
Elementary allows UI mirroring both on a single object and on the entire UI.
If activated with the ''elm_object_mirrored_set()'' function, an Elementary
widget will display as if there was a vertical mirror in the middle of it.
Only the controls and the disposition of the widget are mirrored. Text is not
mirrored.
The default mirror mode of widgets can be set with ''elm_config''. Here, we
activate the mirror mode by default:
==== Configuring Frame Rate ====
<code c>
elm_config_mirrored_set(EINA_TRUE);
</code>
We can also set the frames per second (FPS) value for
''ecore_animator_frametime'' and ''edje_frametime'' calculations. Here, we set
the FPS to 60:
<code c>
elm_config_fps_set(60.0);
</code>
----
{{page>widgets_index}}

View File

@ -0,0 +1,103 @@
~~Title: Ctxpopup Widget PG~~
{{page>widgets_index}}
----
===== Ctxpopup Widgets =====
{{ :widgets_ctxpopup_tree.png }}{{ :widgets_ctxpopup.png }}
Ctxpopup is a contextual popup, which can show a list of items.
=== Table of Contents ===
* [[#Adding_a_Ctxpopup|Adding a Ctxpopup]]
* [[#Configuring_Ctxpopup|Configuring Ctxpopup]]
* [[#Managing_Ctxpopup_Items|Managing Ctxpopup Items]]
* [[#Using_Ctxpopup_Callbacks|Using Ctxpopup Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Ctxpopup.html|Ctxpopup Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_ctxpopup.html|A Ctxpopup Example]]
==== Adding a Ctxpopup ====
A ctxpopup can be created with ''elm_ctxpopup_add()'' and when shown, it
automatically chooses an area inside its parent object's view (set via
''elm_ctxpopup_hover_parent_set()'') to optimally fit into it.
<code c>
Evas_Object *ctxpopup = elm_ctxpopup_add(parent);
</code>
==== Configuring Ctxpopup ====
The context popup orientation can be set with
''elm_ctxpopup_horizontal_set()''. Here we set it to horizontal.
<code c>
elm_ctxpopup_horizontal_set(ctxpopup, EINA_TRUE);
</code>
We can also disable auto hiding if we want the ctxpopup never to be hidden.
(Auto hide is enabled by default.)
<code c>
elm_ctxpopup_auto_hide_disabled_set(ctxpopup, EINA_TRUE);
</code>
==== Managing Ctxpopup Items ====
The ctxpopup can contain a small number of items. Each of them can have a
label and an icon. Here we append an item with the "Test" label and no icon.
<code c>
Elm_Object_Item *it = elm_ctxpopup_item_append(ctxpopup, "test", NULL, _ctxpopup_item_cb, NULL);
</code>
The ''_ctxpopup_item_cb()'' callback will be called when the item is clicked. This
is how to write the definition of this callback.
<code c>
static void
_ctxpopup_item_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("ctxpopup item selected\n");
}
</code>
Then the item label is set to "New label".
<code c>
elm_object_item_part_text_set(it, "default", "New label");
</code>
And its icon is modified to the standard "home" icon.
<code c>
Evas_Object *home_icon = elm_icon_add(ctxpopup);
elm_icon_standard_set(home_icon, "home");
elm_object_item_part_content_set(it, "icon", home_icon);
</code>
==== Using Ctxpopup Callbacks ====
The context popup emits the "dismissed" signal when it is dismissed. We can
register a callback to this signal. The event_info parameter is NULL.
<code c>
evas_object_smart_callback_add(ctxpopup, "dismissed", _dismissed_cb, data);
</code>
<code c>
static void
_dismissed_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("ctxpopup dismissed\n");
}
</code>
\\
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_ctxpopup.html|A Ctxpopup Example]]__**//
\\
----
{{page>widgets_index}}

View File

@ -0,0 +1,122 @@
~~Title: Datetime Widget PG~~
{{page>widgets_index}}
----
===== Datetime Widgets =====
{{ :widgets_datetime_tree.png }}{{ :widgets_datetime.png }}
The datetime widget displays and adds date and time values.
This widget inherits from the Layout one, so that all the functions acting on
it also work for datetime objects.
=== Table of Contents ===
* [[#Adding_a_Datetime|Adding a Datetime]]
* [[#Setting_Datetime_Format|Setting Datetime Format]]
* [[#Using_Datetime_Callbacks|Using Datetime Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Datetime.html|Datetime Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/datetime_example.html|A Datetime Example]]
==== Adding a Datetime ====
The widget is created with ''elm_datetime_add()''. It is then possible to select
the visible fields with ''elm_datetime_field_visible_set()''. The following fields
can be controlled:
* ''ELM_DATETIME_YEAR'': The Year field
* ''ELM_DATETIME_MONTH'': The Month field
* ''ELM_DATETIME_DATE'': The Date field
* ''ELM_DATETIME_HOUR'': The Hour field
* ''ELM_DATETIME_MINUTE'': The Minute field
* ''ELM_DATETIME_AMPM'': The AM/PM field
As an example, this is how to create a datetime widget and set the HOUR and
MINUTE fields visible.
<code c>
Evas_Object *datetime = elm_datetime_add(parent);
elm_datetime_field_visible_set(datetime, ELM_DATETIME_HOUR, EINA_TRUE);
elm_datetime_field_visible_set(datetime, ELM_DATETIME_MINUTE, EINA_TRUE);
elm_datetime_field_visible_set(datetime, ELM_DATETIME_YEAR, EINA_FALSE);
elm_datetime_field_visible_set(datetime, ELM_DATETIME_MONTH, EINA_FALSE);
elm_datetime_field_visible_set(datetime, ELM_DATETIME_DATE, EINA_FALSE);
elm_datetime_field_visible_set(datetime, ELM_DATETIME_AMPM, EINA_FALSE);
</code>
==== Setting Datetime Format ====
The format of the date and time can be configured with
''elm_datetime_format_set()'' using a combination of allowed Libc date format
specifiers.
Elm_datetime supports only the following sub set of libc date format
specifiers:
| ''%Y'' | The year as a decimal number including the century (example: 2011).|
| ''%y'' | The year as a decimal number without a century (range 00 to 99)|
| ''%m'' | The month as a decimal number (range 01 to 12).|
| ''%b'' | The abbreviated month name according to the current locale.|
| ''%B'' | The full month name according to the current locale.|
| ''%h'' | The abbreviated month name according to the current locale(same as %b).|
| ''%d'' | The day of the month as a decimal number (range 01 to 31).|
| ''%e'' | The day of the month as a decimal number (range 1 to 31). single digits are preceded by a blank.|
| ''%I'' | The hour as a decimal number using a 12-hour clock (range 01 to 12).|
| ''%H'' | The hour as a decimal number using a 24-hour clock (range 00 to 23).|
| ''%k'' | The hour (24-hour clock) as a decimal number (range 0 to 23). single digits are preceded by a blank.|
| ''%l'' | The hour (12-hour clock) as a decimal number (range 1 to 12); single digits are preceded by a blank.|
| ''%M'' | The minute as a decimal number (range 00 to 59).|
| ''%p'' | Either 'AM' or 'PM' according to the given time value, or the corresponding strings for the current locale. Noon is treated as 'PM' and midnight as 'AM'|
| ''%P'' | Like p but in lower case: 'am' or 'pm' or a corresponding string for the current locale.|
| ''%c'' | The preferred date and time representation for the current locale.|
| ''%x'' | The preferred date representation for the current locale without the time.|
| ''%X'' | The preferred time representation for the current locale without the date.|
| ''%r'' | The complete calendar time using the AM/PM format of the current locale.|
| ''%R'' | The hour and minute in decimal numbers using the format H:M.|
| ''%T'' | The time of day in decimal numbers using the format H:M:S.|
| ''%D'' | The date using the format %m/%d/%y.|
| ''%F'' | The date using the format %Y-%m-%d.|
//For more reference on the available LIBC date format specifiers, please visit
the link:
[[http://www.gnu.org/s/hello/manual/libc.html#Formatting-Calendar-Time|Formatting
Calendar Time]].//
Here, as an example, we set the format to: "HH : MM".
<code c>
elm_datetime_format_set(datetime, "%H : %M");
</code>
==== Using Datetime Callbacks ====
This widget emits the following signals, besides the ones sent from Layout:
* ''"changed"'' - whenever Datetime field value is changed, this signal is sent.
* ''"language,changed"'' - whenever system locale changes, this signal is sent.
* ''"focused"'' - When the datetime has received focus. (since 1.8)
* ''"unfocused"'' - When the datetime has lost focus. (since 1.8)
A callback can be registered on the ''"changed"'' signal to detect when the
Datetime field values are changed. The ''event_info'' parameter is NULL.
<code c>
evas_object_smart_callback_add(datetime, "changed", _changed_cb, data);
</code>
<code c>
static void
_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("Datetime field changed. \n");
}
</code>
\\
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/datetime_example.html|A Datetime Example]]__**//
\\
----
{{page>widgets_index}}

View File

@ -0,0 +1,437 @@
~~Title: Entry Widget PG~~
{{page>widgets_index}}
----
===== Entry Widgets =====
{{ :widgets_entry_tree.png }}{{ :widgets_entry.png }}
The entry widget is a box where the user can enter text. It supports the
following features:
* text wrapping
* multiline
* scrolling
* formatted markup text
* password mode
* filtering text
* read/write from a file
* theme style overrides
=== Table of Contents ===
* [[#Adding_an_Entry|Adding an Entry]]
* [[#Using_Text_Edition|Using Text Edition]]
* [[#Setting_Password_Mode|Setting Password Mode]]
* [[#Entry_Line_Modes_And_Wrapping|Entry Line Modes And Wrapping]]
* [[#Selecting_Text|Selecting Text]]
* [[#Controlling_Cursor|Controlling Cursor]]
* [[#Formatting_Text|Formatting Text]]
* [[#Using_Special_Markups|Using Special Markups]]
* [[#Overriding_Style|Overriding Style]]
* [[#Filtering_Text|Filtering Text]]
* [[#File_Load/Save|File Load/Save]]
* [[#Using_Entry_Theme_Content|Using Entry Theme Content]]
* [[#Using_Entry_Theme_Texts|Using Entry Theme Texts]]
* [[#Using_Entry_Callbacks|Using Entry Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Entry.html|Entry Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/entry_example.html|A Simple Editing example]]
==== Adding an Entry ====
The entry widget is created with the ''elm_entry_add()'' function, and the text
inside the entry can be set with ''elm_entry_entry_set()''.
<code c>
Evas_Object *entry = elm_entry_add(parent);
elm_entry_entry_set(entry, "A short text.");
</code>
By default, entries are:
* not scrolled
* multi-line
* word wrapped
* autosave is enabled
==== Using Text Edition ====
We can also append text to the end of existing content,
<code c>
elm_entry_entry_append(entry, "END");
</code>
or insert text at the current cursor position.
<code c>
elm_entry_entry_insert(entry, "CURSOR");
Eina_Bool Empty = elm_entry_is_empty(entry);
</code>
Call ''elm_entry_is_empty()'' to see whether the entry is empty. Here, the boolean
variable Empty will return ''EINA_FALSE''.
By default, the user can enter text in the entry widget when it is in the
focus. We can prevent the user from editing text if needed.
<code c>
elm_entry_editable_set(entry, EINA_FALSE);
</code>
<note>
It is still possible to use the previous functions to modify the text of a
non-editable entry.
</note>
==== Setting Password Mode ====
When dealing with password content, the password mode activates to hide what
the user is typing. In this mode, the display of any text is replaced by
asterisks (*), and the entry is single line (there is no line wrap).
<code c>
elm_entry_password_set(entry, EINA_TRUE);
</code>
==== Entry Line Modes And Wrapping ====
The entry widget has two line modes:
* single line mode
* multiline mode
First, we set the entry in single line mode.
<code c>
elm_entry_single_line_set(entry, EINA_TRUE);
</code>
In this mode, the text does not wrap when reaching the edge, but the entry
grows horizontally instead. Pressing the "Enter" key in this mode generates an
"activate" event instead of adding a new line.
When the entry is set to multiline mode (single line off), the text wraps at
the end of the entry and pressing "Enter" creates a new line.
<code c>
elm_entry_single_line_set(entry, EINA_FALSE);
elm_entry_line_wrap_set(entry, ELM_WRAP_WORD);
</code>
In multiline entries, ''elm_entry_line_wrap_set()'' provides a way to cut the text
implicitly into a new line when it reaches the far edge of the widget. The
following wrap modes are available:
* ''ELM_WRAP_NONE'': No wrap
* ''ELM_WRAP_CHAR'': Wrap between characters
* ''ELM_WRAP_WORD'': Wrap in allowed wrapping points (as defined in the unicode standard)
* ''ELM_WRAP_MIXED'': Word wrap, and if that fails, char wrap
==== Selecting Text ====
Text selections can be made with different functions. This selects all the
content of the entry widget.
<code c>
elm_entry_select_all(entry);
</code>
We can drop the current selection with
<code c>
elm_entry_select_none(entry);
</code>
To select part of the text, use ''elm_entry_select_region_set()''. The code
below selects the first twenty characters of the entry content.
<code c>
elm_entry_select_region_set(entry, 0, 20);
</code>
Current selected text within the entry can be retrieved like this.
<code c>
const char *selection;
selection = elm_entry_selection_get(entry);
</code>
If the entry text is empty, ''elm_entry_selection_get()'' will return NULL.
We can copy or cut the selection to the clipboard. (There is an example of a
cut below.)
<code c>
elm_entry_selection_cut(entry);
</code>
This selection can be pasted in the same or a different entry.
<code c>
elm_entry_selection_paste(entry);
</code>
==== Controlling Cursor ====
The cursor represents the current position in the entry, where the next action
is done (for example, text insertion or deletion). Usually, the cursor is
represented as a blinking character, but that depends on the theme
configuration. Cursor position can be modified by using several functions.
It can be moved to the beginning of the entry,
<code c>
elm_entry_cursor_begin_set(entry);
</code>
or to the end.
<code c>
elm_entry_cursor_end_set(entry);
</code>
It can be moved one line down or up.
<code c>
elm_entry_cursor_down(entry);
elm_entry_cursor_up(entry);
</code>
It can also be moved one character to the left or right,
<code c>
elm_entry_cursor_prev(entry);
elm_entry_cursor_next(entry);
</code>
or set at a specific position (15th character, for example).
<code c>
elm_entry_cursor_pos_set(entry, 15);
</code>
We can start a selection at the current cursor position, move five characters
to the right and end the selection.
<code c>
elm_entry_cursor_selection_begin(entry);
for(i = 0; i < 5; i++)
{
elm_entry_cursor_next(entry);
}
elm_entry_cursor_selection_end(entry);
</code>
==== Formatting Text ====
The markup tags supported by the Entry are defined by the theme, but even when
writing new themes or extensions it's a good idea to stick to a sane default,
to maintain coherency and avoid application breakages. Currently defined by
the default theme are the following tags:
* ''<br>'': Inserts a line break.
* ''<ps>'': Inserts a paragraph separator. This is preferred over line breaks.
* ''<tab>'': Inserts a tab.
* ''<em>...</em>'': Emphasis. Sets the oblique style for the enclosed text.
* ''<b>...</b>'': Sets the bold style for the enclosed text.
* ''<link>...</link>'': Underlines the enclosed text.
* ''<hilight>...</hilight>'': Highlights the enclosed text.
* ''<title>...</title>'': Main title.
* ''<subtitle>...</subtitle>'': Secondary level title.
* ''<bigger>...</bigger>'': A really big text, not so big as the titles.
* ''<big>...</big>'': Big text.
* ''<small>...</small>'': Small text.
* ''<smaller>...</smaller>'': Really small text, at the point of unreadability.
Entry also support tags for code syntax highlight. Note that this does not mean
that the entry will automatically perform code highlight, application are
responsible of applying the correct tag to code blocks. The default theme
define the following tags:
* ''<code>...</code>'': Monospace font without shadows.
* ''<comment>...</comment>'': Code comments.
* ''<string>...</string>'': Strings of text.
* ''<number>...</number>'': Numeric expression (ex: 1, 2, 0.34, etc)
* ''<brace>...</brace>'': Braces used for code syntax.
* ''<type>...</type>'': Variables types (ex: int, float, char, Evas_Object, etc)
* ''<class>...</class>'': Class names, when defined, not when used.
* ''<function>...</function>'': Function names, when defined, not called.
* ''<param>...</param>'': Generic parameters.
* ''<keyword>...</keyword>'': Language keywords (ex: return, NULL, while, for, etc)
* ''<preprocessor>...</preprocessor>'': Preprocessors definitions.
* ''<line_added>...</line_added>'': Diff addeded lines.
* ''<line_removed>...</line_removed>'': Diff removed lines.
* ''<line_changed>...</line_changed>'': Diff changed lines.
==== Using Special Markups ====
Special markups can be added within the text of the entry.
* ''<a href = ..>...</a>'': Anchors
* ''<item size = .. vsize = .. href = ..>...</item>'': Items
Anchors generate an "anchor,clicked" signal when the user clicks on them. The
href attribute is used to identify the anchor. It also reacts to the
"anchor,in" (mouse in), "anchor,out" (mouse out), "anchor,down" (mouse down),
and "anchor,up" (mouse up) events.
The item markup provides a way to insert any Evas_Object in the text. The
Evas_Object name has to be specified in the href attribute.
==== Overriding Style ====
To tweak the style of the text within the entry widget, it is possible to
override parts of the theme style to the textblock object by using
''elm_entry_text_style_user_push()''. This function pushes a new style on top of
the user style stack that overrides the current style. Remove the style in the
top of user style stack with ''elm_entry_text_style_user_pop()''.
==== Filtering Text ====
Text within an entry can be filtered in size. Here we set the maximum number
of characters allowed in the entry to eight.
<code c>
static Elm_Entry_Filter_Limit_Size limit_size =
{
.max_char_count = 8,
.max_byte_count = 0
};
// Append a new callback to the list, this function will be called each time
// a text is inserted in the entry. Pass the limit_size struct previously
// created to set the maximum number of characters allowed to 8
elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size,
&limit_size);
</code>
Content can be filtered by passing an ''Elm_Entry_Filter_Accept_Set'' structure.
This structure contains the accepted characters and rejected characters. In
the example below we reject the '+', '-', '*', and '/' characters.
<code c>
static Elm_Entry_Filter_Accept_Set accept_set =
{
.accepted = NULL,
.rejected = "+*-/"
};
elm_entry_markup_filter_append(entry, elm_entry_filter_accept_set,
&accept_set);
</code>
==== File Load/Save ====
The entry content can be saved to a file (/tmp/test.txt, for example).
<code c>
// Set the file in which the entry text will be saved. This function
// implicitly loads the existing file content
elm_entry_file_set(entry, "/tmp/test.txt", ELM_TEXT_FORMAT_MARKUP_UTF8);
</code>
Autosave is activated by default and changes are written back to the file
after a short delay. This feature can be deactivated and we can manually save
the content when needed.
<code c>
// Disable autosaving
elm_entry_autosave_set(entry, EINA_FALSE);
// Trigger saving when needed
elm_entry_file_save(entry);
</code>
==== Using Entry Theme Content ====
Two content parts of the default theme are available: "icon" and "end". Here
we set an icon in the "end" content part.
<code c>
Evas_Object *icon;
ic = elm_icon_add(entry);
elm_image_file_set(ic, "icon.png", NULL);
elm_object_part_content_set(entry, "end", icon);
</code>
==== Using Entry Theme Texts ====
The default theme allows the use of the following text parts:
* "default" - text of the entry
* "guide" - placeholder of the entry
This is how to set the placeholder text of the entry to "Hello World".
<code c>
elm_object_part_text_set(entry, "Hello World");
</code>
==== Using Entry Callbacks ====
Entry widget emits the following signals, besides the ones sent from Layout:
* ''"aborted"'': The escape key was pressed on a single line entry. (since 1.7)
* ''"activated"'': The enter key was pressed on a single line entry.
* ''"anchor,clicked"'': An anchor has been clicked. The event_info parameter for the callback will be an #Elm_Entry_Anchor_Info.
* ''"anchor,down"'': Mouse button has been pressed on an anchor. The event_info parameter for the callback will be an #Elm_Entry_Anchor_Info.
* ''"anchor,hover,opened"'': The anchor is clicked.
* ''"anchor,in"'': Mouse cursor has moved into an anchor. The event_info parameter for the callback will be an #Elm_Entry_Anchor_Info.
* ''"anchor,out"'': Mouse cursor has moved out of an anchor. The event_info parameter for the callback will be an #Elm_Entry_Anchor_Info.
* ''"anchor,up"'': Mouse button has been unpressed on an anchor. The event_info parameter for the callback will be an #Elm_Entry_Anchor_Info.
* ''"changed"'': The text within the entry was changed.
* ''"changed,user"'': The text within the entry was changed because of user interaction.
* ''"clicked"'': The entry has been clicked (mouse press and release).
* ''"clicked,double"'': The entry has been double clicked.
* ''"clicked,triple"'': The entry has been triple clicked.
* ''"cursor,changed"'': The cursor has changed position.
* ''"cursor,changed,manual"'': The cursor has changed position manually.
* ''"focused"'': The entry has received focus.
* ''"unfocused"'': The entry has lost focus.
* ''"language,changed"'': Program language changed.
* ''"longpressed"'': A mouse button has been pressed and held for a couple
* ''"maxlength,reached"'': Called when a maximum length is reached.
* ''"preedit,changed"'': The preedit string has changed.
* ''"press"'': A mouse button has been pressed on the entry. seconds.
* ''"redo,request"'': Called on redo request.
* ''"selection,changed"'': The current selection has changed.
* ''"selection,cleared"'': The current selection has been cleared.
* ''"selection,copy"'': A copy of the selected text into the clipboard was requested.
* ''"selection,cut"'': A cut of the selected text into the clipboard was requested.
* ''"selection,paste"'': A paste of the clipboard contents was requested.
* ''"selection,start"'': A selection has begun and no previous selection existed.
* ''"text,set,done"'': Whole text has been set to the entry.
* ''"theme,changed"'': Called when the theme is changed.
* ''"undo,request"'': Called on undo request.
* ''"rejected"'': Called when some of inputs are rejected by the filter. (since 1.9)
For signals, where ''event_info'' has not been explicitly described, it is set to
NULL.
As an example, we register a callback to the "focused" signal.
<code c>
evas_object_smart_callback_add(entry, "focused", _focused_cb, data);
// Callback function for the "focused" signal
// This callback is called when the entry receive the focus
static void
_focused_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("Entry focused\n");
}
</code>
\\
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/entry_example.html|A Simple Editing example]]__**//
\\
----
{{page>widgets_index}}

View File

@ -0,0 +1,132 @@
~~Title: Flip Widget PG~~
{{page>widgets_index}}
----
===== Flip Widgets =====
{{ :widgets_flip_tree.png }}{{ :widgets_flip.png }}
The flip widget can hold two Evas Objects and allows the user flip between
them using several pre-defined animations.
=== Table of Contents ===
* [[#Adding_a_Flip|Adding a Flip]]
* [[#Configuring_Flip_Animation|Configuring Flip Animation]]
* [[#Interacting_With_the_User|Interacting With the User]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Flip.html|Flip Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_flip.html|A Flip Example]]
==== Adding a Flip ====
This is how to create a flip widget.
<code c>
Evas_Object *flip, *content1, *content2;
flip = elm_flip_add(parent);
</code>
We can add content to the flip widget. content1 is set to the "front" content
and content2 is set to the "back" mode.
<code c>
elm_object_part_content_set(flip, "front", content1);
elm_object_part_content_set(flip, "back", content2);
</code>
==== Configuring Flip Animation ====
Now we can run an flip animation.
<code c>
elm_flip_go(flip, ELM_FLIP_CUBE_UP);
</code>
This animation flips up the "front" content object as if it was on a side of a
cube, letting the down facing side of the cube appear with the "back" content
object. Several animations are available:
* ''ELM_FLIP_ROTATE_X_CENTER_AXIS'' - Rotate the currently visible content around a horizontal axis in the middle of its height, the other content is shown as the other side of the flip.
* ''ELM_FLIP_ROTATE_Y_CENTER_AXIS'' - Rotate the currently visible content around a vertical axis in the middle of its width, the other content is shown as the other side of the flip.
* ''ELM_FLIP_ROTATE_XZ_CENTER_AXIS'' - Rotate the currently visible content around a diagonal axis in the middle of its width, the other content is shown as the other side of the flip.
* ''ELM_FLIP_ROTATE_YZ_CENTER_AXIS'' - Rotate the currently visible content around a diagonal axis in the middle of its height, the other content is shown as the other side of the flip.
* ''ELM_FLIP_CUBE_LEFT'' - Rotate the currently visible content to the left as if the flip was a cube, the other content is show as the right face of the cube.
* ''ELM_FLIP_CUBE_RIGHT'' - Rotate the currently visible content to the right as if the flip was a cube, the other content is show as the left face of the cube.
* ''ELM_FLIP_CUBE_UP'' - Rotate the currently visible content up as if the flip was a cube, the other content is show as the bottom face of the cube.
* ''ELM_FLIP_CUBE_DOWN'' - Rotate the currently visible content down as if the flip was a cube, the other content is show as the upper face of the cube.
* ''ELM_FLIP_PAGE_LEFT'' - Move the currently visible content to the left as if the flip was a book, the other content is shown as the page below that.
* ''ELM_FLIP_PAGE_RIGHT'' - Move the currently visible content to the right as if the flip was a book, the other content is shown as the page below that.
* ''ELM_FLIP_PAGE_UP'' - Move the currently visible content up as if the flip was a book, the other content is shown as the page below that.
* ''ELM_FLIP_PAGE_DOWN'' - Move the currently visible content down as if the flip was a book, the other content is shown as the page below that.
{{ :elm_flip.png }}
<note>
''elm_flip_go_to(flip,front,ELM_FLIP_CUBE_UP)'' is the same as
''elm_flip_go()'' except if front is ''EINA_TRUE'' it makes front visible,
otherwise makes back.
</note>
==== Interacting With the User ====
By default, the user cannot interact with the flip. We can set the interaction
to be possible, but we have to choose which animation appears on the
interaction (rotation has been selected in the following example).
<code c>
elm_flip_interaction_set(flip, ELM_FLIP_INTERACTION_ROTATE);
</code>
The available modes of interaction are
* ''ELM_FLIP_INTERACTION_NONE'' - No interaction is allowed
* ''ELM_FLIP_INTERACTION_ROTATE'' - Interaction causes a rotating animation
* ''ELM_FLIP_INTERACTION_CUBE'' - Interaction causes a cube animation
* ''ELM_FLIP_INTERACTION_PAGE'' - Interaction causes a page animation
We must also choose, which interaction directions are enabled (only right and
left in the following example).
<code c>
elm_flip_interaction_direction_enabled_set(flip, ELM_FLIP_DIRECTION_LEFT, EINA_TRUE);
elm_flip_interaction_direction_enabled_set(flip, ELM_FLIP_DIRECTION_RIGHT, EINA_TRUE);
</code>
We can also set the amount of the flip that is sensitive to user interaction.
In the following example, it is set to the entire flip (1) to make the flip
easy to interact with.
<code c>
elm_flip_interaction_direction_hitsize_set(flip, ELM_FLIP_DIRECTION_LEFT, 1);
elm_flip_interaction_direction_hitsize_set(flip, ELM_FLIP_DIRECTION_RIGHT, 1);
</code>
==== Using Flip Callbacks ====
Two signals are emitted by the flip: one when an animation starts and one when
it ends. For these signals, event_info parameter is NULL.
* ''"animate,begin"'' - A flip animation is started
* ''"animate,done"'' - A flip animation is finished
We can register a callback on the "animation,begin" signal.
<code c>
evas_object_smart_callback_add(entry, "animate,begin", _anim_start_cb, data);
// Callback function for the "animate,begin" signal
// This callback is called when the flip animation starts
static void
_anim_start_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("Animation starts\n");
}
</code>
\\
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_flip.html|A Flip Example]]__**//
\\
----
{{page>widgets_index}}

View File

@ -0,0 +1,123 @@
~~Title: Glview Widget PG~~
{{page>widgets_index}}
----
===== Glview Widgets =====
{{ :widgets_glview_tree.png }}{{ :widgets_glview.png }}
This widget renders OpenGL in an elementary object, which hides Evas GL
complexity.
=== Table of Contents ===
* [[#Adding_a_Glview|Adding a Glview]]
* [[#Using_GLView_API|Using GLView API]]
* [[#Using_GLView_Callbacks|Using GLView Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__GLView.html|Glview Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/glview_example_01_8c-example.html|A Glview Example]]
==== Adding a Glview ====
Create a GLView widget with the elm_glview_add() function.
<code c>
Evas_Object *glview = elm_glview_add(parent);
</code>
In this example, the size of the GLView is set to 200x200 pixels.
<code c>
elm_glview_size_set(glview, 200, 200);
</code>
==== Using GLView API ====
We can configure the GLView rendering mode by activating the following
rendering modes:
^''ELM_GLVIEW_ALPHA'' |Alpha channel enabled rendering mode. ^''ELM_GLVIEW_DEPTH'' |Depth buffer enabled rendering mode (24 bits by default) |
^''ELM_GLVIEW_STENCIL'' |Stencil buffer enabled rendering mode (8 bits by default) ^''ELM_GLVIEW_DIRECT'' |Request direct rendering, unless there must be a fallback. |
^''ELM_GLVIEW_CLIENT_SIDE_ROTATION''|Client will handle GL view rotation if direct rendering is enabled.^''ELM_GLVIEW_DEPTH_8'' |Request min. \\ 8 bits for the depth buffer |
^''ELM_GLVIEW_DEPTH_16'' |Request min. \\ 16 bits for the depth buffer ^''ELM_GLVIEW_DEPTH_24'' |Request min. \\ 24 bits for the depth buffer (default) |
^''ELM_GLVIEW_DEPTH_32'' |Request min. \\ 32 bits for the depth buffer ^''ELM_GLVIEW_STENCIL_1'' |Request min. \\ 1 bits for the stencil buffer |
^''ELM_GLVIEW_STENCIL_2'' |Request min. \\ 2 bits for the stencil buffer ^''ELM_GLVIEW_STENCIL_4'' |Request min. \\ 4 bits for the stencil buffer |
^''ELM_GLVIEW_STENCIL_8'' |Request min. \\ 8 bits for the stencil buffer (default) ^''ELM_GLVIEW_STENCIL_16'' |Request min. \\ 16 bits for the stencil buffer |
^''ELM_GLVIEW_MULTISAMPLE_LOW'' |MSAA with minimum number of samples. ^''ELM_GLVIEW_MULTISAMPLE_MED'' |MSAA with half the number of maximum samples. |
^''ELM_GLVIEW_MULTISAMPLE_HIGH'' |MSAA with maximum number of samples. ^ | |
In this example, we enable alpha channel and depth buffer rendering mode.
<code c>
elm_glview_mode_set(glview, ELM_GLVIEW_ALPHA | ELM_GLVIEW_DEPTH);
</code>
We decide what to do with the GL surface when the GLView widget is resized.
<code c>
elm_glview_resize_policy_set(glview, ELM_GLVIEW_RESIZE_POLICY_RECREATE);
</code>
The GL surface is destroyed and recreated to the new size (default function).
The resize policy can also be set to ''ELM_GLVIEW_RESIZE_POLICY_SCALE''. In that
case, only the image object is scaled, not the underlying GL surface.
This is how to set the GLView rendering policy.
<code c>
elm_glview_render_policy_set(glview, ELM_GLVIEW_RENDER_POLICY_ALWAYS);
</code>
The glview object is always redrawn during the rendering loop. It can also be
set to ''ELM_GLVIEW_RENDER_POLICY_ON_DEMAND'' (default function), where glview
widget is redrawn only when it is visible.
We can register callbacks:
<code c>
elm_glview_init_func_set(glview, _init_gl_cb);
elm_glview_del_func_set(glview, _del_gl_cb);
elm_glview_resize_func_set(glview, _resize_gl_cb);
elm_glview_render_func_set(glview, _draw_gl_cb);
</code>
''elm_glview_init_func_set()'' registers an init callback that is called at the
GLView object creation.
''elm_glview_del_func_set()'' registers a del function that is called when the
GLView object is deleted.
''elm_glview_resize_func_set()'' registers the resize function that is called
during the rendering loop when the GLView object is resized.
''elm_glview_render_func_set()'' registers the render function that is called when
the GLView object must be redrawn.
==== Using GLView Callbacks ====
GLView widget emits the following signals, besides the ones sent from GLView:
* ''"focused"'' - when glview has received focus.
* ''"unfocused"'' - when glview has lost focus.
* ''"language,changed"'' - the program's language changed
This is how to register a callback.
<code c>
evas_object_smart_callback_add(glview, "focused", _focused_cb, data);
// Callback function for the "focused" signal
// This callback is called when the GLView is focused
static void
_focused_cb(void *data, Evas_Object *obj, void *event_info)
{
Elm_Focus_Info *fi = event_info;
printf("GLView is focused\n");
}
</code>
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/glview_example_01_8c-example.html|A Glview Example]]__**//
\\
----
{{page>widgets_index}}

View File

@ -0,0 +1,104 @@
~~Title: Icon Widget PG~~
{{page>widgets_index}}
----
===== Icon Widgets =====
{{ :widgets_icon_tree.png }}{{ :widgets_icon.png }}
The icon widget inherits from the image widget. It is used to display images
in an icon context.
=== Table of Contents ===
* [[#Adding_a_Icon|Adding a Icon]]
* [[#Changing_Image_File|Changing Image File]]
* [[#Using_Icon_Callbacks|Using Icon Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Icon.html|Icon Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_icon.html|An Icon Example]]
==== Adding a Icon ====
We can create an icon and set it as a "Home" standard icon.
<code c>
Evas_Object *icon = elm_icon_add(parent);
elm_icon_standard_set(icon, "Home");
</code>
Default images provided by Elementary's default theme are described below.
^standard (since 1.13)^toolbar^menu^media player^
| "folder" |"home" |"menu/home" |"media_player/forward"|
| "user-home" |"close" |"menu/close" |"media_player/info"|
| "user-trash" |"apps" |"menu/apps" |"media_player/next"|
| "view-close" |"arrow_up" |"menu/arrow_up" |"media_player/pause"|
| "view-refresh" |"arrow_down" |"menu/arrow_down" |"media_player/play"|
| "window-close" |"arrow_left" |"menu/arrow_left" |"media_player/prev"|
| "document-close" |"arrow_right"|"menu/arrow_right"|"media_player/rewind"|
| "document-edit" |"chat" |"menu/chat" |"media_player/stop"|
| "dialog-info" |"clock" |"menu/clock" |
| "dialog-close" |"delete" |"menu/delete" |
| "arrow-up" |"edit" |"menu/edit" |
| "arrow-down" |"refresh" |"menu/refresh" |
| "arrow-left" |"folder" |"menu/folder" |
| "arrow-right" |"file" |"menu/file" |
| "arrow-up-left" |
| "arrow-up-right" |
| "arrow-down-left" |
| "arrow-down-right" |
| "edit-delete" |
| "application-chat" |
| "application-clock" |
| "media-seek-forward" |
| "media-seek-backward" |
| "media-skip-forward" |
| "media-skip-backward" |
| "media-playback-pause" |
| "media-playback-start" |
| "media-playback-stop" |
| "media-eject" |
| "audio-volume" |
| "audio-volume-muted" |
==== Changing Image File ====
We can change the image by using an image in the filesystem (for example,
/tmp/Home.png),
<code c>
elm_image_file_set(icon, "/tmp/Home.png", NULL);
</code>
or a group in an Edje file (for example, /tmp/Home.edj).
<code c>
elm_image_file_set(icon, "/tmp/Home.edj", "elm/icon/Home/default");
</code>
A thumbnail can be generated and cached for future use. (For this, you need
the Ethumb library support.)
<code c>
elm_icon_thumb_set(icon, "/tmp/Home.png", NULL);
</code>
This function sets the file in the icon and enables the use of a cached
thumbnail if it already exists. Otherwise, it creates a new thumbnail and
caches it for future use.
==== Using Icon Callbacks ====
The icon widget emits the following signals:
* ''"thumb,done"'' - elm_icon_thumb_set() is completed with success.
* ''"thumb,error"'' - elm_icon_thumb_set() fails.
In both cases, event_info is NULL;
\\
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_icon.html|An Icon Example]]__**//
\\
----
{{page>widgets_index}}

View File

@ -0,0 +1,109 @@
~~Title: Image Widget PG~~
{{page>widgets_index}}
----
===== Image Widgets =====
{{ :widgets_image_tree.png }}{{ :widgets_image.png }}
The image widget can load and display an image from a disk file or a memory
region.
=== Table of Contents ===
* [[#Adding_an_Image|Adding a Image]]
* [[#Configuring_Image_Widget|Configuring Image Widget]]
* [[#Using_Image_Callbacks|Using Image Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Image.html|Image Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_image.html|An Image Example]]
==== Adding an Image ====
This object is created with ''elm_image_add()''.
<code c>
Evas_Object *image = elm_image_add(parent);
</code>
==== Configuring Image Widget ====
Various properties of the image can be tuned. First, we disable elementary
scaling so that the image does not scale but resizes on both directions.
<code c>
elm_image_no_scale_set(image, EINA_TRUE);
elm_image_resizable_set(image, EINA_TRUE, EINA_TRUE);
</code>
When scaling images, the smooth scaling algorithm can be used. It provides a
better quality image but is slower than the default algorithm.
<code c>
elm_image_smooth_set(image, EINA_TRUE);
</code>
Preloading is used to load images without blocking the user interface. This
preserves the reactivity of the user experience. The image is loaded in a
thread. It can be disabled if desired.
<code c>
elm_image_preload_disabled_set(image, EINA_TRUE);
</code>
The image can be rotated or flipped. Here we rotate our image 180 degrees.
<code c>
elm_image_orient_set(image, ELM_IMAGE_ROTATE_180);
</code>
The following orientations are available:
* ''ELM_IMAGE_ORIENT_0'': No orientation change
* ''ELM_IMAGE_ROTATE_90'': Rotate the image 90 degrees clockwise
* ''ELM_IMAGE_ROTATE_180'': Rotate the image 180 degrees clockwise
* ''ELM_IMAGE_ROTATE_270'': Rotate the image 90 degrees counter-clockwise
* ''ELM_IMAGE_FLIP_HORIZONTAL'': Flip the image horizontally
* ''ELM_IMAGE_FLIP_VERTICAL'': Flip the image vertically
* ''ELM_IMAGE_FLIP_TRANSPOSE'': Flip the image along the bottom-left to top-right line
* ''ELM_IMAGE_FLIP_TRANSVERSE'': Flip the image along the top-left to bottom-right line
If we want to keep the original aspect ration when resizing the image, we must
define how the image fits into the object's area.
<code c>
// Tell the image to keep original aspect ratio
elm_image_aspect_fixed_set(image, EINA_TRUE);
// Then let the image fit the entire object
elm_image_fill_outside_set(image, EINA_TRUE);
</code>
In this configuration, part of the image may go outside the object. If
''elm_image_fill_outside_set'' is set to ''EINA_FALSE'', the image stays inside the
limits of the parent object.
==== Using Image Callbacks ====
The image widget emits the signals below:
* ''"drop"'': The user drops an image typed object onto the object in question - the event info argument is the path to that image file
* ''"clicked"'': The user clicks the image. event_info is NULL.
Here is how to register a callback when a user clicks on the image:
<code c>
evas_object_smart_callback_add(image, "clicked", _clicked_cb, data);
// Callback function for the "clicked" signal
// This callback is called when the image is clicked
static void
_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("Image clicked\n");
}
</code>
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_image.html|An Image Example]]__**//
\\
----
{{page>widgets_index}}

View File

@ -0,0 +1,122 @@
~~Title: Index Widget PG~~
{{page>widgets_index}}
----
===== Index Widgets =====
{{ :widgets_index_tree.png }}{{ :widgets_index.png }}
An index widget gives you an index for fast access to whichever group of other
UI items you have. By default hidden, the index appears when the user clicks
over its reserved area in the canvas. In the default theme, it is a one finger
wide area on the right side of the index widget's container. Generally, an
index is used together with lists, generic lists or generic grids.
=== Table of Contents ===
* [[#Adding_a_Index|Adding a Index]]
* [[#Adding_Items|Adding Items]]
* [[#Sorting_Index_Items|Sorting Index Items]]
* [[#Using_Index_Callbacks|Using Index Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Index.html|Index Widget API]]
|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/index_example_01.html|A first Index Example]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/index_example_02.html|A second index example]]|
==== Adding a Index ====
Call ''elm_index_add()'' to create a new index widget.
<code c>
Evas_Object *index;
index = elm_index_add(parent);
</code>
==== Adding Items ====
Here we add the listitem object at the letter "A", calling the smart callback ''it_select_cb()'' when this item is selected.
<code c>
Elm_Object_Item *list_item1, *list_item2;
elm_index_item_append(index, "A", _it_select_cb, list_item1);
</code>
This is how to define the smart callback.
<code c>
// Callback function called when the list_item1 object
// is selected
static void
_it_select_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("Item1 selected\n");
}
</code>
In the previous case, the indexes are appended to the existing ones. It is also possible to prepend index items with ''elm_index_item_prepend()''.
==== Sorting Index Items ====
We can insert index items using a sorting function. Indexes can be sorted, for example, by alphabetic order.
We must write a compare function that returns a positive int, 0 or a negative int when the data2 item parameter is respectively greater than, equal to or lower than the data1 parameter.
<code c>
static int
_index_icmp(const void *data1, const void *data2)
{
int result;
// Code that does the item comparison will be written here
return result;
}
</code>
We add a new item at the "B" index using the compare function to sort the indexes.
<code c>
elm_index_item_sorted_insert(index, "B", NULL, list_item2, _index_icmp, NULL);
</code>
==== Using Index Callbacks ====
This widget emits the following signals, besides the ones sent from Layout:
* ''"changed"'' - When the selected index item changes. event_info is the selected item's data pointer.
* ''"delay,changed"'' - When the selected index item changes, but after a small idling period. event_info is the selected item's data pointer.
* ''"selected"'' - When the user releases a mouse button and selects an item. event_info is the selected item's pointer.
* ''"level,up"'' - when the user moves a finger from the first level to the second level
* ''"level,down"'' - when the user moves a finger from the second level to the first level
* ''"language,changed"'' - the program's language changed
* ''"focused"'' - When the index has received focus. (since 1.8)
* ''"unfocused"'' - When the index has lost focus. (since 1.8)
The ''"delay,changed"'' event is so that it'll wait a small time before actually
reporting those events and, moreover, just the last event happening on those
time frames will actually be reported.
When the user selects an item in the index, the ''"selected"'' signal is emitted.
The developer can then implement the associated callback to do the appropriate
action (to show a given area or child object depending on the index item
selected, for example). Here is an example of such a callback.
<code c>
static void
_index_selected_cb(void *data, Evas_Object *obj, void *event_info)
{
Elm_Object_Item *lit = event_info;
// Code that does the desired action
}
</code>
Then we register this callback to the "selected" signal.
<code c>
evas_object_smart_callback_add(index, "selected", _index_selected_cb, NULL);
</code>
\\
|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/index_example_01.html|A first Index Example]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/index_example_02.html|A second index example]]|
----
{{page>widgets_index}}

View File

@ -0,0 +1,87 @@
~~Title: Label Widget PG~~
{{page>widgets_index}}
----
===== Label Widgets =====
{{ :widgets_label_tree.png }}{{ :widgets_label.png }}
The label widget displays text with simple html-like markup.
=== Table of Contents ===
* [[#Adding_a_Label|Adding a Label]]
* [[#Using_Label_Styles|Using Label Styles]]
* [[#Configuring_the_Label|Configuring the Label]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Label.html|Label Widget API]]
* [[/tutorial/basic/label|Basic Label Tutorial]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_label.html|A Label Example]]
==== Adding a Label ====
To add a label and set the text in it, use the following functions.
<code c>
Evas_Object *label = elm_label_add(win);
elm_object_text_set(label, "Some long text for our label, that is not so long");
</code>
==== Using Label Styles ====
Label displays the text with several predefined styles.
* ''default'' - No animation
* ''marker'' - Centers the text in the label and makes it bold by default
* ''slide_long'' - The entire text appears from the right of the screen and slides until it disappears in the left of the screen(reappearing on the right again).
* ''slide_short'' - The text appears in the left of the label and slides to the right to show the overflow. When all of the text has been shown the position is reset.
* ''slide_bounce'' - The text appears in the left of the label and slides to the right to show the overflow. When all of the text has been shown the animation reverses, moving the text to the left.
Here we set the style to ''"slide_long"''.
<code c>
elm_object_style_set(label, "slide_long");
</code>
==== Configuring the Label ====
The duration of the animation and the slide mode can be set.
<code c>
elm_label_slide_duration_set(label, 3);
elm_label_slide_mode_set(label, ELM_LABEL_SLIDE_MODE_ALWAYS);
</code>
The style can be modified.
<code c>
elm_object_style_set(label, "slide_bounce");
</code>
==== Using Label Callbacks ====
This widget emits the following signals, besides the ones sent from Layout:
* ''"language,changed"'': The program's language changes.
* ''"slide,end"'': The slide reaches the end.
Here we register a callback on the ''"slide,end"'' signal.
<code c>
evas_object_smart_callback_add(label, "slide,end", _slide_end_cb, data);
</code>
<code c>
// Callback function for the "slide,end" signal
// This callback is called when the label slide reaches the end
static void
_slide_end_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("Slide has reach the end.\n");
}
</code>
\\
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_label.html|A Label Example]]__**//
\\
----
{{page>widgets_index}}

View File

@ -0,0 +1,224 @@
~~Title: List Widget PG~~
{{page>widgets_index}}
----
===== List Widgets =====
{{ :widgets_list_tree.png }}{{ :widgets_list.png }}
This widget is a very simple type of a list widget. It is not to be used to
manage a lot of items. For that, genlists are a better option.
The list items can contain a text and two contents ("start", and "end"). These
are set with the ''elm_object_item_*()'' functions.
=== Table of Contents ===
* [[#Adding_a_List|Adding a List]]
* [[#Using_the_List|Using the List]]
* [[#Adding_Item_to_the_List|Adding Item to the List]]
* [[#Changing_Text_Or_Icon_of_an_Item|Changing Text Or Icon of an Item]]
* [[#Retrieving_Selected_Items|Retrieving Selected Items]]
* [[#List_Item_Operations|List Item Operations]]
* [[#Using_List_Callbacks|Using List Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__List.html|List Widget API]]
* [[/tutorial/basic/list|Basic List Tutorial]]
^List Examples^^^
|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/list_example_01.html|A List Example]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/list_example_02.html|A List Example]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/list_example_03.html|Item management Example]]|
==== Adding a List ====
To create a list:
<code c>
Evas_Object *list = elm_list_add(parent);
</code>
==== Using the List ====
This widget implements the scrollable interface, so the scroller widget
functions can be used on it. For example, if you want to change the bounce
property of the scroller or the scrolling policy:
<code c>
Evas_Object *list;
// Change the scroller policy to fix the scroll only vertically
elm_scroller_policy_set(list, ELM_SCROLLER_POLICY_ON,
ELM_SCROLLER_POLICY_OFF);
// Enable bounce effect when the list reaches the upper and lower limits
elm_scroller_bounce_set(list, EINA_TRUE, EINA_TRUE);
</code>
The ''elm_list_multi_select_set()'' function can be called to enable
multi-selection of items. Each time an item is clicked, the state changes to
"selected".
<code c>
Evas_Object *list;
// Activate multi selection
elm_list_multi_select_set(list, EINA_TRUE);
</code>
==== Adding Item to the List ====
Items are added ''with elm_list_item_append()'' or ''elm_list_item_prepend()''. Here
an example of adding ten items with text and one icon on the front: The last
two arguments are the callback function when the created item is clicked and
the data passed to the callback function.
<code c>
Evas_Object *list;
int i;
// This function is called when the list item is selected
static void
_selected_item_cb(void *data, Evas_Object *obj, void *event_info)
{
Elm_Object_Item *list_it = elm_list_selected_item_get(obj);
Eina_Bool selected = elm_list_item_selected_get(list_it);
printf("item is %s\n", selected? "selected": "unselected");
}
for (i = 0; i < 10; i++)
{
Evas_Object *ic;
char tmp[8];
snprintf(tmp, sizeof(tmp), "Item %02d", i);
// Create an icon
ic = elm_icon_add(win);
// Set the file to the icon file
elm_image_file_set(ic, "path/to/file", NULL);
// Add item to the list
elm_list_item_append(list, tmp, ic, NULL, _selected_item_cb, NULL);
}
</code>
==== Changing Text Or Icon of an Item ====
If you want to change the state of an item, you can do it by using all the
functions relative to ''Elm_Object_Item''. Each item of the list contains two
evas_object. Give those as the third and the fourth arguments when you append
or prepend the item in the list. Those evas objects are changed with
''elm_object_item_part_content_set''. The first object is referenced as the
"start" object in the theme, whereas the second one is referenced as the "end"
object. Give these names when you use the ''elm_object_item_part_content_set''.
The label of the item is changed by using ''elm_object_item_text_set''.
<code c>
Evas_Object *list;
Eina_List *l;
Elm_Object_Item *it;
// Retrieve the current selected item
it = elm_list_selected_item_get(list);
if (!it)
return;
ic = elm_icon_add(win);
// Set the file to the icon file
elm_image_file_set(ic, "path/to/file", NULL);
// Change the first icon
elm_object_item_part_content_set(it, "start", ic);
// Change the second icon
elm_object_item_part_content_set(it, "end", ic);
// Change the label
elm_object_item_text_set(it, "I've been selected !");
</code>
==== Retrieving Selected Items ====
The list of the currently selected items is retrieved with
''elm_list_selected_items_get()''. If the multiselect mode is false, you can
retrieve the only selected item with ''elm_list_selected_item_get()''. For
example, this is how to unselect all previously selected items.
<code c>
Evas_Object *list; Eina_List *l;
Eina_List *selected_items;
// List of Elm_Object_Item
Elm_Object_Item *it;
selected_items = elm_list_selected_items_get(list);
EINA_LIST_FOREACH(selected_items, l, it)
elm_list_item_selected_set(it, EINA_FALSE);
</code>
==== List Item Operations ====
To find out if an item is selected, call elm_list_item_selected_get. This
function returns ''EINA_TRUE'' if the item is selected, otherwise ''EINA_FALSE''.
Elementary list provides two functions for sliding a list to a specific item.
''elm_list_item_show'' shows the item passed as an argument, whereas
''elm_list_item_bring_in'' shows the item, but only after animating the slide.
You can go to the item immediately preceding a specific item with the function
''elm_list_item_prev'', or to the one immediately following a specific item with
the function ''elm_list_item_next''.
The following example shows selecting the item immediately following the
currently selected one, unselecting it, selecting the next one and bringing it
to the screen.
<code c>
Evas_Object *list;
Elm_Object_Item *current, *next;
current = elm_list_selected_item_get(list);
elm_list_item_selected_set(current, EINA_FALSE);
next = elm_list_item_next(current);
elm_list_item_selected_set(next, EINA_TRUE);
elm_list_item_bring_in(next);
</code>
==== Using List Callbacks ====
This widget emits the following signals, besides the ones sent from Layout:
* ''"activated"'' - The user has double-clicked or pressed (enter|return|spacebar) on an item. The event_info parameter is the item that was activated.
* ''"clicked,double"'' - The user has double-clicked an item. The event_info parameter is the item that was double-clicked.
* ''"clicked,right"'' - The user has right-clicked an item. The event_info parameter is the item that was right-clicked. (since 1.13)
* ''"selected"'' - when the user selected an item
* ''"unselected"'' - when the user unselected an item
* ''"longpressed"'' - an item in the list is long-pressed
* ''"edge,top"'' - the list is scrolled until the top edge
* ''"edge,bottom"'' - the list is scrolled until the bottom edge
* ''"edge,left"'' - the list is scrolled until the left edge
* ''"edge,right"'' - the list is scrolled until the right edge
* ''"highlighted"'' - an item in the list is highlighted. This is called when the user presses an item or keyboard selection is done so the item is physically highlighted. The event_info parameter is the item that was highlighted.
* ''"unhighlighted"'' - an item in the list is unhighlighted. This is called when the user releases an item or keyboard selection is moved so the item is physically unhighlighted. The event_info parameter is the item that was unhighlighted.
* ''"language,changed"'' - the program's language changed
* ''"focused"'' - When the list has received focus. (since 1.8)
* ''"unfocused"'' - When the list has lost focus. (since 1.8)
* ''"item,focused"'' - When the list item has received focus. (since 1.10)
* ''"item,unfocused"'' - When the list item has lost focus. (since 1.10)
You can register to the ''"clicked,double"'' signal with the following code. Note
that the currently double-clicked item can be retrieved via the event_info
pointer. This code registers to the "double,clicked" signal and unselects the
item that has been double-clicked.
<code c>
Evas_Object *list;
evas_object_smart_callback_add(list, "clicked,double", _double_clicked_cb, data);
</code>
<code c>
// Callback function for the "clicked" signal
// This callback is called when the button is clicked by the user
static void
_double_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
elm_Object_Item *it = event_info;
elm_list_selected_item_set(it, EINA_FALSE);
}
</code>
\\
^List Examples^^^
|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/list_example_01.html|A List Example]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/list_example_02.html|A List Example]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/list_example_03.html|Item management Example]]|
----
{{page>widgets_index}}

View File

@ -0,0 +1,265 @@
~~Title: Map Widget PG~~
{{page>widgets_index}}
----
===== Map Widgets =====
{{ :widgets_map_tree.png }}{{ :widgets_map.png?400 }}
The map widget displays a geographic map. The default map data are provided by
the [[http://www.openstreetmap.org/|OpenStreetMap project]]. Custom providers
can also be added.
It supports some basic but yet nice features:
* zooming
* scrolling
* markers with content to be displayed when user clicks over them
* group of markers
* routes
The map widget implements the scroller interface so that all the functions
that work with the scroller widget also work with maps.
=== Table of Contents ===
* [[#Adding_a_Map|Adding a Map]]
* [[#Playing_with_the_Map|Playing with the Map]]
* [[#Drawing_Overlays|Drawing Overlays]]
* [[#Adding_Other_Overlays|Adding Other Overlays]]
* [[#Calculating_Routes|Calculating Routes]]
* [[#Using_Map_Callbacks|Using Map Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Map.html|Map Widget API]]
^ Map Examples ^^^
|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/map_example_01.html|Creation and Zoom]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/map_example_02.html|Overlay Usage]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/map_example_03.html|Route and Name Usage]]|
==== Adding a Map ====
Once created with the ''elm_map_add()'' function, zoom level x12 can be set.
<code c>
Evas_Object *map = elm_map_add(parent);
elm_map_zoom_mode_set(map, ELM_MAP_ZOOM_MODE_MANUAL);
elm_map_zoom_set(map, 12);
</code>
Here the zoom mode is set to manual, there the list of all the available
options:
* ''ELM_MAP_ZOOM_MODE_MANUAL'' - Zoom controlled manually by ''elm_map_zoom_set()''. It's set by default.
* ''ELM_MAP_ZOOM_MODE_AUTO_FIT'' - Zoom until map fits inside the scroll frame with no pixels outside this area.
* ''ELM_MAP_ZOOM_MODE_AUTO_FILL'' - Zoom until map fills scroll, ensuring no pixels are left unfilled.
==== Playing with the Map ====
If we have coordinates of a specific area (2 2 N, 48 8 E), we can show it on the map.
<code c>
elm_map_region_show(map, 2.2, 48.8);
</code>
This shows the desired coordinates. We can also show the location with a bring-in animation.
<code c>
elm_map_region_bring_in(map, 2.2, 48.8);
</code>
The map is rotated 90 degrees around the current position.
<code c>
elm_map_rotate_set(map, 90, 2.2, 48.8);
</code>
==== Drawing Overlays ====
Overlays are markers that can be placed anywhere on the map. They can
represent any object we want to put on the map.
=== Creating an Overlay Class ===
Overlay classes can be created if several objects are of the same type. For
example, we create a forest overlay class to represent the forests visible on
the map. We set the minimum zoom level at which this class is visible. The
forest class overlay is visible when the zoom level is superior to eight.
We set an icon ("Home" icon here) to the forest class. This icon is displayed
in place of the forest class on the map.
<code c>
Evas_Object *icon;
Elm_Map_Overlay *forest_class = elm_map_overlay_class_add(map);
// Set min zoom level at which class is displayed
elm_map_overlay_displayed_zoom_min_set(forest_class, 8);
// Create a Home icon object and set it to the forest class
icon = elm_icon_add(map);
elm_icon_standard_set(icon, "home");
elm_map_overlay_icon_set(forest_class, icon);
</code>
=== Adding Overlays to a Class ===
After creating a forest class, we can add overlay objects to it. Here we
create an overlay for the Meudon forest. Data is linked to the overlay with
the ''elm_map_overlay_data_set()'' function. We set the name of the forest in
the data. The icon can be set to the overlay with the
''elm_map_overlay_icon_set()'' function.
<note>
Do not use the same icon object for two different overlays. Create a new icon
object each time you need one.
</note>
<code c>
Elm_Map_Overlay *ovl;
const char* data_meudon = "Meudon forest";
const char* data_fausses = "Fausse forest";
// Add an overlay
ovl = elm_map_overlay_add(map, 2.20718, 48.79759);
icon = elm_icon_add(map);
elm_icon_standard_set(icon, "stop");
elm_map_overlay_icon_set(ovl, icon);
elm_map_overlay_data_set(ovl, &amp;data_meudon);
// Add the new ovl object to the forest class
elm_map_overlay_class_append(forest_class, ovl);
// Add another overlay next to the first one
ovl = elm_map_overlay_add(map, 2.1699, 48.8189);
icon = elm_icon_add(map);
elm_icon_standard_set(icon, "stop");
elm_map_overlay_icon_set(ovl, icon);
elm_map_overlay_data_set(ovl, &amp;data_fausses);
elm_map_overlay_class_append(forest_class, ovl);
</code>
If we add another overlay to the forest class, the two overlays can be grouped
under the forest class icon on certain zoom level conditions. We can define on
which zoom level items are grouped.
<code c>
elm_map_overlay_class_zoom_max_set(forest_class, 8);
</code>
In this case, overlay members of the forest class are grouped when the map is
displayed at less than zoom level eight.
=== Creating Bubbles Following Overlays ===
This is how to set a content in a bubble following an overlay.
<code c>
// Add an overlay bubble object
Elm_Map_Overlay *bubble = elm_map_overlay_bubble_add(map);
// Set it to follow a specific overlay (the last created one here)
elm_map_overlay_bubble_follow(bubble, ovl);
</code>
Once following an overlay, the bubble appears, moves or hides following the
parent overlay's behavior.
Content is added to the bubble with the
''elm_map_overlay_bubble_content_append()'' function.
==== Adding Other Overlays ====
We can draw a circle on the map with coordinates and a radius size.
<code c>
Elm_Map_Overlay *circle = elm_map_overlay_circle_add(map, 2.2, 48.8, 0.02);
</code>
We can also add a scale at the 200x0 coordinate (in pixels).
<code c>
Elm_Map_Overlay *scale = elm_map_overlay_scale_add(map, 200, 0);
</code>
Or we can draw a line, a polygon, or a route. See the full API for a full
description of these functions.
==== Calculating Routes ====
A route between a starting point and an ending point is calculated with the
''elm_map_route_add()'' call. The type of transport and the routing
calculation method can be provided so as to have the desired result.
In this example, we want a route calculation between the first and the second
overlay. We configure it to use the bicycle, and we want to find the fastest
route in time.
<code c>
Elm_Map_Route *route = elm_map_route_add(map,
ELM_MAP_ROUTE_TYPE_BICYCLE,
ELM_MAP_ROUTE_METHOD_FASTEST,
2.20718, 48.79759,
2.1699, 48.8189,
NULL, NULL);
// Add a callback to when the route has been calculated and loaded
evas_object_smart_callback_add(map, "route,loaded", _route_loaded_cb, route);
</code>
Once the route is calculated, we can create a route overlay object and change its color. In this example, we use the "route,loaded" callback.
<code c>
static void
_route_loaded_cb(void *data, Evas_Object *obj, void *ev)
{
Elm_Map_Route *route = data;
Elm_Map_Overlay *route_ovl = elm_map_overlay_route_add(obj, route);
elm_map_overlay_color_set(route_ovl, 0, 255, 0, 255);
}
</code>
==== Using Map Callbacks ====
The map widget emits the following callbacks:
* ''"clicked"'' - This is called when a user has clicked the map without dragging around.
* ''"clicked,double"'' - This is called when a user has double-clicked the map.
* ''"press"'' - This is called when a user has pressed down on the map.
* ''"longpressed"'' - This is called when a user has pressed down on the map for a long time without dragging around.
* ''"scroll"'' - the content has been scrolled (moved).
* ''"scroll,drag,start"'' - dragging the contents around has started.
* ''"scroll,drag,stop"'' - dragging the contents around has stopped.
* ''"scroll,anim,start"'' - scrolling animation has started.
* ''"scroll,anim,stop"'' - scrolling animation has stopped.
* ''"zoom,start"'' - Zoom animation started.
* ''"zoom,stop"'' - Zoom animation stopped.
* ''"zoom,change"'' - Zoom changed when using an auto zoom mode.
* ''"tile,load"'' - A map tile image load begins.
* ''"tile,loaded"'' - A map tile image load ends.
* ''"tile,loaded,fail"'' - A map tile image load fails.
* ''"route,load"'' - Route request begins.
* ''"route,loaded"'' - Route request ends.
* ''"route,loaded,fail"'' - Route request fails.
* ''"name,load"'' - Name request begins.
* ''"name,loaded"'' - Name request ends.
* ''"name,loaded,fail"'' - Name request fails.
* ''"overlay,clicked"'' - A overlay is clicked.
* ''"loaded"'' - when a map is finally loaded. (since 1.7)
* ''"language,changed"'' - the program's language changed
* ''"focused"'' - When the map has received focus. (since 1.8)
* ''"unfocused"'' - When the map has lost focus. (since 1.8)
\\
^ Map Examples ^^^
|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/map_example_01.html|Creation and Zoom]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/map_example_02.html|Overlay Usage]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/map_example_03.html|Route and Name Usage]]|
----
{{page>widgets_index}}

View File

@ -0,0 +1,91 @@
~~Title: Notify Widget PG~~
{{page>widgets_index}}
----
===== Notify Widgets =====
{{ :widgets_notify_tree.png }}{{ :widgets_notify.png }}
This widget displays a container in a particular region of the parent object.
It can receive some content, and can be automatically hidden after a certain
amount of time.
=== Table of Contents ===
* [[#Adding_a_Notify|Adding a Notify]]
* [[#Configuring_Notify_Widget|Configuring Notify Widget]]
* [[#Using_Notify_Callbacks|Using Notify Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Notify.html|Notify Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_notify.html|A Notify Example]]
==== Adding a Notify ====
This is how to create a notify object.
<code c>
Evas_Object *notify;
notify = elm_notify_add(parent);
</code>
==== Configuring Notify Widget ====
We create a label and add it to the notify object.
<code c>
Evas_Object *content;
// Create the label and set some text to it
content = elm_label_add(parent);
elm_object_text_set(content, "A label text");
evas_object_show(content);
// Add the label object to the notify widget
elm_object_content_set(notify, content);
</code>
In this example, we show the notify object on the bottom left corner of the
parent object.
<code c>
elm_notify_align_set(notify, 1.0, 1.0);
evas_object_show(notify);
</code>
We can set a timeout interval, after which the notify widget is hidden. In
this example, the timeout interval is five seconds.
<code c>
elm_notify_timeout_set(notify, 5.0);
</code>
==== Using Notify Callbacks ====
The notify widget emits the following signals:
* ''"timeout"'' - The timeout count ends and the notify is hidden
* ''"block,clicked"'' - The user clicks outside of the notify
For both these signals event_info is NULL.
Here we register a callback on the "timeout" signal.
<code c>
evas_object_smart_callback_add(notify, "timeout", _timeout_cb, data);
</code>
<code c>
// Callback function for the "timeout" signal
// The timeout expires and the notify object is hidden
static void
_timeout_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("Notify is hidden\n");
}
</code>
\\
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_notify.html|A Notify Example]]__**//
----
{{page>widgets_index}}

View File

@ -0,0 +1,94 @@
~~Title: Panel Widget PG~~
{{page>widgets_index}}
----
===== Panel Widgets =====
{{ :widgets_panel_tree.png }}{{ :widgets_panel.png }}
The panel widget is an animated object that can contain subobjects. It can be
expanded or contracted by clicking on the button on its edge.
Panel inherits from layout widget, so the layout API can be used on this
widget.
=== Table of Contents ===
* [[#Adding_a_Panel|Adding a Panel]]
* [[#Using_the_Panel|Using the Panel]]
* [[#Add_a_Content|Add a Content]]
* [[#Using_Panel_Callbacks|Using Panel Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Panel.html|Panel Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_panel.html|A Panel Example]]
==== Adding a Panel ====
This is how to add a panel and set its orientation to left.
<code c>
Evas_Object *panel = elm_panel_add(parent);
elm_panel_orient_set(panel, ELM_PANEL_ORIENT_LEFT);
</code>
==== Using the Panel ====
The panel is manually hidden.
<code c>
elm_panel_hidden_set(panel, EINA_TRUE);
</code>
It can be toggled if we do not know the hidden state of the widget.
<code c>
elm_panel_toggle(panel);
</code>
It can be set scrollable.
<code c>
elm_panel_scrollable_set(panel, EINA_TRUE);
</code>
==== Add a Content ====
This is how to add a content to the panel, in our example the content is a
label:
<code c>
content = elm_label_add(parent);
elm_object_text_set(content,"content");
evas_object_show(content);
elm_object_content_set(panel, content);
</code>
==== Using Panel Callbacks ====
This widget emits the following signals, besides the ones sent from Layout:
* ''"scroll"'' : When the content has been scrolled (moved). (since 1.10) This signal is emitted only when the panel is scrollable. Elm_Panel_Scroll_Info will be passed by event_info argument.
* ''"focused"'' : When the panel has received focus. (since 1.8)
* ''"unfocused"'' : When the panel has lost focus. (since 1.8)
We can register a callback on the ''"scroll"'' signal, when the user scrolls the
panel. The event_info parameter is of the type ''Elm_Panel_Scroll_Info''.
<code c>
evas_object_smart_callback_add(pan, "scroll", scroll_cb, data);
</code>
<code c>
// Callback function for the "scroll" signal
// This callback is called when the user scrolls the panel
static void
scroll_cb(void *data, Evas_Object *obj, void *event_info)
{
Elm_Panel_Scroll_Info *scrollinfo = event_info;
printf("The panel was scrolled.\n");
}
</code>
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_panel.html|A Panel Example]]__**//
\\
----
{{page>widgets_index}}

View File

@ -0,0 +1,63 @@
~~Title: Photo Widget PG~~
{{page>widgets_index}}
----
===== Photo Widgets =====
{{ :widgets_photo_tree.png }}{{ :widgets_photo.png }}
The photo widget is used to display a photo (such as a contact image). If no
photo is set on it, it displays a person icon to show that it is a photo
placeholder.
=== Table of Contents ===
* [[#Adding_a_Photo|Adding a Photo]]
* [[#Using_Photo_Widget|Using Photo Widget]]
* [[#Using_Photo_Callbacks|Using Photo Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Photo.html|Photo Widget API]]
==== Adding a Photo ====
This is how to create a photo object.
<code c>
Evas_Object *photo, *parephotoslider = elm_photo_add(parent);
photo = elm_photo_add(parent);
</code>
==== Using Photo Widget ====
A file can be set to the photo widget. Here, ''PHOTO_FILENAME'' is a string
corresponding to the photo file name on the system.
<code c>
elm_photo_file_set(photo, PHOTO_FILENAME);
</code>
We can set the photo as editable, so it can be copied, cut or dragged in
another region of the screen.
<code c>
elm_photo_editable_set(photo, EINA_TRUE);
</code>
It can also be completely visible on the screen.
<code c>
elm_photo_fill_inside_set(photo, EINA_TRUE);
</code>
==== Using Photo Callbacks ====
The following callbacks are registered on the photo widget.
* ''"clicked"'' - The user has clicked the photo.
* ''"drag,start"'' - The user starts dragging the inner image out of the photo's frame.
* ''"drag,end"'' - The user drops the dragged image.
event_info is always NULL.
----
{{page>widgets_index}}

View File

@ -0,0 +1,111 @@
~~Title: Photocam Widget PG~~
{{page>widgets_index}}
----
===== Photocam Widgets =====
{{ :widgets_photocam_tree.png }}{{ :widgets_photocam.png }}
The photocam widget displays high resolution photos taken from digital
cameras. It provides a way to zoom in the photo, load it fast and fit it
nicely. It is optimized for .jpeg images format and has a low memory
footprint.
This widget implements the scroller interface, so all the functions concerning
the scroller can be used with the photocam widget.
=== Table of Contents ===
* [[#Adding_a_Photocam|Adding a Photocam]]
* [[#Using_Photocam_Zoom|Using Photocam Zoom]]
* [[#Using_Photocam_Callbacks|Using Photocam Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Photocam.html|Photocam Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_photocam.html|A Photocam Example]]
==== Adding a Photocam ====
This is how to create a photocam widget and set an image file on it.
<code c>
Evas_Object *photocam;
photocam = elm_photocam_add(win);
elm_photocam_file_set(photocam, "/tmp/photo.jpeg");
</code>
==== Using Photocam Zoom ====
We can choose between two automatic zoom modes and a manual zoom mode. Here we
set the zoom mode to manual and ask for a double zoom.
<code c>
elm_photocam_zoom_mode_set(photocam, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
elm_photocam_zoom_set(photocam, 2.0);
</code>
The zoom mode can be set to ''ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT''. In this case, the
photo fits exactly inside the scroll frame with no pixels outside this region.
The zoom mode can also be set to ''ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL'' to fill all
the pixels of the photocam widget.
Multi-touch zooming is activated by enabling gestures.
<code c>
elm_photocam_gesture_enabled_set(photocam, EINA_TRUE);
</code>
We can zoom in a specific region. In this example, we want to zoom in the
region starting at the coordinates (200x200), with a width of 400px and a
height of 300px.
<code c>
elm_photocam_image_region_bring_in(photocam, 200, 200, 400, 300);
</code>
==== Using Photocam Callbacks ====
The photocam widget emits the following signals:
* ''"clicked"'' - This is called when a user has clicked the photo without dragging around.
* ''"press"'' - This is called when a user has pressed down on the photo.
* ''"longpressed"'' - This is called when a user has pressed down on the photo for a long time without dragging around.
* ''"clicked,double"'' - This is called when a user has double-clicked the photo.
* ''"load"'' - Photo load begins.
* ''"loaded"'' - This is called when the image file load is complete for the first view (low resolution blurry version).
* ''"load,detail"'' - Photo detailed data load begins.
* ''"loaded,detail"'' - This is called when the image file load is complete for the detailed image data (full resolution needed).
* ''"zoom,start"'' - Zoom animation started.
* ''"zoom,stop"'' - Zoom animation stopped.
* ''"zoom,change"'' - Zoom changed when using an auto zoom mode.
* ''"scroll"'' - the content has been scrolled (moved)
* ''"scroll,anim,start"'' - scrolling animation has started
* ''"scroll,anim,stop"'' - scrolling animation has stopped
* ''"scroll,drag,start"'' - dragging the contents around has started
* ''"scroll,drag,stop"'' - dragging the contents around has stopped
* ''"focused"'' - When the photocam has received focus. (since 1.8)
* ''"unfocused"'' - When the photocam has lost focus. (since 1.8)
For all these signals, event_info is NULL.
This is how to register a callback on the "loaded" signal.
<code c>
void message_port_cb(int local_port_id, const char *remote_app_id, bundle *message)
{
evas_object_smart_callback_add(photocam, "loaded", _loaded_cb, data);
}
// Callback function for the "loaded" signal
// The photocam has loaded the photo file in a low resolution
static void
loaded_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("The photo has been loaded\n");
}
</code>
\\
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_photocam.html|A Photocam Example]]__**//
\\
----
{{page>widgets_index}}

View File

@ -0,0 +1,69 @@
~~Title: Plug Widget PG~~
{{page>widgets_index}}
----
===== Plug Widgets =====
{{ :widgets_plug_tree.png }}{{ :widgets_plug.png }}
The plug widget shows an Evas_Object created by an other process. It can be
used anywhere the same way as any other elementary widget.
=== Table of Contents ===
* [[#Adding_a_Plug|Adding a Plug]]
* [[#Using_the_Plug|Using the Plug]]
* [[#Using_Plug_Callbacks|Using Plug Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Plug.html|Plug Widget API]]
==== Adding a Plug ====
This is how to create a plug.
<code c>
Evas_Object *plug;
plug = elm_plug_add(parent);
</code>
The socket image provides the service where we can connect the plug object
with the ''elm_plug_connect()'' function. In this process we use the service
name and number set by the socket we want to connect to.
As an example, we connect to a service named "plug_test" on the number 0.
<code c>
elm_plug_connect(plug, "plug_test", 0, EINA_FALSE);
</code>
The Evas_Object corresponding to the distant image is retrieved with the ''elm_plug_image_object_get()'' function.
<code c>
Evas_Object *plug_img = elm_plug_image_object_get(plug);
</code>
<note>
The socket we try to connect to must be started with the
''elm_win_socket_listen()'' function in the other process on the remote window
object (it is called remote_win here).
</note>
<code c>
// Create a remote window in the other process
Elm_Win *remote_win = elm_win_add(NULL,
"Window Socket",
ELM_WIN_SOCKET_IMAGE);
// Create a socket named "plug_test" and listen to it
elm_win_socket_listen(remote_win, "plug_test", 0, EINA_FALSE);
</code>
==== Using Plug Callbacks ===
This widget emits the following signals:
* ''"clicked"'': the user clicked the image (press/release). The event parameter of the callback will be NULL.
* ''"image,deleted"'': the server side was deleted. The event parameter of the callback will be NULL.
* ''"image,resized"'': the server side was resized. The event parameter of the callback will be Evas_Coord_Size (two integers).
----
{{page>widgets_index}}

View File

@ -0,0 +1,137 @@
~~Title: Popup Widget PG~~
{{page>widgets_index}}
----
===== Popup Widgets =====
{{ :widgets_popup_tree.png }}{{ :widgets_popup.png }}
The popup widget shows a popup area that may contain
* a title area (optional)
* a content area
* an action area (optional)
The optional title area may contain an icon and text, the action area may
contain up to three buttons.
=== Table of Contents ===
* [[#Adding_a_Popup|Adding a Popup]]
* [[#Setting_the_Popup_Areas|Setting the Popup Areas]]
* [[#Using_Popup_Callbacks|Using Popup Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Popup.html|Popup Widget API]]
* [[/tutorial/popup_tutorial|Popup Tutorial]]
^ Popup Examples ^^^
|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/popup_example_01_c.html|A First Example]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/popup_example_02_c.html|A Second Example]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/popup_example_01_c.html|A Third Example]]|
==== Adding a Popup ====
This is how to create a popup widget.
<code c>
Evas_Object *popup = elm_popup_add(parent);
</code>
==== Setting the Popup Areas ====
<code c>
elm_object_style_set(popup, "toast");
</code>
We configure the title area. We set the icon object using the part name
"title,icon". We set the title text to "Test popup" using the partname
"title,text".
<code c>
Evas_Object *icon;
// Adding an icon to the title area
elm_object_part_content_set(popup, "title,icon", icon);
// Setting the title text
elm_object_part_text_set(popup, "title,text", "Test popup");
</code>
We set the content of the popup. It can be a simple text
or an Evas object.
<code c>
elm_object_part_text_set(popup, "default", "Test popup");</code>
<code c>
Evas_Object *content;
elm_object_content_set(popup, content);
</code>
We set the buttons of the action area by creating an "OK" button, a "Cancel"
button and a "Help" button.
<code c>
Evas_Object *button1, *button2, *button3;
// Create the three buttons
button1 = elm_button_add(popup);
elm_object_text_set(button1, "OK");
button2 = elm_button_add(popup);
elm_object_text_set(button2, "Cancel");
button3 = elm_button_add(popup);
elm_object_text_set(button3, "Help");
// Set the buttons to the action area
elm_object_part_content_set(popup, "button1", button1);
elm_object_part_content_set(popup, "button2", button2);
elm_object_part_content_set(popup, "button3", button3);
</code>
==== Using Popup Callbacks ====
This widget emits the following signals, besides the ones sent from Layout:
* ''"timeout"'' - whenever popup is closed as a result of timeout.
* ''"block,clicked"'' - whenever user taps on Blocked Event area.
* ''"focused"'' - When the popup has received focus. (since 1.8)
* ''"unfocused"'' - When the popup has lost focus. (since 1.8)
* ''"language,changed"'' - the program's language changed (since 1.8)
* ''"item,focused"'' - When the popup item has recieved focus. (since 1.10)
* ''"item,unfocused"'' - When the popup item has lost focus. (since 1.10)
''elm_popup_timeout_set()'' is used to hide the popup after a certain time. In
this example, we set the timeout to five seconds.
<code c>
elm_popup_timeout_set(popup, 5.0);
</code>
When the timeout expires, the "timeout" signal is sent to the user.
<code c>
evas_object_smart_callback_add(popup, "timeout", _timeout_cb, data);
</code>
<code c>
static void
_timeout_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("Timeout \n");
}
</code>
The visible region of the popup is surrounded by a translucent region called
Blocked Event area. By clicking on this area, the signal "block,clicked" is
sent to the application.
\\
^ Popup Examples ^^^
|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/popup_example_01_c.html|A First Example]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/popup_example_02_c.html|A Second Example]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/popup_example_01_c.html|A Third Example]]|
----
{{page>widgets_index}}

View File

@ -0,0 +1,135 @@
~~Title: Progressbar Widget PG~~
{{page>widgets_index}}
----
===== Progressbar Widgets =====
{{ :widgets_progressbar_tree.png }}{{ :widgets_progressbar.png }}
The progress bar is a widget for visually representing the progress status of
a given job/task.
=== Table of Contents ===
* [[#Adding_a_Progressbar|Adding a Progressbar]]
* [[#Using_Progressbar_Styles|Using Progressbar Styles]]
* [[#Using_the_Progressbar|Using the Progressbar]]
* [[#Configuring_the_Progressbar|Configuring the Progressbar]]
* [[#Using_Progressbar_Callbacks|Using Progressbar Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Progressbar.html|Progressbar Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/progressbar_example.html|A Progressbar Example]]
==== Adding a Progressbar ====
This widget is used to display the progress status of a given job. It inherits
from the layout widget, so all function concerning the layout widget is used
on the progressbar widget.
This is how to create a progressbar widget.
<code c>
Evas_Object *pb = elm_progressbar_add(win);
</code>
==== Using Progressbar Styles ====
This widget has the following styles:
* "default"
* "wheel" (simple style, no text, no progression, only "pulse" effect is available)
==== Using the Progressbar ====
By default, the progressbar does not show a label or an icon, and the unit
label is set to "%.0f % %".
This is how to set a label (in this example, it is named "Test label").
<code c>
elm_object_text_set(pb, "Test label");
</code>
An icon is set with ''elm_object_part_content_set()'' using the partname "icon".
<code c>
elm_object_part_content_set(pb, "icon", icon_object);
</code>
The unit label format string can be modified using a "printf" style format. We
set it to be a float number with two decimals.
<code c>
elm_progressbar_unit_format_set(pb, "%1.2f%%");
</code>
==== Configuring the Progressbar ====
The progressbar pulse mode is activated to make the progressbar loop
infinitely between the start and end position.
<code c>
elm_progressbar_pulse_set(pb, EINA_TRUE);
elm_progressbar_pulse(pb, EINA_TRUE);
</code>
It can be inverted. In that mode, the values are inverted so that the high
values are on the left and the low values on the right.
<code c>
elm_progressbar_inverted_set(pb, EINA_TRUE);
</code>
The progressbar emits the "changed" signal when the progress value changes.
The value is changed with the ''elm_progressbar_value_set()'' function. Here
the pb progress value is set to 20%.
<code c>
elm_progressbar_value_set(pb, 0.2);
</code>
The current value can be read.
<code c>
double value = elm_progressbar_value_get(pb);
</code>
We can set the orientation of the progressbar to vertical instead of the
default horizontal orientation.
<code c>
elm_progressbar_horizontal_set(pb, EINA_FALSE);
</code>
==== Using Progressbar Callbacks ====
This widget emits the following signals, besides the ones sent from Layout:
* ''"changed"'' - when the value is changed (since 1.7)
* ''"focused"'' - When the progressbar has received focus. (since 1.8)
* ''"unfocused"'' - When the progressbar has lost focus. (since 1.8)
* ''"language,changed"'' - the program's language changed (since 1.9)
The "changed" signal is the only signal specifically emitted by the
progressbar widget.
This is how to register a callback on this signal.
<code c>
evas_object_smart_callback_add(pb, "changed", changed_cb, data);
</code>
<code c>
// Callback function for the "changed" signal
// This callback is called when the progressbar value changes
static void
changed_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("The value has changed\n");
}
</code>
\\
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/progressbar_example.html|A Progressbar Example]]__**//
----
{{page>widgets_index}}

View File

@ -0,0 +1,119 @@
~~Title: Radio Widget PG~~
{{page>widgets_index}}
----
===== Radio Widgets =====
{{ :widgets_radio_tree.png }}{{ :widgets_radio.png }}
This widget displays one or more options, but the user can only select one of
them. It is composed of an indicator (selected/unselected), an optional icon
and an optional label. Usually grouped with two or more other radio objects,
it can also be used alone.
The radio widget inherits from the layout widget. All the layout functions can
be used with radio objects.
=== Table of Contents ===
* [[#Adding_a_Radio|Adding a Radio]]
* [[#Changing_Radio_Value|Changing Radio Value]]
* [[#Managing_Radio_Groups|Managing Radio Groups]]
* [[#Using_Radio_Callbacks|Using Radio Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Radio.html|Radio Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_radio.html|A Radio Example]]
==== Adding a Radio ====
We create a radio widget and set a label to it.
<code c>
Evas_Object *radio;
// Creating a radio
radio = elm_radio_add(parent);
// Set a label to it
elm_object_text_set(radio, "Radio widget");
</code>
We set an icon to the radio object.
<code c>
// Create a Home icon
Evas_Object *icon;
icon = elm_icon_add(parent);
elm_icon_standard_set(icon, "home");
// Set it to the radio widget
elm_object_part_content_set(radio, "icon", icon);
</code>
==== Changing Radio Value ====
The user can select one of a set of values with the radio widget. Each radio
object from a group of radio objects represents an integer value. Here we set
the value one to the new radio object.
<code c>
elm_radio_state_value_set(radio, 1);
</code>
==== Managing Radio Groups ====
We create a group of radio objects with at least two radio widgets.
<code c>
// Create another radio object
Evas_Object *radio2 = elm_radio_add(parent);
elm_radio_state_value_set(radio2, 2);
// Create a group composed of radio and radio2
Evas_Object *group = radio;
elm_radio_group_add(radio2, group);
</code>
Now that we have a group composed of two radio objects, we can choose which
one is selected. Here we select radio2.
<code c>
elm_radio_value_set(group, 2);
</code>
We can use ''elm_radio_value_get()'' to see the currently selected radio of
the group.
==== Using Radio Callbacks ====
This widget emits the following signals, besides the ones sent from Layout:
* ''"changed"'' - This is called when the radio object is selected. If you want to trace the state change of a radio group, you should add this callback to all the radio objects in that group.
* ''"focused"'' - When the radio has received focus. (since 1.8)
* ''"unfocused"'' - When the radio has lost focus. (since 1.8)
* ''"language,changed"'' - the program's language changed (since 1.9)
When the state of a radio is modified in a group of radio objects, the
"changed" signal is emitted.
This is how to register a callback on this signal.
<code c>
evas_object_smart_callback_add(radio, "changed", _changed_cb, data);
</code>
<code c>
// Callback function for the "changed" signal
// This callback is called when the radio value changes
static void
changed_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("The value has changed\n");
}
</code>
\\
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/tutorial_radio.html|A Radio Example]]__**//
----
{{page>widgets_index}}

View File

@ -0,0 +1,94 @@
~~Title: Segmentcontrol Widget PG~~
{{page>widgets_index}}
----
===== Segment Control Widgets =====
{{ :widgets_segmentcontrol_tree.png }}{{ :widgets_segmentcontrol.png }}
This widget consists of several segment items. A segment item is similar to a
discrete two state button. Any time, only one segment item can be selected. A
segment item is composed of a label (text) and an icon.
This widget inherits from the layout widget, so all the layout widgets API can
be used on segmentcontrol objects.
=== Table of Contents ===
* [[#Adding_a_Segmentcontrol|Adding a Segmentcontrol]]
* [[#Adding_Items|Adding Items]]
* [[#Using_the_Segmentcontrol_Callbacks|Using the Segmentcontrol Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__SegmentControl.html|Segmentcontrol Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/segment_control_example.html|A Segment Control Example]]
==== Adding a Segmentcontrol ====
This is how to add a segmentcontrol widget.
<code c>
Evas_Object *segcontrol = elm_segment_control_add(parent);
</code>
==== Adding Items ====
We can add items to it. Here we add four items containing only text labels (no icons).
<code c>
Elm_Object_Item *it;
elm_segment_control_item_add(segcontrol, NULL, "item1");
elm_segment_control_item_add(segcontrol, NULL, "item2");
elm_segment_control_item_add(segcontrol, NULL, "item3");
it = elm_segment_control_item_add(segcontrol, NULL, "item4");
</code>
We can insert an item at a specific position starting at 0
<code c>
elm_segment_control_item_insert_at(segcontrol, NULL, "item7", 2);
</code>
or delete an item.
<code c>
elm_segment_control_item_del_at(segcontrol, 2);
</code>
We can also set the selected state of an item manually
<code c>
elm_segment_control_item_selected_set(it, EINA_TRUE);
</code>
or disable the whole segment control.
<code c>
elm_object_disabled_set(segcontrol, EINA_TRUE);
</code>
==== Using the Segmentcontrol Callbacks ====
This is how to register a callback on the "changed" signal. It is called when
the user clicks on a segment item which is not previously selected. The
event_info parameter is the segment item pointer.
<code c>
evas_object_smart_callback_add(segcontrol, "changed", _changed_cb, data);
</code>
<code c>
// Callback function for the "changed" signal
// This callback is called when the segcontrol selected item changes
static void
_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
Elm_Segment_Item *it = event_info;
printf("The selected segment item has changed\n");
}
</code>
\\
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/segment_control_example.html|A Segment Control Example]]__**//
----
{{page>widgets_index}}

View File

@ -0,0 +1,124 @@
~~Title: Slider Widget PG~~
{{page>widgets_index}}
----
===== Slider Widgets =====
{{ :widgets_slider_tree.png }}{{ :widgets_slider.png }}
The slider widget is a draggable bar that is used to select a value within a
certain range.
=== Table of Contents ===
* [[#Adding_a_Slider|Adding a Slider]]
* [[#Configuring_the_Slider|Configuring the Slider]]
* [[#Using_Slider_Callbacks|Using Slider Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Slider.html|Slider Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/slider_example.html|A Slider Example]]
==== Adding a Slider ====
This is how to create a slider object.
<code c>
Evas_Object *slider;
slider = elm_slider_add(parent);
</code>
==== Configuring the Slider ====
Orientation is set with the ''elm_slider_horizontal_set()'' function, and it
is inverted the same way as the progressbar widget. Here we set it vertical
and inverted.
<code c>
elm_slider_horizontal_set(slider, EINA_FALSE);
elm_slider_inverted_set(slider, EINA_TRUE);
</code>
It can contain icons ("icon" and "end" partnames), a label, a unit label and
an indicator label.
<code c>
Evas_Object *icon1, *icon2;
// Set the icons
elm_object_part_content_set(slider, "icon", icon1);
elm_object_part_content_set(slider, "end", icon2);
// Set the label
elm_object_part_text_set(slider, "default", "slider label");
// Set the unit format
elm_slider_unit_format_set(slider, "%1.2f meters");
</code>
Before using the slider, its minimum and maximum values are set with
''elm_slider_min_max_set()''. The current value is set with
(''elm_slider_value_set()''). Here we set the minimum value to 0, the maximum
value to 100, and the current value to 50.
<code c>
elm_slider_min_max_set(slider, 0.0, 100.0);
elm_slider_value_set(slider, 50.0);
</code>
The span of the slider represents its length (horizontally or vertically). It
is set with ''elm_slider_span_size_set()'' and is scaled by the object or
applications scaling factor.
We can retrieve the current value of the slider anytime.
<code c>
double value = elm_slider_value_get(slider);
</code>
By default, the slider indicator becomes bigger when the user drags it. This
can be disabled if we want the slider indicator to keep its default size. Here
we set the state of the indicator enlargement and then invert the behavior.
<code c>
// Get the current state of the indicator
Eina_Bool enlarge = elm_slider_indicator_show_get(slider);
// Invert the behavior
elm_slider_indicator_show_set(slider, !enlarge);
</code>
==== Using Slider Callbacks ====
This widget emits the following signals, besides the ones sent from Layout:
* ''"changed"'' - Whenever the slider value is changed by the user.
* ''"slider,drag,start"'' - dragging the slider indicator around has started.
* ''"slider,drag,stop"'' - dragging the slider indicator around has stopped.
* ''"delay,changed"'' - A short time after the value is changed by the user. This will be called only when the user stops dragging for a very short period or when they release their finger/mouse, so it avoids possibly expensive reactions to the value change.
* ''"focused"'' - When the slider has received focus. (since 1.8)
* ''"unfocused"'' - When the slider has lost focus. (since 1.8)
* ''"language,changed"'' - the program's language changed (since 1.9)
For all these signals, event_info is NULL.
This is how to register a callback on the "changed" signal.
<code c>
evas_object_smart_callback_add(slider, "changed", _changed_cb, data);
</code>
<code c>
// Callback function for the "changed" signal
// This callback is called when the slider value changes
static void
_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("The slider has changed\n");
}
</code>
\\
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/slider_example.html|A Slider Example]]__**//
----
{{page>widgets_index}}

View File

@ -0,0 +1,114 @@
~~Title: Spinner Widget PG~~
{{page>widgets_index}}
----
===== Spinner Widgets =====
{{ :widgets_spinner_tree.png }}{{ :widgets_spinner.png }}
The spinner widget increases or decreases a numeric value with the arrow
buttons.
This widget inherits from the layout widget, so all functions concerning the
layout widget are used on the spinner widget.
=== Table of Contents ===
* [[#Adding_a_Spinner|Adding a Spinner]]
* [[#Configuring_the_Spinner|Configuring the Spinner]]
* [[#Using_Spinner_Callbacks|Using Spinner Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Spinner.html|Spinner Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/spinner_example.html|A Spinner Example]]
==== Adding a Spinner ====
This is how to create a spinner object.
<code c>
Evas_Object *spin;
spin = elm_spinner_add(parent);
</code>
This widgets allows a "vertical" style: up/down buttons at the right side
and text left aligned.
==== Configuring the Spinner ====
The label format is set to a different value:
<code c>
elm_spinner_label_format_set(spin, "%1.2f meters");
</code>
You can determine the result of clicking the arrow buttons. In this example, a
click on an arrow increases or decreases with 2.0 units:
<code c>
elm_spinner_step_set(spin, 2.0);
</code>
The wrapping mode is activated. In this mode, the spinner wraps when it reaches its minimum or maximum value.
<code c>
elm_spinner_wrap_set(spin, EINA_TRUE);
</code>
We set the minimum and maximum values of the spinner.
<code c>
elm_spinner_min_max_set(spin, -25.0, 100.0);
</code>
The spinner object can be set vertical, and the change interval when the user
presses the arrows long can be modified so that it changes faster.
<code c>
elm_object_style_set(spin, "vertical");
elm_spinner_interval_set(spin, 0.1);
</code>
If the user has to select between text values instead of numerical values, it
is possible to add our own text labels. Here spin2 object shows three numbers
written in text characters.
<code c>
Evas_Object *spin2 = elm_spinner_add(parent);
elm_spinner_min_max_set(spin2, 1, 3);
elm_spinner_special_value_add(spin2, 1, "One");
elm_spinner_special_value_add(spin2, 2, "Two");
elm_spinner_special_value_add(spin2, 3, "Three");
</code>
==== Using Spinner Callbacks ====
This widget emits the following signals, besides the ones sent from Layout:
* ''"changed"'' - Whenever the spinner value is changed.
* ''"delay,changed"'' - A short time after the value is changed by the user. This will be called only when the user stops dragging for a very short period or when they release their finger/mouse, so it avoids possibly expensive reactions to the value change.
* ''"language,changed"'' - the program's language changed
* ''"focused"'' - When the spinner has received focus. (since 1.8)
* ''"unfocused"'' - When the spinner has lost focus. (since 1.8)
* ''"spinner,drag,start"'' - When dragging has started. (since 1.8)
* ''"spinner,drag,stop"'' - When dragging has stopped. (since 1.8)
This is how to register a callback on the "delay,changed" signal.
<code c>
evas_object_smart_callback_add(spin, "delay,changed", _delay_changed_cb, data);
</code>
<code c>
// Callback function for the "delay,changed" signal
// This callback is called a short time after the spinner value changes
static void
_delay_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
printf(The spinner value has changed\n");
}
</code>
\\
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/spinner_example.html|A Spinner Example]]__**//
----
{{page>widgets_index}}

View File

@ -0,0 +1,155 @@
~~Title: Toolbar Widget PG~~
{{page>widgets_index}}
----
===== Toolbar Widgets =====
{{ :widgets_toolbar_tree.png }}{{ :widgets_toolbar.png }}
This widget is a scrollable list of items and shows a menu when an item is
selected. Only one item can be selected at a time.
=== Table of Contents ===
* [[#Adding_a_Toolbar|Adding a Toolbar]]
* [[#Using_Toolbar_Styles|Using Toolbar Styles]]
* [[#Configuring_the_Toolbar|Configuring the Toolbar]]
* [[#Adding_Items_to_the_Toolbar|Adding Items to the Toolbar]]
* [[#Adding_Items_with_States|Adding Items with States]]
* [[#Using_Toolbar_Callbacks|Using Toolbar Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Toolbar.html|Toolbar Widget API]]
^ Toolbar Examples ^^^
|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/toolbar_example_01.html|Simple Items]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/toolbar_example_02.html|Items with States]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/toolbar_example_03.html|Items with Menus]]|
==== Adding a Toolbar ====
Use the following function to create a toolbar.
<code c>
Evas_Object *toolbar;
toolbar = elm_toolbar_add(parent);
</code>
==== Using Toolbar Styles ====
The toolbar has the following styles:
* "default"
* "transparent"
Here, we set the style to "transparent".
<code c>
elm_object_style_set(toolbar, "transparent");
</code>
==== Configuring the Toolbar ====
The toolbar displays its items in one of the following options.
* ''ELM_TOOLBAR_SHRINK_NONE'': Toolbar sets a minimum size to its items so that all of them fit without scrolling.
* ''ELM_TOOLBAR_SHRINK_HIDE'': Toolbar does not scroll or show the items that do not fit in.
* ''ELM_TOOLBAR_SHRINK_SCROLL'': Toolbar scrolls to show the items that do not fit in.
* ''ELM_TOOLBAR_SHRINK_MENU'': Toolbar creates a button to popup hidden items.
Here we set the Toolbar to ''ELM_TOOLBAR_SHRINK_NONE''.
<code c>
elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_NONE);
</code>
By default, the toolbar displays items homogeneously. Items with long labels
occupy a lot of space. To avoid that, we can disable the homogeneous mode.
<code c>
elm_toolbar_homogeneous_set(toolbar, EINA_FALSE);
</code>
==== Adding Items to the Toolbar ====
In the following code, we add two items and choose the associated icon, label,
and function to call when the item is clicked.
<code c>
Elm_Object_Item *home_it, *help_it;
home_it = elm_toolbar_item_append(toolbar, "home", "Home", _home_item_pressed_cb, NULL);
help_it = elm_toolbar_item_append(toolbar, "help", "Help", _help_item_pressed_cb, NULL);
</code>
<code c>
static void
_home_item_pressed_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("Home item clicked\n");
}
</code>
<code c>
static void
_help_item_pressed_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("Help item clicked \n");
}
</code>
An item may be disabled. This is how to disable the help item. The disabled
item does not receive input and, if the theme supports it, is themed
differently (usually greyed out) from its normal state.
<code c>
elm_object_item_disabled_set(help_it, EINA_TRUE);
</code>
==== Adding Items with States ====
Items have two or more states. Each state has its own icon, label, and
function to call when an item is clicked. As an example, we create two states
to the help item with the same icon but two different labels.
<code c>
elm_toolbar_item_state_add(help_it, "help", "Help state 1", _help_item_pressed_cb, NULL);
elm_toolbar_item_state_add(help_it, "help", "Help state 2", _help_item_pressed_cb, NULL);
</code>
We can cycle through the states of the help item by using the following code.
<code c>
elm_toolbar_item_state_set(help_it, elm_toolbar_item_state_next(help_it));
</code>
==== Using Toolbar Callbacks ====
Smart callbacks one can listen to:
* ''"clicked"'' - when the user clicks on a toolbar item and becomes selected.
* ''"longpressed"'' - when the toolbar is pressed for a certain amount of time.
* ''"language,changed"'' - when the program language changes.
* ''"focused"'' - When the toolbar has received focus. (since 1.8)
* ''"unfocused"'' - When the toolbar has lost focus. (since 1.8)
* ''"item,focused"'' - When the toolbar item has received focus. (since 1.10)
* ''"item,unfocused"'' - When the toolbar item has lost focus. (since 1.10)
* ''"selected"'' - when an item is selected. event_info is a selected item. (since 1.11)
* ''"unselected"'' - when an item is unselected. event_info is a unselected item. (since 1.11)
This is how to register a callback on the "clicked" signal.
<code c>
evas_object_smart_callback_add(toolbar, "clicked", _clicked_cb, data);
</code>
<code c>
// Callback function for the "clicked" signal
// This callback is called when a toolbar item is clicked
static void
_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
Elm_Toolbar_Item * item = event_info;
printf("Item clicked\n");
}
</code>
\\
^ Toolbar Examples ^^^
|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/toolbar_example_01.html|Simple Items]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/toolbar_example_02.html|Items with States]]|[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/toolbar_example_03.html|Items with Menus]]|
----
{{page>widgets_index}}

View File

@ -0,0 +1,105 @@
~~Title: Tooltips Widget PG~~
{{page>widgets_index}}
----
===== Tooltips Widgets =====
{{ :widgets_tooltips_tree.png }}{{ :widgets_tooltips.png }}
The tooltip widget is a smart object that shows a content in a frame when
mouse hovers a parent object. The widget provides tips or information about
the parent object.
=== Table of Contents ===
* [[#Adding_a_Tooltips|Adding a Tooltips]]
* [[#Activating_the_Tooltip|Activating the Tooltip]]
* [[#Configuring_Tooltip|Configuring Tooltip]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Tooltips.html|Tooltips Widget API]]
==== Adding a Tooltips ====
The tooltip widget cannot be created with the ''elm_tooltip_add()'' function.
This widget is already contained in a widget when it is created. We can only
activate or disable it.
==== Activating the Tooltip ====
To activate the tooltip on a parent object, we can set a tooltip text to the
parent object,
<code c>
elm_object_tooltip_text_set(parent, "The tooltip text");
</code>
or set a content to the parent object.
<code c>
elm_object_tooltip_content_cb_set(parent,
tooltip_content_cb,
NULL,
tooltip_content_del_cb);
</code>
<code c>
Evas_Object*
tooltip_content_cb(void*data, Evas_Object *obj, Evas_Object *tooltip)
{
// Create the tooltip content
}
static void
tooltip_content_del_cb(void *data, Evas_Object *obj, void *event_info)
{
// Destroy the tooltip content
}
</code>
When passing content to the tooltip, the ''tooltip_content_cb'' function is
called each time the tooltip is showed. The role of this function is to create
the content to set in the tooltip. It returns a pointer to an Evas_Object.
When the tooltip disappears, the ''tooltip_content_del_cb'' function is
called. This function is in charge of deleting the previously allocated
Evas_Object.
Once set, the tooltip can be manually hidden or shown.
<code c>
elm_object_tooltip_hide(parent);
elm_object_tooltip_show(parent);
</code>
The tooltip can be removed from the parent object when it is not needed.
<code c>
elm_object_tooltip_unset(parent);
</code>
<note>
When content is set into the tooltip object, unsetting it calls the callback
provided as ''del_cb'' to notify that the tooltip cannot be used any longer.
</note>
==== Configuring Tooltip ====
Set the orientation of the tooltip widget relative to its parent. By default,
''ELM_TOOLTIP_ORIENT_NONE'' is set.
* ''ELM_TOOLTIP_ORIENT_NONE'': Default value, Tooltip moves with mouse pointer.
* ''ELM_TOOLTIP_ORIENT_TOP_LEFT'': Tooltip should appear at the top left of parent.
* ''ELM_TOOLTIP_ORIENT_TOP'': Tooltip should appear at the top of parent.
* ''ELM_TOOLTIP_ORIENT_TOP_RIGHT'': Tooltip should appear at the top right of parent.
* ''ELM_TOOLTIP_ORIENT_LEFT'': Tooltip should appear at the left of parent.
* ''ELM_TOOLTIP_ORIENT_CENTER'': Tooltip should appear at the center of parent.
* ''ELM_TOOLTIP_ORIENT_RIGHT'': Tooltip should appear at the right of parent.
* ''ELM_TOOLTIP_ORIENT_BOTTOM_LEFT'': Tooltip should appear at the bottom left of parent.
* ''ELM_TOOLTIP_ORIENT_BOTTOM'': Tooltip should appear at the bottom of parent.
* ''ELM_TOOLTIP_ORIENT_BOTTOM_RIGHT'': Tooltip should appear at the bottom right of parent.
* ''ELM_TOOLTIP_ORIENT_LAST'': Sentinel value, don't use.
A tooltip object is not a widget, so it does not emit signals. There are no
registered callbacks for it.
----
{{page>widgets_index}}

View File

@ -0,0 +1,3 @@
++++Widgets Menu|
{{page>[[program_guide:widgets:widgets_menu]]}}
++++

View File

@ -0,0 +1,8 @@
^ [[/program_guide/widgets_pg|Widgets Programming Guide]] ^^^^^^^^^^^^
^Image|[[/program_guide/widgets/background|Background]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Bg.html|API]]//)|[[/program_guide/widgets/glview|GLView]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__GLView.html|API]]//)|[[/program_guide/widgets/icon|Icon]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Icon.html|API]]//)|[[/program_guide/widgets/image|Image]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Image.html|API]]//)|[[/program_guide/widgets/photo|Photo]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Photo.html|API]]//)|[[/program_guide/widgets/photocam|Photocam]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Photocam.html|API]]//)||||||
^Action|[[/program_guide/widgets/button|Button]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Button.html|API]]//)|[[/program_guide/widgets/check|Check]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Check.html|API]]//)|[[/program_guide/widgets/colorselector|Colorselector]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Colorselector.html|API]]//)|[[/program_guide/widgets/flip|Flip]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Flip.html|API]]//)|[[/program_guide/widgets/panel|Panel]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Panel.html|API]]//)|[[/program_guide/widgets/plug|Plug]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Plug.html|API]]//)|[[/program_guide/widgets/popup|Popup]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Popup.html|API]]//)|[[/program_guide/widgets/segmentcontrol|SegmentControl]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__SegmentControl.html|API]]//)|[[/program_guide/widgets/slider|Slider]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Slider.html|API]]//)|[[/program_guide/widgets/spinner|Spinner]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Spinner.html|API]]//)|[[/program_guide/widgets/radio|Radio]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Radio.html|API]]//)|
^Text|[[/program_guide/widgets/ctxpopup|Ctxpopup]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Ctxpopup.html|API]]//)|[[/program_guide/widgets/datetime|Datetime]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Datetime.html|API]]//)|[[/program_guide/widgets/entry|Entry]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Entry.html|API]]//)|[[/program_guide/widgets/index|Index]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Index.html|API]]//)|[[/program_guide/widgets/label|Label]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Label.html|API]]//)|[[/program_guide/widgets/list|List]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__List.html|API]]//)||||||
^others|[[/program_guide/widgets/notify|Notify]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Notify.html|API]]//)|[[/program_guide/widgets/progressbar|Progressbar]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Progressbar.html|API]]//)|[[/program_guide/widgets/map|Map]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Map.html|API]]//)|[[/program_guide/widgets/toolbar|Toolbar]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Toolbar.html|API]]//)|[[/program_guide/widgets/tooltips|Tooltips]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Tooltips.html|API]]//)|[[/program_guide/widgets/win|Win]]-(//[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Win.html|API]]//)||||||

View File

@ -0,0 +1,125 @@
~~Title: Win Widget PG~~
{{page>widgets_index}}
----
===== Win Widgets =====
{{ :widgets_win_tree.png }}{{ :widgets_win.png }}
The window widget is the root widget that is often used in an application. It
allows the developer create content in it, and it is handled by the window
manager.
The window widget is created with elm_win_add() or
''elm_win_util_standard_add()''. Content can be added in the window with
''elm_win_resize_object_add()'' so that a window resize also resizes the content
inside.
=== Table of Contents ===
* [[#Adding_a_Win|Adding a Win]]
* [[#Closing_a_Window|Closing a Window]]
* [[#Using_the_Window_Callbacks|Using the Window Callbacks]]
=== Related Info ===
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/group__Win.html|Win Widget API]]
* [[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/win_example_01.html|A Win Example]]
==== Adding a Win ====
Create a new window and change the title.
<code c>
Evas_Object *window;
// Creating a window
window = elm_win_add(NULL, "main", ELM_WIN_BASIC);
// Change window title
elm_win_title_set(window, "Example Window");
</code>
The first element of ''elm_win_add()'' is the parent window. For example, for a
dialog you want to have the main window as the parent. Here, it is NULL
meaning there is no parent. "main" is the name of the window used by the
window manager for identifying the window uniquely amongst all the windows
within this application (and all instances of the application). The type is a
basic window (the final parameter).
Create a new window with a title and a background. This API is a shortcut of
the previous one. It also creates a standard background to the window with
''elm_bg_add''. The window created is of the type ''ELM_WIN_BASIC''.
<code c>
Evas_Object *window;
// Creating a standard window
window = elm_win_util_standard_add("main", "Example Window");
</code>
==== Closing a Window ====
When the user closes the window outside of the program control, a
"delete,request" signal is emitted to indicate that this event occurred. The
developer can take any action, for example, destroy the window object.
When the autodel parameter is set, the window is automatically destroyed after
the signal is emitted. If autodel is ''EINA_FALSE'', the window is not destroyed
and the program does so when required. The default is ''EINA_FALSE'', where the
window is not destroyed automatically.
The autodel is set using the following call:
<code c>
elm_win_autodel_set(window, EINA_TRUE);
</code>
To close the window, use the ''evas_object_del'' API. The window is destroyed and
the signal "delete,request" is sent.
==== Using the Window Callbacks ====
The window widget emits the following signals:
* ''"delete,request"'': the user requested to close the window. See ''elm_win_autodel_set()'' and elm_win_autohide_set().
* ''"focus,in"'': window got focus (deprecated. use "focused" instead.)
* ''"focus,out"'': window lost focus (deprecated. use "unfocused" instead.)
* ''"moved"'': window that holds the canvas was moved
* ''"withdrawn"'': window is still managed normally but removed from view
* ''"iconified"'': window is minimized (perhaps into an icon or taskbar)
* ''"normal"'': window is in a normal state (not withdrawn or iconified)
* ''"stick"'': window has become sticky (shows on all desktops)
* ''"unstick"'': window has stopped being sticky
* ''"fullscreen"'': window has become fullscreen
* ''"unfullscreen"'': window has stopped being fullscreen
* ''"maximized"'': window has been maximized
* ''"unmaximized"'': window has stopped being maximized
* ''"ioerr"'': there has been a low-level I/O error with the display system
* ''"indicator,prop,changed"'': an indicator's property has been changed
* ''"rotation,changed"'': window rotation has been changed
* ''"profile,changed"'': profile of the window has been changed
* ''"focused" '': When the win has received focus. (since 1.8)
* ''"unfocused" '': When the win has lost focus. (since 1.8)
* ''"theme,changed"'': The theme was changed. (since 1.13)
With all these signals, event_info is NULL.
This is an example to register a callback function called on the "fullscreen"
signal.
<code c>
evas_object_smart_callback_add(window, "fullscreen", _fullscreen_cb, data);
</code>
<code c>
// Callback function for the "fullscreen" signal
// This callback is called when the window becomes fullscreen
static void
_fullscreen_cb(void *data, Evas_Object *obj, void *event_info)
{
printf("Window fullscreen\n");
}
</code>
\\
//**__[[https://build.enlightenment.org/job/nightly_elm_gcc_x86_64/lastSuccessfulBuild/artifact/doc/html/win_example_01.html|A Win Example]]__**//
----
{{page>widgets_index}}

View File

@ -0,0 +1,182 @@
~~Title: Widgets Programming Guide~~
{{page>index}}
===== Widgets Programming Guide =====
The Elementary library is a simple toolkit. It provides several widgets than
can be used to compose the user interface of your application. Widgets allow
you to build your application without having to reinvent basic objects, such
as buttons, lists, or text entries. Widgets will often generate signals that
can be caught in the application when the user interacts with the widgets.
This guide teaches you the basics of Elementary, describes selected concepts
of the Elementary configuration framework, and describes the most common
widgets.
=== Table of Contents ===
* [[/program_guide/widgets/basics|Elementary Basics]]
* [[/program_guide/widgets/config|Elementary Configuration]]
{{page>[[program_guide:widgets:widgets_menu]]}}
==== Elementary Basics ====
In this chapter, we explain how widgets are built in a hierarchical manner,
how to build a minimal Elementary application, and what the differences are
between the callbacks that can be registered for widgets.
==== Elementary Configuration ====
Elementary can be configured using profiles. This chapter details some
configuration items that can be modified to tweak the use of Elementary.
==== Widgets ====
++++Background|
The background widget can be used to set a solid background decoration to a
window or a container object. It works like an image, but has some background
specific properties, such as setting it to tiled, centered, scaled, or
stretched.
++++
++++Button|
The button widget is a simple push button. It is composed of a label icon and
an icon object, and has an auto-repeat feature. Check The check widget
toggles the value of a Boolean between true and false.
++++
++++Colorselector|
The colorselector widget provides a color selection solution
to the user. It has different modes available, each of them showing a
different configuration of the color selection.
++++
++++Ctxpopup|
The ctxpopup widget is a contextual popup that can show a list of items.
++++
++++Datetime|
The datetime widget can display and input date and time values.
++++
++++Entry|
The entry widget is a box to which the user can enter text.
++++
++++Flip|
The flip widget can hold two Evas objects and let the user flip between
these objects using a variety of predefined animations.
++++
++++GLView|
The GLView widget can render OpenGL in an Elementary object, hiding
EvasGL complexity.
++++
++++Icon|
The icon widget inherits from the image widget. It is used to display
images in an icon context.
++++
++++Image|
The image widget can load and display an image from a file or from
memory.
++++
++++Index|
The index widget provides an index for fast access to another group of
UI items.
++++
++++Label|
The label widget displays text with simple HTML-like markup.
List The list widget is a very simple list for managing a small number of
items. If you need to manage a lot of items, use the genlist widget instead.
++++
++++Map|
The map widget can display a geographic map. The default map data is
provided by the OpenStreetMap project (http://www.openstreetmap.org/).
++++
++++Notify| The notify widget displays a container in a specific region of the
parent object. It can receive some content, and it can be automatically hidden
after a certain amount of time.
++++
++++Panel|
The panel widget is an animated object that can contain child objects.
It can be expanded or contracted by clicking on the button on its edge.
++++
++++Photo|
The photo widget can be used to display a photo, such as a contact
image. If no photo is set, the widget displays a person icon to show that it
is a photo placeholder.
++++
++++Photocam|
The photocam widget is designed to display high-resolution photos
taken with a digital camera. It allows you to zoom photos, load photos fast,
and fit photos. It is optimized for JPEG images and has a low memory
footprint.
++++
++++Plug|
The plug widget allows you to show an Evas object created by another
process. It can be used anywhere like any other Elementary widget.
++++
++++Popup|
The popup widget shows a pop-up area that can contain a title area, a
content area, and an action area.
++++
++++Progressbar|
The progressbar widget can be used to display the progress
status of a given job.
++++
++++Radio|
The radio widget can display 1 or more options, but the user can only
select one of them. The widget is composed of an indicator
(selected/unselected), an optional icon, and an optional label. Even though it
is usually grouped with 2 or more other radio widgets, it can also be used
alone.
++++
++++Segmentcontrol|
The slider widget is a draggable bar that is used to select a
value from a range of values.
Slider The slider widget is a draggable bar that is used to select a value
from a range of values.
++++
++++Spinner|
The spinner widget enables the user to increase or decrease a
numeric value by using arrow buttons.
++++
++++Toolbar|
The toolbar widget is a scrollable list of items. It can also show a
menu when an item is selected. Only one item can be selected at a time.
++++
++++Tooltip|
The tooltip widget is a smart object used to show tips or
information about a parent object when the mouse hovers over the parent
object.
++++
++++Transit|
The transit widget can apply several transition effects to an Evas
object, such as translations and rotations. The use of the transit widget is
documented in the Creating Animations and Effects guide.
++++
++++Win|
The win widget is the root window widget that will be often used in an
application. It allows you to create some content in it, and it is handled by
the window manager.
++++
\\
----
{{page>index}}