- Elementary
- Main
- Authors
- Examples
- Files
- Pages
- Types
- Modules

Enumerations | Functions
Popup

## Enumerations
enum | Elm_Popup_Orient { ELM_POPUP_ORIENT_TOP = 0, ELM_POPUP_ORIENT_CENTER, ELM_POPUP_ORIENT_BOTTOM, ELM_POPUP_ORIENT_LEFT, ELM_POPUP_ORIENT_RIGHT, ELM_POPUP_ORIENT_TOP_LEFT, ELM_POPUP_ORIENT_TOP_RIGHT, ELM_POPUP_ORIENT_BOTTOM_LEFT, ELM_POPUP_ORIENT_BOTTOM_RIGHT, ELM_POPUP_ORIENT_LAST }
| Possible orient values for popup. More...

## Functions
Evas_Object * | elm_popup_add (Evas_Object *parent)
| Adds a new Popup to the parent. More...
void | elm_popup_content_text_wrap_type_set (Evas_Object *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 Evas_Object *obj)
| Returns the wrapping type of content text packed in content area of popup object. More...
void | elm_popup_orient_set (Evas_Object *obj, Elm_Popup_Orient orient)
| Sets the orientation of the popup in the parent region. More...
Elm_Popup_Orient | elm_popup_orient_get (const Evas_Object *obj)
| Returns the orientation of Popup. More...
void | elm_popup_timeout_set (Evas_Object *obj, double timeout)
| Sets a timeout to hide popup automatically. More...
double | elm_popup_timeout_get (const Evas_Object *obj)
| Returns the timeout value set to the popup (in seconds) More...
void | elm_popup_allow_events_set (Evas_Object *obj, Eina_Bool allow)
| Sets whether events should be passed to by a click outside. More...
Eina_Bool | elm_popup_allow_events_get (const Evas_Object *obj)
| Returns value indicating whether allow event is enabled or not. More...
Elm_Object_Item * | elm_popup_item_append (Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data)
| Add a new item to a Popup object. More...
#define | elm_obj_popup_content_text_wrap_type_set(wrap) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_CONTENT_TEXT_WRAP_TYPE_SET), EO_TYPECHECK(Elm_Wrap_Type, wrap)
| Sets the wrapping type of content text packed in content. More...
#define | elm_obj_popup_content_text_wrap_type_get(ret) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_CONTENT_TEXT_WRAP_TYPE_GET), EO_TYPECHECK(Elm_Wrap_Type *, ret)
| Returns the wrapping type of content text packed in content area of area of popup object. More...
#define | elm_obj_popup_orient_set(orient) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ORIENT_SET), EO_TYPECHECK(Elm_Popup_Orient, orient)
| Sets the orientation of the popup in the parent region. More...
#define | elm_obj_popup_orient_get(ret) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ORIENT_GET), EO_TYPECHECK(Elm_Popup_Orient *, ret)
| Returns the orientation of Popup. More...
#define | elm_obj_popup_timeout_set(timeout) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_TIMEOUT_SET), EO_TYPECHECK(double, timeout)
| Sets a timeout to hide popup automatically. More...
#define | elm_obj_popup_timeout_get(ret) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_TIMEOUT_GET), EO_TYPECHECK(double *, ret)
| Returns the timeout value set to the popup (in seconds) More...
#define | elm_obj_popup_allow_events_set(allow) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_SET), EO_TYPECHECK(Eina_Bool, allow)
| Sets whether events should be passed to by a click outside. More...
#define | elm_obj_popup_allow_events_get(ret) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, ret)
| Returns value indicating whether allow event is enabled or not. More...
#define | elm_obj_popup_item_append(label, icon, func, data, ret) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
| Add a new item to a Popup object. More...

## Detailed Description

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:

- `"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)

Styles available for Popup

- "default"

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

- "default" - The content of the popup
- "title,icon" - Title area's icon
- "button1" - 1st button of the action area
- "button2" - 2nd button of the action area
- "button3" - 3rd button of the action area

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

- "title,text" - This operates on Title area's label
- "default" - content-text set in the content area of the widget

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

- "default" -Item's icon

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

- "default" - Item's label

Supported elm_object_item common APIs.

- elm_object_item_part_text_set
- elm_object_item_part_text_get
- elm_object_item_part_content_set
- elm_object_item_part_content_get
- elm_object_item_disabled_set
- elm_object_item_disabled_get
- elm_object_item_del
- elm_object_item_signal_emit

Here are some sample code to illustrate Popup usage:

- popup_example_01.c
- popup_example_02.c
- popup_example_03.c

## Macro Definition Documentation

#define elm_obj_popup_allow_events_get | ( |  | ret | ) | ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, ret)

Returns value indicating whether allow event is enabled or not.

Since
  1.8

Parameters

  [out] | ret |

See Also
  elm_popup_allow_events_get

Referenced by elm_popup_allow_events_get().

#define elm_obj_popup_allow_events_set | ( |  | allow | ) | ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_SET), EO_TYPECHECK(Eina_Bool, allow)

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

Since
  1.8

Parameters

  [in] | allow |

See Also
  elm_popup_allow_events_set

Referenced by elm_popup_allow_events_set().

#define elm_obj_popup_content_text_wrap_type_get | ( |  | ret | ) | ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_CONTENT_TEXT_WRAP_TYPE_GET), EO_TYPECHECK(Elm_Wrap_Type *, ret)

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

Since
  1.8

Parameters

  [out] | ret |

See Also
  elm_popup_content_text_wrap_type_get

Referenced by elm_popup_content_text_wrap_type_get().

#define elm_obj_popup_content_text_wrap_type_set | ( |  | wrap | ) | ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_CONTENT_TEXT_WRAP_TYPE_SET), EO_TYPECHECK(Elm_Wrap_Type, wrap)

Sets the wrapping type of content text packed in content.

Since
  1.8

Parameters

  [in] | wrap |

See Also
  elm_popup_content_text_wrap_type_set

Referenced by elm_popup_content_text_wrap_type_set().

#define elm_obj_popup_item_append | ( |  | label,
|  |  | icon,
|  |  | func,
|  |  | data,
|  |  | ret
| ) |  | ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)

Add a new item to a Popup object.

Since
  1.8

Parameters

  [in] | label |
  [in] | icon |
  [in] | func |
  [in] | data |
  [out] | ret |

See Also
  elm_popup_item_append

Referenced by elm_popup_item_append().

#define elm_obj_popup_orient_get | ( |  | ret | ) | ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ORIENT_GET), EO_TYPECHECK(Elm_Popup_Orient *, ret)

Returns the orientation of Popup.

Since
  1.8

Parameters

  [out] | ret |

See Also
  elm_popup_orient_get

Referenced by elm_popup_orient_get().

#define elm_obj_popup_orient_set | ( |  | orient | ) | ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ORIENT_SET), EO_TYPECHECK(Elm_Popup_Orient, orient)

Sets the orientation of the popup in the parent region.

Since
  1.8

Parameters

  [in] | orient |

See Also
  elm_popup_orient_set

Referenced by elm_popup_orient_set().

#define elm_obj_popup_timeout_get | ( |  | ret | ) | ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_TIMEOUT_GET), EO_TYPECHECK(double *, ret)

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

Since
  1.8

Parameters

  [out] | ret |

See Also
  elm_popup_timeout_get

Referenced by elm_popup_timeout_get().

#define elm_obj_popup_timeout_set | ( |  | timeout | ) | ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_TIMEOUT_SET), EO_TYPECHECK(double, timeout)

Sets a timeout to hide popup automatically.

Since
  1.8

Parameters

  [in] | timeout |

See Also
  elm_popup_timeout_set

Referenced by elm_popup_timeout_set().

## Enumeration Type Documentation

enum Elm_Popup_Orient

Possible orient values for popup.

These values should be used in conjunction to elm_popup_orient_set() to set the position in which the popup should appear(relative to its parent) and in conjunction with elm_popup_orient_get() to know where the popup is appearing.

Enumerator
ELM_POPUP_ORIENT_TOP | Popup should appear in the top of parent, default.
ELM_POPUP_ORIENT_CENTER | Popup should appear in the center of parent.
ELM_POPUP_ORIENT_BOTTOM | Popup should appear in the bottom of parent.
ELM_POPUP_ORIENT_LEFT | Popup should appear in the left of parent.
ELM_POPUP_ORIENT_RIGHT | Popup should appear in the right of parent.
ELM_POPUP_ORIENT_TOP_LEFT | Popup should appear in the top left of parent.
ELM_POPUP_ORIENT_TOP_RIGHT | Popup should appear in the top right of parent.
ELM_POPUP_ORIENT_BOTTOM_LEFT | Popup should appear in the bottom left of parent.
ELM_POPUP_ORIENT_BOTTOM_RIGHT | Notify should appear in the bottom right of parent.
ELM_POPUP_ORIENT_LAST | Sentinel value, don't use.

## Function Documentation

Evas_Object* elm_popup_add | ( | Evas_Object * | parent | ) |

Adds a new Popup to the parent.

Parameters

  parent | The parent object

Returns
  The new object or NULL if it cannot be created

Eina_Bool elm_popup_allow_events_get | ( | const Evas_Object * | obj | ) |

Returns value indicating whether allow event is enabled or not.

Parameters

  obj | The popup object

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 | ( | Evas_Object * | obj,
|  | Eina_Bool | allow
| ) |  |

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

Parameters

  obj | The popup object
  allow | EINA_TRUE Events are passed to lower objects, else not

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.

References elm_obj_popup_allow_events_set.

Elm_Wrap_Type elm_popup_content_text_wrap_type_get | ( | const Evas_Object * | obj | ) |

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

Parameters

  obj | The 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 | ( | Evas_Object * | obj,
|  | Elm_Wrap_Type | wrap
| ) |  |

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

Parameters

  obj | The Popup object
  wrap | wrapping type of type Elm_Wrap_Type

See Also
  elm_popup_content_text_wrap_type_get()

References elm_obj_popup_content_text_wrap_type_set.

Elm_Object_Item* elm_popup_item_append | ( | Evas_Object * | 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.

Parameters

  obj | popup object
  icon | Icon to be set on new item
  label | The Label of the new item
  func | Convenience function called when item selected
  data | Data passed to `func` above

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.

References elm_obj_popup_item_append.

Elm_Popup_Orient elm_popup_orient_get | ( | const Evas_Object * | obj | ) |

Returns the orientation of Popup.

Parameters

  obj | The popup object

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 | ( | Evas_Object * | obj,
|  | Elm_Popup_Orient | orient
| ) |  |

Sets the orientation of the popup in the parent region.

Parameters

  obj | The popup object
  orient | the orientation of the popup

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.

References elm_obj_popup_orient_set.

double elm_popup_timeout_get | ( | const Evas_Object * | obj | ) |

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

Parameters

  obj | The popup object

Returns
  the timeout value

See Also
  elm_popup_timeout_set()

References elm_obj_popup_timeout_get.

void elm_popup_timeout_set | ( | Evas_Object * | obj,
|  | double | timeout
| ) |  |

Sets a timeout to hide popup automatically.

Parameters

  obj | The popup object
  timeout | The timeout in seconds

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.

References elm_obj_popup_timeout_set.

Copyright ©2000-2014 Enlightenment.org - Samsung Electronics supports the EFL Documentation Project - Generated Wed Jan 8 2014 20:51:12