Functions
Popup

Functions

EOAPI void elm_obj_popup_align_set (double horizontal, double vertical)
 Set the alignment of the popup object Sets the alignment in which the popup will appear in its parent. More...
 
EOAPI void elm_obj_popup_align_get (double *horizontal, double *vertical)
 Get the alignment of the popup object. More...
 
EOAPI void elm_obj_popup_allow_events_set (Eina_Bool allow)
 Sets whether events should be passed to by a click outside. More...
 
EOAPI Eina_Bool elm_obj_popup_allow_events_get (void)
 Returns value indicating whether allow event is enabled or not. More...
 
EOAPI void elm_obj_popup_content_text_wrap_type_set (Elm_Wrap_Type wrap)
 Sets the wrapping type of content text packed in content area of popup object. More...
 
EOAPI Elm_Wrap_Type elm_obj_popup_content_text_wrap_type_get (void)
 Returns the wrapping type of content text packed in content area of popup object. More...
 
EOAPI void elm_obj_popup_orient_set (Elm_Popup_Orient orient)
 Sets the orientation of the popup in the parent region. More...
 
EOAPI Elm_Popup_Orient elm_obj_popup_orient_get (void)
 Returns the orientation of Popup. More...
 
EOAPI void elm_obj_popup_timeout_set (double timeout)
 Sets a timeout to hide popup automatically. More...
 
EOAPI double elm_obj_popup_timeout_get (void)
 Returns the timeout value set to the popup (in seconds) More...
 
EOAPI Elm_Object_Itemelm_obj_popup_item_append (const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data)
 Add a new item to a Popup object. More...
 
Elm_Object_Itemelm_popup::item_append (std::string label_, evas::object icon_, Evas_Smart_Cb func_, const void *data_) const
 Add a new item to a Popup object. More...
 
void elm_popup_align_set (Eo *obj, double horizontal, double vertical)
 Set the alignment of the popup object Sets the alignment in which the popup will appear in its parent. More...
 
void elm_popup_align_get (const Eo *obj, double *horizontal, double *vertical)
 Get the alignment of the popup object. More...
 
void elm_popup_allow_events_set (Eo *obj, Eina_Bool allow)
 Sets whether events should be passed to by a click outside. More...
 
Eina_Bool elm_popup_allow_events_get (const Eo *obj)
 Returns value indicating whether allow event is enabled or not. More...
 
void elm_popup_content_text_wrap_type_set (Eo *obj, Elm_Wrap_Type wrap)
 Sets the wrapping type of content text packed in content area of popup object. More...
 
Elm_Wrap_Type elm_popup_content_text_wrap_type_get (const Eo *obj)
 Returns the wrapping type of content text packed in content area of popup object. More...
 
void elm_popup_orient_set (Eo *obj, Elm_Popup_Orient orient)
 Sets the orientation of the popup in the parent region. More...
 
Elm_Popup_Orient elm_popup_orient_get (const Eo *obj)
 Returns the orientation of Popup. More...
 
void elm_popup_timeout_set (Eo *obj, double timeout)
 Sets a timeout to hide popup automatically. More...
 
double elm_popup_timeout_get (const Eo *obj)
 Returns the timeout value set to the popup (in seconds) More...
 
Elm_Object_Itemelm_popup_item_append (Eo *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data)
 Add a new item to a Popup object. More...
 
Evas_Object * elm_popup_add (Evas_Object *parent)
 Adds a new Popup to the parent. More...
 
void elm_popup::align_get (double *horizontal_, double *vertical_) const
 Get the alignment of the popup object. More...
 
void elm_popup::align_set (double horizontal_, double vertical_) const
 Get the alignment of the popup object. More...
 
bool elm_popup::allow_events_get () const
 Returns value indicating whether allow event is enabled or not. More...
 
void elm_popup::allow_events_set (bool allow_) const
 Returns value indicating whether allow event is enabled or not. More...
 
Elm_Wrap_Type elm_popup::content_text_wrap_type_get () const
 Returns the wrapping type of content text packed in content area of popup object. More...
 
void elm_popup::content_text_wrap_type_set (Elm_Wrap_Type wrap_) const
 Returns the wrapping type of content text packed in content area of popup object. More...
 
Elm_Popup_Orient elm_popup::orient_get () const
 Returns the orientation of Popup. More...
 
void elm_popup::orient_set (Elm_Popup_Orient orient_) const
 Returns the orientation of Popup. More...
 
double elm_popup::timeout_get () const
 Returns the timeout value set to the popup (in seconds) More...
 
void elm_popup::timeout_set (double timeout_) const
 Returns the timeout value set to the popup (in seconds) More...
 

Detailed Description

popup_inheritance_tree.png

This widget is an enhancement of Notify. In addition to content area, there are two optional sections, namely title area and action area.

The popup widget displays its content with a particular orientation in the parent area. This orientation can be one among top, center, bottom, left, top-left, top-right, bottom-left and bottom-right. Content part of Popup can be an Evas Object set by application or it can be Text set by application or set of items containing an icon and/or text. The content/item-list can be removed using elm_object_content_set with second parameter passed as NULL.

The following figures show the textual layouts of popup in which Title Area and Action area are optional ones. Action area can have up to 3 buttons handled using elm_object common APIs mentioned below. If user wants to have more than 3 buttons then these buttons can be put inside the items of a list as content. User needs to handle the clicked signal of these action buttons if required. No event is processed by the widget automatically when clicked on these action buttons.

*|---------------------|    |---------------------|    |---------------------|
*|     Title Area      |    |     Title Area      |    |     Title Area      |
*|Icon|    Text        |    |Icon|    Text        |    |Icon|    Text        |
*|---------------------|    |---------------------|    |---------------------|
*|       Item 1        |    |                     |    |                     |
*|---------------------|    |                     |    |                     |
*|       Item 2        |    |                     |    |    Description      |
*|---------------------|    |       Content       |    |                     |
*|       Item 3        |    |                     |    |                     |
*|---------------------|    |                     |    |                     |
*|         .           |    |---------------------|    |---------------------|
*|         .           |    |     Action Area     |    |     Action Area     |
*|         .           |    | Btn1  |Btn2|. |Btn3 |    | Btn1  |Btn2|  |Btn3 |
*|---------------------|    |---------------------|    |---------------------|
*|       Item N        |     Content Based Layout     Description based Layout
*|---------------------|
*|     Action Area     |
*| Btn1  |Btn2|. |Btn3 |
*|---------------------|
    Item Based Layout
  

Timeout can be set on expiry of which popup instance hides and sends a smart signal "timeout" to the user. The visible region of popup is surrounded by a translucent region called Blocked Event area. By clicking on Blocked Event area, the signal "block,clicked" is sent to the application. This block event area can be avoided by using API elm_popup_allow_events_set. When gets hidden, popup does not get destroyed automatically, application should destroy the popup instance after use. To control the maximum height of the internal scroller for item, we use the height of the action area which is passed by theme based on the number of buttons currently set to popup.

Popup sets the focus to itself when evas_object_show is called on popup. To set the focus into popup's contents and buttons automatically, evas_object_show on popup should be called after setting all the contents and buttons of popup.

This widget inherits from the Layout one, so that all the functions acting on it also work for popup objects (since 1.8).

This widget emits the following signals, besides the ones sent from Layout:

Styles available for Popup

Default contents parts of the popup widget that you can use are:

Default text parts of the popup widget that you can use are:

Default contents parts of the popup items that you can use are:

Default text parts of the popup items that you can use are:

Supported elm_object_item common APIs.

Here are some sample code to illustrate Popup usage:

Function Documentation

void elm_popup::align_get ( double *  horizontal_,
double *  vertical_ 
) const
inline

Get the alignment of the popup object.

See also
elm_popup_align_set()
Since
1.9
Parameters
horizontalThe horizontal alignment of the popup
verticalThe vertical alignment of the popup

References elm_obj_popup_align_get().

void elm_popup::align_set ( double  horizontal_,
double  vertical_ 
) const
inline

Get the alignment of the popup object.

See also
elm_popup_align_set()
Since
1.9
Parameters
horizontalThe horizontal alignment of the popup
verticalThe vertical alignment of the popup

References elm_obj_popup_align_set().

bool elm_popup::allow_events_get ( ) const
inline

Returns value indicating whether allow event is enabled or not.

Returns
EINA_FALSE if Blocked event area is present else EINA_TRUE
See also
elm_popup_allow_events_set()
Note
By default the Blocked event area is present
Parameters
allowEINA_TRUE Events are passed to lower objects, else not

References elm_obj_popup_allow_events_get().

void elm_popup::allow_events_set ( bool  allow_) const
inline

Returns value indicating whether allow event is enabled or not.

Returns
EINA_FALSE if Blocked event area is present else EINA_TRUE
See also
elm_popup_allow_events_set()
Note
By default the Blocked event area is present
Parameters
allowEINA_TRUE Events are passed to lower objects, else not

References elm_obj_popup_allow_events_set().

Elm_Wrap_Type elm_popup::content_text_wrap_type_get ( ) const
inline

Returns the wrapping type of content text packed in content area of popup object.

Returns
wrap type of the content text
See also
elm_popup_content_text_wrap_type_set
Parameters
wrapwrapping type of type Elm_Wrap_Type

References elm_obj_popup_content_text_wrap_type_get().

void elm_popup::content_text_wrap_type_set ( Elm_Wrap_Type  wrap_) const
inline

Returns the wrapping type of content text packed in content area of popup object.

Returns
wrap type of the content text
See also
elm_popup_content_text_wrap_type_set
Parameters
wrapwrapping type of type Elm_Wrap_Type

References elm_obj_popup_content_text_wrap_type_set().

EOAPI void elm_obj_popup_align_get ( double *  horizontal,
double *  vertical 
)

Get the alignment of the popup object.

See also
elm_popup_align_set()
Since
1.9
Parameters
[out]horizontalThe horizontal alignment of the popup
[out]verticalThe vertical alignment of the popup

Referenced by elm_popup::align_get(), and elm_popup_align_get().

EOAPI void elm_obj_popup_align_set ( double  horizontal,
double  vertical 
)

Set the alignment of the popup object Sets the alignment in which the popup will appear in its parent.

See also
elm_popup_align_get()
Since
1.9
Parameters
[in]horizontalThe horizontal alignment of the popup
[in]verticalThe vertical alignment of the popup

Referenced by elm_popup::align_set(), and elm_popup_align_set().

EOAPI Eina_Bool elm_obj_popup_allow_events_get ( void  )

Returns value indicating whether allow event is enabled or not.

Returns
EINA_FALSE if Blocked event area is present else EINA_TRUE
See also
elm_popup_allow_events_set()
Note
By default the Blocked event area is present

Referenced by elm_popup::allow_events_get(), and elm_popup_allow_events_get().

EOAPI void elm_obj_popup_allow_events_set ( Eina_Bool  allow)

Sets whether events should be passed to by a click outside.

Enabling allow event will remove the Blocked event area and events will pass to the lower layer objects otherwise they are blocked.

See also
elm_popup_allow_events_get()
Note
The default value is EINA_FALSE.
Parameters
[in]allowEINA_TRUE Events are passed to lower objects, else not

Referenced by elm_popup::allow_events_set(), and elm_popup_allow_events_set().

EOAPI Elm_Wrap_Type elm_obj_popup_content_text_wrap_type_get ( void  )

Returns the wrapping type of content text packed in content area of popup object.

Returns
wrap type of the content text
See also
elm_popup_content_text_wrap_type_set

Referenced by elm_popup::content_text_wrap_type_get(), and elm_popup_content_text_wrap_type_get().

EOAPI void elm_obj_popup_content_text_wrap_type_set ( Elm_Wrap_Type  wrap)

Sets the wrapping type of content text packed in content area of popup object.

See also
elm_popup_content_text_wrap_type_get()
Parameters
[in]wrapwrapping type of type Elm_Wrap_Type

Referenced by elm_popup::content_text_wrap_type_set(), and elm_popup_content_text_wrap_type_set().

EOAPI Elm_Object_Item * elm_obj_popup_item_append ( const char *  label,
Evas_Object *  icon,
Evas_Smart_Cb  func,
const void *  data 
)

Add a new item to a Popup object.

Both an item list and a content could not be set at the same time! once you add an item, the previous content will be removed.

Returns
A handle to the item added or NULL, on errors
Warning
When the first item is appended to popup object, any previous content of the content area is deleted. At a time, only one of content, content-text and item(s) can be there in a popup content area.
Parameters
[in]labelThe Label of the new item
[in]iconIcon to be set on new item
[in]funcConvenience function called when item selected
[in]dataData passed to func above

Referenced by elm_popup_item_append(), and elm_popup::item_append().

EOAPI Elm_Popup_Orient elm_obj_popup_orient_get ( void  )

Returns the orientation of Popup.

Returns
the orientation of the popup
See also
elm_popup_orient_set()
Elm_Popup_Orient

Referenced by elm_popup_orient_get(), and elm_popup::orient_get().

EOAPI void elm_obj_popup_orient_set ( Elm_Popup_Orient  orient)

Sets the orientation of the popup in the parent region.

Sets the position in which popup will appear in its parent. By default, #ELM_POPUP_ORIENT_CENTER is set.

See also
Elm_Popup_Orient for possible values.
Parameters
[in]orientthe orientation of the popup

Referenced by elm_popup_orient_set(), and elm_popup::orient_set().

EOAPI double elm_obj_popup_timeout_get ( void  )

Returns the timeout value set to the popup (in seconds)

Returns
the timeout value
See also
elm_popup_timeout_set()

Referenced by elm_popup_timeout_get(), and elm_popup::timeout_get().

EOAPI void elm_obj_popup_timeout_set ( double  timeout)

Sets a timeout to hide popup automatically.

This function sets a timeout and starts the timer controlling when the popup is hidden. Since calling evas_object_show() on a popup restarts the timer controlling when it is hidden, setting this before the popup is shown will in effect mean starting the timer when the popup is shown. Smart signal "timeout" is called afterwards which can be handled if needed.

Note
Set a value <= 0.0 to disable a running timer.
If the value > 0.0 and the popup is previously visible, the timer will be started with this value, canceling any running timer.
Parameters
[in]timeoutThe timeout in seconds

Referenced by elm_popup_timeout_set(), and elm_popup::timeout_set().

Evas_Object* elm_popup_add ( Evas_Object *  parent)

Adds a new Popup to the parent.

Parameters
parentThe parent object
Returns
The new object or NULL if it cannot be created
void elm_popup_align_get ( const Eo *  obj,
double *  horizontal,
double *  vertical 
)

Get the alignment of the popup object.

See also
elm_popup_align_set()
Since
1.9
Parameters
[out]horizontalThe horizontal alignment of the popup
[out]verticalThe vertical alignment of the popup

References elm_obj_popup_align_get().

void elm_popup_align_set ( Eo *  obj,
double  horizontal,
double  vertical 
)

Set the alignment of the popup object Sets the alignment in which the popup will appear in its parent.

See also
elm_popup_align_get()
Since
1.9
Parameters
[in]horizontalThe horizontal alignment of the popup
[in]verticalThe vertical alignment of the popup

References elm_obj_popup_align_set().

Eina_Bool elm_popup_allow_events_get ( const Eo *  obj)

Returns value indicating whether allow event is enabled or not.

Returns
EINA_FALSE if Blocked event area is present else EINA_TRUE
See also
elm_popup_allow_events_set()
Note
By default the Blocked event area is present

References elm_obj_popup_allow_events_get().

void elm_popup_allow_events_set ( Eo *  obj,
Eina_Bool  allow 
)

Sets whether events should be passed to by a click outside.

Enabling allow event will remove the Blocked event area and events will pass to the lower layer objects otherwise they are blocked.

See also
elm_popup_allow_events_get()
Note
The default value is EINA_FALSE.
Parameters
[in]allowEINA_TRUE Events are passed to lower objects, else not

References elm_obj_popup_allow_events_set().

Elm_Wrap_Type elm_popup_content_text_wrap_type_get ( const Eo *  obj)

Returns the wrapping type of content text packed in content area of popup object.

Returns
wrap type of the content text
See also
elm_popup_content_text_wrap_type_set

References elm_obj_popup_content_text_wrap_type_get().

void elm_popup_content_text_wrap_type_set ( Eo *  obj,
Elm_Wrap_Type  wrap 
)

Sets the wrapping type of content text packed in content area of popup object.

See also
elm_popup_content_text_wrap_type_get()
Parameters
[in]wrapwrapping type of type Elm_Wrap_Type

References elm_obj_popup_content_text_wrap_type_set().

Elm_Object_Item* elm_popup_item_append ( Eo *  obj,
const char *  label,
Evas_Object *  icon,
Evas_Smart_Cb  func,
const void *  data 
)

Add a new item to a Popup object.

Both an item list and a content could not be set at the same time! once you add an item, the previous content will be removed.

Returns
A handle to the item added or NULL, on errors
Warning
When the first item is appended to popup object, any previous content of the content area is deleted. At a time, only one of content, content-text and item(s) can be there in a popup content area.
Parameters
[in]labelThe Label of the new item
[in]iconIcon to be set on new item
[in]funcConvenience function called when item selected
[in]dataData passed to func above

References elm_obj_popup_item_append().

Elm_Popup_Orient elm_popup_orient_get ( const Eo *  obj)

Returns the orientation of Popup.

Returns
the orientation of the popup
See also
elm_popup_orient_set()
Elm_Popup_Orient

References elm_obj_popup_orient_get().

void elm_popup_orient_set ( Eo *  obj,
Elm_Popup_Orient  orient 
)

Sets the orientation of the popup in the parent region.

Sets the position in which popup will appear in its parent. By default, #ELM_POPUP_ORIENT_CENTER is set.

See also
Elm_Popup_Orient for possible values.
Parameters
[in]orientthe orientation of the popup

References elm_obj_popup_orient_set().

double elm_popup_timeout_get ( const Eo *  obj)

Returns the timeout value set to the popup (in seconds)

Returns
the timeout value
See also
elm_popup_timeout_set()

References elm_obj_popup_timeout_get().

void elm_popup_timeout_set ( Eo *  obj,
double  timeout 
)

Sets a timeout to hide popup automatically.

This function sets a timeout and starts the timer controlling when the popup is hidden. Since calling evas_object_show() on a popup restarts the timer controlling when it is hidden, setting this before the popup is shown will in effect mean starting the timer when the popup is shown. Smart signal "timeout" is called afterwards which can be handled if needed.

Note
Set a value <= 0.0 to disable a running timer.
If the value > 0.0 and the popup is previously visible, the timer will be started with this value, canceling any running timer.
Parameters
[in]timeoutThe timeout in seconds

References elm_obj_popup_timeout_set().

Elm_Object_Item* elm_popup::item_append ( std::string  label_,
evas::object  icon_,
Evas_Smart_Cb  func_,
const void *  data_ 
) const
inline

Add a new item to a Popup object.

Both an item list and a content could not be set at the same time! once you add an item, the previous content will be removed.

Returns
A handle to the item added or NULL, on errors
Warning
When the first item is appended to popup object, any previous content of the content area is deleted. At a time, only one of content, content-text and item(s) can be there in a popup content area.
Parameters
labelThe Label of the new item
iconIcon to be set on new item
funcConvenience function called when item selected
dataData passed to func above

References elm_obj_popup_item_append().

Elm_Popup_Orient elm_popup::orient_get ( ) const
inline

Returns the orientation of Popup.

Returns
the orientation of the popup
See also
elm_popup_orient_set()
Elm_Popup_Orient
Parameters
orientthe orientation of the popup

References elm_obj_popup_orient_get().

void elm_popup::orient_set ( Elm_Popup_Orient  orient_) const
inline

Returns the orientation of Popup.

Returns
the orientation of the popup
See also
elm_popup_orient_set()
Elm_Popup_Orient
Parameters
orientthe orientation of the popup

References elm_obj_popup_orient_set().

double elm_popup::timeout_get ( ) const
inline

Returns the timeout value set to the popup (in seconds)

Returns
the timeout value
See also
elm_popup_timeout_set()
Parameters
timeoutThe timeout in seconds

References elm_obj_popup_timeout_get().

void elm_popup::timeout_set ( double  timeout_) const
inline

Returns the timeout value set to the popup (in seconds)

Returns
the timeout value
See also
elm_popup_timeout_set()
Parameters
timeoutThe timeout in seconds

References elm_obj_popup_timeout_set().