Tizen Native API  7.0
Relative_Container

relative_container_inheritance_tree.png

A relative container calculates the size and position of all the children based on their relationship to each other.

By default, corner of child are same to its parent corner, meaning default values of the edge are:

 elm_relative_container_relation_left_set(layout, child, layout, 0.0);
 elm_relative_container_relation_top_set(layout, child, layout, 0.0);
 elm_relative_container_relation_right_set(layout, child, layout, 1.0);
 elm_relative_container_relation_bottom_set(layout, child, layout, 1.0);

The following are examples of how to use a relative_container:

Functions

Evas_Objectelm_relative_container_add (Evas_Object *parent)
 Add a new relative_container to the parent.
void elm_relative_container_relation_left_set (Evas_Object *obj, Evas_Object *child, Evas_Object *base, double relative_position)
 Specifies the left side edge of the child object relative to the base object. When relative_position is 0 the left edges of the two objects are aligned. When relative_position is 1 the left edge of the child object is aligned to the right edge of the base object.
void elm_relative_container_relation_left_get (const Evas_Object *obj, Evas_Object *child, Evas_Object **base, double *relative_position)
 Get the left side edge of the child object relative to the base object.
void elm_relative_container_relation_right_set (Evas_Object *obj, Evas_Object *child, Evas_Object *base, double relative_position)
 Specifies the right side edge of the child object relative to the base object. When relative_position is 0 the right edge of the child object is aligned to the left edge of the base object. When relative_position is 1 the right edges of the two objects are aligned.
void elm_relative_container_relation_right_get (const Evas_Object *obj, Evas_Object *child, Evas_Object **base, double *relative_position)
 Get the right side edge of the child object relative to the base object.
void elm_relative_container_relation_top_set (Evas_Object *obj, Evas_Object *child, Evas_Object *base, double relative_position)
 Specifies the top side edge of the child object relative to the base object. When relative_position is 0 the top edges of the two objects are aligned. When relative_position is 1 the top edge of the child object is aligned to the bottom edge of the base object.
void elm_relative_container_relation_top_get (const Evas_Object *obj, Evas_Object *child, Evas_Object **base, double *relative_position)
 Get the top side edge of the child object relative to the base object.
void elm_relative_container_relation_bottom_set (Evas_Object *obj, Evas_Object *child, Evas_Object *base, double relative_position)
 Specifies the bottom side edge of the child object relative to the base object. When relative_position is 0 the bottom edge of the child object is aligned to the top edge of the base object. When is 1 the bottom edges of the two objects are aligned.
void elm_relative_container_relation_bottom_get (const Evas_Object *obj, Evas_Object *child, Evas_Object **base, double *relative_position)
 Get the bottom side edge of the child object relative to the base object.
Eina_Listelm_relative_container_children_get (const Evas_Object *obj)
 Get a list of the objects in the relative_container.

Function Documentation

Add a new relative_container to the parent.

Parameters:
parentThe parent object
Returns:
The new object or NULL if it cannot be created
Since :
6.0
Examples:
relative_container_example_01.c, and relative_container_example_02.c.

Get a list of the objects in the relative_container.

Returns a new list with a pointer to Evas_Object in its nodes.

You must free this list with eina_list_free() once you are done with it.

Parameters:
[in]objThe object.
Returns:
List of children
Since :
6.0
void elm_relative_container_relation_bottom_get ( const Evas_Object obj,
Evas_Object child,
Evas_Object **  base,
double *  relative_position 
)

Get the bottom side edge of the child object relative to the base object.

Parameters:
[in]objThe object.
[in]childThe child object whose size and position is being changed.
[out]baseThe object whose size and position is being used as reference. NULL means that the container object is used(this is the default value).
[out]relative_positionThe ratio between top and bottom of the base, ranging from 0.0 to 1.0. 1.0 by default.
Since :
6.0
void elm_relative_container_relation_bottom_set ( Evas_Object obj,
Evas_Object child,
Evas_Object base,
double  relative_position 
)

Specifies the bottom side edge of the child object relative to the base object. When relative_position is 0 the bottom edge of the child object is aligned to the top edge of the base object. When is 1 the bottom edges of the two objects are aligned.

Parameters:
[in]objThe object.
[in]childThe child object whose size and position is being changed.
[in]baseThe object whose size and position is being used as reference. NULL means that the container object is used(this is the default value).
[in]relative_positionThe ratio between top and bottom of the base, ranging from 0.0 to 1.0. 1.0 by default.
Since :
6.0
Examples:
relative_container_example_01.c.
void elm_relative_container_relation_left_get ( const Evas_Object obj,
Evas_Object child,
Evas_Object **  base,
double *  relative_position 
)

Get the left side edge of the child object relative to the base object.

Parameters:
[in]objThe object.
[in]childThe child object whose size and position is being changed.
[out]baseThe object whose size and position is being used as reference. NULL means that the container object is used(this is the default value).
[out]relative_positionThe ratio between left and right of the base, ranging from 0.0 to 1.0. 0.0 by default.
Since :
6.0
void elm_relative_container_relation_left_set ( Evas_Object obj,
Evas_Object child,
Evas_Object base,
double  relative_position 
)

Specifies the left side edge of the child object relative to the base object. When relative_position is 0 the left edges of the two objects are aligned. When relative_position is 1 the left edge of the child object is aligned to the right edge of the base object.

Parameters:
[in]objThe object.
[in]childThe child object whose size and position is being changed.
[in]baseThe object whose size and position is being used as reference. NULL means that the container object is used(this is the default value).
[in]relative_positionThe ratio between left and right of the base, ranging from 0.0 to 1.0. 0.0 by default.
Since :
6.0
Examples:
relative_container_example_01.c, and relative_container_example_02.c.
void elm_relative_container_relation_right_get ( const Evas_Object obj,
Evas_Object child,
Evas_Object **  base,
double *  relative_position 
)

Get the right side edge of the child object relative to the base object.

Parameters:
[in]objThe object.
[in]childThe child object whose size and position is being changed.
[out]baseThe object whose size and position is being used as reference. NULL means that the container object is used(this is the default value).
[out]relative_positionThe ratio between left and right of the base, ranging from 0.0 to 1.0. 1.0 by default.
Since :
6.0
void elm_relative_container_relation_right_set ( Evas_Object obj,
Evas_Object child,
Evas_Object base,
double  relative_position 
)

Specifies the right side edge of the child object relative to the base object. When relative_position is 0 the right edge of the child object is aligned to the left edge of the base object. When relative_position is 1 the right edges of the two objects are aligned.

Parameters:
[in]objThe object.
[in]childThe child object whose size and position is being changed.
[in]baseThe object whose size and position is being used as reference. NULL means that the container object is used(this is the default value).
[in]relative_positionThe ratio between left and right of the base, ranging from 0.0 to 1.0. 1.0 by default.
Since :
6.0
Examples:
relative_container_example_01.c, and relative_container_example_02.c.
void elm_relative_container_relation_top_get ( const Evas_Object obj,
Evas_Object child,
Evas_Object **  base,
double *  relative_position 
)

Get the top side edge of the child object relative to the base object.

Parameters:
[in]objThe object.
[in]childThe child object whose size and position is being changed.
[out]baseThe object whose size and position is being used as reference. NULL means that the container object is used(this is the default value).
[out]relative_positionThe ratio between top and bottom of the base, ranging from 0.0 to 1.0. 0.0 by default.
Since :
6.0
void elm_relative_container_relation_top_set ( Evas_Object obj,
Evas_Object child,
Evas_Object base,
double  relative_position 
)

Specifies the top side edge of the child object relative to the base object. When relative_position is 0 the top edges of the two objects are aligned. When relative_position is 1 the top edge of the child object is aligned to the bottom edge of the base object.

Parameters:
[in]objThe object.
[in]childThe child object whose size and position is being changed.
[in]baseThe object whose size and position is being used as reference. NULL means that the container object is used(this is the default value).
[in]relative_positionThe ratio between top and bottom of the base, ranging from 0.0 to 1.0. 0.0 by default.
Since :
6.0
Examples:
relative_container_example_01.c.